Learn R Programming

GRAB (version 0.2.4)

fitNullModel.SPACox: Fit SPACox null model from survival outcomes or residuals

Description

Computes martingale residuals (or uses provided residuals) and an empirical cumulant generating function (CGF) for SPA-based single-variant tests.

Usage

fitNullModel.SPACox(response, designMat, subjData, control, ...)

Value

A list of class "SPACox_NULL_Model" with elements:

N

Number of subjects.

mresid

Martingale residuals (numeric vector).

cumul

CGF grid as a matrix with columns t, K0, K1, K2.

tX

Transpose of design matrix with intercept (p+1 x n).

yVec

Status/event indicator or residual-based response.

X.invXX

Projection helper: X %% solve(t(X) %% X).

subjData

Character vector of subject IDs.

Arguments

response

Either a survival::Surv object (time-to-event) or a numeric residual vector with class "Residual".

designMat

Numeric design matrix (n x p) of covariates.

subjData

Vector of subject IDs aligned with rows of designMat.

control

List with fields such as range and length.out for the CGF grid.

...

Extra arguments passed to survival::coxph when response is Surv.