qpgee | R Documentation |
Fits a quantile penalized generalized estimating equation (QPGEE) model for longitudinal data using penalized quantile regression with different working correlation structures.
qpgee(x, ...)
## S3 method for class 'formula'
qpgee(x, id, data = parent.frame(), ...)
## Default S3 method:
qpgee(
x,
y,
nobs,
tau = 0.5,
corstr = "exchangeable",
lambda = NULL,
method = "HBIC",
intercept = TRUE,
betaint = NULL,
nfold = 5,
ncore = 1,
control = qpgeeControl(),
...
)
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. |
An object of class 'qpgee'.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.