# Sensitivity Analysis of the effect of vaccine on viral load,
# as described in Gilbert, Bosch, and Hudgens (2003, Biometrics).
# This code gives an example of how to call the program in the
# file Viral.Load.Sensitivity.Analysis.Program.r for producing
# a sensitivity analysis.
# Input parameters:
# Set b (the number of bootstrap replications) >= 1000
b <- 1000
# Set the numbers randomized to vaccine and placebo:
Nn1 <- 500
Nn0 <- 500
# Example simulated data-set- 50 infections in the vaccine group and 75 in the placebo group
exampy1.samp <- rnorm(50,mean=4.0,sd=sqrt(.91))
exampy0.samp <- rnorm(75,mean=4.5,sd=sqrt(.75))
alpha1 <- .05
# Run the program repeatedly for beta varying between -5 and 5 (for example):
source('Viral.Load.Sensitivity.Analysis.Program.r')
for (i in seq(-5,5,length=51)) {
beta <- i
cat(paste("beta=",beta),"\n")
viralloadprogram(b,Nn1,Nn0,exampy1.samp,exampy0.samp,alpha1,beta)
}
# The output can be found in the file output.dat in the same directory as the program was run
# Plot the output using the code in the file Viral.Load.plots.r
source('Viral.Load.plots.r')
Viral.Load.plots("output.dat","figure1.ps","figure2.ps")
# The plots of the results are in the same directory as the program was run
# in the files figure1.ps and figure2.ps