Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Statistics: Political Science (Class 5) Non-Linear Relationships.

Similar presentations


Presentation on theme: "Introduction to Statistics: Political Science (Class 5) Non-Linear Relationships."— Presentation transcript:

1 Introduction to Statistics: Political Science (Class 5) Non-Linear Relationships

2 Thus far Focus on examining and controlling for linear relationships –Each one unit increase in an IV is associated with the same expected change in the DV –Ordinary-least-squares regression can only estimate linear relationships But, we can “trick” regression into estimating non-linear relationships buy transforming our independent (and/or dependent) variables

3 When to transform an IV Theoretical expectation Look at the data (sometimes tricky in multivariate analysis or when you have thousands of cases) Today: three types of transformations –Logarithm –Squared terms –Converting to indicator variables

4 Logarithm The power to which a base must be raised to produce a given value We’ll focus on natural logarithms where ln(x) is the power to which e (2.718281) must be raised to get x –ln(4) = 1.386 because e 1.386 = 4

5 1  5 in original measure = 1.609 change in logged value 5  10 in original measure =.693 change in logged value 10  15 in original measure =.405 change in logged value 15  20 in original measure =.288 change in logged value So the effect of a change in a 1 unit change x depends on whether the change is from 1 to 2 or 2 to 3 Υ = β 0 + β 1 ln(x) + u

6 When to log an IV “Diminishing returns” as X gets large –Data is skewed – e.g., income

7 Income and home value $60,000/year  $200,000 home $120,000/year  $400,000 home Bill Gates makes about $175 million/year –$175,000,000 = 2917 x $60,000 –Should we expect him to have a 2917 x $200,000 ($583,400,000) home?

8

9

10 TVs and Infant Mortality TVs as proxy for resources or wealth Biggest differences at the low end? –E.g., “there are a couple of TVs in town” and “some people have TVs in their private homes”

11

12 0.6 TVs  predicted infant mortality rate of -19.054

13 Coef.SETP TVs per capita-156.43612.934-12.1000.000 Constant74.8103.41921.8800.000 Coef.SETP TVs per capita (logged)-24.6561.397-17.6400.000 Constant-11.1513.346-3.3300.001 R-squared = 0.566 R-squared = 0.748

14

15

16 Getting Predicted Values Coef.SETP TVs per capita (logged)-24.6561.397-17.6400.000 Constant-11.1513.346-3.3300.001 TVs per capitaLoggedPredicted value 0.1-2.30345.621 0.2-1.60928.531 0.3-1.20418.534 0.4-0.91611.441 0.5-0.6935.939 0.6-0.5111.444

17

18 Quadratic (squared) models Curved like logarithm –Key difference: quadratics allow for “U-shaped” relationship Enter original variable and squared term –Allows for a direct test of whether allowing the line to curve significantly improves the predictive power of the model

19

20 Age and Political Ideology Coef.SETP Age-0.0070.004-1.7400.082 Constant0.1220.2090.5800.561 Coef.SETP Age-0.0650.025-2.6300.009 Age-squared0.0010.0002.3900.017 Constant1.5540.6352.4500.015 What would we conclude from this analysis?

21 Age and Political Ideology Coef.SETP Age-0.0650.025-2.6300.009 Age-squared0.0010.0002.3900.017 Constant1.5540.6352.4500.015 AgeAge 2 -0.065*Age.0005574*Age 2 ConstantPredicted Value 18324-1.1780.1811.5540.557 28784-1.8320.4371.5540.159 381444-2.4870.8051.554-0.128 482304-3.1411.2841.554-0.303 583364-3.7951.8751.554-0.366 684624-4.4502.5771.554-0.319 786084-5.1043.3911.554-0.159

22

23 Age and Political Ideology Coef.SETP Age-0.0650.025-2.6300.009 Age-squared0.0010.0002.3900.017 Constant1.5540.6352.4500.015 Note: We are using two variables to measure the relationship between age and ideology. Interpretation: 1.statistically significant relationship between age and ideology (can confirm with an F-test) 2.squared term significantly contributes to the predictive power of the model.

24 If you add a linear and squared term (e.g., age and age 2 ) to a model and neither is independently statistically significant This does not necessarily mean that age is not significantly related to the outcome Why? What we want to know is whether age and age 2 jointly improve the predictive power of the model. How can we test this?

25 Formula q = # of variables being tested n = number of cases k = number of IVs in unrestricted F = (SSR r - SSR ur )/q SSR ur /(n-(k+1) Check whether value is above critical value in the F-distribution [depends on degrees of freedom: Numerator = number of IVs being tested; Denominator = N-(number of IVs)-1 ]

