cquad_basic: Conditional maximum likelihood estimation of the basic...

Description Usage Arguments Value Author(s) References Examples

View source: R/cquad_basic.R

Description

Fit by conditional maximum likelihood a simplified version of the model for binary logitudinal data proposed by Bartolucci & Nigro (2010); see also Cox (1972).

Usage

1
2
cquad_basic(id, yv, X = NULL, be = NULL, w = rep(1, n), dyn =
FALSE, Ttol=10)

Arguments

id

list of the reference unit of each observation

yv

corresponding vector of response variables

X

corresponding matrix of covariates (optional)

be

intial vector of parameters (optional)

w

vector of weights (optional)

dyn

TRUE if in the dynamic version; FALSE for the static version (by default)

Ttol

Treshold individual observations that activates the recursive algorithm (default=10)

Value

formula

formula defining the model

lk

conditional log-likelihood value

coefficients

estimate of the regression parameters (including for the lag-response)

vcov

asymptotic variance-covariance matrix for the parameter estimates

scv

matrix of individual scores

J

Hessian of the log-likelihood function

se

standard errors

ser

robust standard errors

Tv

number of time occasions for each unit

Author(s)

Francesco Bartolucci (University of Perugia), Claudia Pigini (University of Ancona "Politecnica delle Marche"), Francesco Valentini (University of Ancona "Politecnica delle Marche")

References

Bartolucci, F. and Nigro, V. (2010), A dynamic model for binary panel data with unobserved heterogeneity admitting a root-n consistent conditional estimator, Econometrica, 78, pp. 719-733.

Cox, D. R. (1972), The Analysis of multivariate binary data, Applied Statistics, 21, 113-120.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# example based on simulated data
data(data_sim)
data_sim = data_sim[1:500,]   # to speed up the example, remove otherwise
id = data_sim$id; yv = data_sim$y; X = cbind(X1=data_sim$X1,X2=data_sim$X2)
# static model
out1 = cquad_basic(id,yv,X,Ttol=10)
summary(out1)
# dynamic model
out2 = cquad_basic(id,yv,X,dyn=TRUE,Ttol=10)
summary(out2)

Example output

Loading required package: MASS
Loading required package: plm
Loading required package: Formula
Balanced panel data
 |--------------|--------------|--------------|
 |   iteration  |      lk      |    lk-lko    |
 |--------------|--------------|--------------|
 |            1 |     -136.698 |          Inf | 
 |            2 |     -99.8641 |      36.8336 | 
 |            3 |     -98.5722 |      1.29189 | 
 |            4 |     -98.5504 |    0.0217807 | 
 |            5 |     -98.5504 |   9.0852e-06 | 
 |            6 |     -98.5504 |  1.71951e-12 | 
 |--------------|--------------|--------------|

Call:
cquad_basic(id = id, yv = yv, X = X, Ttol = 10)

Log-likelihood:
-98.55042 
         est.      s.e.    t-stat      p-value
X1  0.9711559 0.1653706  5.872604 4.290015e-09
X2 -0.7783091 0.1569574 -4.958727 7.095666e-07

Balanced panel data
 |--------------|--------------|--------------|
 |   iteration  |      lk      |    lk-lko    |
 |--------------|--------------|--------------|
 |            1 |     -87.3636 |          Inf | 
 |            2 |     -51.7419 |      35.6217 | 
 |            3 |     -48.5148 |      3.22715 | 
 |            4 |     -48.2432 |     0.271592 | 
 |            5 |     -48.2399 |   0.00332452 | 
 |            6 |     -48.2399 |  6.37843e-07 | 
 |--------------|--------------|--------------|

Call:
cquad_basic(id = id, yv = yv, X = X, dyn = TRUE, Ttol = 10)

Log-likelihood:
-48.23987 
           est.      s.e.    t-stat      p-value
X1     1.021992 0.2287968  4.466813 7.939362e-06
X2    -1.292209 0.2602722 -4.964836 6.875927e-07
y_lag  1.551071 0.4382356  3.539353 4.011094e-04

cquad documentation built on Oct. 23, 2020, 7:55 p.m.