Description Usage Arguments Details Value References See Also Examples
The function glm.cmp
is used to fit a mean parametrized Conway-Maxwell Poisson
generalized linear model with a log-link by using Fisher Scoring iteration.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
formula |
an object of class 'formula': a symbolic description of the model to be fitted to the mean via log-link. |
formula_nu |
an optional object of class 'formula': a symbolic description of the model to be fitted to the dispersion via log-link. |
data |
an optional data frame containing the variables in the model |
offset |
this can be used to specify an a priori known component to be included
in the linear predictor for mean during fitting. This should be |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
na.action |
a function which indicates what should happen when the data contain NAs. The default is set by the na.action setting of options, and is na.fail if that is unset. The ‘factory-fresh’ default is na.omit. Another possible value is NULL, no action. Value na.exclude can be useful. |
betastart |
starting values for the parameters in the linear predictor for mu. |
gammastart |
starting values for the parameters in the linear predictor for nu. |
lambdalb, lambdaub |
numeric: the lower and upper end points for the interval to be
searched for lambda(s). The default value for lambdaub should be sufficient for small to
moderate size nu. If nu is large and required a larger |
maxlambdaiter |
numeric: the maximum number of iterations allowed to solve for lambda(s). |
tol |
numeric: the convergence threshold. A lambda is said to satisfy the mean constraint if the absolute difference between the calculated mean and a fitted values is less than tol. |
contrasts_mu, contrasts_nu |
optional lists. See the contrasts.arg of model.matrix.default. |
Fit a mean-parametrized COM-Poisson regression using maximum likelihood estimation via an iterative Fisher Scoring algorithm.
Currently, the COM-Poisson regression model allows constant dispersion and regression being linked to the dispersion parameter i.e. varying dispersion.
For the constant dispersion model, the model is
Y_i ~ CMP(μ_i, ν),
where
E(Y_i) = μ_i = exp(x_i^T β),
and ν > 0 is the dispersion parameter.
The fitted COM-Poisson distribution is over- or under-dispersed if ν < 1 and ν > 1 respectively.
For the varying dispersion model, the model is
Y_i ~ CMP(μ_i, ν_i),
where
E(Y_i) = μ_i = exp(x_i^T β),
and dispersion parameters are model via
ν_i = exp(s_i^T γ),
where x_i and s_i are some covariates.
A fitted model object of class cmp
similar to one obtained from glm
or glm.nb
.
The function summary
(i.e., summary.cmp
) can be used to obtain
and print a summary of the results.
The functions plot
(i.e., plot.cmp
) and
gg_plot
can be used to produce a range
of diagnostic plots.
The generic assessor functions coef
(i.e., coef.cmp
),
logLik
(i.e., logLik.cmp
)
fitted
(i.e., fitted.cmp
),
nobs
(i.e., nobs.cmp
),
AIC
(i.e., AIC.cmp
) and
residuals
(i.e., residuals.cmp
)
can be used to extract various useful features of the value
returned by glm.cmp
.
The functions LRTnu
and cmplrtest
can be used to perform a likelihood ratio
chi-squared test for nu = 1 and for nested COM-Poisson model respectively.
An object class 'glm.cmp' is a list containing at least the following components:
coefficients |
a named vector of coefficients |
coefficients_beta |
a named vector of mean coefficients |
coefficients_gamma |
a named vector of dispersion coefficients |
se_beta |
approximate standard errors (using observed rather than expected information) for mean coefficients |
se_gamma |
approximate standard errors (using observed rather than expected information) for dispersion coefficients |
residuals |
the response residuals (i.e., observed-fitted) |
fitted_values |
the fitted mean values |
rank_mu |
the numeric rank of the fitted linear model for mean |
rank_nu |
the numeric rank of the fitted linear model for dispersion |
linear_predictors |
the linear fit for mean on log scale |
df_residuals |
the residuals degrees of freedom |
df_null |
the residual degrees of freedom for the null model |
null_deviance |
The deviance for the null model. The null model will include only the intercept. |
deviance; residual_deviance |
The residual deviance of the model |
y |
the |
x |
the model matrix for mean |
s |
the model matrix for dispersion |
model_mu |
the model frame for mu |
model_nu |
the model frame for nu |
call |
the matched call |
formula |
the formula supplied for mean |
formula_nu |
the formula supplied for dispersion |
terms_mu |
the |
terms_nu |
the |
data |
the |
offset |
the |
lambdaub |
the final |
Fung, T., Alwan, A., Wishart, J. and Huang, A. (2020). mpcmp
: Mean-parametrized
Conway-Maxwell Poisson Regression. R package version 0.3.4.
Huang, A. (2017). Mean-parametrized Conway-Maxwell-Poisson regression models for dispersed counts. Statistical Modelling 17, 359–380.
summary.cmp
, autoplot.cmp
, plot.cmp
, fitted.cmp
,
residuals.cmp
and LRTnu
.
Additional examples may be found in fish
,
takeoverbids
, cottonbolls
.
1 2 3 4 5 6 7 8 9 10 11 12 | ### Huang (2017) Page 368--370: Overdispersed Attendance data
data(attendance)
M.attendance <- glm.cmp(daysabs~ gender+math+prog, data=attendance)
M.attendance
summary(M.attendance)
plot(M.attendance) # or autoplot(M.attendance)
### Ribeiro et al. (2013): Varying dispersion as a function of covariates
data(sitophilus)
M.sit <- glm.cmp(formula = ninsect ~ extract, formula_nu = ~extract, data = sitophilus)
summary(M.sit)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.