Publications by Rui Fan

Lab 7: Inference for Multiple Regression Models

13.03.2024

In this lab exercise, you will learn: No Perfect Multicollinearity Assumption To check imperfect multicollineartiy, find the sample correlation matrix for all independent variables using cor. Statistical Inference for Multiple Regressions linearHypothesis in package car. Heteroskedasticity robust SE: vcovHC Confidence interval using robust SE: ...

7328 sym R (12575 sym/36 pcs)

Lab 6: Assignment Solutions

13.03.2024

E6.1 Use the Birthweight_Smoking data set introduced in Empirical Exercise E5.3 to answer the following questions. Start the project by clearing the workspace. Then load the R package openxlsx and the data Birthweight. rm(list=ls()) library(openxlsx) id <- "1IL42szr5_GLat_hqY30yJVV_JVHxHEmO" bw <- read.xlsx(sprintf("https://docs.google.com/uc?id=%...

6195 sym R (8664 sym/24 pcs) 2 tbl

Lab 6: Multiple Regression

25.02.2024

In this lab exercise, you will learn: Multiple Regression Using R \(lm(y \sim x_1+x_2+x_3)\) How to interpret results of multiple regressions. \(SER\), \(R^2\), and \(\bar R^2\). Exercise: The Gender Wage Gap The gender pay gap or gender wage gap is the average difference between the remuneration for men and women who are working. Women are gene...

4828 sym R (6098 sym/12 pcs)

Lab 5: Assignment Solutions

24.02.2024

E5.1 Use the data set Earnings_and_Height described in Empirical Exercise 4.2 to carry out the following exercises. Start the project by clearing the workspace. Then load the R package openxlsx and the data Earnings_and_Height. rm(list=ls()) library(openxlsx) id <- "1XKjDOQBJcxwslhwipkJAF2qLNmFW9Bfu" earn <- read.xlsx(sprintf("https://docs.google....

4872 sym R (7813 sym/34 pcs)

Lab 5: Inference for Simple Linear Regression with 1 Regressor (with solutions)

20.02.2024

In this lab exercise, you will learn: Regression with dummy variables How to interpret coefficients How to construct confidence intervals and conduct hypothesis tests Heteroskedasticity Visual inspection for heteroskedasticity How to obtain robust standard errors (SE): vcovHC How to conduct significance test using robust SE: coeftest Exercise ...

11425 sym R (10202 sym/72 pcs) 7 img

Lab 5: Inference for Simple Linear Regression with 1 Regressor

20.02.2024

In this lab exercise, you will learn: Regression with dummy variables How to interpret coefficients How to construct confidence intervals and conduct hypothesis tests Heteroskedasticity Visual inspection for heteroskedasticity How to obtain robust standard errors (SE): vcovHC How to conduct significance test using robust SE: coeftest Exercise ...

10296 sym R (7257 sym/60 pcs) 7 img

Lab 4: Assignment Solutions

20.02.2024

Start the project by clearing the workspace. Then load the R package openxlsx and the data Earnings_and_Height. rm(list=ls()) library(openxlsx) id <- "1XKjDOQBJcxwslhwipkJAF2qLNmFW9Bfu" earn <- read.xlsx(sprintf("https://docs.google.com/uc?id=%s&export=download",id),sheet=1,startRow=1,colNames=TRUE,rowNames=FALSE) str(earn) ## 'data.frame': 178...

4270 sym R (4076 sym/25 pcs) 1 img

Lab 4: Simple Linear Regression with 1 Regressor (with solutions)

11.02.2024

In this lab exercise, you will learn: How to make a scatter plot plot How to run an OLS regression in R lm: run OLS regression summary: obtain regression results coef: obtain estimated coefficients How to compute the predicted value of \(y\), \(\hat{y}\) predict The data set used for this exercise is Growth.xlsx from E4.1 of Stock and Watson...

4441 sym R (4579 sym/28 pcs) 5 img

Lab 4: Simple Linear Regression with 1 Regressor

11.02.2024

In this lab exercise, you will learn: How to make a scatter plot plot How to run an OLS regression in R lm: run OLS regression summary: obtain regression results coef: obtain estimated coefficients How to compute the predicted value of \(y\), \(\hat{y}\) predict The data set used for this exercise is Growth.xlsx from E4.1 of Stock and Watson...

4084 sym R (4294 sym/24 pcs) 5 img

Lab 3: Statistics (with solutions)

05.02.2024

In this lab exercise, you will learn: How to select a subset of data subset How to compute confidence intervals using R qnorm, qt, qf t.test How to conduct a statistical test using R pnorm, pt, pf t.test The data set used for this exercise is CPS96_15 from E3.1 of Stock and Watson (2020, e4). This data contains 13,201 observations on full-ti...

5923 sym R (4210 sym/57 pcs)