Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

An example analysis of R language calculating the confidence interval of a group of data and drawing a density diagram for visual display

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you the R language to calculate the confidence interval of a group of data and draw a density chart for visual display of the example analysis, the content is concise and easy to understand, can definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

What is the confidence interval?

I watched the video in which StatQuest introduced the confidence interval, and I generally understood it, but let me express it in words, and I still don't know how to express it. Bilibili could have watched StatQuest videos directly. Today, I saw bilibili's main up message saying that the original author of StatQuest was going to be stationed in bilibili, so he deleted all the videos that were originally authorized. So it will be a while before we watch these videos in bilibili.

Today's main content comes from How to Calculate Confidence Interval in R: Statistics in R: Data Sharkie

The function used to calculate the confidence interval is the CI () function, which comes from the R language package Rmisc

R language pack Rmisc needs to be installed for the first time

Install.packages ("Rmisc")

Calculate the confidence interval of 95% of the average value of a set of data

X CI (x <... > 0.95)

Upper mean lower

5.976934 5.843333 5.709732

There is a sentence in the reference link mentioned earlier.

Logically, as you increase the sample size, the closer is the value of a sample parameter to a population parameter, therefore the narrower the confidence interval gets. The larger the sample, the closer the mean of the sample is to the mean of the population, so the confidence interval of the mean will be narrower.

As it happens, yesterday's tweet was to draw a density map to fill a specified interval with color.

Ggplot2 draws a density distribution map to fill in different colors according to the range of values.

Below, we use ggplot2 to draw a density chart and show the confidence interval of 95% of the average.

# install.packages ("Rmisc")

Library (Rmisc)

X

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report