Model predictions based on a fitted "glmreg" object.

Share:

Description

This function returns predictions from a fitted "glmreg" object.

Usage

1
2
3
4
5
## S3 method for class 'glmreg'
predict(object,newx,which=1:length(object$lambda),
type=c("link","response","class","coefficients","nonzero"), na.action=na.pass, ...)
## S3 method for class 'glmreg'
coef(object,which=1:length(object$lambda),...)

Arguments

object

Fitted "glmreg" model object.

newx

Matrix of values at which predictions are to be made. Not used for type="coefficients"

which

Indices of the penalty parameter lambda at which predictions are required. By default, all indices are returned.

type

Type of prediction: "link" returns the linear predictors; "response" gives the fitted values; "class" returns the binomial outcome with the highest probability; "coefficients" returns the coefficients.

na.action

action for missing data value

...

arguments for predict

Value

The returned object depends on type.

Author(s)

Zhu Wang <zwang@connecticutchildrens.org>

References

Zhu Wang, Shuangge Ma, Michael Zappitelli, Chirag Parikh, Ching-Yun Wang and Prasad Devarajan (2014) Penalized Count Data Regression with Application to Hospital Stay after Pediatric Cardiac Surgery, Statistical Methods in Medical Research. 2014 Apr 17. [Epub ahead of print]

See Also

glmreg

Examples

1
2
3
4
5
6
7
8
## Dobson (1990) Page 93: Randomized Controlled Trial :
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
treatment <- gl(3,3)
print(d.AD <- data.frame(treatment, outcome, counts))
fit <- glmreg(counts ~ outcome + treatment, data=d.AD, family="poisson")
summary(fit)
coef(fit)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.