TROUBLESOME CONCEPTS IN STATISTICS: r 2 AND POWER
description
Transcript of TROUBLESOME CONCEPTS IN STATISTICS: r 2 AND POWER
HS AP Stat # 1
TROUBLESOME CONCEPTS IN STATISTICS:
rr22 AND POWERPOWER
N. Scott UrquhartDirector, STARMAP
Department of StatisticsColorado State University
Fort Collins, CO 80523-1877
HS AP Stat # 2
STARMAP FUNDINGSpace-Time Aquatic Resources Modeling and Analysis Program
The work reported here today was developed under the STAR Research Assistance Agreement CR-829095 awarded by the U.S. Environmental Protection Agency (EPA) to Colorado State University. This presentation has not been formally reviewed by EPA. The views expressed here are solely those of the presenter and STARMAP, the Program he represents. EPA does not endorse any products or commercial services mentioned in these presentation.
This research is funded by
U.S.EPA – Science To AchieveResults (STAR) ProgramCooperativeAgreement
# CR - 829095
HS AP Stat # 3
INTENT FOR TODAY
To discuss two topics which have givensome of you a bit of confusion
r2 in regression Power in the context of tests of hypotheses Thanks for Ann Brock and Harriett Bassett
for suggesting these topics Approach: Visually illustrate the idea,
Then talk about the concepts illustrated The sequences of graphs are available on the
internet right now (address is at the end of
this handout) Questions are welcome
HS AP Stat # 4
r2 IN REGRESSION
r2 provides a summary of the strength of a (linear) regression which reflects: The relative size of the residual variability, The slope of the fitted line, and How good the observed values of the
predictor variable are for prediction Mainly the range of the Xs
Let’s seesee these features in action, then Look at the formulas
HS AP Stat # 5
WHAT MAKES r2 TICK?
r2 increases as residual variation decreases
r2 increases as the slope increases
r2 increases the range of x increases
varying one thing, leaving the remaining things fixed
HS AP Stat # 6
WHAT IS r2?
r2 provides AA measure of the fit of a line to a set of data which incorporates The amount of residual variation, The strength of the line (slope), and How good the set of values of “x” are for
estimating the line Some areas of endeavor tend to
overuse it!
HS AP Stat # 7
HOW DOES r2 TELL US ABOUT VARIATION?
The following graph illustrates this: The data scatter has r2 = 0.5 (approximately) The red points have the same values, but all
concentrated at X = 5. {Strictly speaking the above formulas
applyonly in the case of bivariate
regression.} {Estimation formulas involve factors
of n-1 and n-2.}
2
2 21
var( )
var( | ) ( )
Y
Y X
HS AP Stat # 8
r2
HS AP Stat # 9
FORMULAS FOR r2
But these have little intuitive appeal ! We’ll decompose observations into
parts: Mean Regression Residual
22
2 2
22
2 2 2 2
is estimated by
,
,
cov ( , )var( )var( )
( )( )
( ) ( )
X Y
X Y
X Y
X Y
X YX Y
x x y ysr
s s x x y y
HS AP Stat # 10
DECOMPOSING REGRESSION
This is really n equations
Square each of these equations and add them up across i.
The three cross product terms will eachadd to zero. (Try it!)
1 2ˆ ˆ( ) ( ), , , ,i i i i iy y y y y y i n
HS AP Stat # 11
DECOMPOSING REGRESSION(continued)
SSMean SSReg SSRes
2 2 2 2ˆ ˆ( ) ( )i i iy ny y y y y
2
Proportion of variation "due" to regression
SSRegSSReg SSRes
r
Sum of Squares f or Mean
+ Sum of Squares Regression
+ Sum of Squares of Residuals
HS AP Stat # 12
POWER OF A TEST OF HYPOTHESIS
Power = Prob(“Being right”) = Prob(Rejecting false hypothesis)
Power depends on two main things The difference in the hypothesized and true
situations, and The strength of the information for making
the test Sample size is very important factor In regression it depends on the same factors as
the ones which increase r2. Again, see it, then talk about it
Power increases as = 1 - 2 increases
HS AP Stat # 13
POWER VARIES WITH DIFFERENCE ( = 1 - 2) and SAMPLE SIZE (n)
HS AP Stat # 14
ON TESTS OF HYPOTHESES( ON THE WAY TO POWER)
ACTION
TRUE SITUATION
FAIL TO REJECT THE NULL
HYPOTHESIS
REJECT THE NULL
HYPOTHESIS
CORRECT ACTION
CORRECT ACTION
HYPOTHESIS TRUE
HYPOTHESIS FALSE
TYPE II ERROR
TYPE I ERROR
Tests of hypotheses are designed to control = Prob (Type I Error)
While getting Power = 1- Prob (Type II Error) as large as
possible
HS AP Stat # 15
ON TESTS OF HYPOTHESES(AN ASIDE)
Which is worse, a type I error, or a type II error?
It depends tremendously on perspective Consider the criminal justice system
Truth: Accused is innocent (HO) or guilty (HA) Action: Accused is acquitted or convicted
Type I error = Convict an innocent person Type II error = Acquit a guilty person
Which is worse? Consider the difference in view of the
Accused Society – especially if accused is terrorist
HS AP Stat # 16
COMPUTING THE CRITICAL REGION
Consider a simple case X ~ N( , 1) HO: = 4 versus
HA: 4 Critical Region (CR) is
X l and X u , so 0.025 = P(X l )
= P((X-4)/1 ( l - 4)/1) = P(Z -1.96)
l = 2.04, similarly, u = 5.96
HS AP Stat # 17
COMPUTING POWER
Consider a simple case X ~ N( , 1) HO: = 4 versus
HA: 4 Power (at 5) = ?
= Prob(XA in CR| 5)
XA ~ N( 5, 1)
Prob(XA 2.04) + Prob(XA 5.96)
= Prob(Z -2.96) + Prob(Z 0.96)
= 0.0015 + 0.1685 = 0.1700
HS AP Stat # 18
POWER VARIES WITH DIFFERENCE ( = 1 - 2) and SAMPLE SIZE (n)
HS AP Stat # 19
COMPUTING POWER USING A MEAN BASED ON n = 2 OBSERVATIONS
Consider a simple case: When
the mean of two observations follows: HO: = 4 versus HA: 4 Power (at 5) = ?
Critical Region (CR) is l and u , so 0.025 = P( l ) = P(( -4)/0.707 ( l -
4)/0.707) = P(Z -1.96)
So l = 4 – (1.96)(0.707) = 2.61, similarly, u = 5.39
1~ ( , ),X N
2 1 2~ ( , / )X N
2X 2X
2X 2X
HS AP Stat # 20
COMPUTING POWER USING A MEAN BASED ON n = 2 OBSERVATIONS
(continued)
2 5 2 61 53 38 0 55
0 707 0 707 Prob Prob
.. ( . )
. .AX
Z Z
2 5 1 2Because ~ ( , / ),AX N
0 0004 0 2912 0 2916 0 2930 , a bit more accurately. . . ( . )
2 2 22 61 5 39Power = Prob Prob + Prob( ) ( . ) ( . )A A AX CR X X
HS AP Stat # 21
POWER VARIES WITH DIFFERENCE ( = 1 - 2) and SAMPLE SIZE (n)
HS AP Stat # 22
COMPUTING POWER USING A MEAN BASED ON n = 4 OBSERVATIONS
(continued)
4 5 1 4Because ~ ( , / ),AX N
4 4 43 02 4 98Power = Prob Prob + Prob ( ) ( . ) ( . )A A AX CR X X
4 5 3 02 53 96 0 04
0 5 0 5 Prob Prob
.. ( . )
. .AX
Z Z
(This page is not in the handout – so it all would fit on one page)
0 0000 0 5160 0 5160 . . .
HS AP Stat # 23
POWER VARIES WITH DIFFERENCE ( = 1 - 2) and SAMPLE SIZE (n)
HS AP Stat # 24
POWER VARIES WITH DIFFERENCE ( = 1 - 2) and SAMPLE SIZE (n)
HS AP Stat # 25
DIRECTIONAL NOTE
As the alternative has been two-sided throughout this presentation, the power curves are symmetric about the vertical axis. By examining only the positive side, we
can see the curves twice as large.
HS AP Stat # 26
YOU HAVE ACCESS TO THESEPRESENTATIONS
You can find each of the slide shows shownhere today at:
http://www.stat.colostate.edu/starmap/learning.html
Each show begins with authorship & funding slides You are welcome to use them, and adapt them But, please always acknowledge source and funding You are free to reorder the graphs if it makes
more sense for r2 to decrease than increase.
Urquhart is available to talk to AP Stat classesabout statistics as a profession.
See content on the web site above.