Assignment 1
- #intro-econometrics
- #assignment
- #OLS
- #simple-regression
- #correlation
- #prediction
- #residuals
- #causality
Toolkit
- A1a
Part A, Q1: Interpreting R output (hours worked vs education). The variable
monthly_hrs_wrkmeasures the number of hours worked in a month. Using the commandcor, what can we learn from the R output about the relationship between hours worked and education? The output reports - A1b
Why do we set the argument
use = "complete.obs"in the functioncor? - A2a
Part A, Q2. You use the command
lmin R to estimate the linear regression of hours worked on education. The estimated model isa. Interpret the intercept from the estimated model above.
- A2b
b. Based on the estimates above, what is the predicted number of monthly hours worked for an individual with 12 years of education? What about an individual with 16?
- A2c
c. What can we say about the relation between years of study and hours worked? Is the relation positive or negative? Is it strong or weak?
- A2d
d. Can we make a causal claim for these results? Explain.
- A2e
e. What other variables are likely to influence the monthly hours worked? Indicate at least 3.
- B1
Part B, Q1: Data exploration [Heiss 1.6.4]. The
BWGHT2data come from a project that looked at the effect of smoking during pregnancy on newborn weight (1,465 births; key variablesbwghtbirth weight in grams,cigsaverage cigarettes per day,monpremonth prenatal care began).a. Import the dataset and name the data.frame object
data.BW.b. Create a new variable called
non.smokerindicating (TRUE) if a mother is a non-smoker.c. What is the proportion of smokers in the sample? (hint: do not include the
NAobservations in your calculations) - B2
Part B, Q2: Ordinal factor variables [Heiss 1.6.1].
a. Create a frequency table of the variable
monpre, the month prenatal care begins (hint: useprop.table).b. What is the median month that prenatal care begins in the sample?
- B3
Part B, Q3: Statistical dependence.
a. What is the average daily number of cigarettes smoked during pregnancy in the entire sample?
b. What is the average daily number of cigarettes smoked during pregnancy among women who are smokers?
c. Compare the results from 3(a) and 3(b). Which average, if any, is a good measure for typical smoking behavior during pregnancy? Explain.
- B4a
Part B, Q4: OLS regression [Heiss 2.1, 2.2].
a. Run the regression between birth weight (the dependent variable) and the number of cigarettes smoked by the mother during pregnancy (the independent variable). Report the estimation results in the form of an equation.
- B4b
b. Is it possible to apply a causal interpretation to these results?
- B4c
c. What is the predicted birthweight for mothers who do not smoke? What is the predicted birthweight for mothers who smoke a pack of cigarettes a day? (assume there are 30 cigarettes per pack)
- B4d
d. What value does
cigshave to be in order to predict a birth weight of 3.4 kg? - B4e
e. A woman smokes 20 cigarettes a day and has a newborn weighing 3.2 kg. What is the residual for this woman?
- B5
Part B, Q5: Scatter plots [Heiss 1.4.1 to 1.4.5, 2.1]. Create a scatterplot of birthweight (y-axis) versus number of cigarettes smoked (x-axis) with: descriptive X and Y axis labels (what is plotted and in what units), a title, appropriate scales for the axes, and a dashed line for the OLS regression from
lm.bwght.cigs(hint: in base plot you can useabline).
Solutions are Alfie's submitted work, not an official key.
Part A reasons from pre-computed R output (hours worked on years of schooling); Part B uses the BWGHT2 birthweight and smoking data. Three habits are drilled: correlation is not slope, a regression gives predictions and residuals by plugging in, and a simple regression on observational data is never causal.
Related: Lec_08-Goodness of Fit & Multicollinearity (why the wide scatter means a low )