Package 'EffectTreat'

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

Help Index


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 ρ(T0,S)\rho(_{T_0, S}) and ρ(T1,S)\rho(_{T_1, S}), and median of the correlation ρ(T0,T1)\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 PCA.ContCont. See PCA.ContCont.

Min

The minimum values of the PCA that should be considered. Default=1-1.

Max

The maximum values of the PCA that should be considered. Default=11.

Cex.Letters

The size of the symbols for SS, T0T_{0}, and T1T_{1} in the diagram. Default=33.

Cex.Corrs

The size of the text depicting the (median) correlations in the diagram. Default=22.

Lines.Rel.Width

Logical. When Lines.Rel.Width=TRUE, the widths of the lines that represent the correlations in the diagram are relative to the size of the correlations (i.e., a smaller line is used for correlations closer to zero whereas a thicker line is used for (absolute) correlations closer to 11). When Lines.Rel.Width=FALSE, the width of all lines representing the correlations between the counterfactuals is identical. Default=TRUE.

Col.Pos.Neg

Logical. When Col.Pos.Neg=TRUE, the color of the lines that represent the correlations in the diagram is red for negative correlations and black for positive ones. When Col.Pos.Neg=FALSE, all lines are in black. Default=TRUE.

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

PCA.ContCont

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 181181 observations on 44 variables.

Id

The Patient ID.

Treat

The treatment indicator, coded as 1-1 = control and 11 = 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 T0T_0 and T1T_1 that should be considered in the computation of ρmin2\rho_{min}^{2}. Default seq(0, 1, by=.01), i.e., the values 00, 0.010.01, 0.020.02, ..., 11.

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., ρ(T0,T1)\rho(_{T_{0},T_{1}})).

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 ρ(T0,T1)\rho(_{T_{0},T_{1})}.

Rho2.Min

A scalar or vector that contains the ρmin2\rho_{min}^{2} values as a function of ρ(T0,T1)\rho(_{T_{0},T_{1}}).

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

PCA.ContCont

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 SS by treatment interactions.

Sigma_SS

The variance-covariance matrix of the pretreatment predictors. For example, when there are 22 pretreatment predictors ΣSS=(σS1S1σS1S2σS1S2σS2S2)\bold{\Sigma}_{SS}=\left(\begin{array}{cc}\sigma_{S1S1} & \sigma_{S1S2} \\ \sigma_{S1S2} & \sigma_{S2S2}\end{array}\right).

Sigma_T0T0

The variance of TT in the control treatment group.

Sigma_T1T1

The variance of TT in the experimental treatment group.

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δ2R^2_{\delta} for desired prediction accuracy

Description

Computes the minimum Rδ2R^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 δ\delta values to be considered.

Sigma_T0T0

The variance of TT in the control treatment group.

Sigma_T1T1

The variance of TT in the experimental treatment group.

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 SS = the vector of pretreatment predictors and TT = the True endpoint. All SS and TT 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 ΣTT=(σT0T0σT0T1σT0T1σT1T1)\bold{\Sigma}_{TT}=\left(\begin{array}{cc}\sigma_{T0T0} & \sigma_{T0T1} \\ \sigma_{T0T1} & \sigma_{T1T1}\end{array}\right).

Sigma_TS

The matrix that contains the covariances σT0Sr\sigma_{T0Sr}, σT1Sr\sigma_{T1Sr}. For example, when there are 22 pretreatment predictors ΣTS=(σT0S1σT0S2σT1S1σT1S2)\bold{\Sigma}_{TS}=\left(\begin{array}{cc}\sigma_{T0S1} & \sigma_{T0S2} \\ \sigma_{T1S1} & \sigma_{T1S2}\end{array}\right).

Sigma_SS

The variance-covariance matrix of the pretreatment predictors. For example, when there are 22 pretreatment predictors ΣSS=(σS1S1σS1S2σS1S2σS2S2)\bold{\Sigma}_{SS}=\left(\begin{array}{cc}\sigma_{S1S1} & \sigma_{S1S2} \\ \sigma_{S1S2} & \sigma_{S2S2}\end{array}\right).

T0T1

A scalar or vector that contains the correlation(s) between the counterfactuals T0T_0 and T1T_1 that should be considered in the computation of Rψ2R^2_{\psi}. Default seq(-1, 1, by=.01), i.e., the values 1-1, 0.99-0.99, 0.98-0.98, ..., 11.

