Learn R Programming

GRAB (version 0.2.4)

fitNullModel.WtCoxG: Fit weighted Cox null model with outlier handling and batch-effect QC

Description

Fits a weighted Cox model using case/control weighting based on reference prevalence and identifies residual outliers for SPA testing. Optionally performs batch-effect QC by cross-referencing external allele frequencies.

Usage

fitNullModel.WtCoxG(
  response,
  designMat,
  subjData,
  control,
  data,
  GenoFile,
  GenoFileIndex,
  SparseGRMFile,
  SurvTimeColumn,
  IndicatorColumn,
  ...
)

Value

A list of class "WtCoxG_NULL_Model" with elements:

mresid

Martingale residuals from weighted Cox model.

Cova

Design matrix used in the null model (n x p).

yVec

Event indicator extracted from Surv.

weight

Observation weights derived from reference prevalence.

RefPrevalence

Reference prevalence used to define weights.

N

Number of subjects.

outLierList

Lists indices (0-based) and residual subsets for SPA.

control

Copy of control options used.

mergeGenoInfo

QC-derived marker metadata for batch-effect testing (if run).

subjData

Character vector of subject IDs.

Arguments

response

survival::Surv response (time-to-event). Residuals are not supported here.

designMat

Numeric matrix (n x p) of covariates.

subjData

Character vector of subject IDs aligned with rows of designMat.

control

List with fields such as OutlierRatio.

data

Data frame used for optional batch-effect QC.

GenoFile

Character. PLINK prefix (without extension) used when sampling markers for QC.

GenoFileIndex

Character. Path to an index file used in QC workflow.

SparseGRMFile

Character. Path to sparse GRM used in QC workflow.

SurvTimeColumn

Character. Column name in data containing survival time.

IndicatorColumn

Character. Column name in data containing event indicator (0/1).

...

Optional named parameters forwarded to QC (e.g., RefAfFile).