pln {endogeneity} | R Documentation |
Estimate a Poisson model with a log-normally distributed heterogeneity term. Also referred to as Poisson-Normal model.
pln(
form,
data = NULL,
par = NULL,
method = "BFGS",
init = c("zero", "unif", "norm", "default")[4],
H = 20,
verbose = 0,
accu = 10000
)
form |
Formula |
data |
Input data, a data frame |
par |
Starting values for estimates |
method |
Optimization algorithm. |
init |
Initialization method |
H |
Number of quadrature points |
verbose |
Level of output during estimation. Lowest is 0. |
accu |
1e12 for low accuracy; 1e7 for moderate accuracy; 10.0 for extremely high accuracy. See optim |
A list containing the results of the estimated model
Peng, Jing. (2022) Identification of Causal Mechanisms from Randomized Experiments: A Framework for Endogenous Mediation Analysis. Information Systems Research (Forthcoming), Available at SSRN: https://ssrn.com/abstract=3494856
library(MASS)
N = 2000
set.seed(1)
# Works well when the variance of the normal term is not overly large
# When the variance is very large, it tends to be underestimated
x = rbinom(N, 1, 0.5)
z = rnorm(N)
y = rpois(N, exp(-1 + x + z + 0.5 * rnorm(N)))
est = pln(y~x+z)
est$estimates