M

If M=NA, all correlation(s) between the counterfactuals T0T_0 and T1T_1 specified in the argument T0T1 are used to compute Rψ2R^2_{\psi}. If M=m, random draws are taken from T0T1 until m Rψ2R^2_{\psi} are found. Default M=NA.

Value

An object of class Multivar.PCA.ContCont with components,

Total.Num.Matrices

An object of class numeric that contains the total number of matrices that can be formed as based on the user-specified correlations in the function call.

Pos.Def

A data.frame that contains the positive definite matrices that can be formed based on the user-specified correlations. These matrices are used to compute the vector of the Rψ2R^2_{\psi} values.

PCA

A scalar or vector that contains the PCA (Rψ2R^2_{\psi}) value(s).

R2_psi_g

A Data.frame that contains Rψg2R^2_{\psi g}.

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 SS=pretreatment predictor and TT=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 ρψ\rho_{\psi}.

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 ρψ\rho_{\psi}.

T0T0

A scalar that specifies the variance of the true endpoint in the control treatment condition that should be considered in the computation of ρψ\rho_{\psi}. Default 1.

T1T1

A scalar that specifies the variance of the true endpoint in the experimental treatment condition that should be considered in the computation of ρψ\rho_{\psi}. Default 1.

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 T0T_0 and T1T_1 that should be considered in the computation of ρψ\rho_{\psi}. Default seq(-1, 1, by=.01), i.e., the values 1-1, 0.99-0.99, 0.98-0.98, ..., 11.

Details

Based on the causal-inference framework, it is assumed that each subject j has two counterfactuals (or potential outcomes), i.e., T0jT_{0j} and T1jT_{1j} (the counterfactuals for the true endpoint (TT) under the control (Z=0Z=0) and the experimental (Z=1Z=1) treatments of subject j, respectively). The individual causal effects of ZZ on TT for a given subject j is then defined as ΔTj=T1jT0j\Delta_{T_{j}}=T_{1j}-T_{0j}.

The correlation between the individual causal effect of ZZ on TT and SjS_{j} (the pretreatment predictor) equals (for details, see Alonso et al., submitted):

ρψ=σT1T1ρT1SσT0T0ρT0SσT0T0+σT1T12σT0T0σT1T1ρT0T1,\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 ρT0T1\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 ρT0T1\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 ρT0S\rho_{T_{0}S}, ρT1S\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 numeric that contains the total number of matrices that can be formed as based on the user-specified correlations in the function call.

Pos.Def

A data.frame that contains the positive definite matrices that can be formed based on the user-specified correlations. These matrices are used to compute the vector of the ρψ\rho_{\psi} values.

PCA

A scalar or vector that contains the PCA (ρψ\rho_{\psi}) value(s).

GoodSurr

A data.frame that contains the PCA (ρψ\rho_{\psi}), σψT\sigma_{\psi_{T}}, and δ\delta.

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

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 ρmin2\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 ρ(T0,T1)\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 GoodPretreatContCont. See GoodPretreatContCont.

main

The title of the plot.

col

The color of the bins.

Type

The type of plot that is produced. When Type=Freq or Type=Percent, the Y-axis shows frequencies or percentages of ρmin2\rho_{min}^{2}. When Type=CumPerc, the Y-axis shows cumulative percentages of ρmin2\rho_{min}^{2}. Default "Percent".

Labels

Logical. When Labels=TRUE, the percentage of ρmin2\rho_{min}^{2} values that are equal to or larger than the midpoint value of each of the bins are displayed (on top of each bin). Only applies when Type=Freq or Type=Percent. Default FALSE.

Par

Graphical parameters for the plot. Default par(oma=c(0, 0, 0, 0), mar=c(5.1, 4.1, 4.1, 2.1)).

...

Extra graphical parameters to be passed to hist().

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

GoodPretreatContCont

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δ2R^2_{\delta} as a function of δ\delta.

Description

This function plots Rδ2R^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 plot.Min.R2.delta. See Min.R2.delta.

Ylab

The legend of the Y-axis of the PCA plot. Default Rδ2R^2_{\delta}.

Main

The title of the plot. Default " " (no title).

