Continuous variable as random slope and the minimum number of levels for a categorical variable to be treated as random
Dear all, I've recently read in this page (https://dynamicecology. wordpress.com/2015/11/04/is-it-a-fixed-or-random-effect/) the following text "First you CANNOT treat a continuous variable as a random effect. So if you are putting area or temperature or body size is in they may be a nuisance/control variable but they are a fixed effect. Of course you are only estimating one parameter (the slope) so there is no degree of freedom cost to treating it as random. And it makes no sense to ask what is the variance across a continuous variable." Actually I don't know why it doesn't make any sense ask what is the variance across a continuous variable. I've seen the classical example on sleepstudy data which treats a cntinuous variable as random slope: fm1 <- lmer (Reaction~Days+(Days|Subject), sleepstudy) with sleepstudy$Days being a continuous variable, and lmer estimates the variance of the Days slope. So... is it OK to use a continuous variable as random slope or not? Furthermore the post says: "[...] you should not treat a categorical variable with only two levels (e.g. two sites), also known as a binary variable, as a random effect. You wouldn?t take two measures and then try to estimate variance, but that is what you?re asking R to do if you treat it as random. Beyond that there is a lot of debate. But many people think <http://stats.stackexchange.com/questions/37647/minimum-number-of-levels-for-a-random-effects-factor> you should have at least 5 levels (e.g. 5 sites) before you treat something as random" Actually I've seen a lot of GLMMs done with random factors with just 2 levels. Is it acceptable or not? Thanks in advance, Michele
Research Associate @ NPSY-Lab.VR - University of Verona Research Associate @ AgliotiLab - University of Rome "La Sapienza" Iscrizione all'albo A dell'Ordine degli Psicologi del Veneto n.7733 office tel. 0039 045 802 8401 *http://agliotilab.org/lab-staff/phd-students/3rd-year/michele-scandola#anchor <http://agliotilab.org/lab-staff/phd-students/3rd-year/michele-scandola#anchor>* http://profs.formazione.univr.it/npsy-labvr/michele-scandola/ http://scholar.google.it/citations?user=mRc0hxsAAAAJ http://it.linkedin.com/pub/michele-scandola/24/967/313 *Le informazioni, i dati e le notizie contenute nella presente comunicazione e i relativi allegati sono di natura privata e come tali possono essere riservate e sono, comunque, destinate esclusivamente ai destinatari indicati in epigrafe. La diffusione, distribuzione e/o la copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario ? proibita, sia ai sensi dell?art. 616 c.p., sia ai sensi del D.Lgs. n. 196/2003. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di darcene immediata comunicazione anche inviando un messaggio di ritorno all?indirizzo e-mail del mittente.* *This e-mail (including attachments) is intended only for the recipient(s) named above. It may contain confidential or privileged information and should not be read, copied or otherwise used by any other person. If you are not the named recipient, please contact npsylab.vr at gmail.com <npsylab.vr at gmail.com> and delete the e-mail from your system. Rif. D.L. 196/2003.* [[alternative HTML version deleted]]