Learn R Programming

endoSwitch (version 1.0.0)

endoSwitch2Stage: Endogenous switching regression

Description

This function estimates the endogenous switching regression model via two-stage estimations (Maddala, 1986)

Usage

endoSwitch2Stage(data, OutcomeDep, SelectDep, OutcomeCov, SelectCov)

Arguments

data

a data frame. Data for running the regression analysis.

OutcomeDep

character. Dependent variable in the outcome equation.

SelectDep

character. Dependent variable in the Selection model. The variable must be binary (0 or 1).

OutcomeCov

character vector. Covariates in the outcome equation.

SelectCov

character vector. Covariates in the selection equation.

Value

A list containing regression results.

Details

The first stage uses a probit model to estimate the selection equation. The second stage uses ordinary least squares including the inverse mills ratios computed from the first stage estimation results to estimate the outcome equations.

References

Maddala, G. S. <U+201C>Limited-Dependent and Qualitative Variables in Econometrics.<U+201D> Cambridge Books. Cambridge University Press, 1986.

Examples

Run this code
# NOT RUN {
data(ImpactData)
OutcomeDep <- 'Output'
SelectDep <- 'CA'
OutcomeCov <- c('Age')
SelectCov <- c('Age', 'Perception')
Results <- endoSwitch2Stage(ImpactData, OutcomeDep, SelectDep, OutcomeCov, SelectCov)
# First stage regression results
summary(Results$FirstStageReg)
# Second stage regression results -- non-adopter
summary(Results$SecondStageReg.0)
# Second stage regression results -- adopter
summary(Results$SecondStageReg.1)
# }

Run the code above in your browser using DataLab