Hi folks! When running a gamm and seing its plots I found the residuals locations are shifted , I presume its because the gam smooth is fitted after taking the random effects into account (obviously). But I am not understanding how its possible to change data points location in these plots. The same is valid for the lmer, I usually plot the fitted line whith the residuals, but I have never seen this discrepancy in points positions with the fitted line before. I would appreciate if anyone could clarify what is happening. Plots are attached codes: a) mod1=gamm(y1_r_prop~s(areia), random = list(area=~1,chave=~1),data=dadosest) plot(mod1$gam,residuals=TRUE,pch=1.3,shift = coef(mod1$gam)[1]) b) mod2=gamm(y1_r_prop~s(areia), random = list(chave=~1),method="ML",data=dadosest) plot(mod2$gam,residuals=TRUE,pch=1.3,shift = coef(mod2$gam)[1]) c) mod3=gamm(y1_r_prop~s(areia), random = list(area=~1),method="ML",data=dadosest) plot(mod3$gam,residuals=TRUE,pch=1.3,shift = coef(mod3$gam)[1]) d) mod4=gam(y1_r_prop~s(areia),method="ML",data=dadosest) plot(mod4,residuals=TRUE,pch=1.3,shift = coef(mod4)[1]) e) plot(y1_r_prop~areia) curve(18.3048+-2.2142*x,add=TRUE) # coefficients from a lmer with both area and chave random effects Thank you all!
gamm shifting residuals in plots
2 messages · Vinicius Maia, Thierry Onkelinx
The mailing accepts only a limited range of file extensions. Your images got stripped from your mail. Put them somewhere online and send the link. Sending a minimal reproducible example is better. 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 18 jan. 2019 om 02:11 schreef Vinicius Maia < vinicius.a.maia at hotmail.com>:
Hi folks! When running a gamm and seing its plots I found the residuals locations are shifted , I presume its because the gam smooth is fitted after taking the random effects into account (obviously). But I am not understanding how its possible to change data points location in these plots. The same is valid for the lmer, I usually plot the fitted line whith the residuals, but I have never seen this discrepancy in points positions with the fitted line before. I would appreciate if anyone could clarify what is happening. Plots are attached codes: a) mod1=gamm(y1_r_prop~s(areia), random = list(area=~1,chave=~1),data=dadosest) plot(mod1$gam,residuals=TRUE,pch=1.3,shift = coef(mod1$gam)[1]) b) mod2=gamm(y1_r_prop~s(areia), random = list(chave=~1),method="ML",data=dadosest) plot(mod2$gam,residuals=TRUE,pch=1.3,shift = coef(mod2$gam)[1]) c) mod3=gamm(y1_r_prop~s(areia), random = list(area=~1),method="ML",data=dadosest) plot(mod3$gam,residuals=TRUE,pch=1.3,shift = coef(mod3$gam)[1]) d) mod4=gam(y1_r_prop~s(areia),method="ML",data=dadosest) plot(mod4,residuals=TRUE,pch=1.3,shift = coef(mod4)[1]) e) plot(y1_r_prop~areia) curve(18.3048+-2.2142*x,add=TRUE) # coefficients from a lmer with both area and chave random effects Thank you all!
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models