simulate_data: Generate a dataset for estimating individualized treatment...

Description Usage Arguments Value See Also Examples

View source: R/simdata.R

Description

This function generates a simulated dataset for estimating individualized treatment rules. The outcome variable is assumed to follow equation (1) in Section S.1.1 of the supplementary material.

Usage

1
2
3
4
5
6
7
8
9
simulate_data(
  N = 200,
  p = 20,
  K = 4,
  J = 4,
  propensity_func,
  main_func,
  interaction_func
)

Arguments

N

the number of subjects.

p

the number of covariates.

K

the number of treatments.

J

the number of subject groups.

propensity_func

a user-defined function that calculates true propensity scores of assigning each subject to each treatment.
An example of the accepted format of this function can be found in pi.true.

main_func

a user-defined function that calculates main effects of covariates on the outcome for each subject.
An example of the accepted format of this function can be found in mu.true.

interaction_func

a user-defined function that calculates interaction effects of of covariates and treatments on the outcome for each subject.
An example of the accepted format of this function can be found in delta.true.

Value

A matrix containing the following columns of all subjects:

See Also

pi.true for propensity_func, mu.true for main_func, and delta.true for interaction_func.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#######################################
## The simulated dataset in Section S.1.2 of
## the supplementary material for N=200

set.seed(0)
simdata200 = simulate_data(
  N = 200, p = 20, K = 4, J = 4,
  propensity_func = pi.true, # equation (2) in Section S.1.1
  main_func = mu.true, # equation (5) in Section S.1.2
  interaction_func = delta.true # equation (6) in Section S.1.2
)

jitonglou/MultiMlearn documentation built on Dec. 21, 2021, 12:08 a.m.