Surrogate (version 1.7)

plot SPF BinBin: Plots the surrogate predictive function (SPF) in the binary-binary settinf.

Description

Plots the surrogate predictive function (SPF), i.e., \(r(i,j)=P(\Delta T=i|\Delta S=j)\), in the setting where both \(S\) and \(T\) are binary endpoints. For example, \(r(-1,1)\) quantifies the probability that the treatment has a negative effect on the true endpoint (\(\Delta T=-1\)) given that it has a positive effect on the surrogate (\(\Delta S=1\)).

Usage

# S3 method for SPF.BinBin
plot(x, Type="All.Histograms", Specific.Pi="r_0_0", Col="grey", 
Box.Plot.Outliers=FALSE, Legend.Pos="topleft", Legend.Cex=1, ...)

Arguments

x

A fitted object of class SPF.BinBin. See ICA.BinBin.

Type

The type of plot that is requested. Possible choices are: Type="All.Histograms", the histograms of all \(9\) \(r(i,j)=P(\Delta T=i|\Delta S=j)\) vectors arranged in a \(3\) by \(3\) grid; Type="All.Densities", plots of densities of all \(r(i,j)=P(\Delta T=i|\Delta S=j)\) vectors; Type="Histogram", the histogram of a particular \(r(i,j)=P(\Delta T=i|\Delta S=j)\) vector (the Specific.Pi= argument has to be used to specify the desired \(r(i,j)\)); Type="Density", the density of a particular \(r(i,j)=P(\Delta T=i|\Delta S=j)\) vector (the Specific.Pi= argument has to be used to specify the desired \(r(i,j)\)); Type="Box.Plot", a box plot of all \(r(i,j)=P(\Delta T=i|\Delta S=j)\) vectors; Type="Lines.Mean", a line plot the depicts the means of all \(r(i,j)=P(\Delta T=i|\Delta S=j)\) vectors; Type="Lines.Median", a line plot the depicts the medians of all \(r(i,j)=P(\Delta T=i|\Delta S=j)\) vectors; Type="Lines.Mode", a line plot the depicts the modes of all \(r(i,j)=P(\Delta T=i|\Delta S=j)\) vectors; Type="3D.Mean", a 3D bar plot the depicts the means of all \(r(i,j)=P(\Delta T=i|\Delta S=j)\) vectors; Type="3D.Median", a 3D bar plot the depicts the medians of all \(r(i,j)=P(\Delta T=i|\Delta S=j)\) vectors; Type="3D.Mode", a 3D bar plot the depicts the modes of all \(r(i,j)=P(\Delta T=i|\Delta S=j)\) vectors; Type="3D.Spinning.Mean", a spinning 3D plot that depicts the means of all \(r(i,j)=P(\Delta T=i|\Delta S=j)\) vectors that can be rotated; Type="3D.Spinning.Median", a spinning 3D plot that depicts the medians of all \(r(i,j)=P(\Delta T=i|\Delta S=j)\) vectors that can be rotated; Type="3D.Spinning.Mode", a spinning 3D plot that depicts the modes of all \(r(i,j)=P(\Delta T=i|\Delta S=j)\) vectors that can be rotated.

Specific.Pi

When Type="Histogram" or Type="Density" , the histogram/density of a particular \(r(i,j)=P(\Delta T=i|\Delta S=j)\) vector is shown. The Specific.Pi= argument is used to specify the desired \(r(i,j)\)). Default r_0_0.

Col

The color of the bins or lines when histograms or density plots are requested. Default "grey".

Box.Plot.Outliers

Logical. Should outliers be depicted in the box plots?. Default FALSE.

Legend.Pos

Position of the legend when a type="Box.Plot", type="Lines.Mean", type="Lines.Median", or type="Lines.Mode" is requested. Default "topleft".

Legend.Cex

Size of the legend when a type="Box.Plot", type="Lines.Mean", type="Lines.Median", or type="Lines.Mode" is requested. Default 1.

Arguments to be passed to the plot, histogram, ... functions.

References

Alonso, A., Van der Elst, W., & Molenberghs, G. (2015). Assessing a surrogate effect predictive value in a causal inference framework.

See Also

SPF.BinBin

Examples

Run this code
# NOT RUN {
# Generate plausible values for Pi  
ICA <- ICA.BinBin.Grid.Sample(pi1_1_=0.341, pi0_1_=0.119,
pi1_0_=0.254, pi_1_1=0.686, pi_1_0=0.088, pi_0_1=0.078, Seed=1,
Monotonicity=c("General"), M=2500)
           
# Compute the surrogate predictive function (SPF)
SPF <- SPF.BinBin(ICA)

# Explore the results
summary(SPF)

# Examples of plots 
plot(SPF, Type="All.Histograms")
plot(SPF, Type="All.Densities")
plot(SPF, Type="Histogram", Specific.Pi="r_0_0")
plot(SPF, Type="Box.Plot", Legend.Pos="topleft", Legend.Cex=.7)
plot(SPF, Type="Lines.Mean")
plot(SPF, Type="Lines.Median")
plot(SPF, Type="3D.Mean")
plot(SPF, Type="3D.Median")
plot(SPF, Type="3D.Spinning.Mean")
plot(SPF, Type="3D.Spinning.Median")
# }

Run the code above in your browser using DataLab