[R-sig-ME] Random slopes for 2 variables and random intercept for 1 variable

Shadiya Al Hashmi saah500 at york.ac.uk
Wed Apr 27 11:32:42 CEST 2016


Dear Thierry,

Apologies if my question wasn't clear.

I need to add a slope for Listgp per stimulus, a slope for length per listener and a slope for context per listener. 

Listgp per listener is intercept only, length and context per stimulus per listener are both intercept only.

Hope this clarifies things.

Best wishes,

Shad

Sent from my iPhone

> On Apr 27, 2016, at 12:21 PM, Thierry Onkelinx <thierry.onkelinx at inbo.be> wrote:
> 
> Dear Shad,
> 
> Your question isn't very clear. You'll need to tell use which random slopes you want to add to the model.
> 
> ir. Thierry Onkelinx
> Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest 
> team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance 
> Kliniekstraat 25
> 1070 Anderlecht
> Belgium
> 
> To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
> The plural of anecdote is not data. ~ Roger Brinner 
> The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey
> 
> 2016-04-27 11:17 GMT+02:00 Shadiya Al Hashmi <saah500 at york.ac.uk>:
>> Thanks Thierry but I need the random effects in the model since I am working within a generalized mixed effects model. That's why I used glmer.
>> 
>> The reason why I didn't include the random effects in the model is that I wasn't sure of how to translate the slopes and intercepts of the variables.
>> 
>> Two ways I could think of, however, are as follows.
>> 
>> maxmodal<- glmer(match ~ Listgp + length + context + gender + age + freq. + (0-Listgp|listener), (1+length|listener)+(1+context|listener), (1+Listgp|stimulus), (0-length|stimulus), (0-context|stimulus), data = msba, family = "binomial", control = glmerControl(optimizer =
>> "bobyqa"), nAGQ =1)
>> 
>> maxmodal<- glmer(match ~ Listgp + length + context + gender + age + freq. + (1-Listgp|listener), (1+length|listener)+(1+context|listener), (1+Listgp|stimulus), (1-length|stimulus), (1-context|stimulus), data = msba, family = "binomial", control = glmerControl(optimizer =
>> "bobyqa"), nAGQ =1)
>> 
>> 
>> However, I am not sure either is the right way to go about it. 
>> 
>> Best wishes,
>> 
>> Shad
>> 
>>> On 27 April 2016 at 11:45, Thierry Onkelinx <thierry.onkelinx at inbo.be> wrote:
>>> Dear Shadiya,
>>> 
>>> glmer() requires at least one random effect. You can use glm() to fit the model without random effects. 
>>> 
>>> Best regards,
>>> 
>>> ir. Thierry Onkelinx
>>> Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest 
>>> team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance 
>>> Kliniekstraat 25
>>> 1070 Anderlecht
>>> Belgium
>>> 
>>> To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
>>> The plural of anecdote is not data. ~ Roger Brinner 
>>> The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey
>>> 
>>> 2016-04-27 10:38 GMT+02:00 Shadiya Al Hashmi <saah500 at york.ac.uk>:
>>>> Good morning,
>>>> 
>>>> 
>>>> I have a data design which includes 3 factors of interest/*experimental
>>>> manipulations* (using Barr et. al’s (2013) terminology); namely *Listgp*
>>>> (listener group: T[monolinguals], TA [bilinguals] and TQ [Turkish speakers
>>>> who know Arabic through reading Quran]), *length* (long and short vowels)
>>>> and *context (emphatics, pharyngeals, plain and q)*.
>>>> 
>>>> 
>>>> 
>>>> *Listgp* is a *between-listener* (subject) and *within-stimulus* (item)
>>>> variable [(1|listener), (1+Listgp|stimulus)] while both *length* and
>>>> *context* are *within-listener* and *between-stimulus* variables
>>>> [(1+length|listener), (1|stimulus) and (1+context|listener), (1|stimulus)].
>>>> 
>>>> 
>>>> 
>>>> My question is, how can I code this in the following maximal model lacking
>>>> the random effects (for the time being?
>>>> 
>>>> 
>>>> 
>>>> maxmodal<- glmer(match ~ Listgp + length + context + gender + age + freq.,
>>>> data = msba, family = "binomial", control = glmerControl(optimizer =
>>>> "bobyqa"), nAGQ =1)
>>>> 
>>>> 
>>>> 
>>>> Here is more information on the variables involved.
>>>> 
>>>> *DV/Y (response):* match
>>>> 
>>>> *Random effects:* listener and stimulus
>>>> 
>>>> *Fixed effects/predictors:* a) *By-listener predictors*+ b) *by-stimulus
>>>> predictors: *
>>>> 
>>>> *a) By-listener predictors:* (*3*)
>>>> 
>>>> *1. Factors: (2)*
>>>> 
>>>> -*Listgp* (listener group): effect of interest (T: monolingual Turkish
>>>> speakers, TA: bilingual Turkish speakers and TQ: Turkish speakers who know
>>>> Arabic through reading Quran).)
>>>> 
>>>> -*gender* (female and male)
>>>> 
>>>> 
>>>> 
>>>> *2. Continuous predictors (1)*
>>>> 
>>>> -*age *(age of listeners at the time of experiment)
>>>> 
>>>> 
>>>> 
>>>> *b) By-stimulus predictors: (3)*
>>>> 
>>>> *1. Factors: (2)_*
>>>> 
>>>> -* context *(stimulus context: emphatic, pharyngeal, plain and q)
>>>> 
>>>> -*length *(stimulus length: long and short)
>>>> 
>>>> *2. Continuous predictors: (1)*
>>>> 
>>>> -*freq*. (stimulus frequency as per arabiCorpus)
>>>> 
>>>> Number of obs: 1224, groups:  listener, 51; stimulus, 24
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> Appreciating your kind input.
>>>> 
>>>> --
>>>> Shad
>>>> 
>>>>         [[alternative HTML version deleted]]
>>>> 
>>>> _______________________________________________
>>>> R-sig-mixed-models at 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