STATS 1000 / STATS 1004 / STATS 1504
Statistical Practice 1
Practical Week 5
2015
Practical Outline
In this practical, we will• look at how to do binomial calculations in Excel. • look at how to do normal calculations inExcel.
Part I – Learning about SPSS
1
Opening
Excel
First, start Excelby clicking on the icon at the bottom of your screen.
(Or choose: Start>All Programs>Microsoft Office>Microsoft Office Excel 2007)
2
Binomial Calculations in Excel
Binomial probabilities can be calculated in Excel using the built-in function
BINOMDIST. The easiest way to calculate a single binomial probability is as fol-lows.
(Alternatively, from the Formulas menu, select Insert Function. )
2. In theInsert Functiondialog box, selectCategory:Statistical, followed byFunction:BINOMDIST.
3. Enter the required function arguments in the BINOMDIST dialog box before clicking on OK.
Number s The number of successes, x.
0.0 0.1 0.2 0.3 0 1 2 3 4 5 6 x cumulative = 1
(a)P(X≤x) orange boxes.
0.0 0.1 0.2 0.3 0 1 2 3 4 5 6 x cumulative = 0 (b)P(X =x) orange box. Figure 1: Difference between cumulative = 1 and cumulative = 0
Probability s The probability of success in a single trial,p.
Cumulative 1(TRUE) or 0(FALSE) (See Figure 1).
Enter 1(TRUE) if the value to be calculated is the probability of being less than or equal to the number given in Numbers s.
Enter 0(FALSE) if the value to be calculated is the probability of being equal to the number given in Numbers s
For example is X ∼ Bin(10,0.5) and you want to calculate the probability that X is less than or equal to 2, then you would enter
Number s 2
Trials 10
Probability s 0.5
If you toss a fair coin 10 times, what is the probability of • no heads,
• 3 or less heads, • at least one head,
• between 1 and 3 heads (inclusive)? Question
Solutions
LetX be the number of heads, then
X ∼Bin(10,1/2) • P(X = 0) =BINOMDIST(0,10,0.5,0)= 0.0010 • P(X ≤3) = BINOMDIST(3,10,0.5,1)= 0.1719 • P(X ≤1) = 1−P(X = 0) = 1−BINOMDIST(0,10,0.5,0)= 0.9990 • P(1≤X ≤3) =P(X ≤3)−P(X = 0) =BINOMDIST(3,10,0.5,1) - BINOMDIST(0,10,0.5,0) = 0.1709
3
Normal Probabilities
Normal probabilities can be obtained inExcelusing the built-in functionNORMDIST
as follows.
1. In theInsert Functiondialog box, selectCategory:Statistical, followed byFunction:NORMDIST (Note: not NORMSDIST).
2. Enter the required function arguments in the NORMDIST dialog box before clicking on OK.
x The real number x.
Mean The real number µ.
Standard dev The real number σ >0.
Cumulative You should enter 1(TRUE) as we require the cumulative
The value calculated is the probability that X is less than or equal to the number x for X ∼N(µ, σ) (See Figure 2).
X
Figure 2: P(X ≤x) for normal distribution (orange area).
Note: a separate function NORMSDIST is also provided.
• This function has just a single argument z and calculates the probability that the standard normal random variable is less than or equal toz.
• It is equivalent to using NORMDISTwith µ= 0 andσ = 1.
The inverse cumulative distribution function can also be calculated inExcel. The inverse cumulative distribution function gives the constantcsuch that probability that X is less than or equal to cis equal to some given probabilityp. TheExcel function to do this isNORMINV. It is used as follows:
1. In theInsert Functiondialog box, selectCategory:Statistical, followed byFunction:NORMINV (Note: not NORMSINV).
2. Enter the required function arguments in the NORMINV dialog box before clicking on OK.
Probability The number pwith 0< p <1.
Mean The real number µ.
The value calculated is the solution x∗ to the equation P(X≤x∗) =p forX ∼N(µ, σ).
The weight of cats is normally distributed with a mean of 4kg and a standard deviation of 0.5kg. What is the probability of
• a randomly selected cat weighs less than 3kg? • a randomly selected cat weighs more than 4kg?
• a randomly selected cat weighs more than 4kg or less than 3kg? • a randomly selected cat weighs between 3 and 4kg?
What weight cis such that 10% of all cats are less than this weight? Question Solutions • P(X <3) =NORMDIST(3,4,0.5,1) = 0.0228. • P(X >4) = 1−P(X≤4) = =1 - NORMDIST(4,4,0.5,1) = 0.5 • P(X >4 or X <3) =P(X >4) +P(X <3)=NORMDIST(3,4,0.5,1) + (1 - NORMDIST(4,4,0.5,1)) = 0.5228. • P(3 ≤ X ≤ 4) = P(X ≤ 4) − P(X ≤ 3) =NORMDIST(4,4,0.5,1) -NORMDIST(3,4,0.5,1) = 0.4772.
Use NORMINV(0.2,4,0.5) to give the answer 3.58 kg
Part II – Assignment Questions
Usingexcel answer the following questions.1. A multiple choice test has 15 questions. Each question has 5 candidate answers of which exactly 1 is correct. Suppose a certain student answers each question by randomly choosing one of the five answers.
Make sure you have checked your answers with the lab tutor.
LetX be the number correctly answered. (a) What is the distribution of X?
Solutions
No solutions as assignment questions
(c) Find the probability the student gets at most 4 correct answers. (d) Find the probability the student gets 6 or more correct answers.
(e) Find the probability the student gets between 4 and 10 correct answers (inclusive).
2. The weight of mice is known to be normally distributed with a mean of 10grams and a standard deviation of 1gram.
(a) What is the probability that a randomly selected mouse weighs less than 10 grams?
(b) What is the probability that a randomly selected mouse weighs more than 11 grams?
(c) What is the probability that a randomly selected mouse weighs between 8 and 12 grams?
(d) What is the weightcsuch that the probability that a randomly selected mouse weighs less than cis 0.01?
Part III – Appendix
A
Probability notation
X ∼Bin(n, p): The random variableX has a binomial distribution with the num-ber of trials n and the probability of success p.
X ∼N(µ, σ): The random variable X has a normal distribution with a mean of µand a standard deviation of σ.
P(X=x): The probability that the random variable X is equal tox.