10.07.2015 Views

Using R for Introductory Statistics : John Verzani

Using R for Introductory Statistics : John Verzani

Using R for Introductory Statistics : John Verzani

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Using</strong> R <strong>for</strong> introductory statistics 148Figure 5.4 Spike plot ofBinomial(10,1/2) distributionresponses by a 0, then the sequence of responses is an i.i.d. Bernoulli sequence withparameter p, the population proportion. The number of “yes” respondents is then aBinomial(n, p) random variable where n is the size of the sample.For instance, if it is known that 62% of the population would respond favorably to thequestion were they asked, and a sample of size 100 is asked, what is the probability that60% or less of the sample responded favorably?> pbinom(60, size=100, prob=0.62)[1] 0.3759Normal random variablesThe normal distribution is a continuous distribution that describes many populations innature. Additionally, it is used to describe the sampling distribution of certain statistics.The normal distribution is a family of distributions with density given byThe two parameters are the mean, µ, and the standard deviation, a. We use Normal(µ, σ)to denote this distribution, although many books use the variance, σ 2 , <strong>for</strong> the secondparameter.The R family name is norm and the parameters are labeled mean= and sd=.Figure 5.5 shows graphs of two normal densities, f(x|µ=0,σ=1) and f(x|µ=4, σ=1/2).The curves are symmetric and bell-shaped. The mean, µ, is a point of symmetry <strong>for</strong> thedensity. The standard deviation controls the spread of the curve. The distance betweenthe inflection points, where the curves change from opening down to opening up, is twostandard deviations.The figure also shows two shaded areas. Let Z have Normal(0, 1) distribution and Xhave Normal(4,1/2) distribution. Then the left shaded region is P(Z≤1.5) and the right oneis P(X≤4.75). The random variable Z is called a standard normal, as it has mean a and

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!