Skip to content

means , CIs from lmer, glmer

4 messages · Kornbrot, Diana, Ben Bolker, Rune Haubo

#
I am keen to promote the use of generalised mixed models for the analysis of proportions to psychologists
Have straight fowl code in SPSS [costly] and would like to supply equivalent R Code without ?tears?
Design is a follows raw frequencies are: FreqPos for ?success? and FreqNeg for ?failure?
Predictors are Rab with 4 levels, repeated over participants and Between with 2 separate groups of participants
Model is binomial with logit link

Require following output to correspond to SPSS output from code below
Descriptive: Means, se and 95% CIs  by Rab, by Between and by Rab*Between
Inferential: fo  Rab, Between and  Rab*Between: F value, MSE, numerator df, denominator df [this enables p-values]

Have tried

logit1 <- glmer(cbind(FreqPos,FreqNeg) ~ Rab + Between + Rab*Between + (1| Participant), family=binomial(link="logit"))
gives F and MSE no denominator df or MSE. Different results to SPSS
nb F=MSE - that can?t be right F is supposed to be ratio of chi-squares

summary (logit1)
gives coefficients  and SEs. Different results to SPSS
also tried predicted and fitted but still no means

have spent days searching internet for examples - but none of them seem to show how to get the output I need

All help greatly appreciated

____
Spss syntax

*Generalized Linear Mixed Models.
GENLINMIXED
  /DATA_STRUCTURE SUBJECTS=Participant REPEATED_MEASURES=Rab COVARIANCE_TYPE=UNSTRUCTURED
  /FIELDS TARGET=FreqPos TRIALS=FIELD(Nmax)  OFFSET=NONE
  /TARGET_OPTIONS DISTRIBUTION=BINOMIAL LINK=LOGIT
  /FIXED  EFFECTS=Rab Between Rab*Between USE_INTERCEPT=TRUE
  /BUILD_OPTIONS TARGET_CATEGORY_ORDER=DESCENDING INPUTS_CATEGORY_ORDER=DESCENDING MAX_ITERATIONS=100 CONFIDENCE_LEVEL=95 DF_METHOD=SATTERTHWAITE COVB=MODEL PCONVERGE=0.000001(ABSOLUTE) SCORING=0 SINGULAR=0.000000000001
  /EMMEANS TABLES=Rab COMPARE=Rab CONTRAST=DEVIATION
   /EMMEANS TABLES=Between CONTRAST=NONE
   /EMMEANS TABLES=Rab*Between CONTRAST=NONE
  /EMMEANS_OPTIONS SCALE=ORIGINAL PADJUST=LSD.

best
Diana


_____________________________________
Professor Diana Kornbrot
Mobile
+44 (0) 7403 18 16 12
Work
University of Hertfordshire
College Lane, Hatfield, Hertfordshire AL10 9AB, UK
+44 (0) 170 728 4626
d.e.kornbrot at herts.ac.uk<mailto:d.e.kornbrot at herts.ac.uk>
http://dianakornbrot.wordpress.com/
http://go.herts.ac.uk/Diana_Kornbrot
skype:  kornbrotme
Home
19 Elmhurst Avenue
London N2 0LT, UK
+44 (0) 208 444 2081
 ------------------------------------------------------------
#
Hi Diana,

A reproducible example is always helpful/increases your chances of
getting a useful answer ...
It might help if you included the SPSS output (or posted it somewhere
-- note that this list doesn't take HTML-formatted messages nor most
attachments), as many of us don't have access to it.

Look into the (very well-documented) emmeans package:
https://CRAN.R-project.org/package=emmeans
and the lmerTest package (for Satterthwaite df approximations)

On Mon, Feb 26, 2018 at 12:11 PM, Kornbrot, Diana
<d.e.kornbrot at herts.ac.uk> wrote:
#
Just a small note that lmerTest (and the Satterthwaite method for
degrees of freedom) is only meaningful for _linear_ mixed models - not
for the generalized variants such as the one considered here for
proportions.

Best,
Rune
On 27 February 2018 at 02:02, Ben Bolker <bbolker at gmail.com> wrote:
#
Yes, that was a thinko on my part.  Thanks.
On 18-02-27 05:22 AM, Rune Haubo wrote: