Skip to content

glmer() cluster sample size

3 messages · Thierry Onkelinx, Hedyeh Ahmadi

#
Hello all,
I'm running a glmer() model with 3 levels where individuals are nested within 21 sites and each individual has 1 to 2 repeated measures. My model has the random effect structure (1|site/subjet_id).

So I have sample sizes in glmer() output for 3 levels as follows:
Site=21
Subject_id:site=9334
Total number of observations=17592

I was wondering how are these sample sizes calculated in R?

I was under impression that they are just unique number of site, subject_id, and total number of rows, for complete cases across all my varibles, respectively. This is true for my site and total sample sizes but the subject_id:site sample size is confusing me. Shouldn't this just be the number of unique subject ids? When I look at number rof unique ids, I get 9301 but the glmer() output for subject_id:site is 9334.

Thank you in advance for your time.


 Best,


Biostatistician?
Keck School of Medicine
Department of Preventive Medicine
University of Southern California

LinkedIn
www.linkedin.com/in/hedyeh-ahmadi<http://www.linkedin.com/in/hedyeh-ahmadi>
#
It looks like some subjects were present at multiple locations. The number
of levels is the number of unique combinations of site and subject.

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 at 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 31 mrt 2023 om 01:11 schreef Hedyeh Ahmadi <hedyehah at usc.edu>:

  
  
#
Thank you Thierry! That was it...

Best,

Hedyeh Ahmadi, Ph.D.
Statistician
Keck School of Medicine
Department of Preventive Medicine
University of Southern California

LinkedIn
www.linkedin.com/in/hedyeh-ahmadi<http://www.linkedin.com/in/hedyeh-ahmadi>
<http://www.linkedin.com/in/hedyeh-ahmadi><http://www.linkedin.com/in/hedyeh-ahmadi>