cumulative probability at different levels of the response with emmeans

61 views Asked by At

Given this model:

library(ordinal)

wine2 <- wine
wine2$rating[wine2$rating==5] <- 1
wine2$rating <- ordered(wine2$rating)

fm <- clm(rating ~ response*temp, data=wine2)

how can I calculate the cum.prob of temp at different cuts with emmeans:

I thought this would work:

library(emmeans)
emmeans(fm, pairwise ~ temp, mode="cum.prob", at = list(cut=c("1|2","3|4")))

but the results are averaged across cuts, instead of showing emmeans for each cut separately

 $emmeans
     temp cumprob     SE  df asymp.LCL asymp.UCL
     cold   0.380 0.0491 Inf     0.284     0.477
     warm   0.433 0.0403 Inf     0.354     0.512
    
    Results are averaged over the levels of: cut 
    Confidence level used: 0.95 
    
    $contrasts
     contrast    estimate     SE  df z.ratio p.value
     cold - warm   -0.053 0.0582 Inf -0.909  0.3632 
    
    Results are averaged over the levels of: cut 
1

There are 1 answers

0
Russ Lenth On BEST ANSWER

You didn't include cut in your specs. Also, the levels of cut are generated by the software.

emmeans(fm, pairwise ~ cut | temp, mode="cum.prob")