Activity Intro Regress - R

docx

School

University of Guelph *

*We aren’t endorsed by this school

Course

232

Subject

Statistics

Date

Apr 3, 2024

Type

docx

Pages

5

Uploaded by ConstableStar6714

Report
Activity: Introduction to Regression Data: Canadian Election Study, 2015 Objective: Understand how to run a linear regression Learn to interpret the B coefficient (slope), and the significance of the B coefficient Instructions In this activity, we will look at bivariate regression analyses where one independent variable is regressed on a dependent variables. We will use data from the Canadian Election Study, 2015 to look at how economy affected opinion of the incumbent Conservative Party and the ultimately victorious Liberal Party. What effect did perceptions of the economy have on views of the incumbent Conservative Party? What effect did perceptions of the economy have on views of the incumbent Liberal Party? The dependent variables, opinion of the parties, are measured using feeling thermometers, one for the Liberal Party (ptfeel_libs) and one for the Conservative Party (ptfeel_cons). These feeling thermometers are scales running from 0 (really dislike) to 100 (really like). The first independent variable we will look at is a simple question that asked respondents about whether the economy had gotten better, worse or stayed about the same over the past year. I recoded the answers into a new variable, called econbetter. For econbetter, views that the economy had gotten better was given the highest value, and perceptions that the economy had gotten worse became the lowest value on the scale. So, the variable should be interpreted as every one point increase towards believing that the economy got better over the previous year. The regression output for RCPA3::regC() looks like this: > regC(CES2015_Combined_Stata13$ptfeel_cons~CES2015_Combined_Stata13$econbetter) ===================================================================== ====== Linear Regression Analysis ===================================================================== ====== Table: Linear Regression Coefficients Estimate Std. Error t value Pr(>|t|) ------------------------------------ --------- ----------- -------- --------- (Intercept) 32.308 0.367 88.003 <.001 CES2015_Combined_Stata13$econbetter 17.18 0.468 36.716 <.001 Table: Regression Residuals Min. 1st Qu. Median 3rd Qu. Max. -------- -------- ------- -------- ------- -66.668 -28.623 0.512 23.647 67.692 Additional Information: Residual standard error: 29.33 on 10308 degrees of freedom N: 10310 (1304 observations deleted due to missingness) Multiple R-squared: 0.1157, Adjusted R-squared: 0.1156
F-statistic: 1348 on 1 and 10308 DF, p-value: < 2.2e-16 Dependent variable: CES2015_Combined_Stata13$ptfeel_cons The first thing to look for the “b” [unstandardized] coefficient (blue box). Then, look for the significance of the coefficient (red oval) to determine whether one can be confident that the effect of the coefficient is not zero or due to random chance. The coefficient for the independent variable is the slope of a line. The y-intercept of that line is the constant, identified in the bottom row as the coefficient for “_cons.” The constant is not very important to analyzing the results of this bivariate regression and need not be reported. You should also look to see how much variation in the dependent variable is explained by the model by looking at the R-squared (gold rounded-rectangle). You should also note the number of observations (green dashed line), which can be a warning sign that something is wrong. In this example, a one point increase in thinking that the economy got better over the past year is predicted to increase views of Conservatives by 17.18 points (significant at P<0.05) The r-squared is 0.116, which indicates that the model explains 11.6% of the variation in the dependent variable. That is not much, so it is likely (and unsurprising) that other independent variables could likely be added to the model to explain support for the Conservatives. Now, look at the same dependent variable, feelings towards the Conservatives, but a slightly different independent variable. This independent variable comes from a follow-up question on the survey that asked whether the government had made the economy any better over the previous year. This variable, goveconbetter, has been recoded so that better=2, not made a difference/don’t know=1, and worse=0. The resulting ordinary least squares (OLS) regression result can be seen here: > regC(CES2015_Combined_Stata13$ptfeel_cons~CES2015_Combined_Stata13$goveconbetter) ============================================================== ============= Linear Regression Analysis ============================================================== ============= Table: Linear Regression Coefficients Estimate Std. Error t value Pr(>|t|) --------------------------------------- --------- ----------- -------- --------- (Intercept) 21.667 0.392 55.255 <.001 CES2015_Combined_Stata13$goveconbetter 25.59 0.397 64.521 <.001 Table: Regression Residuals Min. 1st Qu. Median 3rd Qu. Max. -------- -------- ------- -------- ------- -72.847 -21.667 2.153 19.743 78.333 Additional Information: Residual standard error: 26.32 on 10293 degrees of freedom N: 10295 (1319 observations deleted due to missingness) Multiple R-squared: 0.288, Adjusted R-squared: 0.2879 F-statistic: 4163 on 1 and 10293 DF, p-value: < 2.2e-16 Dependent variable: CES2015_Combined_Stata13$ptfeel_cons
1. What sentence best explains the model’s findings about the effect of views that the government made the economy better on feelings towards the incumbent Conservative Party? a. The model estimates that thinking that the government has made the economy better by one point (on a three point scale) will lead to a 25.6 point increase in positive feelings towards the Conservatives (significant at P <0.01). b. The model estimates that thinking that the government has made the economy better by one point (on a three point scale) will lead to a 25.6 point increase in positive feelings towards the Conservatives, but this effect is statistically insignificant. c. The model estimates that thinking that the government has made the economy better by one point (on a three point scale) will lead to a 25.6 point decrease in positive feelings towards the Conservatives (significant at P <0.01). d. The model estimates that thinking that the government has made the economy better by one point (on a three point scale) will lead to a 25.6 point decrease in positive feelings towards the Conservatives, but this effect is statistically insignificant. 2. How much variation in the dependent variable, positive feelings towards the Conservative Party, does this variable explain? a. 21.7% b. 25.6% c. 28.8% d. 39.6% 3. How many observations did the model use to calculate these results? a. 26.32 b. 4,162.92 c. 10,295 Now, look at the original independent variable, perceptions of whether or not the economy has gotten better this past year, but explaining variation in feelings towards the opposition (and triumphant) Liberal Party (ptfeel_libs). > regC(CES2015_Combined_Stata13$ptfeel_libs~CES2015_Combined_Stata13$econbetter) ============================================================== ============= Linear Regression Analysis ============================================================== ============= Table: Linear Regression Coefficients Estimate Std. Error t value Pr(>|t|) ------------------------------------ --------- ----------- -------- --------- (Intercept) 52.841 0.348 152.03 <.001 CES2015_Combined_Stata13$econbetter -3.864 0.443 -8.721 <.001 Table: Regression Residuals Min. 1st Qu. Median 3rd Qu. Max. -------- -------- ------- -------- ------- -52.841 -18.977 3.159 21.023 54.887 Additional Information:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Residual standard error: 27.67 on 10254 degrees of freedom N: 10256 (1358 observations deleted due to missingness) Multiple R-squared: 0.007363, Adjusted R-squared: 0.007266 F-statistic: 76.06 on 1 and 10254 DF, p-value: < 2.2e-16 Dependent variable: CES2015_Combined_Stata13$ptfeel_libs 4. What sentence best explains the model’s findings about the effect of views that the government made the economy better on feelings towards the incumbent Conservative Party? a. The model estimates that thinking that the government has made the economy better by one point (on a three point scale) will lead to a 3.9 point increase in positive feelings towards the Liberals (significant at P <0.01). b. The model estimates that thinking that the government has made the economy better by one point (on a three point scale) will lead to a 3.9 point increase in positive feelings towards the Conservatives, but this effect is statistically insignificant. c. The model estimates that thinking that the government has made the economy better by one point (on a three point scale) will lead to a 3.9 point decrease in positive feelings towards the Liberals (significant at P <0.01). d. The model estimates that thinking that the government has made the economy better by one point (on a three point scale) will lead to a 3.9 point decrease in positive feelings towards the Liberals, but this effect is statistically insignificant. 5. True/False: ‘Econbetter’ explains more variation in feelings towards the incumbent Conservatives than variation in feelings towards the Liberals. Now look at the regression results for whether the government has improved the economy on feelings towards the Liberal Party. > regC(CES2015_Combined_Stata13$ptfeel_libs~CES2015_Combined_Stata13$goveconbetter) ============================================================== ============= Linear Regression Analysis ============================================================== ============= Table: Linear Regression Coefficients Estimate Std. Error t value Pr(>|t|) --------------------------------------- --------- ----------- -------- --------- (Intercept) 55.762 0.41 136.096 <.001 CES2015_Combined_Stata13$goveconbetter -6.435 0.415 -15.518 <.001 Table: Regression Residuals Min. 1st Qu. Median 3rd Qu. Max. -------- -------- ------- -------- ------- -55.762 -19.327 4.238 20.673 57.107 Additional Information: Residual standard error: 27.44 on 10242 degrees of freedom N: 10244 (1370 observations deleted due to missingness) Multiple R-squared: 0.02297, Adjusted R-squared: 0.02288 F-statistic: 240.8 on 1 and 10242 DF, p-value: < 2.2e-16 Dependent variable: CES2015_Combined_Stata13$ptfeel_libs
6. What is the coefficient indicating the effect of ‘goveconbetter’ on feelings towards the Liberals? a. -15.5 b. -6.4 c. 6.4 d. 55.7 7. True/False: The effect of beliefs that the government has improved the economy has a statistically significant effect on feelings towards the Liberal Party at P<0.01. 8. True/False: The R-squared for this analysis is so low, that there is a good chance that other variables would explain more variation in the dependent variable