Learn R Programming

GRAB (version 0.2.4)

GRAB.SimuPheno: Simulate phenotypes from linear predictors

Description

Generates various types of phenotypes (quantitative, binary, ordinal, time-to-event) from linear predictors using appropriate link functions.

Usage

GRAB.SimuPheno(
  eta,
  traitType = "binary",
  control = list(pCase = 0.1, sdError = 1, pEachGroup = c(1, 1, 1), eventRate = 0.1),
  seed = NULL
)

Value

Simulated phenotype vector or data frame:

quantitative

Numeric vector of continuous values.

binary

Numeric vector of 0/1 values.

ordinal

Numeric vector of categorical levels.

time-to-event

Data frame with SurvTime and SurvEvent columns.

Arguments

eta

Vector of linear predictors (typically covariates×beta + genotypes×beta).

traitType

Type of phenotype: "quantitative", "binary", "ordinal", or "time-to-event".

control

List of simulation parameters specific to each trait type:

pCase

Proportion of cases (binary traits).

sdError

Error term standard deviation (quantitative traits).

pEachGroup

Group proportions (ordinal traits).

eventRate

Event rate (time-to-event traits).

seed

Random seed for reproducibility (optional).

Details

Trait Type Details:

  • Quantitative: Y = eta + error, where error ~ N(0, sdError²)

  • Binary: Logistic model with specified case proportion

  • Ordinal: Proportional odds model with specified group proportions

  • Time-to-event: Weibull survival model with specified event rate

For more details, see: https://wenjianbi.github.io/grab.github.io/docs/simulation_phenotype.html