View source: R/predict.glmreg.R
predict.glmreg | R Documentation |
This function returns predictions from
a fitted "glmreg"
object.
## S3 method for class 'glmreg' predict(object,newx,newoffset,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),...)
object |
Fitted |
newx |
Matrix of values at which predictions are to be made. Not
used for |
which |
Indices of the penalty parameter |
type |
Type of prediction: |
newoffset |
an offset term used in prediction |
na.action |
action for missing data value |
... |
arguments for predict |
The returned object depends on type
.
Zhu Wang <wangz1@uthscsa.edu>
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]
glmreg
## 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") predict(fit, newx=d.AD[,1:2]) summary(fit) coef(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.