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

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

View Full Document Right Arrow Icon
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.
Background image of page 1

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

View Full DocumentRight Arrow Icon
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")
Background image of page 2
> sample.mean.size2.rep20000 <- sim.uniform(2, 20000)
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
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 Right Arrow Icon
Ask a homework question - tutors are online