| Title: | Poisson Fixed Effects Robust |
|---|---|
| Description: | Computation of robust standard errors of Poisson fixed effects models, following Wooldridge (1999). |
| Authors: | Evan Wright [aut, cre] |
| Maintainer: | Evan Wright <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 2.0.0 |
| Built: | 2026-06-01 11:18:04 UTC |
| Source: | https://github.com/cran/poisFErobust |
Computation of robust standard errors of Poisson fixed effects models, following Wooldridge (1999).
The DESCRIPTION file:
| Package: | poisFErobust |
| Type: | Package |
| Title: | Poisson Fixed Effects Robust |
| Version: | 2.0.0 |
| Date: | 2020-02-17 |
| Authors@R: | person("Evan", "Wright", email = "[email protected]", role = c("aut", "cre")) |
| Description: | Computation of robust standard errors of Poisson fixed effects models, following Wooldridge (1999). |
| License: | MIT + file LICENSE |
| Depends: | R (>= 3.1.0) |
| Imports: | data.table (>= 1.9.6), glmmML (>= 1.0) |
| URL: | https://bitbucket.org/ew-btb/poisson-fe-robust |
| NeedsCompilation: | no |
| RoxygenNote: | 6.0.1 |
| Suggests: | testthat |
| LazyData: | true |
| Packaged: | 2020-02-17 20:28:47 UTC; evan |
| Author: | Evan Wright [aut, cre] |
| Maintainer: | Evan Wright <[email protected]> |
| Repository: | https://cran.r-universe.dev |
| Date/Publication: | 2020-02-17 20:40:06 UTC |
| RemoteUrl: | https://github.com/cran/poisFErobust |
| RemoteRef: | HEAD |
| RemoteSha: | f745da3707e60aea7bc83926059dd3a5a373829f |
Index of help topics:
ex.dt.bad Poisson data violating conditional mean
assumption
ex.dt.good Poisson data satisfying conditional mean
assumption
pois.fe.robust Robust standard errors of Poisson fixed effects
regression
poisFErobust-package Poisson Fixed Effects Robust
Evan Wright [aut, cre]
Maintainer: Evan Wright <[email protected]>
Wooldridge, Jeffrey M. (1999): "Distribution-free estimation of some nonlinear panel data models," Journal of Econometrics, 90, 77-97.
# 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)# 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)
A data.table containing id by day observations of Poisson
random variables which violate the conditional mean assumption of
Wooldridge (1999).
data("ex.dt.bad")data("ex.dt.bad")
A data.table with 450 observations on the following 7 variables.
ida factor with levels 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
daya numeric vector
fea numeric vector
x1a numeric vector
x2a numeric vector
ya numeric vector
x1.leada numeric vector
The data were simulated like
y <- rpois(1, exp(fe + x1 + x2 + 2.5*x1.lead))
where fe, x1, and x2 are standard normal random variables.
fe varies only across id.
x1.lead is a one period lead of x1 which causes the violation
of the conditional mean assumption.
Wooldridge, Jeffrey M. (1999): "Distribution-free estimation of some nonlinear panel data models," Journal of Econometrics, 90, 77-97.
data("ex.dt.bad") str(ex.dt.bad)data("ex.dt.bad") str(ex.dt.bad)
A data.table containing id by day observations of Poisson
random variables which satisfy the conditional mean assumption of
Wooldridge (1999).
data("ex.dt.good")data("ex.dt.good")
A data frame with 500 observations on the following 6 variables.
ida factor with levels 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
daya numeric vector
fea numeric vector
x1a numeric vector
x2a numeric vector
ya numeric vector
The data were simulated like
y <- rpois(1, exp(fe + x1 + x2))
where fe, x1, and x2 are standard normal random variables.
fe varies only across id.
Wooldridge, Jeffrey M. (1999): "Distribution-free estimation of some nonlinear panel data models," Journal of Econometrics, 90, 77-97.
data("ex.dt.good") str(ex.dt.good)data("ex.dt.good") str(ex.dt.good)
Compute standard errors following Wooldridge (1999) for Poisson regression with fixed effects, and a hypothesis test of the conditional mean assumption (3.1).
pois.fe.robust(outcome, xvars, group.name, data, qcmle.coefs = NULL, allow.set.key = FALSE, index.name = NULL)pois.fe.robust(outcome, xvars, group.name, data, qcmle.coefs = NULL, allow.set.key = FALSE, index.name = NULL)
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 |
allow.set.key |
logical. When |
index.name |
DEPRECATED (leave as NULL). |
data must be a data.table containing the following:
a column named by outcome, non-negative integer
columns named according to each string in xvars, numeric type
a column named by group.name, factor type
a column named by index.name, integer sequence increasing by one
each observation with no gaps within groups
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.
A list containing
coefficients, a numeric vector of coefficients.
se.robust, a numeric vector of standard errors.
p.value, the p-value of a hypothesis test of the
conditional mean assumption (3.1).
Evan Wright
Wooldridge, Jeffrey M. (1999): "Distribution-free estimation of some nonlinear panel data models," Journal of Econometrics, 90, 77-97.
# 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)# 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)