Dear Claire,<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I am working on a lmer regression. I have two modality factors (factors A and B), and one that has four levels (factorC). For this factor, I want to compare level 1 with level 2, then level 1 with 3 and level 1 with 4.</blockquote>
<div><br>That is not a helmert contrast. A helmert contrast compares the mean for each level of a factor against the mean of all subseqequent levels (a reverse helmert contrast would compare to the mean of the preceding levels). what you're doing could be done with treatment or contrast coding.<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
model = lmer(DV ~ factorA + factorB + factorC + factorA*factorC + (1|Corpustext), data=corpus, family="binomial",contrasts = list(factorC = "contr.helmert"))<br>
<br>
- I've included helmert contrast in the model, but how can I make sure that the contrasts are the ones I intended?</blockquote><div><br>you can define the order of the levels and hence which ones will be compared with which ones by <br>
<br>factor(factorC, levels=c('c','a','b') or however you want to order them. <br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
- If the interaction between factorA and factorC is not significant for one contrast, shall I remove this contrast (then, how can I do that) or keep it in the final model?</blockquote><div><br>I would keep it unless you have problems fitting an adequate model due to data sparsity (overfitting). <i>If </i>you want to remove any interactions, you have to recode factorC into separate variables (i.e. do the coding manually, resulting in 3 new variables instead of factorC: factorC1vs2, factorC1vs3, factorC1vs4), so that you can remove the interaction for only some of the contrasts. <br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
Finally, when I check my actual final model with the somers2 function, I get the following values:<br>
C Dxy n Missing<br>
0.769677 0.539354 1311.000000 0.000000<br>
- Is my model properly fitted? (I know a Dxy of 1 is a perfectly fit model)</blockquote><div><br>I don't use this function, but my understanding is that the Dxy is an attempt to have an R-square like pseudo measure for logit models. so, it looks ok to me. But note that these measures do not show you whether a model is appropriately fitted. For that you should conduct model evalutation. The slides on the WOMM pages contains a section on that (the JaegerKuperman slides).<br>
<br>Florian <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
Many thanks for your help.<br>
<br>
Claire Delle Luche<br>
<br>
Laboratoire Dynamique du Langage<br>
14, avenue Berthelot<br>
69007 Lyon<br>
France<br>
<br>
_______________________________________________<br>
R-lang mailing list<br>
<a href="mailto:R-lang@ling.ucsd.edu">R-lang@ling.ucsd.edu</a><br>
<a href="http://pidgin.ucsd.edu/mailman/listinfo/r-lang" target="_blank">http://pidgin.ucsd.edu/mailman/listinfo/r-lang</a><br>
</blockquote></div><br>