Is it possible to do standard contrasts across an interaction with the default-backend?

Aperta
#510 19 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
r
Ambito
data

Direzione di ricerca

Iniziare con modelbased::estimate_contrasts() e il relativo backend marginaleffects predefinito, confrontandoli con l’esempio di interazione emmeans::contrast() fornito. Determinare se i contrasti standard tra tutti i termini di interazione sono supportati; il lavoro è completato quando il comportamento è implementato oppure la limitazione supportata e l’utilizzo sono documentati chiaramente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Enhancement :boom: Feature idea :fire:

I'm trying to reproduce this analysis using modelbased::estimate_contrasts(). It's basically a set of 'out of the box' contrasts fitted across an interaction.

date_tib <- discovr::speed_date

date_afx <- afex::aov_4(date ~ strategy*looks*personality + (looks*personality|id), data = date_tib)
#> Contrasts set to contr.sum for the following variables: strategy

# Desired analysis using emmeans

three_way_emm <- emmeans::emmeans(date_afx, specs = c("strategy", "looks", "personality"), model = "multivariate")

emmeans::contrast(
  three_way_emm,
  interaction = c(strategy = "trt.vs.ctrl",
                  looks = "trt.vs.ctrl",
                  personality = "trt.vs.ctrl"),
  ref = 2,
  adjust = "holm"
  )
#>  strategy_trt.vs.ctrl looks_trt.vs.ctrl personality_trt.vs.ctrl estimate   SE
#>  Normal - Hard to get Low - Average     Low - Average               -4.7 4.07
#>  Normal - Hard to get High - Average    Low - Average              -36.2 4.65
#>  Normal - Hard to get Low - Average     High - Average              18.5 5.41
#>  Normal - Hard to get High - Average    High - Average              -5.8 6.02
#>  df t.ratio p.value
#>  18  -1.155  0.5263
#>  18  -7.789  <.0001
#>  18   3.421  0.0091
#>  18  -0.963  0.5263
#> 
#> P value adjustment: holm method for 4 tests

Created on 2025-06-11 with reprex v2.1.1

I can't see a way to set the contrasts across an interaction in estimate_contrasts() (without manually specifying weights but let's not go there ...). The function documentation doesn't mention an equivalent to interactiuon = that gets passed onto emmeans. But also, highly likley I just don't know how to use your function:) Is there a way? If not, is this something you'd impliment?

Incidentally, I'd prefer to do it without changing the backend to emmeans (because everything else in my book uses the default marginaleffects backend), but if it has to be changed then so be it.

Lingua principale
R
Stelle
264
Fork
24
Merge medio
17h 36m
PR unite (30g)
21

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di easystats/modelbased

Tutte le issue di easystats/modelbased

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.