Presentation is loading. Please wait.

Presentation is loading. Please wait.

Regression Correlation Background Defines relationship between two variables X and Y R ranges from -1 (perfect negative correlation) 0 (No correlation)

Similar presentations


Presentation on theme: "Regression Correlation Background Defines relationship between two variables X and Y R ranges from -1 (perfect negative correlation) 0 (No correlation)"— Presentation transcript:

1 Regression Correlation Background Defines relationship between two variables X and Y R ranges from -1 (perfect negative correlation) 0 (No correlation) +1 (perfect positive correlation) R=.689

2 Regression Correlation Background R 2 Indicates reduction in error knowing X and Predicting Y R 2 ranges from 0 (No reduction in error) 1 (complete reduction in error) R 2 =.474

3 Regression Examples Predicting height from G.P.A. R 2 = 0 (Knowing height does not help predict G.P.A – best guess is always mean G.P.A.) R 2 = 1 (Knowing height in CM completely predicts height in Inches)

4 Regression Real world examples are somewhere in between Predicting height from weight R 2 =.36 (Knowing height somewhat helps predict weight)

5 Regression But how do we figure out HOW to make that prediction given one of the variables?

6 Regression Need background concept of slope How much does Y change for a given change in X? All lines have R=1

7 Regression All lines have R=-1

8 Regression Need background concept of INTERCEPT What is Y when X=0? All lines have Same Slope but different intercept

9 Regression Unique line is defined by Slope and Y- Intercept Y=bX+a b=slope a=Y-Interecpt

10 Regression Predicting depression from loneliness Y= BDI Depression X= Loneliness Y=2X+2

11 Regression Predicted vs. Actual R=1, R 2 =1 No Error Never happens like this in real world

12 Actual scores don’t fit on a line perfectly

13 Some possible solutions? Error is Sum of (Predicted Y-Actual Y) 2

14 Where is the line with smallest error? Least Squares Regression Line

15 Calc slope=b= Σ (X-X)(Y-Y) ---------------------------------------------------------- Σ (X-X)(X-X) =2.13 with this data

16 Where is the line with smallest error? Least Squares Regression Line Calc y intercept = a Y- (b)(X) =4 with this data So Least squares regression line is Y=2.13X+4

17 Where is the line with smallest error? Least Squares Regression Line

18 How good is our prediction? Sum of (Predicted Y-Actual Y) 2 X ScoreActual Y scorePredicted Y scoreSquared Error 054.001.00 176.130.75 288.270.07 31110.400.36 4812.5320.55 51514.670.11 61716.800.04 72218.939.40 81821.079.40 92523.203.24 4.513.644.93

19 Can we standardize this for an average Error? Yes: Standard error of the estimate Like a standard deviation Gives average precition error per score Standard error of the estimate = SQRT(SS residual /N pairs -2) In this example = SQRT(44.9/10-2)=SQRT(44.9/8)=2.36

20 Chi-square (χ2) Non Parametric Statistical tests Used for nominal data (categories) ordinal (ordered categories) non-normal interval/ratio data

21 Goodness of fit χ2 Used with nominal data Tests a DISTRIBUTION (not a mean) Sees if observed data FITS an expected distribution H 0 =true frequency distribution is expected H 1 =true frequency distribution has some other form

22 VEGAS BABY!!! Rolling dice at the Mirage Lots of Snake Eyes coming up Are the dice fixed? Test with goodness of fit Does our distribution FIT the expected distribution

23 VEGAS BABY!!! Expected distribution for 120 rolls if fair: Each die(dice) has 1/6 chance 1/6 X 120 = 20 of each type Expected Distribution = [20,20,20,20,20,20]

24 VEGAS BABY!!! Actual distribution for 120 rolls is: [28,16,23,23,17,13] Are these dice fair? Use Goodness of fit χ2

25 VEGAS BABY!!! Determine critical χ2 value: df = number of categories – 1 = 6-1 = 5 χ2 critical for df=5 is 11.07 from table

26

27

28

29

30 CatOiOi EiEi (O i -E i )(O i -E i ) 2 (O i -E i ) 2 / E i 128208643.2 21620-4160.8 32320390.45 42320390.45 51720-390.45 61320-7492.45 Σ120 07.8 FAIR!!!

31 CatOiOi EiEi (O i -E i )(O i -E i ) 2 (O i -E i ) 2 / E i 15640162566.4 23240-8641.6 346406360.9 446406360.9 53440-6360.9 62640-141964.9 Σ240 015.6 CHEAT!!!

32 Test of independence χ2 Used with nominal data Tests whether DISTRIBUTION 1 is dependent upon DISTRIBUTION 2 H 0 = Distribution 1 is independent of Distribution 2 H 1 = Distribution 1 is related to Distribution 2

33 Example: Are Men more likely to have supported was in IRAQ 100 Subjects (50 male, 50 female) Asked yes or no question about supporting war in Iraq H 0 = Gender does not affect likelihood of supporting war H 1 = Gender does affect likelihood of supporting war

34 Determine critical Value Df = (R-1) (C-1) Df = (Category 1 Size -1) size X Category 2 Size -1) =(2-1) X (2-1) = 1 X 1 = 1 Critical Value from A-3 is 3.84

35 Set up Data MalesFemalesTotal Support war 32 2153 Not support war 18 2947 Total 5050100

36 Set up Data MalesFemalesTotal Support war 32 (26.5) 21(26.5)53 Not support war 18 (23.5) 29(23.5)47 Total 5050100

37 CategoryOiEi(Oi-Ei)(Oi-Ei) 2 (Oi-Ei) 2 / Ei M/S3226.55.530.31.14 M/N1823.5-5.530.31.29 F/S2126.5-5.530.31.14 F/N2923.55.530.31.29 Σ100 04.86 Calculate observed χ2

38 Test observed against critical observed χ2 = 4.86 critical χ2 = 3.84 So we reject the idea that gender does not affect support of war and conclude Gender DOES affect support of war

39 McNemar test for significance of change Used with nominal data Tests whether DISTRIBUTION 1 is dependent upon DISTRIBUTION 2 Same as test of dependence but uses SAME person to test nominal data before and after some event

40 Example: Are Men more likely to have supported was in IRAQ 100 Subjects Do you favor the pledge allegiance? Before and After terrorist attacks H 0 = proportion of individuals supporting pledge before attacks is same as after attacks H 1 = proportion of individuals supporting pledge before attacks is different after attacks

41 Determine critical Value Df = 1 for all McNemar tests Critical Value is 3.84

42 Set up Data Before Attacks YesNoTotal After AttacksYes 33 2053 No 9 3847 Total 4258100

43 Set up Data Before Attacks YesNoTotal After AttacksYes 33 20 (14.5) 53 No 9 (14.5) 3847 Total 4258

44 CategoryOiEi(Oi-Ei)(Oi-Ei) 2 (Oi-Ei) 2 / Ei 1914.5-5.530.32.09 22014.55.530.32.09 Σ29 04.17 Calculate observed χ2

45 Test observed against critical observed χ2 = 4.71 critical χ2 = 3.84 So we reject the idea that the proportions are the same Conclusion: Attacks did change the proportion who support pledge of allegiance


Download ppt "Regression Correlation Background Defines relationship between two variables X and Y R ranges from -1 (perfect negative correlation) 0 (No correlation)"

Similar presentations


Ads by Google