plot.sigProb {sigInt} | R Documentation |
Plot predicted probabilities from a sigProb
object.
Description
This method takes a sigProb
object produced by
predict.sigfit
and plots the comparative static(s) of interest.
Usage
## S3 method for class 'sigProb'
plot(x, prob, xvar, main = "", ylab, xlab, col = "blue", pch = 16, ...)
Arguments
x |
an object of class |
prob |
A string providing the column name for the column of |
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 |
See Also
predict.sigfit
generate.eq
plot
par
Examples
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")
[Package sigInt version 0.2.0 Index]