Description Usage Arguments Details Value
The exposure is generated as a function of the confounders and the response is then generated as a function of the exposure and the confounders
1 2 3 | simulate_UC(obs, orUE, probE_0, probY_0, orEY_0, probU, modUB, orME, orMY_0,
rho, orUEy_0 = NULL, method = c("continuous_confounder",
"no_continuous_confounder"))
|
obs |
the number of observations in the simulated data (number of rows) |
orUE |
the odds ratio OR(ue) |
probE_0 |
probability that E=1 when (all confounders)= 0 |
probY_0 |
p(y=1/exposure=0 & confounders=0) |
orEY_0 |
odds ratio OR(ey) |
probU |
p(u=1) prevalence of the binary unmeasured confounder |
modUB |
moderating effect of the UC on OR(ey) |
orME |
odds ratio OR(me) |
orMY_0 |
odds ratio OR(my/e=0) |
rho |
correlation coefficient between U1 and U2 |
orUEy_0 |
|
method |
The binary confounder is labeled "U1" and the continuous "U2". Confounders can be correlated, using the 'rho' argument. Linear moderation can also be introduced via the 'modUB' argument between the continuous confounder and the exposure/outcome.
The method argument specifies how the exposure (E) and outcome (Y) variables are generated. The "continuous_confounder" option means that E and Y are based on both the binary and continuous confounder. The "no_continuous_confounder" option means that E and Y are a function of just the binary confounder. If this is selected, the unmeasured confounder U2 is still generated and may be correlated with U1, although it will be uncorrelated with both E and Y.
object of class 'UCsims' which is a list containing a dataframe of the simulated data, a vector of parameter values and the method.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.