Title: | Prediction of Therapeutic Success |
---|---|
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. |
Authors: | Wim Van der Elst, Ariel Alonso & Geert Molenberghs |
Maintainer: | Wim Van der Elst <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.1 |
Built: | 2025-02-10 03:12:31 UTC |
Source: | https://github.com/cran/EffectTreat |
This function provides a diagram that depicts the estimable correlations and
, and median of the correlation
for a specified range of values of the predictive causal association (PCA;
).
CausalPCA.ContCont(x, Min=-1, Max=1, Cex.Letters=3, Cex.Corrs=2, Lines.Rel.Width=TRUE, Col.Pos.Neg=TRUE)
CausalPCA.ContCont(x, Min=-1, Max=1, Cex.Letters=3, Cex.Corrs=2, Lines.Rel.Width=TRUE, Col.Pos.Neg=TRUE)
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 |
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
# 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)
# 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)
Example.Data is a hypothetical dataset constructed to demonstrate some of the functions in the package.
data(Example.Data)
data(Example.Data)
A data.frame
with observations on
variables.
Id
The Patient ID.
Treat
The treatment indicator, coded as = control and
= experimental.
T
The most credible outcome to assess therapeutic success.
S
The potential pretreatment predictor.
The function GoodPretreatContCont
examines the plausibility of finding a good pretreatment predictor in the continuous-continuous setting. For details, see Alonso et al. (submitted).
GoodPretreatContCont(T0T0, T1T1, Delta, T0T1=seq(from=0, to=1, by=.01))
GoodPretreatContCont(T0T0, T1T1, Delta, T0T1=seq(from=0, to=1, by=.01))
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 |
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 |
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
# 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)
# 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)
The function Min.Max.Multivar.PCA
computes the minimum and maximum values for the multivariate predictive causal association (PCA) in the continuous-continuous case.
Min.Max.Multivar.PCA(gamma, Sigma_SS, Sigma_T0T0, Sigma_T1T1)
Min.Max.Multivar.PCA(gamma, Sigma_SS, Sigma_T0T0, Sigma_T1T1)
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 |
Wim Van der Elst & Ariel Alonso
Alonso, A., & Van der Elst, W. (submitted). Evaluating multivariate predictors of therapeutic success: a causal inference approach.
# 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)
# 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)
for desired prediction accuracyComputes the minimum needed to achieve the desired prediction accuracy for the set of pretreatment predictors.
Min.R2.delta(delta, Sigma_T0T0, Sigma_T1T1)
Min.R2.delta(delta, Sigma_T0T0, Sigma_T1T1)
delta |
The vector of |
Sigma_T0T0 |
The variance of |
Sigma_T1T1 |
The variance of |
Wim Van der Elst, Ariel Alonso & Geert Molenberghs
Alonso, A., Van der Elst, W., Luaces, P., Sanchez, L., & Molenberghs, G. (submitted). Evaluating multivariate predictors of therapeutic success: a causal inference approach.
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)
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)
The function Multivar.PCA.ContCont
computes the predictive causal association (PCA) when = the vector of pretreatment predictors and
= the True endpoint. All
and
should be continuous normally distributed endpoints. See Details below.
Multivar.PCA.ContCont(Sigma_TT, Sigma_TS, Sigma_SS, T0T1=seq(-1, 1, by=.01), M=NA)
Multivar.PCA.ContCont(Sigma_TT, Sigma_TS, Sigma_SS, T0T1=seq(-1, 1, by=.01), M=NA)
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 |
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 |
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
Alonso, A., & Van der Elst, W. (submitted). Evaluating multivariate predictors of therapeutic success: a causal inference approach.
# 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)
# 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)
The function PCA.ContCont
computes the predictive causal association (PCA) when =pretreatment predictor and
=True endpoint are continuous normally distributed endpoints. See Details below.
PCA.ContCont(T0S, T1S, T0T0=1, T1T1=1, SS=1, T0T1=seq(-1, 1, by=.01))
PCA.ContCont(T0S, T1S, T0T0=1, T1T1=1, SS=1, T0T1=seq(-1, 1, by=.01))
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 |
Based on the causal-inference framework, it is assumed that each subject j has two counterfactuals (or potential outcomes), i.e., and
(the counterfactuals for the true endpoint (
) under the control (
) and the experimental (
) treatments of subject j, respectively). The individual causal effects of
on
for a given subject j is then defined as
.
The correlation between the individual causal effect of on
and
(the pretreatment predictor) equals (for details, see Alonso et al., submitted):
where the correlation 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 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 ,
, identifies the matrices that are positive definite (i.e., valid correlation matrices), and computes
for each of these matrices. The obtained vector of
values can subsequently be used to e.g., conduct a sensitivity analysis.
Notes
A single value is obtained when all correlations in the function call are scalars.
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 |
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
# 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
# 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
This function provides a plot that displays the frequencies, percentages, or cumulative percentages of for a fixed value of
(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
; see
GoodPretreatContCont
). For details, see the online appendix of Alonso et al., submitted.
## 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)), ...)
## 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)), ...)
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 |
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
# 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)
# 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)
as a function of
.
This function plots as a function of
(in the multivariate case).
## S3 method for class 'Min.R2.delta' plot(x, Ylab, Main="", Ylim=c(0, 1), ...)
## S3 method for class 'Min.R2.delta' plot(x, Ylab, Main="", Ylim=c(0, 1), ...)
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 |
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
Alonso, A., Van der Elst, W., Luaces, P., Sanchez, L., & Molenberghs, G. (submitted). Evaluating multivariate predictors of therapeutic success: a causal inference approach.
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)
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)
This function provides a plot that displays the frequencies, percentages, or cumulative percentages of the Predictive Causal Association (PCA; ,
). 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).
## 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, ...)
## 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, ...)
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 |
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
# 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")
# 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 |
and the
% CIs for the mean and median
values (and optionally, for other user-requested
values).
## 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, ...)
## 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, ...)
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 |
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
# 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))
# 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))
for a specific assumed correlation between the counterfactuals.Plots the distribution of |
and the
% CIs for a user-requested
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 value (rather than a vector of
values), and thus the plot automatically uses the considered
value in the object
x
to compute the % CI for
|
.
## S3 method for class 'Predict.Treat.T0T1.ContCont' plot(x, Xlab, Main, alpha=0.05, Cex.Legend=1, ...)
## S3 method for class 'Predict.Treat.T0T1.ContCont' plot(x, Xlab, Main, alpha=0.05, Cex.Legend=1, ...)
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 |
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
# 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))
# 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))
This function computes the predicted of a patient based on the pretreatment value
of a patient in the continuous-continuous setting.
Predict.Treat.ContCont(x, S, Beta, SS, mu_S)
Predict.Treat.ContCont(x, S, Beta, SS, mu_S)
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). |
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 |
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
# 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)
# 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)
This function computes the predicted of a patient based on the vector of pretreatment values
of a patient in the continuous-continuous setting.
Predict.Treat.Multivar.ContCont(Sigma_TT, Sigma_TS, Sigma_SS, Beta, S, mu_S, T0T1=seq(-1, 1, by=.01))
Predict.Treat.Multivar.ContCont(Sigma_TT, Sigma_TS, Sigma_SS, Beta, S, mu_S, T0T1=seq(-1, 1, by=.01))
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 |
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 |
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
Alonso, A., & Van der Elst, W. (submitted). Evaluating multivariate predictors of therapeutic success: a causal inference approach.
PCA.ContCont, Multivar.PCA.ContCont
# 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)
# 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)
.
This function computes the predicted of a patient based on the pretreatment value
of a patient in the continuous-continuous setting for a particular (single) value of rho_T0T1.
Predict.Treat.T0T1.ContCont(x, S, Beta, SS, mu_S, T0T1, alpha=0.05)
Predict.Treat.T0T1.ContCont(x, S, Beta, SS, mu_S, T0T1, alpha=0.05)
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 |
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 |
Wim Van der Elst, Ariel Alonso, & Geert Molenberghs
Alonso, A., Van der Elst, W., & Molenberghs, G. (submitted). Validating predictors of therapeutic success: a causal inference approach.
# 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)
# 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)