Download Slides - Open Online Courses

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

History of statistics wikipedia , lookup

Statistics wikipedia , lookup

Transcript
Analysis of Means
Farrokh Alemi, Ph.D.
Kashif Haqqi M.D.
Go to Index
Table of Content
•
•
•
•
•
•
•
•
Go to Index
Review
Objectives
Definitions
Expected Value
Normal Distribution
Distribution of Mean
Central Limit Theorem
Standard Normal
Distribution
•
•
•
•
•
•
•
•
Use of Z Values
Confidence Interval
Hypothesis
Two Types of Error
One-tailed Tests
Steps in Testing a
Hypothesis
When to Assume
Normal Distribution for
Means
Use t-distribution
Review
•
•
•
Frequency distribution
Mean, median, and mode
Standard deviation and range
Statistics is the
art of making
sense of
distributions.
Go to Index
Objectives
•
•
•
•
Go to Index
Describe different distributions, including
normal, and t-distributions.
Calculate and interpret confidence
intervals using normal distributions.
Understand types of errors that occurs
with hypothesis testing.
Hypothesis testing using t-distribution.
Example You Should Be Able to
Answer at the End
•
•
•
Go to Index
The cost of rehabilitation in the industry is
$25,000, with a standard deviation of
3000.
Assume that the average cost in our
hospital is $30,000.
With 95% confidence, would you say that
our cost is different than the industry?
Is it important to ask these
types of questions?
Definitions
•
•
•
Go to Index
A random variable is a variable whose
values are determined by chance.
A probability distribution is the
probability with which values of a random
variable can or are observed.
Probability of a value is the frequency of
occurrence of that value divided by the
frequency of occurrences of all values.
Example of Probability Estimates
•
•
•
Go to Index
We examined the waiting time of 50 people at
our emergency room and found that 10 people
waited up to 5 minutes, 20 people waited 5.001
to 10 minutes, 13 people waited 10.001 to 15
minutes and 7 people waited 15.001to 20
minutes.
What is the probability of waiting 5 minutes?
What is the probability of waiting up to 10
minutes?
Distributions help us make probability
estimates about observed values.
Example of Probability Estimates
(Continued)
•
•
Go to Index
The probability of waiting up to 5 minutes
is the number of times people waited up to
5 minutes divided by the total number of
people: 10/50=.20.
The probability of waiting up to 10
minutes is the number of people who
waited up to 10 minutes divided by the
total number of people: (10+20)/50=0.6.
Expected Value
•
•
•
•
Go to Index
Expected value of a distribution is the mean of
the distribution.
It represents our long run expectations about the
distribution.
The expected value of X is given by summing
the product of each value of X, referred to as “i”,
times its probability of occurring, referred to as
p(X=i).
Expected value = mean =  p(X=i) * i.
Example Calculation of Expected
Value or Mean
•
•
Go to Index
We examined the waiting time of 50
people at our emergency room and found
that 10 people waited up to 5 minutes, 20
people waited 6 to 10 minutes, 13 people
waited 11 to 15 minutes and 7 people
waited 16-20 minutes.
What is the mean waiting time at our
emergency room?
Example Calculation of Expected
Value or Mean (Continued)
Total
Observed
Probability
waiting
times waiting
time
Frequency Probability time
2.5
10
0.2
0.5
7.5
20
0.4
3
12.5
13
0.26
3.25
17.5
7
0.14
2.45
50
1
9.2
The expected value or mean is 9.2
Go to Index
Do this in Excel
Normal Distribution
•
•
•
Go to Index
A symmetric distribution, meaning that
data are evenly distributed about the
mean.
Mean, median and mode are the same
value.
It has one mode and looks like a bell
shaped curve.
Normal Distribution Continued
•
•
•
Go to Index
The curve is continuous, there are no gaps
or holes.
The curve never touches the X-axis as any
value is possible but with infinitely small
probabilities.
99.7% of values are within 3 standard
deviations of mean.
Distribution of Mean
•
•
•
Go to Index
If you take a repeated sample of some
observations and average them, then you have a
distribution for the mean.
The distribution of the mean has the same mean
as the distribution of the observations.
Standard deviation of the mean = Standard error
= Standard deviation of the observations /
Square root of the sample size.
Example
•
•
•
•
Go to Index
What is the mean, standard deviation and
standard error for the following data: 4, 5,
6?
Mean = 5
Standard deviation = 1
Standard error = 1 / 1.7 = 0.58
Central Limit Theorem
•
•
For any distribution of n observations with
mean of  and standard deviation .
As n increases, the sample means will
have a Normal distribution of mean  and
standard deviation  / square root (n).
Go to Index
Do this in Excel
The theorem is important because it
helps us ignore questions about the
shape of distribution and focus on the
mean and standard deviation of it.
Standard Normal Distribution
•
•
•
•
•
Go to Index
A Normal distribution.
Mean of zero.
Standard deviation of 1.
Z = (Observed value – mean) / standard
deviation of average.
Where standard deviation of mean = standard
error = standard deviation of observations
divided by square root of sample size.
Example Calculation of Z
•
•
Go to Index
What is the Z value for the observed mean
of 16, if the average mean is 10 and the
standard error is 2?
Z = (16-10) / 2 = 3.
Another Example
•
•
•
Go to Index
What is the Z value for the mean 16 of 4
observations, if the average of repeated
sample of means is 10 and the standard
deviation of the observations is 2?
Standard deviation of mean =
2 / 4^0.5 = 2/2 =1
Z value for 16 = (16-10)/1 = 6
Use of Z Values
•
•
•
•
Go to Index
99.7% of data are between z=3 and z=-3.
Z is the number of standard deviations that
X is away from the mean.
0.15% of data are below z=-3.
0.15 % of data are above z=3.
Use of Z Value (Continued)
•
•
•
•
Go to Index
95% of data are within z=1.96 and z=-1.96
5% are outside z=1.96 and z=-1.96
2.5% of data are below z=-1.96
2.5% of data are above z=1.96
Confidence Interval
•
Go to Index
For Normal distributions, the 95% two
tailed confidence interval corresponds to
observations where z=1.96 and z=-1.96.
Example
•
•
•
•
•
•
Go to Index
What is the 95% confidence interval for
mean of 10 and standard deviation of 2?
Lower limit = 10-1.96*2 = 6.08.
Upper limit = 10+1.96*2 =13.92.
At 13.92, Z value is (13.92-10)/2=1.96.
At 6.08 , Z value is (6.08-10) / 2=-1.96.
95% of data fall within these limits.
Two Tailed Confidence Interval
•
•
•
•
Go to Index
What percentage of data are between z=1.96 and
Z=-1.96. Answer: 95%. Often referred to as
two-tailed confidence interval.
What percentage of data are below z=1.96?
Answer = 97.5. Often referred to as one tailedconfidence interval.
What percentage of data are above Z=-1.96.
Answer =97.5. Often referred to as one tailed
confidence interval.
Hypothesis
•
•
•
Go to Index
A statistical hypothesis is a conjecture
about population parameter.
The null hypothesis is that there is no
difference between the parameter and a
value.
The alternative hypothesis states there is a
specific difference.
Experimental data can only reject a
hypothesis not accept it.
Possible Outcomes of Hypothesis
Test
There are four possible outcomes:
1.
2.
3.
4.
Go to Index
We reject a hypothesis that is true.
We reject a hypothesis that is false.
We do not reject a hypothesis that is true.
We do not reject a hypothesis that is false.
Two Types of Error
We reject
hypothesis
We do not reject
hypothesis
Go to Index
Hypothesis is
true
Hypothesis is
false
Type one error
Correct
Correct
Type two error
Type 1 Error
•
•
•
Go to Index
The level of significance is the maximum
probability of type 1 error, symbolized by alpha,
.
When we base our decision on 95% confidence
intervals, 5% of the data are ignored at the two
tails of the distribution. Therefore, there is 5%
chance that we will reject a hypothesis that is
true.
Type one error= 5%,  = 0.05.
One-tailed Tests
•
•
Go to Index
In a two-tailed test, the hypothesis is
rejected when the value is above higher
limit and below the lower limit.
In a one-tailed test that a parameter is
larger than a particular value, the
hypothesis is rejected when the value is
above higher limit.
One-tailed Tests (Continued)
•
•
Go to Index
When we base our decision on 95%
confidence intervals, 2.5% of the data are
ignored at one tail of the distribution.
Therefore, there is 2.5% chance that we
will reject a hypothesis that is true.
=0.025.
Steps in Testing a Hypothesis
1.
2.
3.
4.
State the null hypothesis.
Identify the alternative hypothesis.
Is this a one tailed or two tailed test?
Decide the critical Z value above or below which the
hypothesis is rejected, usually 1.96.
5. Calculate the Z value corresponding to the
observation.
6. Reject or do not reject the hypothesis by comparing
the calculated Z to the critical values.
Go to Index
Example
•
•
•
The cost of rehabilitation in the industry is
$25,000, with a standard deviation of
3000.
In our hospital, the average cost is
$30,000.
With 95% confidence, would you say that
our cost is different than the industry?
Go to Index
Do this in Excel
Steps in Testing Example
Hypothesis
1. The null hypothesis: Our cost is higher or
lower than average.
2. Alternative hypothesis: Our costs are the
same as the industry.
3. This is a two tailed test.
4. The critical Z is +1.96 or –1.96.
5. Observed Z = (30000-25000)/3000 = 1.66.
6. Do not reject the hypothesis.
Go to Index
When to Assume Normal
Distribution for Means
•
•
•
Go to Index
When the population variance is known
and observations have a Normal
distribution.
When the population variance is unknown
and there are more than 30 observations.
Otherwise use t-distribution an
approximation for Normal distribution.
Use t-distribution
•
•
•
•
Go to Index
If the values in the population is Normal.
If we have less than 30 observations.
If we have to estimate the standard
deviation from the sample and variance of
the population is not known.
The t-distribution is used as an
approximation for near Normal data.
Calculating t Statistic
•
•
•
•
Go to Index
t= (observed average – mean) / standard
deviation of the average.
Critical value of t depends on sample size.
For one tail test of alpha = 0.025 and two
tailed test of alpha =0.05.
The critical t value for sample size of 10 is
2.22 and for sample size of 20 is 2.08.
Calculating t Statistic
(Continued)
•
•
Go to Index
If we are examining sample size of 10,
95% of data are within t=2.22 and t=-2.22.
If we are examining sample size of 10,
97.5% of data are below t=2.22.
Testing With t-distribution
1.
2.
3.
4.
State the null hypothesis.
Identify the alternative hypothesis.
Is this a one tailed or two tailed test?
Decide the critical t value above or below which the
hypothesis is rejected, the value depends on sample
size.
5. Calculate the t value corresponding to the
observation.
6. Reject or do not reject the hypothesis by comparing
the calculated t to the critical values.
Go to Index
Example Data
Go to Index
Selecting Data Analysis
Go to Index
Select Descriptive Statistics
Go to Index
Enter Data Range
Go to Index
Result
Confidence interval is
the mean plus or
minus the confidence
level. If it does not
include $30,000, then
our hospital has a
different cost structure
than other hospitals in
our database
Go to Index