plot.sigProb: Plot predicted probabilities from a 'sigProb' object.

Description Usage Arguments See Also Examples

View source: R/plot.sigProb.r

Description

This method takes a sigProb object produced by predict.sigfit and plots the comparative static(s) of interest.

Usage

1
2
## S3 method for class 'sigProb'
plot(x, prob, xvar, main = "", ylab, xlab, col = "blue", pch = 16, ...)

Arguments

x

an object of class sigProb, which is obtained by using predict.sigfit on a model fit using sigint.

prob

A string providing the column name for the column of object$predicted should be used as the outcome or probability of interest.

xvar

A string providing the column name of the column (from either object$model or object$par) that provides the "x-variable" in the plot.

main

The title of the plot

ylab

The y-axis label

xlab

The x-axis label

col

The color of the plot

pch

An integer or character used to choose the type of points used in the plot

...

Additional arguments and graphical parameters used by plot and par

See Also

predict.sigfit generate.eq plot par

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
data(sanctionsData)

f1 <- sq+cd+sf+bd ~ sqrt(senderecondep) + senderdemocracy + contig + ally -1|#SA
                    anticipatedsendercosts|#VA
                    sqrt(targetecondep) + anticipatedtargetcosts + contig + ally|#CB
                    sqrt(senderecondep) + senderdemocracy + lncaprat | #barWA
                    targetdemocracy + lncaprat| #barWB
                    senderdemocracy| #bara
                    -1#VB
## Outcome probabilities for first five using NPL probabilities
Phat <- list(PRhat=sanctionsData$PRnpl, PFhat=sanctionsData$PFnpl)
fit2 <- sigint(f1, data=sanctionsData, method="pl", phat=Phat)

## comparative static on \bar{a}, compute more precise equilibria with uniroot
new.theta <- data.frame(t(replicate(25, coef(fit2))))
new.theta[,19] <- seq(-6, 0, length=25)
pout <- predict(fit2, newdata=sanctionsData[93,], new.theta=new.theta, 
                control=list(gridsize=500))


plot(pout, prob="pc", ylab="Pr Challenge", xlab="Audience Costs")

sigInt documentation built on Jan. 11, 2020, 9:20 a.m.

Related to plot.sigProb in sigInt...