Question: --- title: Week 4 R format: docx: echo: true message: false editor: visual --- Libraries In the following code chunk, load all the libraries you
--- title: "Week 4 R" format: docx: echo: true message: false editor: visual ---
Libraries
In the following code chunk, load all the libraries you will need:
{r}
# ANSWER HERE
Tasks:
a) Load the "Highway1" data set from the car package using data(). Then, don't include it in your code chunk, but look at help(Highway1) to see the descriptions of the variables and the description of where the data came from.
{r}
# ANSWER HERE
b) Use sumtable() in the vtable package to look at the distributions of the variables
{r}
# ANSWER HERE
c) We are interested in the effect of higher speed limits on accident rates. Regress rate on slim using feols(), store the result as speedreg, and then use both etable() and ggplot(data, aes(x = xaxis, y = yaxis)) + geom_point() + geom_smooth(method = 'lm') to look at the results.
{r}
# ANSWER HERE
d) In a sentence, interpret the coefficient on slim. Be precise.
{r}
ANSWER HERE:
e) List at least three variables (that may or may not be in the data) that you would want to control for in order to estimate the causal effect of speed limit on accident rates. Give reasoning for your choices.
ANSWER 1 HERE: ANSWER 2 HERE: ANSWER 3 HERE:
f) Rerun the regression but include lane, htype, and adt as controls, saving the result as with_controls. Look at both speedreg and with_controls using etable()
{r}
# ANSWER HERE
g) In a sentence, interpret the coefficient on slim. Be precise. "Be precise" means that your answer should keep in mind that you have control variables in there, and what that means.
{r}
ANSWER HERE:
h) Using wald() from fixest, perform a hypothesis test that all three of the htype variables in the regression are equal to 0
{r} #
ANSWER HERE
i) Interpret the result of the hypothesis test you just ran.
ANSWER HERE:
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
