cb.sims.sim_sigmoid {causalBatch} | R Documentation |
Sigmoidal Simulation
Description
Sigmoidal Simulation
Usage
cb.sims.sim_sigmoid(
n = 100,
pi = 0.5,
eff_sz = 1,
alpha = 2,
unbalancedness = 1,
null = FALSE,
a = -4,
b = 8,
err = 1/2,
nbreaks = 200
)
Arguments
n |
the number of samples. Defaults to |
pi |
the balance between the classes, where samples will be from group 1
with probability |
eff_sz |
the treatment effect between the different groups. Defaults to |
alpha |
the alpha for the covariate sampling procedure. Defaults to |
unbalancedness |
the level of covariate dissimilarity between the covariates
for each of the groups. Defaults to |
null |
whether to generate a null simulation. Defaults to |
a |
the first parameter for the covariate/outcome relationship. Defaults to |
b |
the second parameter for the covariate/outcome relationship. Defaults to |
err |
the level of noise for the simulation. Defaults to |
nbreaks |
the number of breakpoints for computing the expected outcome at a given covariate level
for each batch. Defaults to |
Value
a list, containing the following:
Y |
an |
Ts |
an |
Xs |
an |
Eps |
an |
x.bounds |
the theoretical bounds for the covariate values. |
Ytrue |
an |
Ttrue |
an |
Xtrue |
an |
Overlap |
the theoretical degree of overlap between the covariate distributions for each of the two groups/batches. |
Details
A sigmoidal relationship between the covariate and the outcome. The first dimension of the outcome is:
Y_i = a\times \text{sigmoid}(b \times X_i) - a - \text{eff\_sz} \times T_i + \frac{1}{2} \epsilon_i
where the batch/group labels are:
T_i \overset{iid}{\sim} Bern(\pi)
The beta coefficient for the covariate sampling is:
\beta = \alpha \times \text{unbalancedness}
The covariate values for the first batch are:
X_i | T_i = 0 \overset{ind}{\sim} 2 Beta(\alpha, \beta) - 1
and the covariate values for the second batch are:
X_i | T_i = 1 \overset{ind}{\sim} 2 Beta(\beta, \alpha) - 1
Finally, the error terms are:
\epsilon_i \overset{iid}{\sim} Norm(0, \text{err}^2)
For more details see the help vignette:
vignette("causal_simulations", package = "causalBatch")
Author(s)
Eric W. Bridgeford
References
Eric W. Bridgeford, et al. "A Causal Perspective for Batch Effects: When is no answer better than a wrong answer?" Biorxiv (2024).
Examples
library(causalBatch)
sim = cb.sims.sim_sigmoid()