Dear all,

I am a French student in Biostatistics in an engineering school (fifth and last year) and I am currently doing an internship to finish my studies at the CHU of Clermont-ferrand.

During my internship, I am working on psychiatric data and for my analyses I am using your package - lme4).
But I encounter some problems by using it... The first one is about the use of the model and the other about the function interaction.


·         Indeed, I am using Fit Generalized Linear Mixed-Effects Models (glmer) function with logit link in binomial family  to explain a variable (0/1) by other variables.
But sometimes my model does not work and I have 2 kinds of mistakes :
1) > model <- glmer(Motif ~ as.factor(anxio2) + (1|ID), data=d31O, family=binomial(link="logit"))
Erreur dans pwrssUpdate(pp, resp, tolPwrss, GQmat, compDev, fac, verbose) : Downdated VtV is not positive definite

Else, I have this mistake :
2)  Erreur : pwrssUpdate did not converge in 30 iterations

To correct that, I tried two solutions (search on the web) by adding a glmerControl :
- Using an other optimizer like "bobyqa" and sometimes it works, but is it correct to do that ? Is it a similar result that the default optimizer ?
Or,
- I am changing the tolPwrss like in this case :
>model <- glmer(Motif ~ as.factor(AP2) + (1|ID), data=d31O, family=binomial(link="logit"),control= glmerControl(tolPwrss=0.1))
But I'm wondering if the result is reliable even if I choose a higher value (like tolPwrss=1 in some case) ?

In other words, is adding a different optimizer and/or tolPwrss changing the result ? If yes, is the result still reliable ?



·         Then, my other problem is by using the interactions in the model.
In fact my variables are factors and firstly I want to use ":", but it seems it doesn't work with two factors :
> model <- glmer(Motif ~ as.factor(AP2):as.factor(antidep2) + (1|ID), data=d31O, family=binomial(link="logit"))
Erreur dans lme4::glFormula(formula = Motif ~ as.factor(AP2):as.factor(antidep2) +  : rank of X = 7 < ncol(X) = 10

I found the function iteraction which replace ":", but is it correct to use this function with 2 factors, and is the resulat reliable ? If it's doing the same thing, I don't understand why it doesn't work with ":" ? I obtain someting like that :
Fixed effects:
                                                                          Estimate Std. Error z value Pr(>|z|)
(Intercept)                                                         9.230e+00  7.442e+00   1.240    0.215
interaction(as.factor(AP2), as.factor(antidep2))1.0 2.694e+01  4.409e+07   0.000    1.000
interaction(as.factor(AP2), as.factor(antidep2))2.0 2.370e+01  1.891e+04   0.001    0.999
interaction(as.factor(AP2), as.factor(antidep2))0.1 2.454e+00  3.319e+00   0.740    0.460
interaction(as.factor(AP2), as.factor(antidep2))1.1 1.769e+01  1.097e+05   0.000    1.000
interaction(as.factor(AP2), as.factor(antidep2))2.1 1.106e+01  1.134e+01   0.976    0.329
interaction(as.factor(AP2), as.factor(antidep2))2.2 1.500e+01  6.144e+04   0.000    1.000

Then, If I tried to add my variables to my model with the interaction, it doesn't work :
> model <- glmer(Motif ~ interaction(as.factor(AP2),as.factor(antidep2)) + as.factor(AP2) + as.factor(antidep2) + (1|ID), data=d31O, family=binomial(link="logit"),control= glmerControl(optimizer="bobyqa"))
Erreur dans lme4::glFormula(formula = Motif ~ interaction(as.factor(AP2),  : rank of X = 7 < ncol(X) = 11

I hope you will understand what I explained and you will be able to help me ..

If there is few things I haven't been clear, don't hesitate to ask me again.

Thank you for your attention to these matters.

Best regards,

Mathilde

--
Mathilde Saussac
Elève ingénieur 5ème année
Polytech Clermont-Ferrand
--------------------------
mathilde.saussac@gmail.com<mailto:mathilde.saussac@gmail.com>
06.86.00.26.83


	[[alternative HTML version deleted]]

