Learn R Programming

DAMisc (version 1.7.2)

print.diffci: Print Confidence Intervals for Predicted Probabilities and Their Differences

Description

Print method for output from the probci function.

Usage

# S3 method for diffci
print(
  x,
  type = c("pr", "pw"),
  ...,
  digits = 4,
  filter = NULL,
  const = NULL,
  onlySig = FALSE
)

Arguments

x

A object of class diffci produced by probci.

type

Which kind of result to print - predictions (pr) or pairwise differences in predictions (pw).

...

Other arguments to be passed down to print, currently unimplemented.

digits

How many digits to round output.

filter

A named list of values where the names indicate the variable to be filtered and the values in the vector indicate the values to include for the filtering variable.

const

A string identifying the name of the variable to be held constant across comparisons. Only applies if type = "pw".

onlySig

Logical indicating whether all differes should be displayed or only those significant at the 95% two-tailed level.

Value

An data frame with the following variables:

variables

The variables and the values at which they are held constant. For example, tmp1 would be the first value of tmp used in the probability calculation and tmp2 would be the second value of tmp used in the probability calculation.

pred_prob

The difference in predicted probability given the following change in X: tmp2-tmp1.

lower, upper

The lower and upper 95% confidence bounds.

Examples

Run this code
# NOT RUN {
data(france)
left.mod <- glm(voteleft ~ male + age + retnat + 
	poly(lrself, 2, raw=TRUE), data=france, family=binomial)
data(france)
left.mod <- glm(voteleft ~ male + age + retnat + 
                  poly(lrself, 2, raw=TRUE), data=france, family=binomial)
out <- probci(left.mod, france, numQuantVals=3, 
              changeX=c("retnat", "lrself"), calcPW = TRUE)
print(out, filter=list(retnat=c("Better", "Worse")))
print(out, type="pw", 
      filter=list(retnat=c("Better", "Worse")),
      const="lrself")
# }

Run the code above in your browser using DataLab