Learn R Programming

geeVerse (version 0.3.0)

qpgee: Quantile Penalized Generalized Estimating Equations (QPGEE)

Description

Fits a quantile penalized generalized estimating equation (QPGEE) model for longitudinal data using penalized quantile regression with different working correlation structures.

Usage

qpgee(x, ...)

# S3 method for formula qpgee(x, id, data = parent.frame(), ...)

# S3 method for default qpgee( x, y, nobs, tau = 0.5, corstr = "exchangeable", lambda = NULL, method = "HBIC", intercept = TRUE, betaint = NULL, nfold = 5, ncore = 1, control = qpgeeControl(), ... )

Value

An object of class `qpgee`.

Arguments

x

A matrix of predictors.

...

Other arguments passed to methods.

id

A vector identifying the clusters (subjects).

data

An optional data frame.

y

A numeric vector of response variables.

nobs

A numeric vector of observations per subject.

tau

The quantile to be estimated (default is 0.5).

corstr

A string specifying the working correlation structure. Options include "exchangeable" (Exchangeable), "AR1" (Autoregressive), "Tri" (Tri-diagonal), "independence" (Independent), and "unstructured".

lambda

A vector of penalty parameters. If NULL, auto-selection is performed.

method

Criterion for penalty selection ("HBIC" or "CV").

intercept

Logical; if TRUE, an intercept is added.

betaint

Initial values for the beta coefficients. If NULL, non-longitudinal quantile regression is used for initialization.

nfold

The number of folds used in cross-validation.

ncore

Number of cores for parallel processing.

control

A list of control parameters from `qpgeeControl()`, such as max_it, epsilon, shrinkCutoff, standardize and trace.

Examples

Run this code
# Quick Example:
# 1. Generate some data
set.seed(123)
sim_data <- generate_data(
  nsub = 50, nobs = rep(5, 50), p = 10,
  beta0 = c(rep(1, 5), rep(0, 5)), rho = 0.3
)

# 2. Fit the model using the formula interface
fit <- qpgee(
  y ~ . - id,
  data = sim_data,
  id = sim_data$id,
  tau = 0.5,
  method = "HBIC"
)

# 3. View the summary of the results
summary(fit)

Run the code above in your browser using DataLab