plotMultinomial: Plot category probabilities of multinomial model

View source: R/plotMultinomial.R

plotMultinomialR Documentation

Plot category probabilities of multinomial model

Description

Plots category probabilities functions estimated by multinom() from the nnet package using the ggplot2 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.

Value

An object of class ggplot and/or gg.

Author(s)

Adela Hladka
Institute of Computer Science of the Czech Academy of Sciences
hladka@cs.cas.cz

Tomas Jurica
Institute of Computer Science of the Czech Academy of Sciences

Patricia Martinkova
Institute of Computer Science of the Czech Academy of Sciences
martinkova@cs.cas.cz

See Also

nnet::multinom()

Examples

# loading data
data(GMAT, GMATtest, GMATkey, package = "difNLR")

matching <- scale(rowSums(GMAT[, 1:20])) # Z-score

# multinomial model for item 1
fit <- nnet::multinom(relevel(GMATtest[, 1], ref = paste(GMATkey[1])) ~ matching)

# plotting category probabilities
plotMultinomial(fit, matching, matching.name = "Z-score")


patriciamar/ShinyItemAnalysis documentation built on May 18, 2023, 4:34 p.m.