Package endogenous. October 29, 2016

Similar documents
Package truncreg. R topics documented: August 3, 2016

Package mvprobit. November 2, 2015

Package StVAR. February 11, 2017

Standard Errors in OLS Luke Sonnet

Package DBfit. October 25, 2018

Package palmtree. January 16, 2018

Package CALIBERrfimpute

Package MOST. November 9, 2017

Package rpst. June 6, 2017

Package oglmx. R topics documented: May 5, Type Package

Package bife. May 7, 2017

Package ECctmc. May 1, 2018

Package assortnet. January 18, 2016

Package CausalGAM. October 19, 2017

Package intccr. September 12, 2017

Package SSLASSO. August 28, 2018

Package clusterpower

Package nonnest2. January 23, 2018

Robust Linear Regression (Passing- Bablok Median-Slope)

Package swcrtdesign. February 12, 2018

Package REndo. November 8, 2017

Package bayesdp. July 10, 2018

Package simsurv. May 18, 2018

Package ICsurv. February 19, 2015

Package misclassglm. September 3, 2016

Package glmmml. R topics documented: March 25, Encoding UTF-8 Version Date Title Generalized Linear Models with Clustering

Package samplingdatacrt

Package DTRreg. August 30, 2017

Package ClusterBootstrap

Package GWRM. R topics documented: July 31, Type Package

Analysis of Panel Data. Third Edition. Cheng Hsiao University of Southern California CAMBRIDGE UNIVERSITY PRESS

Package sparsereg. R topics documented: March 10, Type Package

Package tpr. R topics documented: February 20, Type Package. Title Temporal Process Regression. Version

Package MIICD. May 27, 2017

Package modmarg. R topics documented:

Package gee. June 29, 2015

Package nsprcomp. August 29, 2016

An Introduction to Growth Curve Analysis using Structural Equation Modeling

Package addhaz. September 26, 2018

Package ConvergenceClubs

Package robustreg. R topics documented: April 27, Version Date Title Robust Regression Functions

CHAPTER 7 EXAMPLES: MIXTURE MODELING WITH CROSS- SECTIONAL DATA

Package sure. September 19, 2017

Package rdd. March 14, 2016

Package samplesizelogisticcasecontrol

Package GLDreg. February 28, 2017

Package rereg. May 30, 2018

Package sfadv. June 19, 2017

1. (20%) a) Calculate and plot the impulse response functions for the model. u1t 1 u 2t 1

Also, for all analyses, two other files are produced upon program completion.

Package oaxaca. January 3, Index 11

Package PTE. October 10, 2017

Introduction to Mixed Models: Multivariate Regression

Package lclgwas. February 21, Type Package

Package OrthoPanels. November 11, 2016

Package texteffect. November 27, 2017

Binary Diagnostic Tests Clustered Samples

Package pnmtrem. February 20, Index 9

Package qlearn. R topics documented: February 20, Type Package Title Estimation and inference for Q-learning Version 1.

Package lgarch. September 15, 2015

Serial Correlation and Heteroscedasticity in Time series Regressions. Econometric (EC3090) - Week 11 Agustín Bénétrix

Package ccapp. March 7, 2016

Package RAMP. May 25, 2017

Introduction to Mixed-Effects Models for Hierarchical and Longitudinal Data

Package CompGLM. April 29, 2018

Package milr. June 8, 2017

Package OLScurve. August 29, 2016

Package PCGSE. March 31, 2017

Package ArCo. November 5, 2017

Package RCA. R topics documented: February 29, 2016

Package JGEE. November 18, 2015

Package nricens. R topics documented: May 30, Type Package

Package InformativeCensoring

Computing Murphy Topel-corrected variances in a heckprobit model with endogeneity

Package approximator

Package esabcv. May 29, 2015

Package citools. October 20, 2018

ST512. Fall Quarter, Exam 1. Directions: Answer questions as directed. Please show work. For true/false questions, circle either true or false.

Package GauPro. September 11, 2017

Package simr. April 30, 2018

The glmmml Package. August 20, 2006

Package abe. October 30, 2017

Using HLM for Presenting Meta Analysis Results. R, C, Gardner Department of Psychology

Package Modeler. May 18, 2018

Package reghelper. April 8, 2017

Package cosinor. February 19, 2015

Package RWiener. February 22, 2017

Package RLRsim. November 4, 2016

Package lcc. November 16, 2018

Package RegressionFactory

Example Using Missing Data 1

Package DTRlearn. April 6, 2018

Package mreg. February 20, 2015

Package sfa. R topics documented: February 20, 2015

Study Guide. Module 1. Key Terms

CHAPTER 1 INTRODUCTION

Package psda. September 5, 2017

Package pwrab. R topics documented: June 6, Type Package Title Power Analysis for AB Testing Version 0.1.0

