Surv) with
covariates or from precomputed residuals. Principal components (PCs) named
in control$PC_columns are extracted; residual outliers are detected
using an IQR rule with adjustable multiplier and stored for SPA testing.Fit a SPAmix null model from a survival response (Surv) with
covariates or from precomputed residuals. Principal components (PCs) named
in control$PC_columns are extracted; residual outliers are detected
using an IQR rule with adjustable multiplier and stored for SPA testing.
fitNullModel.SPAmix(response, designMat, subjData, control, ...)A list of class "SPAmix_NULL_Model" containing:
Residual matrix (n x k)
Number of subjects
Response vector (event indicator for survival models)
Selected principal component columns
Number of phenotypes (columns of residuals)
List of per-phenotype indices (0-based) and residual subsets for outlier/non-outlier strata
Either a survival::Surv object (time-to-event data)
or a numeric residual vector/matrix with class "Residual".
Numeric matrix (n x p) of covariates; must include the PC
columns specified in control$PC_columns.
Vector of subject IDs aligned with rows of designMat
and response.
List of options. Required element: PC_columns, a
single comma-separated string of PC column names (e.g.
"PC1,PC2,PC3,PC4"). OutlierRatio.
Extra arguments passed to survival::coxph when
response is Surv.
If response is Surv, a Cox model is fit and martingale
residuals are used. If response is Residual, its values are
used directly. Outliers per phenotype are defined by
[Q1 - r*IQR, Q3 + r*IQR] with r = OutlierRatio; if none are
found, r is iteratively reduced by 20% until at least one appears.