Publications by Lay Khoon Yu
EDA 1
rm(list = ls()) #import data mars <- read_csv("petfood_retail_table.csv", show_col_types = FALSE) mars <- as.data.frame(mars) # check column type kable(sapply(mars, class), col.names = "Column Type") Column Type DATE Date SHOPPER_ID numeric SHOPPER_BASKET character STORE_ID numeric ZIP_CODE numeric MANU_ID character BRAND_ID characte...
167 sym Python (4163 sym/18 pcs) 9 img 1 tbl
EDA
rm(list = ls()) library(readr) library(stargazer) ## ## Please cite as: ## Hlavac, Marek (2022). stargazer: Well-Formatted Regression and Summary Statistics Tables. ## R package version 5.2.3. https://CRAN.R-project.org/package=stargazer library(dplyr) ## ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ##...
178 sym R (547889 sym/32 pcs) 6 img 1 tbl
Diff in Diff
Part B. #import data df1 <- read_csv("us_fred_coastal_us_states_avg_hpi_before_after_2005.csv", show_col_types = FALSE) #overview of the data stargazer(df1) ## ## % Table created by stargazer v.5.2.3 by Marek Hlavac, Social Policy Institute. E-mail: marek.hlavac at gmail.com ## % Date and time: Tue, Oct 10, 2023 - 19:59:12 ## \begin{table}[!htbp]...
4301 sym Python (3795 sym/13 pcs) 1 img 1 tbl
Document
Part I What is bias of an estimator? Suppose that \(x\) is the observed data, \(\theta\) is the true value of an unknown parameter of interest which is estimated by function \(T(x)\) and the value estimated by this function is represented by \(\hat{\theta}\). The bias of an estimator can then be defined as the difference between the expected value ...
5996 sym
Publish Document
Data The dataset used in this week’s work is the CASchools dataset from the AER package. It is a cross-sectional data that records test performance, school characteristics and student demographic backgrounds for school districts in California between 1998 and 1999. There are 420 observations and 14 variables. Variables: district - school distric...
1603 sym Python (4717 sym/14 pcs)
Discussion: Gauss Markov
Part I Gauss-Markov Assumptions are developed based on ordinary least squares regression analysis. When the assumptions are met in a linear regression model, it can be said that the ordinary least squares of the coefficients is the best linear unbiased estimator (BLUE). The assumptions are used as a benchmark to increase validity of our model to a...
7722 sym 7 img
ADEC7320 Discussion 2
Part I. Dataset 1 - ToothGrowth Loading Dataset df1 <- ToothGrowth summary(df1) ## len supp dose ## Min. : 4.20 OJ:30 Min. :0.500 ## 1st Qu.:13.07 VC:30 1st Qu.:0.500 ## Median :19.25 Median :1.000 ## Mean :18.81 Mean :1.167 ## 3rd Qu.:25.27 3rd Qu.:2.000 ## ...
1775 sym Python (2770 sym/22 pcs) 5 img