Learn R Programming

geeVerse (version 0.2.1)

predict.qpgee: Predict method for qpgee model objects

Description

This function makes predictions from a "qpgee" model object. When `newdata` is not provided, it returns predictions using the original data the model was fitted on. If `newdata` is supplied (through `...`), it uses this new data for prediction.

Usage

# S3 method for qpgee
predict(object, ...)

Value

If `newdata` is not supplied, returns a vector of predictions based on the fitted values and handling of NAs specified in the model object. If `newdata` is supplied, returns a vector of predictions for the new data.

Arguments

object

A "qpgee" model object.

...

Additional arguments to the function. Can include `newdata`, a dataframe containing the new data to predict on. The structure of `newdata` should match that of the data the model was originally fitted with, specifically in terms of the variables it contains. Additional arguments are ignored.

Examples

Run this code
# Example usage:
sim_data <- generateData(nsub = 100, nobs = rep(10, 100),  p = 100,
                         beta0 = c(rep(1,7),rep(0,93)), rho = 0.6, correlation = "AR1",
                          dis = "normal", ka = 1)

X=sim_data$X
y=sim_data$y

#fit qpgee
qpgee.fit = qpgee(X,y,tau=0.5,nobs=rep(10, 100),lambda = 0.1)
predict(qpgee.fit)

Run the code above in your browser using DataLab