summary.whatif: Summary of "whatif" Object

Description Usage Arguments Value Author(s) References See Also Examples

Description

Summarizes the information produced by the function whatif. The summary generated is returned as an output object and also printed to the screen.

Usage

1
2
## S3 method for class 'whatif'
summary(object, ...)

Arguments

object

An object of class "whatif", the output of the function whatif.

...

Further arguments passed to and from other methods.

Value

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.

Author(s)

Stoll, Heather hstoll@polsci.ucsb.edu, King, Gary king@harvard.edu and Zeng, Langche zeng@ucsd.edu

References

King, Gary and Langche Zeng. 2006. "The Dangers of Extreme Counterfactuals." Political Analysis 14 (2). Available from https://gking.harvard.edu.

King, Gary and Langche Zeng. 2007. "When Can History Be Our Guide? The Pitfalls of Counterfactual Inference." International Studies Quarterly 51 (March). Available from https://gking.harvard.edu.

See Also

whatif, plot.whatif, print.whatif, print.summary.whatif

Examples

1
2
3
4
5
6
7
8
9
##  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, mc.cores = 1)

##  Print summary
summary(my.result)

WhatIf documentation built on Nov. 14, 2020, 5:13 p.m.