AndersonB_Sec2_HW3

AndersonB_Sec2_HW3 - Biological Statistics I Biometry 3010...

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

View Full Document Right Arrow Icon
Biological Statistics I Biometry 3010 / Natural Resources 3130 / Statistical Science 2200 Homework 3 Name: Beverly Anderson Section: 2 Date: 15 September 2010 Objectives: i. Explore methods for computing probabilities. ii. Determine how “normal” a random set of binomial values looks. iii. Understand how to test a simple hypothesis. 1. (5 points) Assume you have a coin that comes up heads 7 out of every 10 tosses, that is p=0.7. Calculate the distribution of heads in 10 tosses of that coin in two ways in R. a. Method 1 using the mathematical formula: which may be calculated by hand, or in R using the commands: > n = 10 > p = 0.7 > x = seq(0,10,by=1) > P1x = choose(n,x)*(p^x)*((1-p)^(n-x)) > P1x [1] 0.0000059049 0.0001377810 0.0014467005 0.0090016920 0.0367569090 [6] 0.1029193452 0.2001209490 0.2668279320 0.2334744405 0.1210608210 [11] 0.0282475249 b. Method 2 using the R function: > P2x = dbinom(x,n,p) > P2x [1] 0.0000059049 0.0001377810 0.0014467005 0.0090016920 0.0367569090 [6] 0.1029193452 0.2001209490 0.2668279320 0.2334744405 0.1210608210 [11] 0.0282475249 x n x p p x n p n x P - - = ) 1 ( ) , | (
Background image of page 1

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

View Full DocumentRight Arrow Icon
Plot the two estimates on top of one another using the commands: plot(x,P1x) lines(x,P2x) What is the most likely number of heads to occur in 10 tosses (i.e. the mode)? What is the average number of heads to occur (i.e. sum(x*P1x))? How does this compare to the theoretical value? The most likely number of heads to occur in 10 tosses is 7. > sum(x*P1x) [1] 7 The average number of heads to occur is also 7. This is also the theoretical value.
Background image of page 2
2. (10 points) Using the rbinom() function, generate a sample of size 10 from a binomial distribution representing 20 coin flips with a probability of 0.4 of a head. Use the stem() or hist() function to plot the distribution of values. Repeat with different sample sizes, ranging up to 100 or so. It is often said that the normal distribution is a good approximation to the binomial for large sample sizes. From the distributions you produced, at what value of the sample size does the does the distribution appear to be normal? Repeat the experiment using a probability of 0.05. Try the same exercise
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.

Page1 / 9

AndersonB_Sec2_HW3 - Biological Statistics I Biometry 3010...

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