gdataM: Simulates data from an observational study according to the...

Description Usage Arguments Value Examples

View source: R/gdataM.R

Description

Simulates data from an observational study according to the following model: 1 + 2*X2 + 4*X4 + beta1*trt*subgrp + beta2*(1-trt)*(1-subgrp) + N(0,1) where subgrp is the group of interacting variable(s). If depth=1, then subgrp=(X1 < 0.5) If depth!=1 then subgrp=(X1>0.3 & X3>0.1)

Usage

1
gdataM(n, depth, beta1, beta2)

Arguments

n

size of the dataset to be generate. Required input.

depth

gives the number of interacting covariates. If set to 1, then then covariate X1 interacts with treatment. If set to another value, then covariates X1 and X3 both interact with treatment effect (one-way interactions). Required input.

beta1

controls the strength of the treatment effect. Required input.

beta2

controls the strength of the noise. Required input.

Value

dataframe containing y (outcome), X1-X4 (covariates), trt (treatment), prtx (probability of being in treatment group)

Examples

1
2
3
data<-gdataM(n=500, depth=1, beta1=1, beta2=2)
This generates a dataframe with 500 observations, X1 as the only variable interacting with 
the treatment, and a signal to noise ratio of 1/2.

jinjinzhou/ITR.Tree documentation built on May 19, 2019, 10:36 a.m.