A wrapper for feglm
with
family = poisson()
.
Usage
fepoisson(
formula = NULL,
data = NULL,
weights = NULL,
beta_start = NULL,
eta_start = NULL,
control = NULL
)
Arguments
- formula
an object of class
"formula"
: a symbolic description of the model to be fitted.formula
must be of typey ~ x | k
, where the second part of the formula refers to factors to be concentrated out. It is also possible to pass clustering variables tofeglm
asy ~ x | k | c
.- data
an object of class
"data.frame"
containing the variables in the model. The expected input is a dataset with the variables specified informula
and a number of rows at least equal to the number of variables in the model.- weights
an optional string with the name of the 'prior weights' variable in
data
.- beta_start
an optional vector of starting values for the structural parameters in the linear predictor. Default is \(\boldsymbol{\beta} = \mathbf{0}\).
- eta_start
an optional vector of starting values for the linear predictor.
- control
a named list of parameters for controlling the fitting process. See
feglm_control
for details.
Examples
# check the feglm examples for the details about clustered standard errors
# subset trade flows to avoid fitting time warnings during check
set.seed(123)
trade_2006 <- trade_panel[trade_panel$year == 2006, ]
trade_2006 <- trade_2006[sample(nrow(trade_2006), 500), ]
mod <- fepoisson(
trade ~ log_dist + lang + cntg + clny | exp_year + imp_year,
trade_2006
)
summary(mod)
#> Formula: trade ~ log_dist + lang + cntg + clny | exp_year + imp_year
#> <environment: 0x56808865b138>
#>
#> Family: Poisson
#>
#> Estimates:
#>
#> | | Estimate | Std. Error | z value | Pr(>|z|) |
#> |----------|----------|------------|-----------|------------|
#> | log_dist | -0.7937 | 0.0049 | -162.0661 | 0.0000 *** |
#> | lang | 0.0491 | 0.0103 | 4.7808 | 0.0000 *** |
#> | cntg | 0.6913 | 0.0113 | 61.3261 | 0.0000 *** |
#> | clny | -0.0239 | 0.0109 | -2.1871 | 0.0287 * |
#>
#> Significance codes: *** 99.9%; ** 99%; * 95%; . 90%
#>
#> Pseudo R-squared: 0.6274
#>
#> Number of observations: Full 500; Missing 0; Perfect classification 0
#>
#> Number of Fisher Scoring iterations: 12