R: Print the results of a bootstrap model run to screen
summary.PTE_bootstrap_results
R Documentation
Print the results of a bootstrap model run to screen
Description
Prints p-values and confidence intervals to the screen for both the random and best business-as-usual allocation procedures.
Usage
## S3 method for class 'PTE_bootstrap_results'
summary(object, ...)
Arguments
object
An object of class “PTE_bootstrap_results”.
...
Parameters that are ignored.
Author(s)
Adam Kapelner and Justin Bleich
References
Kapelner, A, Bleich, J, Cohen, ZD, DeRubeis, RJ and Berk, R (2014) Inference for Treatment Regime Models in Personalized Medicine, arXiv
See Also
bootstrap_inference
Examples
beta0 = 1
beta1 = -1
gamma0 = 0
gamma1 = sqrt(2 * pi)
mu_x = 0
sigsq_x = 1
sigsq_e = 1
num_boot = 20 #for speed only
n = 50 #for speed only
x = sort(rnorm(n, mu_x, sigsq_x))
noise = rnorm(n, 0, sigsq_e)
treatment = sample(c(rep(1, n / 2), rep(0, n / 2)))
y = beta0 + beta1 * x + treatment * (gamma0 + gamma1 * x) + noise
X = data.frame(treatment, x)
res = bootstrap_inference(X, y,
"lm(y ~ . + treatment * ., data = Xyleft)",
num_cores = 1,
B = num_boot,
plot = FALSE)
summary(res)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(PTE)
Loading required package: doParallel
Loading required package: foreach
Loading required package: iterators
Loading required package: parallel
Welcome to PTE v1.0 by Adam Kapelner and Justin Bleich
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/PTE/summary.Rd_%03d_medium.png", width=480, height=480)
> ### Name: summary.PTE_bootstrap_results
> ### Title: Print the results of a bootstrap model run to screen
> ### Aliases: summary.PTE_bootstrap_results
>
> ### ** Examples
>
> beta0 = 1
> beta1 = -1
> gamma0 = 0
> gamma1 = sqrt(2 * pi)
> mu_x = 0
> sigsq_x = 1
> sigsq_e = 1
> num_boot = 20 #for speed only
> n = 50 #for speed only
>
> x = sort(rnorm(n, mu_x, sigsq_x))
> noise = rnorm(n, 0, sigsq_e)
>
> treatment = sample(c(rep(1, n / 2), rep(0, n / 2)))
> y = beta0 + beta1 * x + treatment * (gamma0 + gamma1 * x) + noise
>
> X = data.frame(treatment, x)
>
> res = bootstrap_inference(X, y,
+ "lm(y ~ . + treatment * ., data = Xyleft)",
+ num_cores = 1,
+ B = num_boot,
+ plot = FALSE)
> summary(res)
I_adversarial observed est = 1.891, p val = 0,
95% CI's: pctile = [1.453, 2.204], BCa = [1.404, 2.185],
I_random observed_est = 1.021, p val = 0,
95% CI's: pctile = [0.58, 1.284], BCa = [0.508, 1.223],
I_best observed_est = 0.843, p val = 0,
95% CI's: pctile = [0.249, 1.195], BCa = [0.446, 1.265]
>
>
>
>
>
> dev.off()
null device
1
>