Publications by Iris
assign10
Q1. (1)Taking the expected value of both sides of the AR(1) equation, we get: E[x_t] = E[δ + φ_1 x_{t-1} + w_t] = E[δ] + E[φ_1 x_{t-1}] + E[w_t] Since w_t has a mean of 0 (w_t ~ N(0, σ_w^2)), we have:E[w_t] = 0 Also, due to the stationarity of x_t, we have: E[x_t] = E[x_{t-1}] Substituting these conditions, we get: E[x_t] = δ + φ_1 E[x_t] Re...
789 sym 5 img
Assign9 -Iris W
Q1. set.seed(123) n <- 100 T <- 20 treatment_year <- 10 year = rep(1:T, times = n) treatment = round(runif(n*T,0,1)) U = rnorm(T*n,5,1) outcome = ifelse(rep(1:T, times = n) > treatment_year & treatment==1, rnorm(T*n, mean = 2) + U, rnorm(T*n, mean=1) + U) post = ifelse(year > treatment_year, 1, 0) data <- data.frame(year, post, treatment, outco...
3071 sym 3 img
Assignment 8 - Iris W
Q1 Given variables:U: Unobserved confounder (individual’s ability); Z: Instrumental variable (whether an individual was offered the scholarship); D: Treatment variable (whether an individual went through the job training program); Y: Outcome variable (wages). In DAG: U affects both D and Y. Z affects D, as individuals who were offered the schola...
4964 sym
Assignment 5 - Iris W
Q1.(i) How many single-person households are there in the data set? k401ksubs <- read_excel("/Users/jingwu/Desktop/401ksubs.xls") sum(k401ksubs$fsize==1) ## [1] 2017 Use OLS to estimate the model single_house <- subset(k401ksubs, fsize==1) fit_ksubs <- lm(nettfa~inc+age, data = `single_house`) summary(fit_ksubs) ## ## Call: ## lm(formula = nettf...
1025 sym
Assignment 4 - Iris W
Q1.1:Find the OLS estimate for βˆ. You can use R to find the inverse of a matrix with a variation of the following code y=matrix(c(4,7,9,11)) X1=c(2,2,4,5) X2=c(3,4,5,1) X=matrix(c(rep(1, 4),X1,X2),nrow=4) solve(t(X) %*% X) %*% t(X) %*% y ## [,1] ## [1,] 1.0824742 ## [2,] 1.8917526 ## [3,] 0.1597938 Q1.2: Find yˆ and εˆ. yˆ=Xβˆ, �...
2519 sym
Assignment1 - Iris Wu
1) Find the average education level in the sample. What are the lowest and highest years of education? mean(wage1$educ) ## [1] 12.56274 min(wage1$educ) ## [1] 0 max(wage1$educ) ## [1] 18 2) Find the average hourly wage in the sample. Does it seem high or low? mean(wage1$wage) ## [1] 5.896103 This seems low. 3) The CPI was 56.9 in 1976 and 304.7 i...
503 sym