Skip to content

lpme provides tools for analyzing latent variable models with measurement error correction, particularly in scenarios with identification restrictions. It implements various correction methods and uses partitioning + bootstrapping for standard errors.

License

Notifications You must be signed in to change notification settings

cjerzak/lpme-software

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lpme: R Packge for Dealing with Latent Predictor Measurement Error Under Identification Restrictions

Installation | Key Functions | References

lpme is an R package that provides tools for analyzing latent variable models with measurement error correction, using bootstrapping techniques for inference.

Package Installation

Within an R session, you can install the development version of lpme from GitHub with:

# install.packages("devtools") 
devtools::install_github("cjerzak/lpme/lpme-software")

Key Functions

lpme_OneRun

lpme_OneRun performs a single run of latent variable analysis with measurement error correction (no bootstrapping; 1 split sample partition):

# Generate data 
Yobs <- rnorm(1000)
ObservablesMat <- matrix(sample(c(0,1), 1000*10, replace = T), ncol = 10)

# One run of latent error correction method 
lpme::lpme_OneRun(Yobs, ObservablesMat, 
                  MakeObservablesGroupings = FALSE, seed = runif(1, 1, 10000))

lpme

lpme implements a bootstrap analysis for latent variable models with measurement error correction. We average over nPartition split sample partitions.

# Generate data 
Yobs <- rnorm(1000)
ObservablesMat <- matrix(sample(c(0,1), 1000*10, replace = T), ncol = 10)

# Latent error correction method, with partitioning and bootstrap 
results  <- lpme::lpme(Yobs, ObservablesMat, 
	     MakeObservablesGroupings = FALSE, nBoot = 32L, nPartition = 10L,
	     bootBasis = 1:length(Yobs), ReturnIntermediaries = TRUE,
	     seed = runif(1, 1, 10000)) 
		 
#View the corrected IV coefficient and its standard error
print(c(results$Corrected_IVRegCoef, results$Corrected_IVRegSE))

Contributing

Contributions to latenterror are welcome! Feel free to submit a pull request or open an issue.

Acknowledgements

We thank Guilherme Duarte, Jeff Lewis, Umberto Mignozzetti, Aaron Pancost, Erik Snowberg, Chris Tausanovitch, and participants of a panel at an MPSA panel for very helpful comments. We thank Major Valls for excellent research assistance.

References

Connor T. Jerzak, Stephen A. Jessee. Measurement Error in Latent Predictors: The Role of Identification Restrictions Working paper to be released summer 2024!

About

lpme provides tools for analyzing latent variable models with measurement error correction, particularly in scenarios with identification restrictions. It implements various correction methods and uses partitioning + bootstrapping for standard errors.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages