View source: R/ProbitRE_PLNRE.R
ProbitRE_PLNRE  R Documentation 
Estimates the following twostage model:
Selection equation (ProbitRE  Probit model with individual level random effects):
z_{it}=1(\boldsymbol{\alpha}\mathbf{w_{it}}'+\delta u_i+\xi_{it} > 0)
Outcome Equation (PLN_RE  Poisson Lognormal model with individualtime level random effects):
E[y_{it}x_{it},v_i,\epsilon_{it}] = exp(\boldsymbol{\beta}\mathbf{x_{it}}' + \sigma v_i + \gamma \epsilon_{it})
Correlation (selfselection at both individual and individualtime level):
u_i
and v_i
are bivariate normally distributed with a correlation of \rho
.
\xi_{it}
and \epsilon_{it}
are bivariate normally distributed with a correlation of \tau
.
Notations:
w_{it}
: variables influencing the selection decision z_{it}
, which could be a mixture of timevariant variables, timeinvariant variables, and time dummies
x_{it}
: variables influencing the outcome y_{it}
, which could be a mixture of timevariant variables, timeinvariant variables, and time dummies
u_i
: individual level random effect in the selection equation
v_i
: individual level random effect in the outcome equation
\xi_{it}
: error term in the selection equation
\epsilon_{it}
: individualtime level random effect in the outcome equation
ProbitRE_PLNRE(
sel_form,
out_form,
data,
id.name,
testData = NULL,
par = NULL,
disable_rho = FALSE,
disable_tau = FALSE,
delta = NULL,
sigma = NULL,
gamma = NULL,
rho = NULL,
tau = NULL,
method = "BFGS",
se_type = c("BHHH", "Hessian")[1],
H = c(10, 10),
psnH = 20,
prbH = 20,
plnreH = 20,
reltol = sqrt(.Machine$double.eps),
factr = 1e+07,
verbose = 1,
offset_w_name = NULL,
offset_x_name = NULL
)
sel_form 
Formula for selection equation, a Probit model with random effects 
out_form 
Formula for outcome equation, a Poisson Lognormal model with random effects 
data 
Input data, a data.frame object 
id.name 
The name of the column representing id. Data will be sorted by id to improve estimation speed. 
testData 
Test data for prediction, a data.frame object 
par 
Starting values for estimates. Default to estimates of standalone selection and outcome models. 
disable_rho 
Whether to disable correlation at the individual level random effect. Defaults to FALSE. 
disable_tau 
Whether to disable correlation at the individualtime level random effect / error term. Defaults to FALSE. 
delta 
Starting value for delta. Will be ignored if par is provided. 
sigma 
Starting value for sigma. Will be ignored if par is provided. 
gamma 
Starting value for gamma. Will be ignored if par is provided. 
rho 
Starting value for rho. Defaults to 0 and will be ignored if par is provided. 
tau 
Starting value for tau. Defaults to 0 and will be ignored if par is provided. 
method 
Optimization method used by optim. Defaults to 'BFGS'. 
se_type 
Report Hessian or BHHH standard errors. Defaults to BHHH. Hessian matrix is extremely timeconsuming to calculate numerically for large datasets. 
H 
A integer vector of length 2, specifying the number of points for inner and outer Quadratures 
psnH 
Number of Quadrature points for Poisson RE model 
prbH 
Number of Quadrature points for Probit RE model 
plnreH 
Number of Quadrature points for PLN_RE model 
reltol 
Relative convergence tolerance. The algorithm stops if it is unable to reduce the value by a factor of reltol * (abs(val) + reltol) at a step. Defaults to sqrt(.Machine$double.eps), typically about 1e8. 
factr 
LBFGSB method uses factr instead of reltol to control for precision. Default is 1e7, that is a tolerance of about 1e8. 
verbose 
A integer indicating how much output to display during the estimation process.

offset_w_name 
An offset variable whose coefficient is assumed to be 1 in the selection equation 
offset_x_name 
An offset variable whose coefficient is assumed to be 1 in the outcome equation 
A list containing the results of the estimated model, some of which are inherited from the return of optim
estimates: Model estimates with 95% confidence intervals
par: Point estimates
var_bhhh: BHHH covariance matrix, inverse of the outer product of gradient at the maximum
se_bhhh: BHHH standard errors
g: Gradient function at maximum
gtHg: g'H^1g
, where H^1 is approximated by var_bhhh. A value close to zero (e.g., <1e3 or 1e6) indicates good convergence.
LL: Likelihood
AIC: AIC
BIC: BIC
n_obs: Number of observations
time: Time takes to estimate the model
partial: Average partial effect at the population level
paritalAvgObs: Partial effect for an individual with average characteristics
predict: A list with predicted participation probability (prob), predicted potential outcome (outcome), and predicted actual outcome (actual_outcome).
counts: From optim. A twoelement integer vector giving the number of calls to fn and gr respectively. This excludes those calls needed to compute the Hessian, if requested, and any calls to fn to compute a finitedifference approximation to the gradient.
message: From optim. A character string giving any additional information returned by the optimizer, or NULL.
convergence: From optim. An integer code. 0 indicates successful completion. Note that the list inherits all the complements in the output of optim. See the documentation of optim for more details.
Peng, J., & Van den Bulte, C. (2023). Participation vs. Effectiveness in Sponsored Tweet Campaigns: A QualityQuantity Conundrum. Management Science (forthcoming). Available at SSRN: https://www.ssrn.com/abstract=2702053
Peng, J., & Van den Bulte, C. (2015). How to Better Target and Incent Paid Endorsers in Social Advertising Campaigns: A Field Experiment. 2015 International Conference on Information Systems. https://aisel.aisnet.org/icis2015/proceedings/SocialMedia/24/
Other PanelCount:
PLN_RE()
,
PoissonRE()
,
ProbitRE_PoissonRE()
,
ProbitRE()
# Use the simulated dataset, in which the true coefficients of x and w are 1 in both stages.
# The model can recover the true parameters very well
data(sim)
res = ProbitRE_PLNRE(z~x+w, y~x, data=sim, id.name='id')
res$estimates
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.