Publications by PhamMinhTam
Final Exam - Financial Innovation
library(dplyr) library(wooldridge) library(car) library(quantreg) Chapter 7 1. data("sleep75") summary(lm(sleep ~ totwrk + educ + age + agesq + male,data = sleep75)) ## ## Call: ## lm(formula = sleep ~ totwrk + educ + age + agesq + male, data = sleep75) ## ## Residuals: ## Min 1Q Median 3Q Max ## -2378.00 -24...
17371 sym R (31938 sym/87 pcs) 2 img
In-class Exercise 8
library(dplyr) library(wooldridge) library(car) library(tseries) data("minwage") minwage232 <- minwage %>% select(gwage232, gemp232, gmwage, gcpi) %>% na.omit() C12 (i) acf(minwage232$gwage232) The ACF plot suggests that the gwage232 series appear to be weakly dependent (ii) summary(lm(gwage232[2:nrow(minwage232)] ~ gwage232[1:(nr...
855 sym R (4670 sym/10 pcs) 1 img
In-class Exercise 7
library(dplyr) library(wooldridge) library(car) data("barium") data("volat") C2 (i) model_i <- lm(lchnimp ~ lchempi + lgas + lrtwex + befile6 + affile6 + afdec6 + t, data = barium) summary(model_i) ## ## Call: ## lm(formula = lchnimp ~ lchempi + lgas + lrtwex + befile6 + affile6 + ## afdec6 + t, data = barium) ## ## Residuals: #...
1450 sym R (6378 sym/13 pcs)
In-class Exercise 6
library(dplyr) library(wooldridge) library(car) library(sandwich) library(lmtest) data("jtrain") (i) Some reasons why the unobserved factors in the error terms might be correlated with grant: Selection Bias: Firms with higher or lower scrap rates might be more likely to receive a grant, leading to a correlation with the error term. Omitte...
1992 sym R (2734 sym/11 pcs)
In-class Exercise 5
library(dplyr) library(wooldridge) library(sandwich) library(lmtest) data("meap00_01") (i) model_ols <- lm(math4 ~ lunch + log(enroll) + log(exppp), data = meap00_01) summary(model_ols) ## ## Call: ## lm(formula = math4 ~ lunch + log(enroll) + log(exppp), data = meap00_01) ## ## Residuals: ## Min 1Q Median 3Q Max #...
1536 sym R (4943 sym/17 pcs)
In-class Exercise 4
library(dplyr) library(wooldridge) data("wage2") (i) model1 <- lm(log(wage) ~ educ + exper + tenure + married + black + south + urban, data = wage2) summary(model1) ## ## Call: ## lm(formula = log(wage) ~ educ + exper + tenure + married + black + ## south + urban, data = wage2) ## ## Residuals: ## Min 1Q Median 3...
823 sym R (6031 sym/13 pcs)
In-class Exercise 2
library(dplyr) library(wooldridge) data("vote1") (i) The effect of expendB on voteA is \(\beta_3+\beta_4expendA\) The effect of expendA on voteA is \(\beta_2+\beta_4expendB\) The sign of \(\beta_4\) is not immediately obvious and would depend on the dynamics between the two candidates’ spending behavior. (ii) model <- lm(voteA ~ prtystrA +...
2124 sym R (1752 sym/11 pcs)
Midterm Exam: Financial Innovation
library(dplyr) library(tidyverse) library(wooldridge) library(car) library(ggplot2) Chapter 2 C9 data("countymurders") countymurders <- countymurders %>% filter(year == "1996") (i) countymurders %>% filter(murders == 0) %>% count() ## n ## 1 1051 There are 1051 counties with zero murders in 1996. countymurders %>% filter(exe...
11130 sym R (9751 sym/49 pcs) 2 img
In-class Exercise 2
library(dplyr) library(tidyverse) library(wooldridge) library(car) data("discrim") C9: Dataset DISCRIM (i) Estimate model using OLS ols <- lm(log(psoda) ~ prpblck + log(income) + prppov, data = discrim) summary(ols) ## ## Call: ## lm(formula = log(psoda) ~ prpblck + log(income) + prppov, data = discrim) ## ## Residuals: ## Min ...
2598 sym R (2620 sym/9 pcs)
Financial Innovation: Exercise 2
library(dplyr) library(tidyverse) library(wooldridge) data('discrim') C8: DISCRIM data (i) Mean, standard deviation, and units prpblck variable avg_prpblck <- mean(discrim$prpblck, na.rm = TRUE) sd_prpblck <- sd(discrim$prpblck, na.rm = TRUE) sprintf("Mean value: %.2f", avg_prpblck) ## [1] "Mean value: 0.11" sprintf("Standard deviation val...
963 sym R (4585 sym/25 pcs)