Ylim

The limits of the Y-axis. Default Ylim=c(0, 1).

...

Extra graphical parameters to be passed to plot().

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

Min.R2.delta

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ψ2R^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 PCA.ContCont or Multivar.PCA.ContCont. See PCA.ContCont and Multivar.PCA.ContCont.

Xlab.PCA

The legend of the X-axis of the PCA plot. Default ρψ\rho_{\psi} (univariate predictor case) or Rψ2R^2_{\psi} (multivariate predictor case).

Main.PCA

The title of the PCA plot. Default "PCA".

Type

The type of plot that is produced. When Type=Freq or Type=Percent, the Y-axis shows frequencies or percentages of PCA and/or δ\delta. When Type=CumPerc, the Y-axis shows cumulative percentages of PCA and/or δ\delta. Default "Percent".

Labels

Logical. When Labels=TRUE, the percentage of ρψ\rho_{\psi}, Rψ2R^2_{\psi} and/or δ\delta values that are equal to or larger than the midpoint value of each of the bins are displayed (on top of each bin). Default FALSE.

PCA

Logical. When PCA=TRUE, a plot of the PCA is provided. Default TRUE.

Good.Pretreat

Logical. When Good.Pretreat=TRUE, a plot of δ\delta is provided. This plot is useful in the context of examinating the plausibility of finding a good pretretment predictor endpoint. For details, see Alonso et al. (submitted). Can only be requested for fitted objects of class object of class PCA.ContCont. Default FALSE.

EffectT0T1

Logical. When EffectT0T1=TRUE, a plot depicting the relation between ρ[T0T1]\rho[T0T1] and PCA is provided. Default FALSE.

R2_psi_g

Logical. When R2_psi_g=TRUE, a plot depicting the relation between ρ[T0T1]\rho[T0T1] and Rψg2R^2_{\psi g} is provided. Default FALSE.

Main.Good.Pretreat

The title of the plot of δ\delta. For details, see Alonso et al. (submitted).

Par

Graphical parameters for the plot. Default par(oma=c(0, 0, 0, 0), mar=c(5.1, 4.1, 4.1, 2.1)).

col

The color of the bins. Default col <- c(8).

...

Extra graphical parameters to be passed to hist() or plot().

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

PCA.ContCont

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 SS.

Description

Plots the distribution of ΔTj\Delta T_j|SjS_j and the 1α1-\alpha% CIs for the mean and median ρT0T1\rho_{T0T1} values (and optionally, for other user-requested ρT0T1\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 Predict.Treat.ContCont or Predict.Treat.Multivar.ContCont. See Predict.Treat.ContCont or Predict.Treat.Multivar.ContCont.

Xlab

The legend of the X-axis of the plot. Default "ΔTj\Delta T_j|SjS_j".

Main

The title of the PCA plot. Default " ".

Mean.T0T1

Logical. When Mean.T0T1=TRUE, the 1α1-\alpha% CI for the mean ρT0T1\rho_{T0T1} value (i.e., the mean of all valid ρT0T1\rho_{T0T1} values in x) is shown. Default FALSE.

Median.T0T1

Logical. When Median.T0T1=TRUE, the 1α1-\alpha% CI for the median ρT0T1\rho_{T0T1} value is shown. Default TRUE.

Specific.T0T1

Optional. A scalar that specifies a particular value ρT0T1\rho_{T0T1} for which the 1α1-\alpha% CI is shown. Default "none".

alpha

The α\alpha level to be used in the computation of the CIs. Default 0.050.05.

Cex.Legend

The size of the legend of the plot. Default 11.

...

Other arguments to be passed to the plot()plot() function.

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

Predict.Treat.ContCont

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 SS for a specific assumed correlation between the counterfactuals.

Description

Plots the distribution of ΔTj\Delta T_j|SjS_j and the 1α1-\alpha% CIs for a user-requested ρT0T1\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 ρT0T1\rho_{T0T1} value (rather than a vector of ρT0T1\rho_{T0T1} values), and thus the plot automatically uses the considered ρT0T1\rho_{T0T1} value in the object x to compute the 1α1-\alpha% CI for ΔTj\Delta T_j|SjS_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 Predict.Treat.T0T1.ContCont. See Predict.Treat.T0T1.ContCont.

Xlab

The legend of the X-axis of the plot. Default "ΔTj\Delta T_j|SjS_j".

Main

The title of the PCA plot. Default " ".

alpha

The α\alpha level to be used in the computation of the CIs. Default 0.050.05.

Cex.Legend

The size of the legend of the plot. Default 11.

...

Other arguments to be passed to the plot()plot() function.

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

Predict.Treat.T0T1.ContCont

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))

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 ΔTj\Delta T_j of a patient based on the pretreatment value SjS_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 PCA.ContCont. See PCA.ContCont.

