chapter2_R_key-1 - !"#$%"&'()(*+,%$&('$-(...

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

View Full Document Right Arrow Icon
" !"#$%"&’ ) *+,%$& ’$- ./0 .10 234564789/: ;8<5=8/: >8?768@A785 > dbinom(2,4,0.25) [1] 0.2109375 > pbinom(2,4,0.25)-pbinom(1,4,0.25) [1] 0.2109375 > pbinom(2,4,0.25) [1] 0.9492188 > pbinom(1,4,0.25) [1] 0.7382812 > qbinom(0.4,4,0.25) [1] 1 > Y=0:10 > plot(Y,dbinom(Y,4,0.25),type="h", ylab="Prob(Y=y|4,0.25)") > mybinom=rbinom(500, 4, 0.25) > mean(mybinom) [1] 0.992 > var(mybinom) [1] 0.797531 > sd(mybinom) [1] 0.893046 > median(mybinom) [1] 1 > quantile(mybinom,0.75) 75%
Background image of page 1

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

View Full DocumentRight Arrow Icon
8 2 > hist(mybinom,breaks=0:4) > sum(mybinom<3)/500 [1] 0.938 > sum(mybinom<=4)/500 [1] 1 > dnorm(20,40,5) [1] 2.676605e-05 > y=seq(20,60,length=300) > plot(y,dnorm(y, 40,5), main="Normal(40,5)",type="l")
Background image of page 2
9 > plot(y,pnorm(y,40,5),type="l") > pnorm(20,40,5) [1] 3.167124e-05 > pnorm(20,40,5)+(1-pnorm(45,40,5)) [1] 0.1586869 > qnorm(0.5,40,5) [1] 40 > mynorm=rnorm(500,40,5)
Background image of page 3

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

View Full DocumentRight Arrow Icon
: > mean(mynorm) [1] 39.87444 > var(mynorm)
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/24/2010 for the course STAT 201a taught by Professor Wu during the Spring '10 term at Pasadena City College.

Page1 / 7

chapter2_R_key-1 - !&quot;#$%&quot;&amp;'()(*+,%$&amp;('$-(...

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

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