[R-sig-ME] lme4 question
Thierry Onkelinx
thierry.onkelinx at inbo.be
Wed Jul 19 16:32:58 CEST 2017
No, This would assume that both stimuli originate from the same
distribution. DV ~ type*IV+(1|id)+(0+type|id)+(0+factor(type)|stimulus)
would allow a differente variance for each type of stimulus. Note however
that you have only 4 stimuli from each type. You can get reasonable
variance estimates from only 4 groups...
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
2017-07-19 16:26 GMT+02:00 Ahreum Maeng <amaengwork op gmail.com>:
> Thank you so much for your reply! Just one more question -- would the
> model still be able to account for the fact that the 4 stimuli were sampled
> from population A and B respectively?
>
> Thanks again,
> Ahreum
>
> On Wed, Jul 19, 2017 at 9:19 AM, Thierry Onkelinx <
> thierry.onkelinx op inbo.be> wrote:
>
>> Dear Ahreum,
>>
>> Keep the mailinglist in cc.
>>
>> Your coding is wrong. Look at the model output. You'll see 5 groups for A
>> and B instead of 4. You need all stimuli in a single variable (e.g. A1, A2,
>> A2, A4, B1, ...). The model becomes DV ~ type*IV+(1|id)+(0+type|id)+(1|
>> stimulus)
>>
>> 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
>>
>> 2017-07-19 15:58 GMT+02:00 Ahreum Maeng <amaengwork op gmail.com>:
>>
>>> No it is not a complete data. I show just part of it as an example.
>>> The grouping variable is "type": there are two types A (coded as 1) and
>>> B (coded as 0).
>>>
>>> id: individuals
>>> type: 2 types of stimuli nested within id. repeated within individual
>>> A_id: there are 4 different stimuli within each type (A and B). This
>>> variable indicates 4 different stimuli within type A. coded as 1, 2, 3, 4.
>>> B_id: there are 4 different stimuli within B.coded as 1, 2, 3, 4.
>>> IV: this variables is characteristics of each stimuli.
>>> DV: responses of individuals for stimuli.
>>>
>>> Please let me know if you need further information about the data set.
>>>
>>> Thank you so much for your kind help in advance,
>>> Ahreum
>>>
>>>
>>> On Wed, Jul 19, 2017 at 7:52 AM, Thierry Onkelinx <
>>> thierry.onkelinx op inbo.be> wrote:
>>>
>>>> Dear Ahream,
>>>>
>>>> You need to tell us more about the data set. Is this the complete data?
>>>> What variable indicates the grouping?
>>>>
>>>> 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
>>>>
>>>> 2017-07-19 14:21 GMT+02:00 Ahreum Maeng <amaengwork op gmail.com>:
>>>>
>>>>> Hello,
>>>>>
>>>>> I am trying to run the following model:
>>>>>
>>>>> DV ~ type*IV+((1|id)+(0+type|id)+(1|A_id)+(1|B_id))
>>>>>
>>>>> As you see on the following sample data structure, "type" is repeated
>>>>> measure where 0=A, 1=B. There are 4 ids within each type A and B.
>>>>> Thus, I coded "B_id" as "0" when the type is 1 (A) and coded "A_id" as
>>>>> "0"
>>>>> when type is 0 (B).
>>>>> Would it be a right way to deal with this repeated measure issue?
>>>>>
>>>>> id type A_id B_id IV DV
>>>>> 1 1 0 1 1 3.14
>>>>> 2 1 0 2 2 4.67
>>>>> 3 1 0 3 3 4.23
>>>>> 4 1 0 4 1 7.00
>>>>> 1 0 1 0 2 3.00
>>>>> 2 0 2 0 3 4.77
>>>>> 3 0 3 0 1 4.25
>>>>> 4 0 4 0 2 7.12
>>>>>
>>>>> Thank you so much for your help in advance!
>>>>>
>>>>> _______________________________________________
>>>>> R-sig-mixed-models op r-project.org mailing list
>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Ahreum Maeng
>>> Assistant Professor in Marketing
>>> KU School of Business
>>> University of Kansas
>>> #2183 Capitol Federal Hall
>>> 1654 Naismith Drive.
>>> Lawrence, KS 66045
>>> https://sites.google.com/site/ahreummaeng1/research
>>> <https://sites.google.com/site/ahreummaeng1/home>
>>>
>>
>>
>
>
> --
> Ahreum Maeng
> Assistant Professor in Marketing
> KU School of Business
> University of Kansas
> #2183 Capitol Federal Hall
> 1654 Naismith Drive.
> Lawrence, KS 66045
> https://sites.google.com/site/ahreummaeng1/research
> <https://sites.google.com/site/ahreummaeng1/home>
>
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list