data(quine, package="MASS") #loads quine from MASS
str(quine)
# split quine in two subsets
set.seed(223344)
lab.A <- sample(nrow(quine), 70, replace=TRUE)
quine.A <- quine[lab.A, 1:3]
quine.B <- quine[-lab.A, 2:4]
# multinomial model and predictions with most-voted criterion
fbp <- Fbounds.pred(data.rec = quine.A, data.don = quine.B,
match.vars = c("Sex", "Age"),
y.rec = "Eth", z.don = "Lrn",
pred = "multinom", type.pred = "mostvoted")
fbp$p.xx.ini # estimated cross-tab of predictions
fbp$bounds # estimated conditional and unconditional bounds
fbp$uncertainty # estimated uncertainty about Y*Z
# multinomial model and predictions with randomized criterion
fbp <- Fbounds.pred(data.rec = quine.A, data.don = quine.B,
match.vars = c("Sex", "Age"),
y.rec = "Eth", z.don = "Lrn",
pred = "multinom", type.pred = "random")
fbp$p.xx.ini # estimated cross-tab of predictions
fbp$bounds # estimated conditional and unconditional bounds
fbp$uncertainty # estimated uncertainty about Y*Z
Run the code above in your browser using DataLab