Package ridge. R topics documented: February 15, Title Ridge Regression with automatic selection of the penalty parameter. Version 2.

Package simmsm. March 3, 2015

Transcription:

Package endogenous October 29, 2016 Type Package Title Classical Simultaneous Equation Models Version 1.0 Date 2016-10-25 Maintainer Andrew J. Spieker <aspieker@upenn.edu> Description Likelihood-based approaches to estimate linear regression parameters and treatment effects in the presence of endogeneity. Specifically, this package includes James Heckman's classical simultaneous equation models-the sample selection model for outcome selection bias and hybrid model with structural shift for endogenous treatment. For more information, see the seminal paper of Heckman (1978) <DOI:10.3386/w0177> in which the details of these models are provided. This package accommodates repeated measures on subjects with a working independence approach. The hybrid model further accommodates treatment effect modification. Imports mvtnorm License GPL-2 NeedsCompilation no Author Andrew J. Spieker [aut, cre] Repository CRAN Date/Publication 2016-10-29 10:48:20 R topics documented: hybrid............................................ 2 sampselect.......................................... 4 Index 7 1

2 hybrid hybrid Hybrid model with structural shift (permits covariate-specific treatment effects) Description James Heckman s Hybrid Model with Structural Shift (also known as the Treatment Effects Model). Jointly models outcome regression model and endogenous variable probit model (e.g., outcome associations in the presence of endogenous treatment in observational data). Can handle clustered data. Accommodates treatment effect modification based on observable covariates. Usage ## S3 method for class "hybrid" hybrid(outcome, probit, modifiers = NULL, = NULL, id = NULL, se = "R") Arguments outcome probit modifiers id se an object of class "formula" with a numeric vector on the left hand side, and predictors of interest on the right hand side. an object of class "formula" with a binary (0/1) numeric vector on the left hand side (1 indicating medication use), and predictors of medication use on the right hand side (right hand side permitted to contain variables on the right hand side of the outcome equation). an object of class "formula" with a binary numeric vector indicating medication use on the left hand side, and treatment effect modifiers on the right hand side. If effect modifiers are treatment group specific (e.g., medication dose), set the effect modifier variables to zero for the untreated observations. If any other numeric values are used, they will ultimately be zet to zero. If NULL, the average treatment effect will be estimated under the assumption of no effect modification. a vector of ial values. The ordering of subparameters is: alpha (probit model parameters), beta (outcome model parameters), eta (an intercept, with or without effect mofidier paramters), sigmay (outcome error standard deviation), rho (error correlation). If NULL, an ial value will be chosen through OLS linear regression and probit-link GLM without regard to endogeneity. a numeric vector indicating subject IDs if data are clustered. In the absence of clustered data, this can be left blank (defaults to NULL). a string, either "M" for model-based standard errors (based on inverse observed Fisher information), or "R" for robust standard errors (based on methods of Huber and White). Defaults to "R". If id is provided for clustered data, the clusterrobust variance estimator (with working independence) will be used even if the user specifies type "M".

hybrid 3 Details The model is evaluated with numerical minimization of the negative log-likelihood (the BFGS is used). The probit model and error correlation parameters are weakly identified and hence the error variance is set at unity. The data must be complete (no missing values) and numeric, with the exception of factors, which may be used on the right hand side of equations. Value hybrid prints a summary of the coefficient estimates, standard errors, Wald-based confidence intervals, and p-values for the outcome model, the treatment effects (and potentially effect modifiers), and the medication use probit model. alpha beta eta sigma rho vcov fitted call out.form prob.form tx.form sterr labels estimate of the medication use probit model parameters. estimate of the outcome model parameters. estimate of the treatment effect, with or without effect modifier parameters. estimate of the standard deviation of the outcome error. estimate of the correlation between the errors. entire estimated variance-covariance matrix, provided if the user wishes to perform any more specific hypothesis tests. ial value ultimately used, whether specified by the user or generated through the default approach. vector of fitted outcome values. the matched call. the formula used for the outcome model. the formula used for the medication use probit model. the formula used for the treatment effects model (potentially with effect modifiers). the choice of the variance estimate procedure (either model-based or robust). labels for predictors to be passed into output. Author(s) Andrew J. Spieker, Ph.D. References Heckman JJ. Dummy endogenous variables in a simultaneous equation system. 46(4), 931-959. Econometrica Maddala GS. Limited-dependent and qualitative variables in econometrics. Cambridgeshire: Cambridge University Press; 1983. Spieker AJ, Delaney JAC, and McClelland RL. Evaluating the treatment effects model for estimation of cross-sectional associations between risk factors and cardiovascular biomarkers influenced by medication use. Pharmacoepidemiology and Drug Safety 24(12), 1286-1296.

