- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to display central limit theorem using uniform random variable in R?
The central limit theorem says that as the sample size increases the distribution of the sample means approaches normal distribution. Therefore, irrespective of the actual population distribution if we take samples of larger size and find the mean of these samples then the distribution of these sample means will be approximately normal. We can display this in R, by creating the histogram of such type of means.
Example1
> x<-replicate(5000,{x1<-runif(5,1,2) + mean(x1)}) > hist(x)
Output
Example2
> y<-replicate(10000,{y1<-runif(5,1,2) + mean(y1)}) > hist(y)
Output
- Related Articles
- How to simulate discrete uniform random variable in R?
- How to generate Bernoulli random variable in R?
- How to display average line for y variable using ggplot2 in R?
- How to display a variable as tooltip in ggplotly using R language?
- Stored procedure using variable in LIMIT expression?
- How to create a binary random variable in R with given probability?
- How to display a variable with subscript ggplot2 graph in R?
- How to limit the length of regression line using ggplot2 in R?
- How to find monthly sales using date variable in R?
- How to display the superscript for a single variable in a base R plot?
- How to increase the printing limit in R?
- How to display two equal signs in R using ggplot2?
- How to display legend on top using ggplot2 in R?
- How to display mean in a histogram using ggplot2 in R?
- How to display a button in random screen position?

Advertisements