26 Don’t worry about the F-test formula The point is: –F-tests are a way to test whether adding a set of variables reduces the sum of squared residuals enough to justify throwing these new variables into the model Depends on: –How much sum of squared residuals is reduced –How many variables we’re adding –How many cases we have to work with More “acceptable” to add variables if you have a lot of cases Intuition: explaining 10 cases with 10 variables v. explaining 1000 cases with 10 variables?

27 TVs and Infant Mortality Squared term or logarithm? Coef.SETP TVs per capita-380.08829.949-12.6900.000 TVs per capita (squared)410.95751.6297.9600.000 Constant90.1973.35326.9000.000

28 Which is “better”? Two basic ways to decide: 1)Theory 2)Which yields a better fit?

29 Coef.SETP TVs per capita-30.28874.056-0.4100.683 TVs per capita (squared)63.41381.6520.7800.439 TVs per capita (logged)-24.6355.155-4.7800.000 Constant-9.46520.417-0.4600.644 What might we conclude from these model estimates? Probably should also do an F-test of joint significance of TVs per capita and TVs per capita-squared. Why? That F-test returned a significance level of 0.335. So we can conclude that… Run two models and compare R-squared… or possibly… Ultimately you’re best off relying on theory about the shape of the relationship

30 Ordered IVs  Indicators Sometimes we have reason to expect the relationship between an IV and outcome to be more complex Can address this using more polynomials (e.g., variable 3, variable 4, etc) –We won’t go there… instead… Example: Party identification and evaluations of candidates and issues

31 Standard “branching” PID Items Generally speaking, do you usually think of yourself as a Republican, a Democrat, an Independent, or something else? –If Republican or Democrat ask: Would you call yourself a strong (Republican/Democrat) or a not very strong (Republican/Democrat)? –If Independent or something else ask: Do you think of yourself as closer to the Republican or Democratic party?

32 Party Identification Measure Strong Republican Weak Republican Lean RepublicanIndependent Lean Democrat Weak Democrat Strong Democrat -3-20123 People who say Democrat or Republican in response to first question Question: Is the change from -2 to -1 (or 1 to 2) the same as the change from 0 to 1 or 2 to 3?

33 Create Indicators Party Identification (-3 to 3) Seven Variables: Strong Republican (1=yes) Weak Republican (1=yes) Lean Republican (1=yes) Pure Independent (1=yes) Lean Democrat (1=yes) Weak Democrat (1=yes) Strong Democrat (1=yes)

34 Predict Obama Favorability (1-4) Coef.SETP Strong Republican-1.6320.161-10.1600.000 Weak Republican-0.7070.198-3.5800.000 Lean Republican-1.2350.181-6.8100.000 Lean Democrat0.6740.1973.4300.001 Weak Democrat0.4940.1872.6400.009 Strong Democrat0.5950.1593.7500.000 Constant2.9400.13421.8700.000 Excluded category: Pure Independents

35 Obama Favorability

36 Predict Obama Favorability (1-4) Coef.SETP Strong Republican-0.3970.150-2.6500.008 Weak Republican0.5280.1892.7900.006 Pure Independent1.2350.1816.8100.000 Lean Democrat1.9090.18810.1500.000 Weak Democrat1.7290.1799.6800.000 Strong Democrat1.8310.14812.3600.000 Constant1.7050.12214.0100.000 New excluded category: Leaning Republicans

37 DV: Obama Favorability Coef.SETP Strong Republican-1.6520.161-10.2900.000 Weak Republican-0.7040.197-3.5800.000 Lean Republican-1.2290.181-6.7900.000 Lean Democrat0.6540.1953.3400.001 Weak Democrat0.4570.1872.4400.015 Strong Democrat0.5790.1583.6500.000 Gender (female=1)0.0720.0870.8300.405 Age-0.0410.019-2.1400.033 Age 2 0.0440.0182.4300.015 Constant3.7840.5097.4300.000 Predicted value for Pure Independent Male, age 20? Remember!: Always interpret these coefficients as the estimated relationships holding other variables in the model constant (or controlling for the other variables)

38 Notes and Next Time Homework due next Thursday (11/18) Next homework handed out next Tuesday –Not due until Tuesday after Fall Break Next time: –Dealing with situations where you expect the relationship between an IV and a DV to depend on the value of another IV


Download ppt "Introduction to Statistics: Political Science (Class 5) Non-Linear Relationships."

Similar presentations


Ads by Google