# NOT RUN {
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
## Using Nested-Pseudo Likelihood with default first stage
# }
# NOT RUN {
fit1 <- sigint(f1, data=sanctionsData, npl.trace=TRUE)
p.out <- predict(fit2, parallel=TRUE) #fitted choice probabilites for all observations
# }
# NOT RUN {
## Outcome probabilities for first five using PL method
Phat <- list(PRhat=sanctionsData$PRhat, PFhat=sanctionsData$PFhat)
fit2 <- sigint(f1, data=sanctionsData, method="pl", phat=Phat)
p1 <- predict(fit2, newdata=sanctionsData[1:5,], type="outcome")
## 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)
p2 <- predict(fit2, newdata=sanctionsData[1,], new.theta=new.theta, control=list(comp=TRUE))
# }
Run the code above in your browser using DataLab