Abstract
This paper describes a simple and interesting application of structural equation modeling for a single lecture in an undergraduate econometrics course to introduce students to the concept of using data to recover latent variables. The application centers around using hourly observations on ride wait times at Disney’s Magic Kingdom to infer how crowded it is at the theme park. Pedagogically, the material is presented in the context of the linear regression model, so the discussion works to enhance students’ understanding of core material, not to introduce new disparate methods. The application provides interesting economic-based insights, like which ride’s wait times are categorically most informative about how crowded it is at the park.
A R Code
## Read in the data and remove missing
data = read.csv(’DISNEYMK_WAIT.csv’)
data = data[!is.na(data$SpaceMtn),]
data = data[!is.na(data$HauntedMansion),]
data = data[!is.na(data$PeterPan),]
## Calculate Moments
mean_SPC = mean(data$SpaceMtn)
mean_PAN = mean(data$PeterPan)
mean_HNT = mean(data$HauntedMansion)
cov_SPC_PAN = cov(data$SpaceMtn,data$PeterPan)
cov_SPC_HNT = cov(data$SpaceMtn,data$HauntedMansion)
cov_PAN_HNT = cov(data$PeterPan,data$HauntedMansion)
var_SPC = var(data$SpaceMtn)
var_PAN = var(data$PeterPan)
var_HNT = var(data$HauntedMansion)
round(c(mean_SPC,mean_PAN,mean_HNT,
cov_SPC_PAN,cov_SPC_HNT,cov_PAN_HNT,
var_SPC,var_PAN,var_HNT),2)
## Parameter Estimates
a_SPC = mean_SPC
a_PAN = mean_PAN
a_HNT = mean_HNT
b_SPC = sqrt((cov_SPC_PAN*cov_SPC_HNT)/cov_PAN_HNT)
b_PAN = cov_SPC_PAN/b_SPC
b_HNT = cov_SPC_HNT/b_SPC
sig2_SPC = var_SPC - (b_SPC ^ 2)
sig2_PAN = var_PAN - (b_PAN ^ 2)
sig2_HNT = var_HNT - (b_HNT ^ 2)
round(c(a_SPC,a_PAN,a_HNT,
b_PAN,b_HNT,b_SPC,
sig2_SPC,sig2_PAN,sig2_HNT),1)
## Parameters Simple Linear Prediction Equations
th_SPC = (b_SPC/sig2_SPC)/((b_SPC ^ 2/sig2_SPC) + 1)
k_SPC = - a_SPC*th_SPC
th_PAN = (b_PAN/sig2_PAN)/((b_PAN ^ 2/sig2_PAN) + 1)
k_PAN = - a_PAN*th_PAN
th_HNT = (b_HNT/sig2_HNT)/((b_HNT ^ 2/sig2_HNT) + 1)
k_HNT = - a_HNT*th_HNT
round(c(k_SPC,k_PAN,k_HNT),4)
round(c(th_SPC,th_PAN,th_HNT),4)
## Parameters Multiple Linear Prediction Equation
com_denom = (b_SPC ^ 2/sig2_SPC) +
(b_PAN ^ 2/sig2_PAN) + (b_HNT ^ 2/sig2_HNT) + 1
p_SPC = (b_SPC/sig2_SPC)/com_denom
p_PAN = (b_PAN/sig2_PAN)/com_denom
p_HNT = (b_HNT/sig2_HNT)/com_denom
p_0 = -a_SPC*p_SPC - a_PAN*p_PAN - a_HNT*p_HNT
round(c(p_0,p_SPC,p_PAN,p_HNT),4)
## Add predicted crowdedness to data
data$crwd = p_0 + p_SPC*data$SpaceMtn +
p_PAN*data$PeterPan + p_HNT*data$HauntedMansion
Reference
Wooldridge, J. M. 2020. Introductory Econometrics: A Modern Approach, 7th ed. Boston: Cengage Learning.Search in Google Scholar
© 2023 Walter de Gruyter GmbH, Berlin/Boston
Articles in the same Issue
- Frontmatter
- Research Articles
- Identifying Common and Idiosyncratic Explosive Behaviors in the Large Dimensional Factor Model with an Application to U.S. State-Level House Prices
- Estimation in the Presence of Heteroskedasticity of Unknown Form: A Lasso-based Approach
- Nonparametric Instrumental Regression with Two-Way Fixed Effects
- Matching on Noise: Finite Sample Bias in the Synthetic Control Estimator
- Does Health Behavior Change After Diagnosis? Evidence From Fuzzy Regression Discontinuity
- Teaching Corner
- Introduction to Latent Variable Estimation for Undergraduate Econometrics: An Application with Disney Theme Park Ride Wait Times
- Practitioner’s Corner
- Neglected Heterogeneity, Simpson’s Paradox, and the Anatomy of Least Squares
- Review
- Estimation of Causal Effects with a Binary Treatment Variable: A Unified M-Estimation Framework
Articles in the same Issue
- Frontmatter
- Research Articles
- Identifying Common and Idiosyncratic Explosive Behaviors in the Large Dimensional Factor Model with an Application to U.S. State-Level House Prices
- Estimation in the Presence of Heteroskedasticity of Unknown Form: A Lasso-based Approach
- Nonparametric Instrumental Regression with Two-Way Fixed Effects
- Matching on Noise: Finite Sample Bias in the Synthetic Control Estimator
- Does Health Behavior Change After Diagnosis? Evidence From Fuzzy Regression Discontinuity
- Teaching Corner
- Introduction to Latent Variable Estimation for Undergraduate Econometrics: An Application with Disney Theme Park Ride Wait Times
- Practitioner’s Corner
- Neglected Heterogeneity, Simpson’s Paradox, and the Anatomy of Least Squares
- Review
- Estimation of Causal Effects with a Binary Treatment Variable: A Unified M-Estimation Framework