4 sampselect Examples #- Generate Data -# require(mvtnorm) set.seed(1) N <- 2000 X1 <- rnorm(n, 0, 1); X2 <- rnorm(n, 0, 1); X3 <- rnorm(n, 0, 1); errors <- rmvnorm(n, sigma = 50*matrix(c(1, 0.5, 0.5, 1), nrow = 2)) Y <- 50 + X1 + X2 + errors[,1] Z <- rep(0, N) Z[(-5 + X1 + X3 + errors[,2]) > 0] <- 1 Y[Z == 1] <- Y[Z == 1] - 0.5*X1[Z == 1] #- Estimate Model with No Effect Modification -# hybrid(y ~ X1 + X2, probit = Z ~ X1 + X3) #- Estimate Model with Effect Modification -# hybrid(y ~ X1 + X2, probit = Z ~ X1 + X3, modifiers = Z ~ X1) #- Estimate Model with Effect Modification and Model-Based Variance -# hybrid(y ~ X1 + X2, probit = Z ~ X1 + X3, modifiers = Z ~ X1, se = "M") sampselect Sample selection model (endogenous probit). Description Usage James Heckman s Classical Simultaneous Equation Model (also known as the Sample Selection Model). Used to account for endogenous sample selection. Jointly models outcome model with propensity of selection, in which some of the outcomes are unobserved. Can also handle clustered data. ## S3 method for class "sampselect" sampselect(outcome, probit, = NULL, id = NULL, se = "R") Arguments outcome probit an object of class "formula" with a numeric vector on the left hand side, and predictors of interest on the right hand side. Values on the left hand side that correspond to unobserved outcomes should be set to numeric values (to zero, for example, although they can be set to any numeric values). an object of class "formula" with a binary (0/1) numeric vector on the left hand side (1 indicating unobserved outcome), and predictors of selection on the right hand side (right hand side permitted to contain variables on the right hand side of the outcome equation).

sampselect 5 id se a vector of ial values. The ordering of subparameters is: alpha (probit model parameters), beta (outcome model parameters), sigmay (outcome error standard deviation), rho (error correlation). If NULL, an ial value will be chosen through OLS linear regression and probit-link GLM without regard to endogeneity. a numeric vector indicating subject IDs if data are clustered. In the absence of clustered data, this can be left blank (defaults to NULL). a string, either "M" for model-based standard errors (based on inverse observed Fisher information), or "R" for robust standard errors (based on methods of Huber and White). Defaults to "R". If id is provided for clustered data, the clusterrobust variance estimator (with working independence) will be used even if the user specifies type "M". Details The model is evaluated with numerical minimization of the negative log-likelihood (the BFGS is used). The probit model and error correlation parameters are weakly identified and hence the error variance is set at unity. The data must be complete (no missing values) and numeric, with the exception of factors, which may be used on the right hand side of equations. Value sampselect prints a summary of the coefficient estimates, standard errors, Wald-based confidence intervals, and p-values for the outcome model and the selection use probit model. alpha beta sigma rho vcov fitted call out.form prob.form sterr labels estimate of the selection probit model parameters. estimate of the outcome model parameters. estimate of the standard deviation of the outcome error. estimate of the correlation between the errors. entire estimated variance-covariance matrix, provided if the user wishes to perform any more specific hypothesis tests. ial value ultimately used, whether specified by the user or generated through the default approach. vector of fitted outcome values. the matched call. the formula used for the outcome model. the formula used for the selection probit model. the choice of the variance estimate procedure (either model-based or robust). labels for predictors to be passed into output. Author(s) Andrew J. Spieker, Ph.D.

6 sampselect References Heckman JJ. Dummy endogenous variables in a simultaneous equation system. 46(4), 931-959. Econometrica Maddala GS. Limited-dependent and qualitative variables in econometrics. Cambridgeshire: Cambridge University Press; 1983. Examples #- Generate Data -# require(mvtnorm) set.seed(1) N <- 2000 X1 <- rnorm(n, 0, 1); X2 <- rnorm(n, 0, 1); X3 <- rnorm(n, 0, 1); errors <- rmvnorm(n, sigma = 50*matrix(c(1, 0.5, 0.5, 1), nrow = 2)) Y <- 50 + X1 + X2 + errors[,1] Z <- rep(0, N) Z[(-5 + X1 + X3 + errors[,2]) > 0] <- 1 Y[Z == 1] <- 0 #- Estimate Model -# sampselect(y ~ X1 + X2, probit = Z ~ X1 + X3) #- Estimate Model with Model-Based Variance -# sampselect(y ~ X1 + X2, probit = Z ~ X1 + X3, se = "M")

Index hybrid, 2 print.hybrid (hybrid), 2 print.sampselect (sampselect), 4 sampselect, 4 summary.hybrid (hybrid), 2 summary.sampselect (sampselect), 4 7