Description Usage Arguments Details Value Author(s) References Examples
Generates a run of simulated observations of the form (W,X,Y) to investigate the "effect" of X on Y taking W into account.
1 2 3 |
n |
An |
O |
A 3x3 numeric
|
lambda0 |
A |
p |
A |
omega |
A |
Sigma1 |
A 2x2 covariance |
sigma2 |
A positive |
Sigma3 |
A 2x2 covariance |
f |
A |
verbose |
Prescribes the amount of information output by the function. Defaults to
|
The parameter of interest is defined as ψ=Ψ(P) with
Ψ(P) = E_P[f(X-x_0) * (θ(X,W) - θ(x_0,W))] / E_P[f(X-x_0)^2],
with P the
distribution of the random vector (W,X,Y), θ(X,W) =
E_P[Y|X,W], x_0 the reference value for X, and f
a user-supplied function such that f(0)=0 (e.g.,
f=identity, the default value). The value ψ is
obtained using the known θ and the joint
empirical distribution of (X,W) based on the same run of
observations as in obs
. Seeing W, X, Y as DNA
methylation, DNA copy number and gene expression, respectively, the
simulation scheme implements the following constraints:
There are two or three copy number classes: normal regions
(k=2
), and regions of copy number gains and/or losses
(k=1
and/or k=3
).
In normal regions, gene expression levels are negatively correlated with DNA methylation.
In regions of copy number alteration, copy number and expression are positively correlated.
Returns a list with the following tags:
obs |
A |
psi |
A |
g |
A |
mu |
A |
muAux |
A |
theta |
A |
theta0 |
A |
sigma2 |
A positive |
effIC |
A |
varIC |
A positive |
Antoine Chambaz, Pierre Neuvial
Chambaz, A., Neuvial, P., & van der Laan, M. J. (2012). Estimation of a non-parametric variable importance measure of a continuous exposure. Electronic journal of statistics, 6, 1059–1099.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | ## Parameters for the simulation (case 'f=identity')
O <- cbind(W=c(0.05218652, 0.01113460),
X=c(2.722713, 9.362432),
Y=c(-0.4569579, 1.2470822))
O <- rbind(NA, O)
lambda0 <- function(W) {-W}
p <- c(0, 1/2, 1/2)
omega <- c(0, 3, 3)
S <- matrix(c(10, 1, 1, 0.5), 2 ,2)
## Simulating a data set of 200 i.i.d. observations
sim <- getSample(2e2, O, lambda0, p=p, omega=omega, sigma2=1, Sigma3=S)
str(sim)
obs <- sim$obs
head(obs)
pairs(obs)
## Adding (dummy) baseline covariates
V <- matrix(runif(3*nrow(obs)), ncol=3)
colnames(V) <- paste("V", 1:3, sep="")
obsV <- cbind(V, obs)
head(obsV)
## True psi and confidence intervals (case 'f=identity')
sim01 <- getSample(1e4, O, lambda0, p=p, omega=omega, sigma2=1, Sigma3=S)
truePsi1 <- sim01$psi
confInt01 <- truePsi1+c(-1, 1)*qnorm(.975)*sqrt(sim01$varIC/nrow(sim01$obs))
confInt1 <- truePsi1+c(-1, 1)*qnorm(.975)*sqrt(sim01$varIC/nrow(obs))
msg <- "\nCase f=identity:\n"
msg <- c(msg, "\ttrue psi is: ", paste(signif(truePsi1, 3)), "\n")
msg <- c(msg, "\t95%-confidence interval for the approximation is: ",
paste(signif(confInt01, 3)), "\n")
msg <- c(msg, "\toptimal 95%-confidence interval is: ",
paste(signif(confInt1, 3)), "\n")
cat(msg)
## True psi and confidence intervals (case 'f=atan')
f2 <- function(x) {1*atan(x/1)}
sim02 <- getSample(1e4, O, lambda0, p=p, omega=omega, sigma2=1, Sigma3=S, f=f2);
truePsi2 <- sim02$psi;
confInt02 <- truePsi2+c(-1, 1)*qnorm(.975)*sqrt(sim02$varIC/nrow(sim02$obs))
confInt2 <- truePsi2+c(-1, 1)*qnorm(.975)*sqrt(sim02$varIC/nrow(obs))
msg <- "\nCase f=atan:\n"
msg <- c(msg, "\ttrue psi is: ", paste(signif(truePsi2, 3)), "\n")
msg <- c(msg, "\t95%-confidence interval for the approximation is: ",
paste(signif(confInt02, 3)), "\n")
msg <- c(msg, "\toptimal 95%-confidence interval is: ",
paste(signif(confInt2, 3)), "\n")
cat(msg)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.