predict.qpgee {geeVerse}R Documentation

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 class 'qpgee'
predict(object, ...)

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.

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.

Examples

# Example usage:
sim_data <- generateData(n_sub = 100, n_obs = rep(10, 100),  p = 100,
                         beta0 = rep(1,7), rho = 0.6, type = "ar",
                          dis = "normal", ka = 1)

X=sim_data$X
y=sim_data$y

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


[Package geeVerse version 0.1.0 Index]