data(war1800)
f1 <- esc + war ~ s_wt_re1 + revis1 | 0 | regime1 | balanc + regime2
m1 <- egame12(f1, data = war1800, boot = 10)
pp1 <- predProbs(m1, x = "s_wt_re1", n = 5)
print(pp1) ## the hypothetical observations and their predicted probs
plot(pp1, which = 2) ## see ?plot.predProbs for more plot examples
## changing the profile used
pp2 <- predProbs(m1, x = "s_wt_re1", n = 5, revis1 = 1, balanc = 0.7)
pp3 <- predProbs(m1, x = "s_wt_re1", n = 5, regime1 = "dem")
pp4 <- predProbs(m1, x = "s_wt_re1", n = 5, balanc = median(balanc))
## variable names (other than x) must match exactly!
pp5 <- predProbs(m1, x = "s_wt_re1", bal = 0.7) ## error will result
## x can be a factor too
pp6 <- predProbs(m1, x = "regime1")
## predProbs (despite the name) also provides predictions for the optimal
## offer in ultimatum models
data(data_ult)
f2 <- offer + accept ~ x1 + x2 + x3 + x4 + w1 + w2 | z1 + z2 + z3 + z4 + w1 + w2
m2 <- ultimatum(f2, data = data_ult, maxOffer = 15, boot = 10)
pp7 <- predProbs(m2, x = "w1", n = 5)
print(pp7)
op <- par(mfrow = c(2, 1))
plot(pp7)
par(op)
Run the code above in your browser using DataLab