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

Souheyla GHEBGHOUB @ouhey|@@ghebghoub @end|ng |rom gm@||@com
Mon Apr 29 12:25:32 CEST 2019


Dear Rene,

Thank youbforbyour feedback.
I will look into this. But before I do, I would like to ask how much
difference would it make if I am using lme4 package (glmer).

I keep switching between both and havent decided yet. But is it easy to
implement the aforesaid if its glmer and not brms?

Thank you
Souheyla


On Mon, 29 Apr 2019, 11:20 René, <bimonosom using gmail.com> wrote:

> 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é
>
>
>
> Am Mo., 22. Apr. 2019 um 03:59 Uhr schrieb Jeff Newmiller <
> jdnewmil using dcn.davis.ca.us>:
>
> > There is no "formula" syntax other than it has to have at least one
> > tilde... there is "lm" formula syntax, and "lme" formula syntax, and
> "nls"
> > formula syntax, etc... and other model builders are not obligated to
> > adhere to the "lm" interpretation of formulas.
> >
> > I don't see why using * alone in an lm formula should be avoided, but
> > perhaps John's advice could be reframed as "watch out for the specific
> > syntax used by your model building function... it may not be the same as
> > that used by lm".
> >
> > On Mon, 22 Apr 2019, Rolf Turner wrote:
> >
> > >
> > > On 22/04/19 6:01 AM, Sorkin, John wrote:
> > >
> > >> Souheyla,
> > >>
> > >> It is both difficult and dangerous to add a comment to a thread that
> > >> one has not followed, and in doing so possibly making an
> > >> inappropriate suggestion. Please forgive what may be an not fully
> > >> informed thought.
> > >>
> > >> The model you suggest, posttest ~ pretest*Group  (ignoring random
> > >> effects) is unusual. In a model that contains an interaction,  I
> > >> would expect to see, in addition to the interaction, all main effects
> > >> included in the interaction, i.e. posttest ~
> > >> group+pretest+pretest*Group.
> > >
> > > As Souheyla has already indicated, in the R (and previously S/Splus)
> > formula
> > > syntax, interactions are indicated by a *colon* --- a:b.  The notation
> > "a*b"
> > > is a shorthand for
> > > a + b + a:b.
> > >
> > > So pretest*Group is the same as pretest + Group + pretest:Group, whence
> > it
> > > contains the main effects.
> > >
> > > I disagree with the advice that you gave Souheyla in a follow-up email.
> > > The construction pretest*Group is preferable, being compact and tidy.
> > Brevity
> > > is a virtue.
> > >
> > > cheers,
> > >
> > > Rolf
> > >
> > > --
> > > Honorary Research Fellow
> > > Department of Statistics
> > > University of Auckland
> > > Phone: +64-9-373-7599 ext. 88276
> > >
> > > _______________________________________________
> > > R-sig-mixed-models using r-project.org mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> > >
> >
> >
> ---------------------------------------------------------------------------
> > Jeff Newmiller                        The     .....       .....  Go
> Live...
> > DCN:<jdnewmil using dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live
> > Go...
> >                                        Live:   OO#.. Dead: OO#..  Playing
> > Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
> > /Software/Embedded Controllers)               .OO#.       .OO#.
> rocks...1k
> >
> > _______________________________________________
> > R-sig-mixed-models using r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> >
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

	[[alternative HTML version deleted]]



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