Learn R Programming

PanelCount (version 1.0.1)

CRE: A Model with Correlated Random Effects in Poisson and Probit Equations

Description

Estimate a model in panel counting data, in which the selection equation is a Probit model with random effects on individuals, and the outcome equation is a Poisson model with random effects on the same individuals. The random effects on the same individual are correlated across two equations.

Usage

CRE(sel_form, out_form, id, data = NULL, par = NULL, par_files = NULL,
  delta = 1, sigma = 1, rho = 0, lower = c(rho = -1), upper = c(rho =
  1), method = "L-BFGS-B", H = c(10, 10), psnH = 20, prbH = 20,
  accu = 1e+10, verbose = 0)

Arguments

sel_form
Formula for selection equation, a probit model with random effects
out_form
Formula for outcome equation, a Poisson model with random effects
id
A vector that represents the identity of individuals, numeric or character
data
Input data, a data frame
par
Starting values for estimates
par_files
Loading initial values from saved ProbitRE and PoissonRE estimates
delta
Variance of random effects in Probit model
sigma
Variance of random effects in Poisson model
rho
Correlation between random effects in Probit and Poisson models
lower
Lower bound for estiamtes
upper
Upper bound for estimates
method
Searching algorithm, don't change default unless you know what you are doing
H
A 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 Quddrature points for Probit RE model
accu
1e12 for low accuracy; 1e7 for moderate accuracy; 10.0 for extremely high accuracy. See optim
verbose
Level of output during estimation. Lowest is 0.

Value

  • A list containing the results of the estimated model

See Also

Other PanelCount: CRE_SS; PLN_RE; PoissonRE; ProbitRE

Examples

Run this code
data(rt)
est = CRE(isRetweet~fans+tweets+as.factor(tweet.id),
                   num.words~fans+tweets+as.factor(tweet.id),
                   id=rt$user.id, data=rt)

Run the code above in your browser using DataLab