S

The observed pretreatment value SjS_j for a patient.

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 ΔTj\Delta T_j.

Var_Delta.T

The variance σΔT.\sigma_{\Delta_{T}}.

T0T1

The correlation between the counterfactuals T0T_{0}, T1T_{1}.

PCA

The vector of ρψ\rho_{\psi} values.

Var_Delta.T_S

The variance σΔT\sigma_{\Delta_{T}}|SjS_j.

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

PCA.ContCont

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 ΔTj\Delta T_j of a patient based on the vector of pretreatment values Sj\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 ΣTT=(σT0T0σT0T1σT0T1σT1T1)\bold{\Sigma}_{TT}=\left(\begin{array}{cc}\sigma_{T0T0} & \sigma_{T0T1} \\ \sigma_{T0T1} & \sigma_{T1T1}\end{array}\right).

Sigma_TS

The matrix that contains the covariances σT0Sr\sigma_{T0Sr}, σT1Sr\sigma_{T1Sr}. For example, when there are 22 pretreatment predictors ΣTS=(σT0S1σT0S2σT1S1σT1S2)\bold{\Sigma}_{TS}=\left(\begin{array}{cc}\sigma_{T0S1} & \sigma_{T0S2} \\ \sigma_{T1S1} & \sigma_{T1S2}\end{array}\right).

Sigma_SS

The variance-covariance matrix of the pretreatment predictors. For example, when there are 22 pretreatment predictors ΣSS=(σS1S1σS1S2σS1S2σS2S2)\bold{\Sigma}_{SS}=\left(\begin{array}{cc}\sigma_{S1S1} & \sigma_{S1S2} \\ \sigma_{S1S2} & \sigma_{S2S2}\end{array}\right).

Beta

The estimated treatment effect on the true endpoint (in the validation sample).

S

The vector of observed pretreatment values Sj\bold{S}_j for a patient.

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 T0T_0 and T1T_1 that should be considered in the computation of ρψ\rho_{\psi}. Default seq(-1, 1, by=.01), i.e., the values 1-1, 0.99-0.99, 0.98-0.98, ..., 11.

Value

An object of class PCA.Predict.Treat.Multivar.ContCont with components,

Pred_T

The predicted ΔTj\Delta T_j.

Var_Delta.T_S

The variance σΔT\sigma_{\Delta_{T}}|SjS_j.

T0T1

The correlation between the counterfactuals T0T_{0}, T1T_{1}.

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 ρT0T1\rho_{T0T1}.

Description

This function computes the predicted ΔTj\Delta T_j of a patient based on the pretreatment value SjS_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 PCA.ContCont. See PCA.ContCont.

S

The observed pretreatment value SjS_j for a patient.

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 ρT0T1\rho_{T0T1} value (used to compute the variance of ΔTj\Delta T_j|SjS_j.

alpha

The α\alpha-level that is used to determine the confidence interval around ΔTj\Delta T_j|SjS_j. Default 0.050.05.

Value

An object of class PCA.Predict.Treat.T0T1.ContCont with components,

Pred_T

The predicted ΔTj\Delta T_j.

Var_Delta.T

The variance σΔT\sigma_{\Delta_{T}}.

T0T1

The correlation between the counterfactuals T0T_{0}, T1T_{1}.

CI_low

The lower border of the 1α1-\alpha% confidence interval of ΔTj\Delta T_j|SjS_j.

CI_high

The upper border of the 1α1-\alpha% confidence interval of ΔTj\Delta T_j|SjS_j.

Var_Delta.T_S

The variance σΔT\sigma_{\Delta_{T}}|SjS_j.

alpha

The α\alpha-level that is used to determine the confidence interval of ΔTj\Delta T_j|SjS_j.

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

PCA.ContCont

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)