Publications by Rui Fan
Lab 2: Assignment Solutions
Suppose you collect data from a sample of \(n\) people. You use random sampling, so your data are independent and identically distributed (i.i.d.). You collect data on one variable, \(y\), so \(y_i\) is the value of \(y\) for person \(i\) in your sample, and \(\bar{y}\) is the sample mean. The true mean of \(y\) in the population is \(\mu_y\) and t...
7876 sym 4 img
Lab 12: Assignment Solutions
E12.1 How does fertility affect labor supply? That is, how much does a woman’s labor supply fall when she has an additional child? In this exercise, you will estimate this effect using data for married women from the 1980 U.S. Census. The data are available on the text website, http://www.pearsonglobaleditions.com, in the file Fertility and descr...
3176 sym R (3328 sym/12 pcs)
Lab 11: Assignment Solutions
E11.2 Believe it or not, workers used to be able to smoke inside office buildings. Smoking bans were introduced in several areas during the 1990s. Supporters of these bans argued that in addition to eliminating the externality of secondhand smoke, they would encourage smokers to quit by reducing their opportunities to smoke. In this assignment, you...
8361 sym R (6490 sym/43 pcs)
Lab 12: Instrumental Variable Regression
In this lab exercise, you will learn how to obtain the TSLS estimator for the instrumental variable model. TSLS: ivreg( ) First-stage F test (test for weak IV): linearHypothesis( ) J-test (test for instrument exogeneity): linearHypothesis( , test=“Chisq”) and the \(p\)-value is 1-pchisq(J, df=m-k) Exercise: Demand for Cigarettes The relation ...
11960 sym R (9306 sym/32 pcs)
Lab 10: Assignment Solutions
E10.1 Some U.S. states have enacted laws that allow citizens to carry concealed weapons. These laws are known as “shall-issue” laws because they instruct local authorities to issue a concealed weapons permit to all applicants who are citizens, are mentally competent, and have not been convicted of a felony. (Some states have some additional res...
4487 sym R (11059 sym/18 pcs)
Lab 11: Regression with a Binary Dependent Variable
In this lab exercise, you will use command glm to run regressions for the probit model and the logit model. Linear Probability Model model <- y~x # regression model fit.lpm <- lm(model, data) # OLS regression coeftest(fit.lpm, vcov=vcovHC, type="HC1") #use heteroskedasticity robust SE Probit Model model <- y~x # regressio...
7036 sym R (16232 sym/58 pcs)
Lab 8: Assignment Solutions
E8.2 On the text website http://www.pearsonglobaleditions.com, you will find a data file CPS2015, which contains data for full-time, full-year workers, ages 25–34, with a high school diploma or B.A./B.S. as their highest degree. A detailed description is given in CPS2015_Description, also available on the website. (These are the same data as in C...
8843 sym R (8819 sym/27 pcs) 1 img
Lab 10: Panel Data
In this lab exercise, you will use command plm from R package plm for panel data analysis. Individual fixed effects only model <- y~x # regression model fit <- plm(model, data, index, effect="individual", model="within") # fixed effects regression coeftest(fit, vcovHC(fit, cluster="group", type="HC0")) # results with clustered standard...
8808 sym R (12064 sym/57 pcs) 2 img
Lab 8: The Nonlinear Regression
In this lab exercise, you will learn: Nonlinear Regression Using R How to generate an interaction term or a polynomial term: \(I(x_1*x_2)\) or \(I(x^2)\) How to interpret results of multiple regressions, esp. with interaction terms. Multiple Regression with \(X\) and \(X^2\) as Independent Variables Find the value of \(X\) that minimizes or ma...
4832 sym R (4963 sym/24 pcs) 1 img
Lab 7: Assignment Solutions
E7.2 In the empirical exercises on earning and height in Chapters 4 and 5, you estimated a relatively large and statistically significant effect of a worker’s height on his or her earnings. One explanation for this result is omitted variable bias: Height is correlated with an omitted factor that affects earnings. For example, Case and Paxson (200...
6690 sym R (4689 sym/19 pcs)