sampleData: Simulate data with binary or time-to-event outcome

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/sampleData.R

Description

Simulate data with binary outcome and 10 covariates.

Usage

1
2
3
4
sampleData(n,outcome="competing.risks",
formula= ~ f(X1,2)+f(X2,-0.033)+f(X3,0.4)+f(X6,.1)+f(X7,-.1)+f(X8,.5)+f(X9,-1))
sampleDataTD(n,n.intervals=5,outcome="competing.risks",
formula= ~ f(X1,2)+f(X2,-0.033)+f(X3,0.4)+f(X6,.1)+f(X7,-.1)+f(X8,.5)+f(X9,-1))

Arguments

n

Sample size

outcome

Character vector. Response variables are generated according to keywords: "binary" = binary response, "survival" = survival response, "competing.risks" = competing risks response

formula

Specify regression coefficients

n.intervals

sampleDataTD only: the maximum number of episodes in which the covariates are updated.

Details

For the actual lava::regression parameters see the function definition.

Value

Simulated data as data.table with n rows and the following columns: Y (binary outcome), time (non-binary outcome), event (non-binary outcome), X1-X5 (binary predictors), X6-X10 (continous predictors)

Author(s)

Thomas A. Gerds <[email protected]>

See Also

lvm

Examples

1
2
3
sampleData(10,outcome="binary")
sampleData(10,outcome="survival")
sampleData(10,outcome="competing.risks")

riskRegression documentation built on Oct. 5, 2018, 1:03 a.m.