proptestR - # illustrate use of prop.test function for...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 # illustrate use of prop.test function for large sample inferences # about proportions, and binom.test function for exact binomial about # a single proportion ######## test and confidence interval for population proportion ################### # Ex 1. To test whether a coin is fair, we tossed it 100 times and got heads 57 times. # should we be suspicious? # large n test of Ho: p=1/2 versus p: != 1/2 # It uses a continuity correction and also gives a 95% confidence interval: prop.test(53,100) # Comment: the X-squared value with 1 df is equal to the square of the Z statistic. # In general the square of a Normal(0,1) random variable is a Chi-square with 1 degree # of freedom. We can compute chisquare probabilities using the "pchisq" function. # Type help(chisq) for more information. # Here's a one-tailed version: prop.test(53,100,alternative="greater") # Ex 2. Roll a six-sided die 50 times. Get "6" ten times. Should we be suspicious?
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/11/2011 for the course STAT 200 taught by Professor Agniel during the Spring '09 term at University of Illinois at Urbana–Champaign.

Page1 / 4

proptestR - # illustrate use of prop.test function for...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online