simulated_data: Simulated data for generating response

View source: R/simulated_data.R

simulated_dataR Documentation

Simulated data for generating response

Description

Generate simulated response.

Usage

simulated_data(
  G,
  E,
  alpha,
  beta,
  error,
  family = c("continuous", "survival"),
  a1 = NULL,
  a2 = NULL
)

Arguments

G

Input matrix of p genetic (G) measurements consisting of n rows. Each row is an observation vector.

E

Input matrix of q environmental (E) risk factors. Each row is an observation vector.

alpha

Matrix of the true coefficients for main E effects.

beta

Matrix of the true regression coefficients for all main G effects (the first row) and interactions.

error

Error terms.

family

Type of the response variable. If family="continuous", a quantitative vector is generated. If family="survival", a two-column matrix with the first column being the log(survival time) and the second column being the censoring indicator is generated.The indicator is a binary variable, with "1" indicating dead, and "0" indicating right censored.

a1

If family="survival", we generate the censoring time from a uniform distribution where a1 is the left endpoint.

a2

If family="survival", we generate the censoring time from a uniform distribution where a2 is the right endpoint.

Value

Response variable. A quantitative vector for family="continuous". For family="survival", it would be a two-column matrix with the first column being the log(survival time) and the second column being the censoring indicator. The indicator is a binary variable, with "1" indicating dead, and "0" indicating right censored.


GEInter documentation built on May 20, 2022, 1:17 a.m.