[R-sig-ME] [FORGED] Re: logistic regression on posttest (0, 1) with pretest(0, 1)*Group(Treatment, Ctrl) interaction

Lenth, Russell V ru@@e||-|enth @end|ng |rom u|ow@@edu
Mon Apr 29 18:11:41 CEST 2019


With regards to obtaining summary statistics, one should use the 'emmeans()' function itself, not 'emmip()'.

For example:

    emmeans(mod2, ~ pretest | Group, type="response")
    pairs(.Last.value)       # to see pairwise comparisons


Russell V. Lenth  -  Professor Emeritus
Department of Statistics and Actuarial Science
The University of Iowa  -  Iowa City, IA 52242  USA
Voice (319)335-0712 (Dept. office)  -  FAX (319)335-3017




> Date: Mon, 29 Apr 2019 12:19:50 +0200
> From: =?UTF-8?B?UmVuw6k=?= <bimonosom using gmail.com>
> To: Jeff Newmiller <jdnewmil using dcn.davis.ca.us>
> Cc: Rolf Turner <r.turner using auckland.ac.nz>,
>             "r-sig-mixed-models using r-project.org" <r-sig-mixed-models using r-project.org>
> Subject: Re: [R-sig-ME] [FORGED] Re: logistic regression on posttest
>             (0, 1) with pretest(0, 1)*Group(Treatment, Ctrl) interaction
> Message-ID:
>             <CADcpBHO4quyXCmN0dD+7gdyVO+msQzbhoeL=ROWivt6TpYRBGA using mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Souheyla,
>
> coming back to the topic (I was busy lately).
>
> The interpretation is always a bit of a problem in regressions with categorical interactions. There are two ways to deal with this, one would be to prefer effect coding (search for contrast sum coding online) over dummy coding. In short, with effect coding, you model the deviation of each group from a grand mean. With dummy coding, you start with the intercept parameter and then add up the design cells to have the actual mean estimate of it... I actually do not like both, because first I have no idea how to ideally tell this bro, and also... there is a second and much much easier
> way:
>
> Try this:
> ## if this is your model: mod2 <- brm(posttest ~ pretest*Group +...)
> library(emmeans)
> emmip(mod2,~pretest|Group,type="response",CIs=TRUE)
> Et voila :)
> This gives you the posterior marginal estimates from the model for your interaction, predicting the cell specific response probability, including highest density intervals (or Bayesian credible intervals). The option type="response" gives you the predicted probability of post =1; if you delete this option, the marginal estimates will be given on the log scale.
> In short, this tells you whether something is better remembered post, if it was already known pre (or not), depending on the group.
>
> You can get also the marginal main effects like this, using:
> emmip(mod2,~pretest,type="response",CIs=TRUE)
> Which would tell you whether something is better remembered post, if it was already known pre. Likewise for group.
>
> And if you want to simply get the summary statistics instead of the plot, use this:
> summod2<-emmip(mod2,~pretest|Group,type="response",CIs=TRUE)
> summod2$data
>
> Best, Ren�
>

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list