[R-sig-ME] how to look at the effect of a variable I need to control for/ random effects

glenda mendieta glendamendieta at gmail.com
Tue Nov 22 23:05:42 CET 2011


Hi Andrew,
thank you very much for your reply and help. I set up the dummy 
variables for n-1 census and basically the values of AIC as well as the 
estimates didn't really differ when comparing a model with dummy 
variables and a model with census (as factor) placed as a fixed 
variable. Running an anova for both models showed they were similar. 
When plotting res. vs. fitt, the same.
glmm.abspre<-glmer(abs.pres~census+avail.surface+ (1|tree), 
data=db.e_St, family=binomial(link=logit))
glmm.asbpre.dum<-glmer(abs.pres~D2+D3+D4+D5+avail.surface+ (1|tree), 
data=db.e_St, family=binomial(link=logit))
the variables, just to recall:
*abs.pre*: binary; *census*: factor, 5 levels; 
*avail.surface*:continuous var.; *tree*:factor, ~89 levels; *spp*:~89 levels

Here some questions out of this, for you or anybody that might want to 
spare some time, which I would certainly be grateful for:
Would this mean that my actual model, should be "census" (as factor) as 
fixed effect:
glmm.abspre<-glmer(abs.pres~Fcensus*avail.surface+ (1|tree), 
data=db.e_St, family=binomial(link=logit))
Or should I instead have "census" as a standardized continuous values? 
(which in an anova shows difference, DF: -6 and only 4 points more in 
the AIC).
Because if I use dummy variables, would I be able to place a term of 
interaction between time (eitherway as a factor or a continuous value) 
and avail.surface?.

At last, a consultation, about random effects:
(1|tree/spp): does this means that the species ("spp") occurring in tree 
1 are not correlated to each other in time?
(1|tree) +(1|spp): does this means that both random factors are 
independent sources of variation?
My question is, considering that my reasoning above makes sense, what 
would be the best way to fit the random effect "spp" in a way that does 
not indicate either of the above?.

Thanks again for your time,

glenda mendieta-leiva
PhD candidate
University of Oldenburg, Germany
Smithsonian Tropical research institute


On 18/11/2011 17:50, Andrew Miles wrote:
> I believe that if you include all the census years as dummy variables 
> in the fixed effects part of the model (minus one for the reference 
> category), that should eliminate the need to include the census years 
> as a random effect since you are incorporating all of the temporal 
> information into the model, and thereby controlling for it.  You can 
> still use random effects to control for any other sort of dependency, 
> such as between samples from the same tree.
>
> Someone with greater statistical knowledge than I have may wish to 
> weigh in on this as well.
>
> Andrew Miles
>
>
> On Nov 18, 2011, at 11:13 AM, glenda mendieta wrote:
>
>> Dear list members:
>>
>> a while ago I made a consultation about the use of GLMM's that can be 
>> found here:
>> https://stat.ethz.ch/pipermail/r-sig-mixed-models/2011q4/006873.html
>> I know there is a lot going on in the list for every consultation to 
>> be answered, but, this time I have "simpler" question:
>>
>> I have a doubt concerning a factor I want to see the effect from, but 
>> I also need to control for.
>> My data consists on:
>> 5 *census* in 10 years, each time we inspect for abundance of species 
>> (*spp*) occurring on different individuals of a unique species of 
>> *tree* (plots).
>> -census: 5 levels, as Fixed effect, since I want to see the effect of 
>> time in the change of pres.abs or abundance of species
>> -trees: ~89 to 113, each individual tree inspected, as Ran.Eff., 
>> since I hoped to control for temporal correlation, as we revise the 
>> same trees every census
>> -spp: 89, number per species of epiphytes growing on the trees
>> -abs.pres: absence presence data of species growing on trees per 
>> census (derived form count data), as ResVar
>> -avail.surface: surface in m2 per tree per census, as FE
>>
>> in the following model, and with the above mentioned data, I would 
>> like to test for the effect of time and surface availability on 
>> colonization (absence/presence). My problem is that I don't know how 
>> to combine the fact that the data are temporally correlated and 
>> control for that but still look at the effect of time in absence and 
>> presence of species.
>> I tried placing time as a centered continuous variable as fixed 
>> effect "c.census", and then again, as random effect, but as a factor 
>> in (census|tree) or would be enough as: (1|tree), since the trees are 
>> the ones being inspected every time?
>>
>> glmm.all<-glmer(abs.pres~c.census*avail.surface+ (census|tree), 
>> data=db.e_St, family=binomial(link=logit))
>>
>> I would very much appreciate a hint on this since I got stuck with it 
>> and can not seem to find my way around it.
>>
>> thank you very much for your time in advance,
>>
>> glenda mendieta-leiva
>> PhD candidate
>> University of Oldenburg, Germany
>> Smithsonian Tropical research institute
>>
>> _______________________________________________
>> R-sig-mixed-models at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>




More information about the R-sig-mixed-models mailing list