## verbal aggression data from package psychotools
data("VerbalAggression", package = "psychotools")
## use response to the second other-to-blame situation (train)
VerbalAggression$s2 <- VerbalAggression$resp[, 7:12]
## exclude subjects who only scored in the highest or the lowest categories
VerbalAggression <- subset(VerbalAggression, rowSums(s2) > 0 & rowSums(s2) < 12)
## fit partial credit tree model
pct <- pctree(s2 ~ anger + gender, data = VerbalAggression)
## just print mob object
print(pct)
## show summary for terminal panel nodes
summary(pct)
## plot with default (and currently only) terminal panel function (node_effects)
plot(pct)
## extract item and category parameters
coef(pct)
## inspect parameter stability tests in the splitting node
sctest(pct, node = 1)
Run the code above in your browser using DataLab