grcmle {GRCdata} | R Documentation |
Maximum likelihood estimation of Poisson or ZIP parameters at the aggregate level.
Description
This function infers Poisson or zero-inflated Poisson (ZIP) parameters from grouped and right-censored count data, and conducts a chi-squared goodness-of-fit test. A grouped and right-censored scheme may look like
0, 1, 2--4, 5--8, 9+.
For grouped and right-censored count data collected in a survey, such as frequency of alcohol drinking, number of births or occurrence of crimes, the response category designed as the example above means never, once, 2 to 4 times, 5 to 8 times, 9 times and more. The frequency distribution from a sample corresponding to the example above may look like
3, 15, 168, 155, 15
.
Usage
grcmle(counts, scheme, method = c("Poisson", "ZIP"),
do.plot = T, init.guess = NULL,
optimizing.algorithm.index = 2, lambda.extend.ratio = 3,
conf.level = 0.95)
Arguments
counts |
specifies the frequency distribution of the grouped and right-censored count data. For the example above, one may input
|
scheme |
specifies the grouping scheme. It should be a vector of integers containing the starting point (or the lowest integer) of each group. For example, to input the scheme above
one may use
|
method |
a string parameter specifies which statistical model to use. Currently there are two options
|
do.plot |
a logical variable indicating whether or not to plot the log likelihood.
The default is |
init.guess |
the initial value used for the optimization procedure of the likelihood estimation. The default value
is |
optimizing.algorithm.index |
defines which optimization algorithm to use. Currently the possible values are
For details of these algorithms, please see the manual of the R package |
lambda.extend.ratio |
specifies the searching interval of possible
|
conf.level |
confidence level of the confidence interval(s) for the parameter(s) inferred |
Details
Maximum likelihood estimation is used for the inference.
Value
The returned value is a list containing
mle |
the parameter(s) inferred. For Poisson model, it is the estimate of |
p.value |
the p-value of the chi-squared test of goodness-of-fit. |
df |
the degree(s) of freedom of the chi-squared test of goodness-of-fit. |
CI.lambda |
the confidence interval of |
CI.p |
the confidence interval of |
conf.level |
the confidence level |
std.err |
the standard error of |
Author(s)
Authors: Xin Guo <x.guo@polyu.edu.hk>, Qiang Fu <qiang.fu@ubc.ca>
Examples
grcmle(counts=c(6, 15, 168, 155, 15), scheme = c(0, 1, 2, 5, 9))
grcmle(counts=c(6, 15, 168, 155, 15), scheme = c(0, 1, 2, 5, 9), method = "ZIP")