For questions requiring R, upload the pdf from rendering the quarto/Rmarkdown fi

For questions requiring R, upload the pdf from rendering the quarto/Rmarkdown file.
This note explains the contents of the data file HouseElectionSpending2018 (available in csv or dta format).
Each row corresponds to a U.S. House election in 2018.
The sample is restricted to contested elections between an incumbent and a challenger.
Summary of variables
state: state postal code
dist: district number
incumbent: “R” if the incumbent is a Republican, “D” if the incumbent is a Democrat
repvoteshare: the Republican candidate’s two-party vote share (i.e., Republican votes/(Republican votes + Democratic votes) in 2018
repspending: a measure of the campaign spending of the Republican (specifically, the natural logarithm of dollars spent plus 1)
demspending: a measure of the campaign spending of the Democrat (specifically, the natural logarithm of dollars spent plus 1)
(Note: because campaign spending is measured as the natural logarithm of dollars spent, we approximately interpret a one-unit
increase in these variables as a doubling of campaign spending)
trumpvoteshare: the two-party vote share of Donald Trump (the Republican) in the 2016 presidential election in that district
lagrepvoteshare: the Republican candidate’s two-party vote share in the previous House election (in 2016)
Question 1:
Download “HouseElectionsSpending2018.csv” and the associated “README.txt,” which describes the variables in this data set, at press.princeton.edu/thinking-clearly.
(a) Run a linear regression that finds the relationship between incumbent vote share and incumbent spending. (Note: This may require you to recode some of the variables in the data set or generate your own variables that better suit your goal.)
i) Is the correlation positive or negative?
ii) According to this data, do incumbents who spend more do better or worse?
iii) Interpret the magnitude and direction of the correlation between incumbent spending and incumbent vote share.
b) Do the same as above for challengers.
c) Let’s think about whether the regressions you’ve run constitute compelling evidence of the effect of campaign spending of vote shares.
i) Identify three confounders you are worried about.
ii) Do you have any variables in this data set that measure those confounders? If so, identify a variable that might plausibly measure a confounder that is in the data set.
iii) Using linear regression, assess whether incumbent spending and challenger spending (the treatments) are in fact correlated with one of the potential confounders measured in the data set.
Question 2:
   Download “HouseElectionsSpending2018.csv” and the associated “README.txt,” which describes the variables in this data set, at press.princeton.edu/thinking-clearly.
(a) Run a regression of incumbent vote share (your dependent variable) on both incumbent spending and challenger spending.
i) Note that if challenger spending is positively correlated with higher challenger vote shares, it must be negatively correlated with incumbent vote share. In light of this, how should we interpret the estimated coefficients associated with your independent variables?
ii)
Are the results you obtained different from those you obtained when you ran separate regressions of incumbent vote share on incumbent spending and incumbent vote share on challenger spending in chapter 9? Why or why not?
b) Let’s add some controls to your regression in an attempt to obtain more reliable estimates of the effect of campaign spending. As you may know, 2018 was a good year for Democrats in House elections.
i) Is the overall good performance of Democrats in 2018 a potential confounder in your regression?
ii)
Create a new variable indicating whether the incumbent is a Republican—call it republicanincumbent. It should take a value of 1 if the incumbent is a Republican and a value of 0 if the incumbent is a Democrat.
iii) Re-run your regression, but include that variable as a control.
iv) Interpret the estimated coefficient associated with your new republicanincumbent variable.
v)
Does including this control variable meaningfully change your estimated coefficients of interest (i.e., the coefficients on incumbent and challenger spending)? Why or why not, do you think?
c) Now add in a control for the vote share that the incumbent’s party received in that district in the 2016 presidential election.
i) What kind of concern might including this control variable address?
ii) Interpret the estimated coefficient associated with this control variable.
iii) Does including this control variable meaningfully change your estimated coefficients of interest (i.e., the coefficients on incumbent and challenger spending)? Why or why not, do you think?

Place this order or similar order and get an amazing discount. USE Discount code “GET20” for 20% discount