rasch: Estimation of Rasch Models for Emoxicon

Description Usage Arguments Details Author(s) References See Also Examples

View source: R/rasch.R

Description

Runs a Rasch model using the emotion scores from emoxicon. If the data is not already dichotomous, a mean split will be performed.

Usage

1
rasch(scores, groups, return_models = TRUE, ...)

Arguments

scores

A dataframe containing the emotion scores

groups

An optional vector of group identifers the same length as scores. If provided, individual Rasch models will be run by group.

return_models

Logical. Should the model for each group be returned? Default is TRUE. Setting this value to FALSE will reduce object size, but only the category orders will be returned.

...

Additional arguments to be passed to RM

Details

When the data is generated using emoxicon and the default emotions lexicon, the entire emoxicon object can be entered.

Author(s)

Tara Valladares <tls8vx at virginia.edu>, Hudson F. Golino <hfg9s at virginia.edu>

References

Mair, P., & Hatzinger, R. (2007). Extended Rasch modeling: The eRm package for the application of IRT models in R. Journal of Statistical Software, 20(9),1-20. doi:10.18637/jss.v020.i09

See Also

emoxicon, where the emotion scores are generated and rasch_fit to calculate Rasch fit statistics.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Load the tinytrolls data
data(tinyTrolls)

# Use the emoxicon function
## Not run: 
emotions.tinytrolls <- emoxicon(text = tinyTrolls$content, lexicon = emotions)
# Recode the variables to 0 (below mean) or 1 (equal to or above mean)
emotions.rasch <- as.data.frame(apply(emotions.tinytrolls[,-c(1:2)],2,
function(x) ifelse(x<mean(x),0,1)))
# Apply the Rasch Model
rm.tinytrolls <- rasch(scores = emotions.tinytrolls)

## End(Not run)

tvall/emoxicon documentation built on Dec. 31, 2020, 9:39 a.m.