[R-sig-ME] Observation-level random effects

Thierry Onkelinx th|erry@onke||nx @end|ng |rom |nbo@be
Fri Apr 9 12:51:17 CEST 2021


If you can't group observations in a meaningful way into groups of
families, then you can't use the (group of) families as a random effect.

ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkelinx using inbo.be
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be

///////////////////////////////////////////////////////////////////////////////////////////
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
///////////////////////////////////////////////////////////////////////////////////////////

<https://www.inbo.be>


Op vr 9 apr. 2021 om 11:46 schreef Shahinur, Islam <shahinur.islam using mun.ca>:

> Hello Thierry,
>
> No, they are not the replicates of the same family, but 20 different
> families under Cross (Population) Farm.NA.
>
> I am trying to see both Tank effect and family effect (possibly nested
> within cross) separately, but it's giving me hard time with family.
>
> Thank you for checking into this, and your suggestions will be much
> appreciated!
>
> Regards,
>
> Shahin
>
>
> On Fri., Apr. 9, 2021, 4:56 a.m. Thierry Onkelinx <
> thierry.onkelinx using inbo.be> wrote:
>
>> Dear Shahin,
>>
>> I assume that a1 to a20 are replicates of the same family "a". If that is
>> the case, you need to use the name of the family ("a") instead of the
>> replicate id's (a1 to a20). Currently, it looks like every observation has
>> a unique value for family. That would lead to an observation level random
>> effect, which you can't use with a Gaussian distribution as it confounds
>> with the residuals.
>>
>> Best regards,
>>
>> ir. Thierry Onkelinx
>> Statisticus / Statistician
>>
>> Vlaamse Overheid / Government of Flanders
>> INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE
>> AND FOREST
>> Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
>> thierry.onkelinx using inbo.be
>> Havenlaan 88 bus 73, 1000 Brussel
>> www.inbo.be
>>
>>
>> ///////////////////////////////////////////////////////////////////////////////////////////
>> 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
>>
>> ///////////////////////////////////////////////////////////////////////////////////////////
>>
>> <https://www.inbo.be>
>>
>>
>> Op do 8 apr. 2021 om 18:50 schreef Shahinur, Islam <shahinur.islam using mun.ca
>> >:
>>
>>> Hello All,
>>>
>>> Thank you, Dr. Thierry, for the reply!
>>>
>>> I am still having the problem!- just in case, I have attached my data
>>> template.
>>>
>>> When I am running the following code:
>>> model1 <- lmer(development~ 1 +cross + egg +cross*egg + (1|Tank)+
>>> (1|family) ,data=sp)
>>>
>>> Still getting the errors: Error: number of levels of each grouping
>>> factor must be < number of observations (problems: family).
>>>
>>> Your suggestions will be much appreciated.
>>>
>>> Regards,
>>>
>>> Shahin
>>>
>>> <><><><><><><><><><><><><><><><><><><><><><><><><><>
>>>
>>> Shahinur S. Islam
>>> PhD Candidate, Department of Ocean Sciences
>>> Ocean Sciences Centre, Memorial University of Newfoundland
>>> St. John's, NL  A1C 5S7, Canada
>>> Cell: (+1)709-740-3324; Twitter: @EcoEvoGen
>>>
>>>
>>> On Thu, Apr 8, 2021 at 1:35 PM Thierry Onkelinx <
>>> thierry.onkelinx using inbo.be> wrote:
>>>
>>>> Dear Shanin,
>>>>
>>>> You can't use an observation level random effect with a Gaussian
>>>> distribution.
>>>> Please provide the number of observations, number of unique families
>>>> and number of unique tanks.
>>>>
>>>> Best regards,
>>>>
>>>> Thierry
>>>>
>>>> ir. Thierry Onkelinx
>>>> Statisticus / Statistician
>>>>
>>>> Vlaamse Overheid / Government of Flanders
>>>> INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE
>>>> AND FOREST
>>>> Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
>>>> thierry.onkelinx using inbo.be
>>>> Havenlaan 88 bus 73, 1000 Brussel
>>>> www.inbo.be
>>>>
>>>>
>>>> ///////////////////////////////////////////////////////////////////////////////////////////
>>>> 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
>>>>
>>>> ///////////////////////////////////////////////////////////////////////////////////////////
>>>>
>>>> <https://www.inbo.be>
>>>>
>>>>
>>>> Op do 8 apr. 2021 om 17:08 schreef Shahinur, Islam <
>>>> shahinur.islam using mun.ca>:
>>>>
>>>>> Hello All,
>>>>> I am having trouble with observation-level random effects while
>>>>> running the
>>>>> full model investigating two fixed covariates (one categorical and one
>>>>> continuous) and two random covariates (tank and family). While I am
>>>>> using
>>>>> the only tank random effect, it works fine, but while I am adding
>>>>> another
>>>>> random covariate (family), I am getting the error message: Error:
>>>>> number of
>>>>> levels of each grouping factor must be < number of observations
>>>>> (problems:
>>>>> family).
>>>>>
>>>>> FYI, here is my code:
>>>>> model1 <- lmer(development~ 1 +cross + egg +cross*egg + (1|Tank)+
>>>>> (1|family) ,data=sp)
>>>>>
>>>>> I do have different family IDs (n=108) for each row, I assume it
>>>>> creates
>>>>> the problem.
>>>>>
>>>>> Your suggestions will be much appreciated!
>>>>>
>>>>> Regards,
>>>>>
>>>>> Shahin
>>>>>
>>>>> <><><><><><><><><><><><><><><><><><><><><><><><><><>
>>>>>
>>>>> Shahinur S. Islam
>>>>> PhD Candidate, Department of Ocean Sciences
>>>>> Ocean Sciences Centre, Memorial University of Newfoundland
>>>>> St. John's, NL  A1C 5S7, Canada
>>>>> Cell: (+1)709-740-3324; Twitter: @EcoEvoGen
>>>>>
>>>>>         [[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