cb.sims.sim_impulse_asycov {causalBatch} | R Documentation |
Impulse Simulation with Asymmetric Covariates
Description
Impulse Simulation with Asymmetric Covariates
Usage
cb.sims.sim_impulse_asycov(
n = 100,
pi = 0.5,
eff_sz = 1,
alpha = 2,
unbalancedness = 1,
null = FALSE,
a = -0.5,
b = 1/2,
c = 4,
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 |
c |
the third 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:
Ys |
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 = c \times \phi(X_i, \mu = a, \sigma = b) - \text{eff\_sz} \times T_i + \frac{1}{2} \epsilon_i
where \phi(x, \mu, \sigma)
is the probability density function for the normal distribution with
mean \mu
and standard deviation \sigma
.
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 asymmetric, in that for the first batch:
X_i | T_i = 0 \overset{ind}{\sim} 2 Beta(\alpha, \alpha) - 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_impulse_asycov()