Publications by Kailu Chen

discussion5

17.04.2024

1. library(plm) # Load the Grunfeld dataset data("Grunfeld", package = "plm") # Overview of the Grunfeld dataset summary(Grunfeld) ## firm year inv value ## Min. : 1.0 Min. :1935 Min. : 0.93 Min. : 58.12 ## 1st Qu.: 3.0 1st Qu.:1940 1st Qu.: 33.56 1st Qu.: 199.97 ## Medi...

4971 sym R (2887 sym/14 pcs)

dicussion week 5

17.04.2024

1. library(plm) # Load the Grunfeld dataset data("Grunfeld", package = "plm") # Overview of the Grunfeld dataset summary(Grunfeld) ## firm year inv value ## Min. : 1.0 Min. :1935 Min. : 0.93 Min. : 58.12 ## 1st Qu.: 3.0 1st Qu.:1940 1st Qu.: 33.56 1st Qu.: 199.97 ## Medi...

4827 sym R (2887 sym/14 pcs)

discussion 4

08.04.2024

# Load necessary library library(readr) # Load the dataset data <- read_csv("/Users/chenkailu/Desktop/us_fred_coastal_us_states_avg_hpi_before_after_2005.csv") ## Rows: 48 Columns: 6 ## ── Column specification ─────────────────────────────────────────────...

2767 sym R (2070 sym/8 pcs)

discussion 3-2

01.04.2024

What is Bias of an Estimator? The bias of an estimator is the difference between an estimator’s expected value and the true value of the parameter being estimated. If an estimator is unbiased, its expected value matches the true parameter value. Bias indicates a systematic error in the estimator, where it consistently overestimates or underestima...

2873 sym

discussion_3-1

01.04.2024

I. 1. State the 5 assumptions The Gauss-Markov theorem outlines conditions under which ordinary least squares (OLS) regression estimates are the best linear unbiased estimators (BLUE). The five key assumptions are linearity, randomness in sampling, non-collinearity among explanatory variables, exogeneity (zero conditional mean), and homoscedastici...

7471 sym 8 img

discussion 1

18.03.2024

if (!require(AER)) install.packages("AER") ## Loading required package: AER ## Loading required package: car ## Loading required package: carData ## Loading required package: lmtest ## Loading required package: zoo ## ## Attaching package: 'zoo' ## The following objects are masked from 'package:base': ## ## as.Date, as.Date.numeric ## Loading...

27 sym R (4026 sym/22 pcs) 2 img

Discussion_1

18.03.2024

if (!require(AER)) install.packages("AER") ## Loading required package: AER ## Loading required package: car ## Loading required package: carData ## Loading required package: lmtest ## Loading required package: zoo ## ## Attaching package: 'zoo' ## The following objects are masked from 'package:base': ## ## as.Date, as.Date.numeric ## Loading...

31 sym R (6396 sym/26 pcs) 2 img

Discussion 15

19.12.2023

I. data(iris) # Convert the Species to a binary factor: 'setosa' or 'not setosa' iris$Species <- factor(ifelse(iris$Species == 'setosa', 'setosa', 'not setosa')) # Logistic regression model model <- glm(Species ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width, data = iris, family = binomial()) ## Warning: glm.fit: algorithm...

3019 sym R (1978 sym/6 pcs) 1 img

Discussion 14

12.12.2023

head(mtcars) ## mpg cyl disp hp drat wt qsec vs am gear carb ## Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 ## Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4 ## Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1 ## Hornet 4 Drive 21.4 6 258 110 3.08 3.215...

6092 sym R (2604 sym/15 pcs) 1 img