Plots category probabilities functions estimated by multinom()
from nnet
package.
plotMultinomial(x, matching, matching.name = "matching")
object of class multinom
numeric: vector of matching criterion used for estimation in x
.
character: name of matching criterion used for estimation in x
.
# NOT RUN {
# loading data
data(GMAT, GMATtest, GMATkey, package = "difNLR")
matching <- scale(apply(GMAT[, 1:20], 1, sum)) # Z-score
data <- GMATtest[, 1:20]
key <- GMATkey
# multinomial model for item 1
fit <- nnet::multinom(relevel(data[, 1], ref = paste(key[1])) ~ matching)
# plotting category probabilities
plotMultinomial(fit, matching, matching.name = "Z-score")
# }
Run the code above in your browser using DataLab