Teaching helper for count predictions from a log-link generalised linear
model. It wraps predict.glm, constructs confidence intervals on
the link scale, exponentiates the fitted values and limits, rounds the result,
and optionally prints the returned table.
Arguments
- object
a
glmobject, i.e. the output fromglm.- newdata
prediction data frame.
- cilevel
confidence level for the intervals.
- digit
number of decimal places to print.
- print.out
if
TRUE, print the prediction table.- ...
optional arguments that are passed to
predict.glm.
Value
Invisibly returns a data frame with three columns:
- Predicted
the predicted count on the response scale.
- Conf.lower
the lower confidence limit on the response scale.
- Conf.upper
the upper confidence limit on the response scale.
Details
New work should use predict20x, which handles lm and
glm fits with one function. predictCount() always exponentiates,
so for a logit-link model it returns odds, as
predict20x(type = "odds") does.
Note: newdata must be a data frame with the same column order and
data types as those used in fitting the model. This stricter interface is kept
for compatibility with the original teaching wrapper.
Note
Deprecated in s20x 3.4.0. Use predict20x instead, with
type = "odds" for the odds from a logit-link model.
