# R-5 - Statistics 1211 Ji Meng Loh March 14, 2008 Homework...

This preview shows pages 1–4. Sign up to view the full content.

Statistics 1211 – Ji Meng Loh March 14, 2008 Homework #5 > sim.uniform <- function(n, num.rep){ + for (i in (1:num.rep)){ + rand.unif <- runif(n) + if (i==1) sample.mean <- mean(rand.unif) + else sample.mean <- c(sample.mean, mean(rand.unif)) + } + return(sample.mean) + } > sample.mean.size2.rep200 <- sim.uniform(2, 200) > hist(sample.mean.size2.rep200, main="Size 2, 200 reps") Because the sample size is greater than one, the histogram will not plot a uniform distribution with all values having a nearly equal distribution, but at the same time, because the size of each sample is small and only “2”, it does not realistically preclude any value between 0.0 and 1.0. It is not unreasonable to believe that of any one of the values plotted above could have a very real frequency given such a small sample size.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
5: > sample.mean.size2.rep20 <- sim.uniform(2, 20) > hist(sample.mean.size2.rep20, main="Size 2, 20 reps") > sample.mean.size2.rep2000 <- sim.uniform(2, 2000) > hist(sample.mean.size2.rep2000, main="Size 2, 2000 reps")
> sample.mean.size2.rep20000 <- sim.uniform(2, 20000)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 06/25/2008 for the course STAT 1211 taught by Professor Hernandez during the Spring '08 term at Columbia.

### Page1 / 5

R-5 - Statistics 1211 Ji Meng Loh March 14, 2008 Homework...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online