pois.fe.robust: Robust standard errors of Poisson fixed effects regression

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/pois.fe.robust.R

Description

Compute standard errors following Wooldridge (1999) for Poisson regression with fixed effects, and a hypothesis test of the conditional mean assumption (3.1).

Usage

1
2
3
pois.fe.robust(outcome, xvars, group.name, data, 
               qcmle.coefs = NULL, allow.set.key = FALSE,
               index.name = NULL)

Arguments

outcome

character string of the name of the dependent variable.

xvars

vector of character strings of the names of the independent variables.

group.name

character string of the name of the grouping variable.

data

data.table which contains the variables named in other arguments. See details for variable type requirements.

qcmle.coefs

an optional numeric vector of coefficients in the same order as xvars. If NULL, coefficients are estimated using glmmML::glmmboot.

allow.set.key

logical. When TRUE (recommended), data will have its key set to group.name, so it may be reordered. This should reduce memory usage.

index.name

DEPRECATED (leave as NULL).

Details

data must be a data.table containing the following:

No observation in data may contain a missing value.

Setting allow.set.key to TRUE is recommended to reduce memory usage; however, it will allow data to be modified (sorted in-place).

pois.fe.robust also returns the p-value of the hypothesis test of the conditional mean assumption (3.1) as described in Wooldridge (1999) section 3.3.

Value

A list containing

Author(s)

Evan Wright

References

Wooldridge, Jeffrey M. (1999): "Distribution-free estimation of some nonlinear panel data models," Journal of Econometrics, 90, 77-97.

See Also

glmmboot

Examples

1
2
3
4
5
6
7
8
9
# ex.dt.good satisfies the conditional mean assumption
data("ex.dt.good")
pois.fe.robust(outcome = "y", xvars = c("x1", "x2"), group.name = "id",
               index.name = "day", data = ex.dt.good)
               
# ex.dt.bad violates the conditional mean assumption
data("ex.dt.bad")
pois.fe.robust(outcome = "y", xvars = c("x1", "x2"), group.name = "id",
               index.name = "day", data = ex.dt.bad)

Example output

$coefficients
       x1        x2 
0.9899730 0.9917526 

$se.robust
        x1         x2 
0.03112512 0.02481941 

$p.value
[1] 0.6996001

Warning messages:
1: In pois.fe.robust(outcome = "y", xvars = c("x1", "x2"), group.name = "id",  :
  index.name is deprecated. It is not necessary.
2: In pois.fe.robust(outcome = "y", xvars = c("x1", "x2"), group.name = "id",  :
  allow.set.key is FALSE. TRUE is recommended to avoid copying the data; however, TRUE will sort the data in-place by group.name.
$coefficients
       x1        x2 
0.4800735 2.9866911 

$se.robust
       x1        x2 
0.2864666 1.2743953 

$p.value
[1] 0.02213269

Warning messages:
1: In pois.fe.robust(outcome = "y", xvars = c("x1", "x2"), group.name = "id",  :
  index.name is deprecated. It is not necessary.
2: In pois.fe.robust(outcome = "y", xvars = c("x1", "x2"), group.name = "id",  :
  allow.set.key is FALSE. TRUE is recommended to avoid copying the data; however, TRUE will sort the data in-place by group.name.

poisFErobust documentation built on Feb. 18, 2020, 1:08 a.m.