Home About us Mathematical Epidemiology Rweb EPITools Statistics Notes Web Design Contact us Links |

> Home > Statistics Notes > Probability > Sample Mean as a Random Variable

But often we do wish to think of the sample mean as a random variable. If I take a certain number of random variables and average them, then this average is also a random variable. It is a random variable, and it has its own distribution.

Exercise:

We're going to generate 10 binomials with

` > ` |
` xmeans<-1:20` |

` > ` |
` for (j in 1:length(x)) {` |

` + ` |
` xmeans[i] <- mean(rbinom(10,size=51,prob=0.03))` |

` + ` |
` }` |

` > ` |
` xmeans` |

Let's try this again. Except now we'll draw 100 binomials and average them all:

```
> xmeans2<-1:20
```

> for (j in 1:length(x)) {

+ xmeans2[j] <- mean(rbinom(100,size=51,prob=0.03))

+ }

> xmeans2

There is much less variability in the means that come from larger samples. There is much more that will be said about this sort of thing.

On to more on expectation values.

Return to statistics page.

Return to probability page.

Return to stochastic seminar.

All content © 2000 Mathepi.Com (except R and Rweb).

About us.