{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

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?

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.

{[ snackBarMessage ]}

### Page1 / 4

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

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

View Full Document
Ask a homework question - tutors are online