GenerateSyntheticData {RCTrep}R Documentation

Generating the synthetic RCT data given marginal distribution of each covariate

Description

Generating the synthetic RCT data given marginal distribution of each covariate

Usage

GenerateSyntheticData(margin_dis, N, margin, var_name, pw.cor = 0)

Arguments

margin_dis

a character indicating the distribution of each variable, allowable options are "bernoulli_categorical" and "bernoulli". If some variables have two categories and some have more than two categories, "bernoulli_categorical" should be specified; if all variables have two categories, "bernoulli" should be specified

N

a numeric value specifying the sample size for the simulated data

margin

a list containing the marginal distribution of variables; if margin_dis="bernoulli_categorical", then margin should be list(x1=c("x1",nlevels(x1),level1, level2,...,leveln, plevel1, plevel2,...,plevel3), x2=c("x2",...)); if margin_dis="bernoulli", margin=list(p(x1=1),p(x2=1),...,p(xn=1))

var_name

a vector indicating the name of variables, the order of variables should be aligned with margin

pw.cor

a vector specifying the pairwise correlations of the variables, default is 0; when margin_dis="bernoulli", then pw.cor must be specified.

Value

a data frame with columns names x1, x2,....


[Package RCTrep version 1.2.0 Index]