Learn R Programming

ShinyItemAnalysis (version 1.3.4)

plotMultinomial: Function for plotting category probabilities of multinomial log-linear regression model

Description

Plots category probabilities functions estimated by multinom() from nnet package.

Usage

plotMultinomial(x, matching, matching.name = "matching")

Arguments

x

object of class multinom

matching

numeric: vector of matching criterion used for estimation in x.

matching.name

character: name of matching criterion used for estimation in x.

See Also

multinom

Examples

Run this code
# 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