- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
Why Output of mean of normal random variable created using rnorm equals to 10 is not 10 in manual calculation with R?
When we find the mean of normal random variable which is created with rnorm(“sample_size”,10) is not 10 because rnorm will create a random variable hence mean will be changed but as we increase the sample size the mean will become closer to 10.
Check out the Examples given below to understand the variation in the Outputs as the sample size increases.
Example
The variation in the Outputs of mean of normal random variable created by using rnorm as the sample size increases is explained below −
mean(rnorm(100,mean=10)) mean(rnorm(100,mean=10)) mean(rnorm(100,mean=10)) mean(rnorm(100,mean=10)) mean(rnorm(100,mean=10)) mean(rnorm(100,mean=10)) mean(rnorm(100,mean=10)) mean(rnorm(1000,mean=10)) mean(rnorm(1000,mean=10)) mean(rnorm(1000,mean=10)) mean(rnorm(10000,mean=10)) mean(rnorm(10000,mean=10)) mean(rnorm(10000,mean=10)) mean(rnorm(10000,mean=10)) mean(rnorm(10000,mean=10)) mean(rnorm(100000,mean=10)) mean(rnorm(100000,mean=10)) mean(rnorm(100000,mean=10)) mean(rnorm(100000,mean=10)) mean(rnorm(100000,mean=10)) mean(rnorm(1000000,mean=10)) mean(rnorm(1000000,mean=10)) mean(rnorm(1000000,mean=10)) mean(rnorm(1000000,mean=10)) mean(rnorm(1000000,mean=10)) mean(rnorm(10000000,mean=10)) mean(rnorm(10000000,mean=10)) mean(rnorm(10000000,mean=10)) mean(rnorm(100000000,mean=10))
The Output is as follows
[1] 10.13626 [1] 9.892686 [1] 9.938534 [1] 9.918113 [1] 10.12262 [1] 10.05268 [1] 10.06714 [1] 9.953736 [1] 10.02104 [1] 9.973183 [1] 9.994081 [1] 10.00588 [1] 9.983589 [1] 10.00452 [1] 10.00093 [1] 9.999846 [1] 9.999979 [1] 9.996462 [1] 10.00455 [1] 10.00049 [1] 9.999261 [1] 9.998425 [1] 9.999633 [1] 10.00064 [1] 9.998785 [1] 10.00003 [1] 9.999948 [1] 9.99997
- Related Articles
- How to generate a normal random vector using the mean of a vector in R?
- Why scale_fill_manual does not fill the bar with colors created by using ggplot2 in R?
- How to find the mean of each variable using dplyr by factor variable with ignoring the NA values in R?
- How to generate standard normal random numbers in R?
- How to create normal random variables with specific correlation between them in R?
- How to display mean inside boxplot created by using boxplot function in R?
- How to perform rounding in R to next 10 instead of nearest 10?
- Find the mean all factors of 10.
- How to display central limit theorem using uniform random variable in R?
- How to generate Bernoulli random variable in R?
- How to create a binary random variable in R with given probability?
- Generating a unique random 10 character string using MySQL?
- How to simulate discrete uniform random variable in R?
- Find the Arithmetic mean of first 10 natural numbers
- Find the mean of first 10 even natural numbers.

Advertisements