Type: | Package |
Title: | Prediction of Therapeutic Success |
Version: | 1.1 |
Author: | Wim Van der Elst, Ariel Alonso & Geert Molenberghs |
Maintainer: | Wim Van der Elst <Wim.vanderelst@gmail.com> |
Description: | In personalized medicine, one wants to know, for a given patient and his or her outcome for a predictor (pre-treatment variable), how likely it is that a treatment will be more beneficial than an alternative treatment. This package allows for the quantification of the predictive causal association (i.e., the association between the predictor variable and the individual causal effect of the treatment) and related metrics. Part of this software has been developed using funding provided from the European Union's 7th Framework Programme for research, technological development and demonstration under Grant Agreement no 602552. |
Imports: | methods |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Repository: | CRAN |
NeedsCompilation: | no |
Packaged: | 2020-07-04 08:24:39 UTC; wim |
Date/Publication: | 2020-07-04 21:30:03 UTC |
Show a causal diagram of the median correlation between the counterfactuals in the continuous-continuous setting
Description
This function provides a diagram that depicts the estimable correlations \rho(_{T_0, S})
and \rho(_{T_1, S})
, and median of the correlation \rho(_{T_0, T_1})
for a specified range of values of the predictive causal association (PCA; \rho_{\psi}
).
Usage
CausalPCA.ContCont(x, Min=-1, Max=1, Cex.Letters=3, Cex.Corrs=2,
Lines.Rel.Width=TRUE, Col.Pos.Neg=TRUE)
Arguments
x |
An object of class |
Min |
The minimum values of the PCA that should be considered. Default= |
Max |
The maximum values of the PCA that should be considered. Default= |
Cex.Letters |
The size of the symbols for |
Cex.Corrs |
The size of the text depicting the (median) correlations in the diagram. Default= |
Lines.Rel.Width |
Logical. When |
Col.Pos.Neg |
Logical. When |
Author(s)
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
References
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
See Also
Examples
# Generate the vector of PCA.ContCont values when rho_T0S=.3, rho_T1S=.9,
# sigma_T0T0=2, sigma_T1T1=2,sigma_SS=2, and the grid of values {-1, -.99,
# ..., 1} is considered for the correlations between T0 and T1:
PCA <- PCA.ContCont(T0S=.3, T1S=.9, T0T0=2, T1T1=2, SS=2,
T0T1=seq(-1, 1, by=.01))
# Obtain causal diagram for PCA score range [-1; 1]:
CausalPCA.ContCont(PCA, Min=-1, Max=1)
# Obtain causal diagram for PCA score range [0.5; 1]:
CausalPCA.ContCont(PCA, Min=0.5, Max=1)
An example dataset
Description
Example.Data is a hypothetical dataset constructed to demonstrate some of the functions in the package.
Usage
data(Example.Data)
Format
A data.frame
with 181
observations on 4
variables.
Id
The Patient ID.
Treat
The treatment indicator, coded as
-1
= control and1
= experimental.T
The most credible outcome to assess therapeutic success.
S
The potential pretreatment predictor.
Examine the plausibility of finding a good pretreatment predictor in the Continuous-continuous case
Description
The function GoodPretreatContCont
examines the plausibility of finding a good pretreatment predictor in the continuous-continuous setting. For details, see Alonso et al. (submitted).
Usage
GoodPretreatContCont(T0T0, T1T1, Delta, T0T1=seq(from=0, to=1, by=.01))
Arguments
T0T0 |
A scalar that specifies the variance of the true endpoint in the control treatment condition. |
T1T1 |
A scalar that specifies the variance of the true endpoint in the experimental treatment condition. |
Delta |
A scalar that specifies an upper bound for the prediction mean squared error when predicting the individual causal effect of the treatment on the true endpoint based on the pretreatment predictor. |
T0T1 |
A scalar or vector that contains the correlation(s) between the counterfactuals |
Value
An object of class GoodPretreatContCont
with components,
T0T1 |
A scalar or vector that contains the correlation(s) between the counterfactuals T0 and T1 that were considered (i.e., |
Sigma.Delta.T |
A scalar or vector that contains the standard deviations of the individual causal treatment effects on the true endpoint as a function of |
Rho2.Min |
A scalar or vector that contains the |
Author(s)
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
References
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
See Also
Examples
# Assess the plausibility of finding a good pretreatment predictor when
# sigma_T0T0 = sigma_T1T1 = 8 and Delta = 1
MinPred <- GoodPretreatContCont(T0T0 = 8, T1T1 = 8, Delta = 1)
summary(MinPred)
plot(MinPred)
Minimum and maximum values for the multivariate predictive causal association (PCA) in the continuous-continuous case
Description
The function Min.Max.Multivar.PCA
computes the minimum and maximum values for the multivariate predictive causal association (PCA) in the continuous-continuous case.
Usage
Min.Max.Multivar.PCA(gamma, Sigma_SS, Sigma_T0T0, Sigma_T1T1)
Arguments
gamma |
The vector of regression coefficients for the |
Sigma_SS |
The variance-covariance matrix of the pretreatment predictors. For example, when there are |
Sigma_T0T0 |
The variance of |
Sigma_T1T1 |
The variance of |
Author(s)
Wim Van der Elst & Ariel Alonso
References
Alonso, A., & Van der Elst, W. (submitted). Evaluating multivariate predictors of therapeutic success: a causal inference approach.
Examples
# Specify vector of S by treatment interaction coefficients
gamma <- matrix(data = c(-0.006, -0.002, 0.045), ncol=1)
# Specify variances
Sigma_SS = matrix(data=c(882.352, 49.234, 6.420,
49.234, 411.964, -26.205, 6.420, -26.205, 95.400),
byrow = TRUE, nrow = 3)
Sigma_T0T0 <- 82.274
Sigma_T1T1 <- 96.386
# Compute min and max PCA
Min.Max.Multivar.PCA(gamma=gamma, Sigma_SS=Sigma_SS,
Sigma_T0T0=Sigma_T0T0, Sigma_T1T1=Sigma_T1T1)
Compute minimum R^2_{\delta}
for desired prediction accuracy
Description
Computes the minimum R^2_{\delta}
needed to achieve the desired prediction accuracy for the set of pretreatment predictors.
Usage
Min.R2.delta(delta, Sigma_T0T0, Sigma_T1T1)
Arguments
delta |
The vector of |
Sigma_T0T0 |
The variance of |
Sigma_T1T1 |
The variance of |
Author(s)
Wim Van der Elst, Ariel Alonso & Geert Molenberghs
References
Alonso, A., Van der Elst, W., Luaces, P., Sanchez, L., & Molenberghs, G. (submitted). Evaluating multivariate predictors of therapeutic success: a causal inference approach.
Examples
Fit <- Min.R2.delta(delta = seq(from = 0, to = 250, by=50),
Sigma_T0T0 = 38.606, Sigma_T1T1 = 663.917)
# Explore the results
summary(Fit)
plot(Fit)
Compute the multivariate predictive causal association (PCA) in the Continuous-continuous case
Description
The function Multivar.PCA.ContCont
computes the predictive causal association (PCA) when S
= the vector of pretreatment predictors and T
= the True endpoint. All S
and T
should be continuous normally distributed endpoints. See Details below.
Usage
Multivar.PCA.ContCont(Sigma_TT, Sigma_TS, Sigma_SS, T0T1=seq(-1, 1, by=.01), M=NA)
Arguments
Sigma_TT |
The variance-covariance matrix
|
Sigma_TS |
The matrix that contains the covariances |
Sigma_SS |
The variance-covariance matrix of the pretreatment predictors. For example, when there are |
T0T1 |
A scalar or vector that contains the correlation(s) between the counterfactuals |
M |
If |
Value
An object of class Multivar.PCA.ContCont
with components,
Total.Num.Matrices |
An object of class |
Pos.Def |
A |
PCA |
A scalar or vector that contains the PCA ( |
R2_psi_g |
A |
Author(s)
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
References
Alonso, A., & Van der Elst, W. (submitted). Evaluating multivariate predictors of therapeutic success: a causal inference approach.
Examples
# First specify the covariance matrices to be used
Sigma_TT = matrix(c(177.870, NA, NA, 162.374), byrow=TRUE, nrow=2)
Sigma_TS = matrix(data = c(-45.140, -109.599, 11.290, -56.542,
-106.897, 20.490), byrow = TRUE, nrow = 2)
Sigma_SS = matrix(data=c(840.564, 73.936, -3.333, 73.936, 357.719,
-30.564, -3.333, -30.564, 95.063), byrow = TRUE, nrow = 3)
# Compute PCA
Results <- Multivar.PCA.ContCont(Sigma_TT = Sigma_TT,
Sigma_TS = Sigma_TS, Sigma_SS = Sigma_SS)
# Evaluate results
summary(Results)
plot(Results)
Compute the predictive causal association (PCA) in the Continuous-continuous case
Description
The function PCA.ContCont
computes the predictive causal association (PCA) when S
=pretreatment predictor and T
=True endpoint are continuous normally distributed endpoints. See Details below.
Usage
PCA.ContCont(T0S, T1S, T0T0=1, T1T1=1, SS=1, T0T1=seq(-1, 1, by=.01))
Arguments
T0S |
A scalar or vector that specifies the correlation(s) between the pretreatment predictor and the true endpoint in the control treatment condition that should be considered in the computation of |
T1S |
A scalar or vector that specifies the correlation(s) between the pretreatment predictor and the true endpoint in the experimental treatment condition that should be considered in the computation of |
T0T0 |
A scalar that specifies the variance of the true endpoint in the control treatment condition that should be considered in the computation of |
T1T1 |
A scalar that specifies the variance of the true endpoint in the experimental treatment condition that should be considered in the computation of |
SS |
A scalar that specifies the variance of the pretreatment predictor endpoint. Default 1. |
T0T1 |
A scalar or vector that contains the correlation(s) between the counterfactuals |
Details
Based on the causal-inference framework, it is assumed that each subject j has two counterfactuals (or potential outcomes), i.e., T_{0j}
and T_{1j}
(the counterfactuals for the true endpoint (T
) under the control (Z=0
) and the experimental (Z=1
) treatments of subject j, respectively). The individual causal effects of Z
on T
for a given subject j is then defined as \Delta_{T_{j}}=T_{1j}-T_{0j}
.
The correlation between the individual causal effect of Z
on T
and S_{j}
(the pretreatment predictor) equals (for details, see Alonso et al., submitted):
\rho_{\psi}=\frac{\sqrt{\sigma_{T1T1}}\rho_{T1S}-\sqrt{\sigma_{T0T0}}\rho_{T0S}}{\sqrt{\sigma_{T0T0}+\sigma_{T1T1}-2\sqrt{\sigma_{T0T0}\sigma_{T1T1}}}\rho_{T0T1}},
where the correlation \rho_{T_{0}T_{1}}
is not estimable. It is thus warranted to conduct a sensitivity analysis (by considering vectors of possible values for the correlations between the counterfactuals – rather than point estimates).
When the user specifies a vector of values that should be considered for \rho_{T_{0}T_{1}}
in the above expression, the function PCA.ContCont
constructs all possible matrices that can be formed as based on these values and the estimable quantities \rho_{T_{0}S}
, \rho_{T_{1}S}
, identifies the matrices that are positive definite (i.e., valid correlation matrices), and computes \rho_{\psi}
for each of these matrices. The obtained vector of \rho_{\psi}
values can subsequently be used to e.g., conduct a sensitivity analysis.
Notes
A single \rho_{\psi}
value is obtained when all correlations in the function call are scalars.
Value
An object of class PCA.ContCont
with components,
Total.Num.Matrices |
An object of class |
Pos.Def |
A |
PCA |
A scalar or vector that contains the PCA ( |
GoodSurr |
A |
Author(s)
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
References
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
Examples
# Based on the example dataset
# load data in memory
data(Example.Data)
# compute corr(S, T) in control treatment, gives .77
cor(Example.Data$S[Example.Data$Treat==-1],
Example.Data$T[Example.Data$Treat==-1])
# compute corr(S, T) in experimental treatment, gives .71
cor(Example.Data$S[Example.Data$Treat==1],
Example.Data$T[Example.Data$Treat==1])
# compute var T in control treatment, gives 263.99
var(Example.Data$T[Example.Data$Treat==-1])
# compute var T in experimental treatment, gives 230.64
var(Example.Data$T[Example.Data$Treat==1])
# compute var S, gives 163.65
var(Example.Data$S)
# Generate the vector of PCA.ContCont values using these estimates
# and the grid of values {-1, -.99, ..., 1} for the correlations
# between T0 and T1:
PCA <- PCA.ContCont(T0S=.77, T1S=.71, T0T0=263.99, T1T1=230.65,
SS=163.65, T0T1=seq(-1, 1, by=.01))
# Examine and plot the vector of generated PCA values:
summary(PCA)
plot(PCA)
# Other example
# Generate the vector of PCA.ContCont values when rho_T0S=.3, rho_T1S=.9,
# sigma_T0T0=2, sigma_T1T1=2,sigma_SS=2, and
# the grid of values {-1, -.99, ..., 1} is considered for the correlations
# between T0 and T1:
PCA <- PCA.ContCont(T0S=.3, T1S=.9, T0T0=2, T1T1=2, SS=2,
T0T1=seq(-1, 1, by=.01))
# Examine and plot the vector of generated PCA values:
summary(PCA)
plot(PCA)
# Obtain the positive definite matrices than can be formed as based on the
# specified (vectors) of the correlations (these matrices are used to
# compute the PCA values)
PCA$Pos.Def
Compute the predicted treatment effect on the true endpoint of a patient based on his or her observed pretreatment predictor value in the continuous-continuous setting
Description
This function computes the predicted \Delta T_j
of a patient based on the pretreatment value S_j
of a patient in the continuous-continuous setting.
Usage
Predict.Treat.ContCont(x, S, Beta, SS, mu_S)
Arguments
x |
An object of class |
S |
The observed pretreatment value |
Beta |
The estimated treatment effect on the true endpoint (in the validation sample). |
SS |
The estimated variance of the pretreatment predictor endpoint. |
mu_S |
The estimated mean of the pretreatment predictor (in the validation sample). |
Value
An object of class PCA.Predict.Treat.ContCont
with components,
Pred_T |
The predicted |
Var_Delta.T |
The variance |
T0T1 |
The correlation between the counterfactuals |
PCA |
The vector of |
Var_Delta.T_S |
The variance |
Author(s)
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
References
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
See Also
Examples
# Generate the vector of PCA.ContCont values when rho_T0S=.3, rho_T1S=.9,
# sigma_T0T0=2, sigma_T1T1=2,sigma_SS=2, and the grid of values {-1, -.99,
# ..., 1} is considered for the correlations between T0 and T1:
PCA <- PCA.ContCont(T0S=.3, T1S=.9, T0T0=2, T1T1=2, SS=2,
T0T1=seq(-1, 1, by=.01))
# Obtain the predicted value T for a patient who scores S = 10, using beta=5,
# SS=2, mu_S=4
Predict <- Predict.Treat.ContCont(x=PCA, S=10, Beta=5, SS=2, mu_S=4)
# examine the results
summary(Predict)
# plot Delta_T_j given S_T, for the mean value of the valid rho_T0T1
plot(Predict, Mean.T0T1=TRUE, Median.T0T1=FALSE)
Compute the predicted treatment effect on the true endpoint of a patient based on his or her observed vector of pretreatment predictor values in the continuous-continuous setting
Description
This function computes the predicted \Delta T_j
of a patient based on the vector of pretreatment values \bold{S}_j
of a patient in the continuous-continuous setting.
Usage
Predict.Treat.Multivar.ContCont(Sigma_TT, Sigma_TS, Sigma_SS, Beta,
S, mu_S, T0T1=seq(-1, 1, by=.01))
Arguments
Sigma_TT |
The variance-covariance matrix
|
Sigma_TS |
The matrix that contains the covariances |
Sigma_SS |
The variance-covariance matrix of the pretreatment predictors. For example, when there are |
Beta |
The estimated treatment effect on the true endpoint (in the validation sample). |
S |
The vector of observed pretreatment values |
mu_S |
The vector of estimated means of the pretreatment predictor (in the validation sample). |
T0T1 |
A scalar or vector that contains the correlation(s) between the counterfactuals |
Value
An object of class PCA.Predict.Treat.Multivar.ContCont
with components,
Pred_T |
The predicted |
Var_Delta.T_S |
The variance |
T0T1 |
The correlation between the counterfactuals |
Author(s)
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
References
Alonso, A., & Van der Elst, W. (submitted). Evaluating multivariate predictors of therapeutic success: a causal inference approach.
See Also
PCA.ContCont, Multivar.PCA.ContCont
Examples
# Specify the covariance matrices to be used
Sigma_TT = matrix(c(177.870, NA, NA, 162.374), byrow=TRUE, nrow=2)
Sigma_TS = matrix(data = c(-45.140, -109.599, 11.290, -56.542,
-106.897, 20.490), byrow = TRUE, nrow = 2)
Sigma_SS = matrix(data=c(840.564, 73.936, -3.333, 73.936, 357.719,
-30.564, -3.333, -30.564, 95.063), byrow = TRUE, nrow = 3)
# Specify treatment effect (Beta), means of vector S (mu_s), and
# observed pretreatment variable values for patient (S)
Beta <- -0.9581 # treatment effect
mu_S = matrix(c(66.8149, 84.8393, 25.1939), nrow=3) #means S_1--S_3
S = matrix(c(90, 180, 30), nrow=3) # S_1--S_3 values for a patient
# predict Delta_T based on S
Pred_S <- Predict.Treat.Multivar.ContCont(Sigma_TT=Sigma_TT, Sigma_TS=Sigma_TS,
Sigma_SS=Sigma_SS, Beta=Beta, S=S, mu_S=mu_S, T0T1=seq(-1, 1, by=.01))
# Explore results
summary(Pred_S)
plot(Pred_S)
Compute the predicted treatment effect on the true endpoint of a patient based on his or her observed pretreatment predictor value in the continuous-continuous setting for a particular (single) value of \rho_{T0T1}
.
Description
This function computes the predicted \Delta T_j
of a patient based on the pretreatment value S_j
of a patient in the continuous-continuous setting for a particular (single) value of rho_T0T1.
Usage
Predict.Treat.T0T1.ContCont(x, S, Beta, SS, mu_S, T0T1, alpha=0.05)
Arguments
x |
An object of class |
S |
The observed pretreatment value |
Beta |
The estimated treatment effect on the true endpoint (in the validation sample). |
SS |
The estimated variance of the pretreatment predictor endpoint. |
mu_S |
The estimated mean of the surrogate endpoint (in the validation sample). |
T0T1 |
The |
alpha |
The |
Value
An object of class PCA.Predict.Treat.T0T1.ContCont
with components,
Pred_T |
The predicted |
Var_Delta.T |
The variance |
T0T1 |
The correlation between the counterfactuals |
CI_low |
The lower border of the |
CI_high |
The upper border of the |
Var_Delta.T_S |
The variance |
alpha |
The |
Author(s)
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
References
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
See Also
Examples
# Generate the vector of PCA.ContCont values when rho_T0S=.3, rho_T1S=.9,
# sigma_T0T0=2, sigma_T1T1=2,sigma_SS=2, and the grid of values {-1, -.99,
# ..., 1} is considered for the correlations between T0 and T1:
PCA <- PCA.ContCont(T0S=.3, T1S=.9, T0T0=2, T1T1=2, SS=2,
T0T1=seq(-1, 1, by=.01))
# Obtain the predicted value T for a patient who scores S = 10, using beta=5,
# SS=2, mu_S=4, assuming rho_T0T1=.6
indiv <- Predict.Treat.T0T1.ContCont(x=PCA, S=10, Beta=5, SS=2, mu_S=4, T0T1=.6)
summary(indiv)
# obtain a plot with the 95% CI around delta T_j | S_j (assuming rho_T0T1=.6)
plot(indiv)
Graphically illustrates the theoretical plausibility of finding a good pretreatment predictor in the continuous-continuous case
Description
This function provides a plot that displays the frequencies, percentages, or cumulative percentages of \rho_{min}^{2}
for a fixed value of \delta
(given the observed variances of the true endpoint in the control and experimental treatment conditions and a specified grid of values for the unidentified parameter \rho(_{T_{0},T_{1}})
; see GoodPretreatContCont
). For details, see the online appendix of Alonso et al., submitted.
Usage
## S3 method for class 'GoodPretreatContCont'
plot(x, main, col, Type="Percent", Labels=FALSE,
Par=par(oma=c(0, 0, 0, 0), mar=c(5.1, 4.1, 4.1, 2.1)), ...)
Arguments
x |
An object of class |
main |
The title of the plot. |
col |
The color of the bins. |
Type |
The type of plot that is produced. When |
Labels |
Logical. When |
Par |
Graphical parameters for the plot. Default |
... |
Extra graphical parameters to be passed to |
Author(s)
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
References
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
See Also
Examples
# compute rho^2_min in the setting where the variances of T in the control
# and experimental treatments equal 100 and 120, delta is fixed at 50,
# and the grid G={0, .01, ..., 1} is considered for the counterfactual
# correlation rho_T0T1:
MinPred <- GoodPretreatContCont(T0T0 = 100, T1T1 = 120, Delta = 50,
T0T1 = seq(0, 1, by = 0.01))
# Plot the results (use percentages on Y-axis)
plot(MinPred, Type="Percent")
# Same plot, but add the percentages of ICA values that are equal to or
# larger than the midpoint values of the bins
plot(MinPred, Labels=TRUE)
Plot R^2_{\delta}
as a function of \delta
.
Description
This function plots R^2_{\delta}
as a function of \delta
(in the multivariate case).
Usage
## S3 method for class 'Min.R2.delta'
plot(x, Ylab, Main="", Ylim=c(0, 1), ...)
Arguments
x |
An object of class |
Ylab |
The legend of the Y-axis of the PCA plot. Default |
Main |
The title of the plot. Default " " (no title). |
Ylim |
The limits of the Y-axis. Default |
... |
Extra graphical parameters to be passed to |
Author(s)
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
References
Alonso, A., Van der Elst, W., Luaces, P., Sanchez, L., & Molenberghs, G. (submitted). Evaluating multivariate predictors of therapeutic success: a causal inference approach.
See Also
Examples
Fit <- Min.R2.delta(delta = seq(from = 0, to = 250, by=50),
Sigma_T0T0 = 38.606, Sigma_T1T1 = 663.917)
# Explore the results
summary(Fit)
plot(Fit)
Plots the Predictive Causal Association in the continuous-continuous case
Description
This function provides a plot that displays the frequencies, percentages, or cumulative percentages of the Predictive Causal Association (PCA; \rho_{\psi}
, R^2_{\psi}
). These figures are useful to examine the sensitivity of the obtained results with respect to the assumptions regarding the correlations between the counterfactuals (for details, see Alonso et al., submitted). Optionally, it is also possible to obtain plots that are useful in the examination of the plausibility of finding a good pretreatment predictor (in the univariate case).
Usage
## S3 method for class 'PCA.ContCont'
plot(x, Xlab.PCA, Main.PCA, Type="Percent",
Labels=FALSE, PCA=TRUE, Good.Pretreat=FALSE, EffectT0T1=FALSE,
R2_psi_g=FALSE, Main.Good.Pretreat, Par=par(oma=c(0, 0, 0, 0),
mar=c(5.1, 4.1, 4.1, 2.1)), col, ...)
Arguments
x |
An object of class |
Xlab.PCA |
The legend of the X-axis of the PCA plot. Default |
Main.PCA |
The title of the PCA plot. Default "PCA". |
Type |
The type of plot that is produced. When |
Labels |
Logical. When |
PCA |
Logical. When |
Good.Pretreat |
Logical. When |
EffectT0T1 |
Logical. When |
R2_psi_g |
Logical. When |
Main.Good.Pretreat |
The title of the plot of |
Par |
Graphical parameters for the plot. Default |
col |
The color of the bins. Default |
... |
Extra graphical parameters to be passed to |
Author(s)
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
References
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
See Also
Examples
# Generate the vector of PCA.ContCont values when rho_T0S=.3, rho_T1S=.9,
# sigma_T0T0=2, sigma_T1T1=2,sigma_SS=2, and
# the grid of values {-1, -.99, ..., 1} is considered for the correlations
# between T0 and T1:
PCA <- PCA.ContCont(T0S=.3, T1S=.9, T0T0=2, T1T1=2, SS=2,
T0T1=seq(-1, 1, by=.01))
# Plot the results:
plot(PCA)
# Same plot but add the percentages of PCA values that are equal to or larger
# than the midpoint values of the bins
plot(PCA, Labels=TRUE)
# Plot of the cumulative distribution of PCA
plot(PCA, Typ="CumPerc")
Plots the distribution of the individual causal effect based on S
.
Description
Plots the distribution of \Delta T_j
|S_j
and the 1-\alpha
% CIs for the mean and median \rho_{T0T1}
values (and optionally, for other user-requested \rho_{T0T1}
values).
Usage
## S3 method for class 'Predict.Treat.ContCont'
plot(x, Xlab, Main, Mean.T0T1=FALSE, Median.T0T1=TRUE,
Specific.T0T1="none", alpha=0.05, Cex.Legend=1, ...)
## S3 method for class 'Predict.Treat.Multivar.ContCont'
plot(x, Xlab, Main, Mean.T0T1=FALSE, Median.T0T1=TRUE,
Specific.T0T1="none", alpha=0.05, Cex.Legend=1, ...)
Arguments
x |
An object of class |
Xlab |
The legend of the X-axis of the plot. Default " |
Main |
The title of the PCA plot. Default " ". |
Mean.T0T1 |
Logical. When |
Median.T0T1 |
Logical. When |
Specific.T0T1 |
Optional. A scalar that specifies a particular value |
alpha |
The |
Cex.Legend |
The size of the legend of the plot. Default |
... |
Other arguments to be passed to the |
Author(s)
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
References
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
See Also
Examples
# Generate the vector of PCA.ContCont values when rho_T0S=.3, rho_T1S=.9,
# sigma_T0T0=2, sigma_T1T1=2,sigma_SS=2, and the grid of values {-1, -.99,
# ..., 1} is considered for the correlations between T0 and T1:
PCA <- PCA.ContCont(T0S=.3, T1S=.9, T0T0=2, T1T1=2, SS=2,
T0T1=seq(-1, 1, by=.01))
# Obtain the predicted value T for a patient who scores S = 10, using beta=5,
# SS=2, mu_S=4
Predict <- Predict.Treat.ContCont(x=PCA, S=10, Beta=5, SS=2, mu_S=4)
# examine the results
summary(Predict)
# plot Delta_T_j given S_T and 95% CI based on
# the mean value of the valid rho_T0T1 results
plot(Predict, Mean.T0T1=TRUE, Median.T0T1=FALSE,
xlim=c(4, 13))
# plot Delta_T_j given S_T and 99% CI using
# rho_T0T1=.8
plot(Predict, Mean.T0T1=FALSE, Median.T0T1=FALSE,
Specific.T0T1=.6, alpha=0.01, xlim=c(4, 13))
Plots the distribution of the individual causal effect based on S
for a specific assumed correlation between the counterfactuals.
Description
Plots the distribution of \Delta T_j
|S_j
and the 1-\alpha
% CIs for a user-requested \rho_{T0T1}
value). The function is similar to plot.Predict.Treat.ContCont
, but it is applied to an object of class Predict.Treat.T0T1.ContCont
(rather than to an object of class Predict.Treat.ContCont
). This object contains only one \rho_{T0T1}
value (rather than a vector of \rho_{T0T1}
values), and thus the plot automatically uses the considered \rho_{T0T1}
value in the object x
to compute the 1-\alpha
% CI for \Delta T_j
|S_j
.
Usage
## S3 method for class 'Predict.Treat.T0T1.ContCont'
plot(x, Xlab, Main, alpha=0.05, Cex.Legend=1, ...)
Arguments
x |
An object of class |
Xlab |
The legend of the X-axis of the plot. Default " |
Main |
The title of the PCA plot. Default " ". |
alpha |
The |
Cex.Legend |
The size of the legend of the plot. Default |
... |
Other arguments to be passed to the |
Author(s)
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
References
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
See Also
Examples
# Generate the vector of PCA.ContCont values when rho_T0S=.3, rho_T1S=.9,
# sigma_T0T0=2, sigma_T1T1=2,sigma_SS=2, and the grid of values {-1, -.99,
# ..., 1} is considered for the correlations between T0 and T1:
PCA <- PCA.ContCont(T0S=.3, T1S=.9, T0T0=2, T1T1=2, SS=2,
T0T1=seq(-1, 1, by=.01))
# Obtain the predicted value T for a patient who scores S = 10, using beta=5,
# SS=2, mu_S=4, assuming rho_T0T1=.6
indiv <- Predict.Treat.T0T1.ContCont(x=PCA, S=10, Beta=5, SS=2, mu_S=4, T0T1=.6)
summary(indiv)
# obtain a plot with the 95% CI around delta T_j | S_j (assuming rho_T0T1=.6)
plot(indiv, xlim=c(5, 12))
Summary
Description
summary
Usage
## S3 method for class 'GoodPretreatContCont'
summary(object, ..., Object)
## S3 method for class 'PCA.ContCont'
summary(object, ..., Object)
## S3 method for class 'Predict.Treat.ContCont'
summary(object, ..., Object)
## S3 method for class 'Predict.Treat.T0T1.ContCont'
summary(object, ..., Object)
## S3 method for class 'Multivar.PCA.ContCont'
summary(object, ..., Object)
## S3 method for class 'Predict.Treat.Multivar.ContCont'
summary(object, ..., Object)
## S3 method for class 'Min.R2.delta'
summary(object, ..., Object)