p - Statistics

Download Report

Transcript p - Statistics

Stat 350 Lab Session
GSI: Yizao Wang
Section 016 Mon 2pm30-4pm MH 444-D
Section 043 Wed 2pm30-4pm MH 444-B
Today’s Agenda
• 5 Steps for Hypothesis Testing Review
• Module 6 Activity 1
One Sampe Test Procedures
• Module 7 Activity 1
Paired t Procedures
• In-Lab Review: confidence intervals
• Today’s Qwizdom is no longer anonymous. Please use
your UMID to log in.
5 Steps for Hypothesis Testing
1. Set up the null and alternative hypotheses
•
•
•
•
•
•
Hypothesis is about the population parameters (p, μ)
H0 represents statement of no effect
Ha represents what the experimenter would like to support
Equal sign always goes to the H0
The direction in Ha is very important in calculating p-value
The significant level is also set at this step (most of the time
by the problem)
5 Steps for Hypothesis Testing
2. Check assumptions for performing the test and
calculate the test statistic
For 1-sample testing of population proportion, check
• (1) random sample
• (2) If np0>=10 and n(1-p0)>=10
Help the computation of p-value.
What to do when (2) does not hold? (very rare case)
For 1-sample testing of population mean, check
• (1) random sample
• (2) Normality of population
Not crucial when n>=30, because of CLT
5 Steps for Hypothesis Testing
2. Check assumptions for performing the test and
calculate the test statistic
• How to check random sample?
Information from the problem
Time plot if data is collected in time
• How to check normality?
QQ plot
• Which statistic to use?
Under normality assumption
use z-statistic when σ is known (population proportion)
use t-statistic when σ is unknown (population mean for
most of the time)
5 Steps for Hypothesis Testing
3. Assuming H0 is true, find the p-value
• p-value is, assuming H0 is true, the probability of getting
the same or more extreme test statistic in the direction of
Ha. It’s a conditional probability.
• p-value = P (t.s. type direction t.s. value)
e.g. p-value = P (t <= -2)
Test statistic type is decided according to the problem
Test statistic value is then calculated
Direction is equal and the direction in Ha
5 Steps for Hypothesis Testing
4. Determine if the result is statistically significant
• p-value <= significance level: Reject H0 (the test is
statistically significant)
• p-value > significance level: Fail to reject H0
5. Report a conclusion in the context of the problem
• There is sufficient evidence to say… Ha
• There is no sufficient evidence to say… Ha.
5 Steps for Hypothesis Testing
1. Set up the null and alternative hypotheses
2. Check assumptions for performing the test and
calculate the test statistic
3. Assuming H0 is true, find the p-value
4. Determine if the result is statistically significant
5. Report a conclusion in the context of the problem
Module 6 Activity 1
One sample t test procedures
• Ctools salmonella.sav
• We will start step by step with Qwizdom
questions…
Order the steps for conducting a
hypothesis test...
1)
2)
3)
4)
5)
Assumptions and test statistic
State the hypotheses
Find the p-value
Conclusion
Decision
What is the response?
A) Individual salmonella levels
B) Average salmonella level
What type of variable is the
response?
A) Discrete
B) Continuous
What type of parameter would be
useful for summarizing this
variable?
A) Proportion
B) Mean
What is the specific parameter of
interest?
p
μ
μd
μ1 – μ2
p1 – p2
Select the appropriate
alternative hypothesis
Ha: μ > 0.3
Ha: μ ≥ 0.3
Ha: μ < 0.3
Ha: μ ≤ 0.3
Ha: μ ≠ 0.3
What graph could be used to check
the random sample assumption?
Histogram
Boxplot
Time-series plot
QQ-plot
What graph would be used to check
the normal distribution assumption?
Histogram
Boxplot
Time-series plot
QQ-plot
What is the distribution of the test
statistics if Ho is true?
N(0,1)
N(μ,σ)
t(n)
t(n-1)
Yes or No
Are the results statistically significant at
the 5% level?
One-Sample Test
Test Value = 0.3
sal
t
2.205
df
8
Sig. (2-tailed)
.059
Mean
Difference
.156444
95% Confidence
Interval of the
Difference
Lower
Upper
-.00716
.32005
Interpretations
• Test statistic: the observed sample mean was 2.205
average distances (i.e. 2.205 standard errors) above the
hypothesized mean of 0.3.
• P-value: the p-value of (0.059/2) = 0.0295 indicates that
if the mean level is really 0.3 MPH/g, and if repeated
random samples of the same size were drawn from the
population of Salmonella enteritidis levels, the probability
of observing a test statistic value as large as 2.205 or
larger is only 0.0295.
Paired t Procedures
• Similar to one sample t procedures
(Module 6 Activity 1)
• μD taking place of μ
• Paired difference vs.
Difference of parameter of two populations
(μD vs. μ1 - μ2 )
Paired vs. Independent Difference
Problem: are the books from Amazon.com
cheaper than those from Borders?
• Scenario 1: pick 100 books randomly, record the
price differences of two sellers and analyze.
• Scenario 2: pick 100 books randomly from
Amazon.com and 100 books randomly from
Borders, calculate the mean price of each group
and calculate the difference and analyze.
Which scenario is better for this problem?
Module 7 Activity 1
• Ctools books.sav
Interpretation of p-Value
• If the null hypothesis is true and this
procedure (experiment) was repeated
many times, we would expect to see a Ttest statistic value of -1.104 or larger in
86.15% of the repetitions.
• Thus our data are not at all unusual under
the null hypothesis theory.
In-Lab Review
• 15-20 minutes
Ctools\Lab info\in lab review on CI
Before We Finish …
• Questions and comments?