Publications by Lay Khoon Yu
Behavioral Economics - Problem Set 2
Set-up and background The assignment is worth 100 points. There are 13 questions. You should have the following packages installed: library(tidyverse) library(patchwork) library(fixest) In this problem set you will replicate some results from the paper “Do Workers Work More if Wages Are High? Evidence from a Randomized Field Experiment” (Fehr ...
10104 sym Python (10898 sym/19 pcs) 4 img
DengAI Modeling & Predictions
# load packages library(readr) library(ISOweek) library(skimr) library(stringr) library(zoo) library(forecast) library(tidyr) library(tidyverse) library(fable) library(fabletools) library(dplyr) library(ggplot2) library(ggcorrplot) library(corrplot) library(kableExtra) library(tsibbledata) library(fpp3) # import datasets train_features <- read_csv...
549 sym R (16074 sym/68 pcs) 13 img 14 tbl
Predictive Analytics - Week 6 (Neural Network Models)
Load Packages & Data # load packages library(readr) library(ggplot2) library(forecast) ## Registered S3 method overwritten by 'quantmod': ## method from ## as.zoo.data.frame zoo library(tidyr) library(tsibble) ## ## Attaching package: 'tsibble' ## The following objects are masked from 'package:base': ## ## intersect, setdiff, u...
749 sym R (4879 sym/41 pcs) 3 img
Predictive Analytics - Week 5 (Hierarchical Time Series)
Import Packages & Data # import required packages library(readr) library(forecast) ## Registered S3 method overwritten by 'quantmod': ## method from ## as.zoo.data.frame zoo library(hts) library(dplyr) ## ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following o...
688 sym R (17567 sym/59 pcs) 5 img
Predictive Analytics - Week 4 (ARIMA w External Regressors)
Dataset Canada Unemployment Rate (1991-2022) External Regressor : Inflation Rate Obtained from World Bank Open Data Load Packages & Dataset # load packages library(readr) library(ggplot2) library(forecast) library(ggfortify) # import dataset df <- read_csv("/Users/laykhoonyu/Documents/MSAA_AE/predictive_analytics/week_4/CND_INF_UNEMP.csv") Data C...
915 sym R (4156 sym/29 pcs) 8 img
Predictive Analytics - Week 3
Dataset Individual Household Electric Power Consumption The dataset used consists of 2075259 measurements gathered in a house located in Sceaux (7km of Paris, France) between December 2006 and November 2010 (47 months). It measures the electric power consumption in one household with a one-minute sampling rate over a period of almost 4 years. Impo...
2501 sym R (6399 sym/39 pcs) 5 img
Predictive Analytics - Week 2 (ETS Model)
Data The data used here is Canada’s GDP Growth from 1961 to 2022. It is accessible from the World Bank Open Data. Import Packages & Data library(readr) library(forecast) gdp_df <- read_csv('/Users/laykhoonyu/Documents/MSAA_AE/predictive_analytics/week_2/CA_GDP_GROWTH.csv', show_col_types = FALSE) Data Preparation gdp_ts <- ts(gdp_df$GDP_GROWTH,...
699 sym R (1517 sym/10 pcs) 2 img
Predictive Analytics - Week 1
# Load packages library(readr) # Load dataset df <- read_csv('/Users/laykhoonyu/Documents/MSAA_AE/predictive_analytics/week_1/USEPUINDXM.csv', show_col_types = FALSE) head(df) ## # A tibble: 6 × 2 ## DATE USEPUINDXM ## <date> <dbl> ## 1 1985-01-01 125. ## 2 1985-02-01 99.0 ## 3 1985-03-01 112. ## 4 1985-04-01 ...
884 sym R (681 sym/8 pcs) 2 img
Heteroskedasticity
Issue Summary In a regression model, heteroskedasticity occurs when the variance of the error terms varies across all levels of the independent variable. The spread of the residuals are not constant along the range of independent variable. The presence of heteroskedasticity violates the assumption of constant variance in the error terms. When suc...
2963 sym 1 img 3 tbl
Panel Data
Overview of Data The panel data used measures cigarette consumption in US states. It has 48 observations from 1985 and 1995. Below are the variables in this data set: state - factor indicating state year - factor indicating year cpi - consumer price index population - state population packs - number of packs per capita income - state personal inco...
3221 sym 2 img