summary.whatif {WhatIf} | R Documentation |
Summarizes the information produced by the function whatif
.
The summary generated is returned as an output object and also printed
to the screen.
## S3 method for class 'whatif': summary(object, ...)
object |
An object of class "whatif", the output of
the function whatif . |
... |
Further arguments passed to and from other methods. |
An object of class "summary.whatif", a list containing the following five elements:
call |
The original call to whatif . |
m |
A scalar. The total number of counterfactuals evaluated. |
m.inhull |
A scalar. The number of counterfactuals evaluated that are in the convex hull of the observed covariate data. |
mean.near |
A scalar. The average percentage of data nearby each counterfactual, where the average is taken over all counterfactuals. |
sum.df |
A data frame with three columns and m rows, where m is the number of counterfactuals. The first column, 'cfact', indexes the counterfactuals. The second column, 'in.hull', contains the results of the convex hull test. The third column, 'per.near', contains the percentage of data points `nearby' each counterfactual. |
This object is printed to the screen.
Stoll, Heather hstoll@polsci.ucsb.edu, King, Gary king@harvard.edu and Zeng, Langche zeng@ucsd.edu
King, Gary and Langche Zeng. 2006a. "The Dangers of Extreme Counterfactuals." Political Analysis, forthcoming. Preprint available from http://gking.harvard.edu.
King, Gary and Langche Zeng. 2006b. "When Can History Be Our Guide? The Pitfalls of Counterfactual Inference." International Studies Quarterly, forthcoming. Preprint available from http://gking.harvard.edu.
whatif
,
plot.whatif
,
print.whatif
,
print.summary.whatif
## Create example data sets and counterfactuals my.cfact <- matrix(rnorm(3*5), ncol = 5) my.data <- matrix(rnorm(100*5), ncol = 5) ## Evaluate counterfactuals my.result <- whatif(data = my.data, cfact = my.cfact) ## Print summary summary(my.result)