jslefche / piecewiseSEM

Piecewise Structural Equation Modeling in R
152 stars 48 forks source link

Large disagreement between Fisher C and AIC #292

Open Arch1985 opened 10 months ago

Arch1985 commented 10 months ago

Hey,

I think this issue is to do with my lack of understanding / user error rather than a bug - but any advice would be really appreciated it.

My piecewise SEM model initially was a poor fit - dsep tests suggested including two additional pathways that make biol sense so that is fine. I did this and according to the Fisher test my model is acceptable, the Chi-Squared diagnostic disagrees. Some disagreement I understand - but the magnitude of this surprises me. Code below sign-off.

Do you have any advice? Really sorry if I missed the answer in the online documentation and am wasting your time. I have tried all sorts to work out what is going on - I suspect a power issue might lie at the heart of this...

Thanks in advance, Ruth

Model - note continuous variables scared for convergence

glmsemIndividReduced<- psem(glmer(Crithidia~Weight+site+collected_doy+Precipitation+(1|Year), family=binomial,data=PathData2,control=glmerControl(optimizer="bobyqa", optCtrl=list(maxfun=100000))), lmer(Weight~site+Temperature+Temperature:Precipitation+(1|Year),data=PathData2), glmer(reproduction~collected_doy+Weight+Temperature+Precipitation+ (1|Year),family=binomial,data=PathData2,control=glmerControl(optimizer="bobyqa", optCtrl=list(maxfun=100000))), glmer(survival~site+Weight+collected_doy+Precipitation+ (1|Year),family=binomial,data=PathData2,control=glmerControl(optimizer="bobyqa", optCtrl=list(maxfun=100000)))) summary(glmsemIndividReduced, .progressBar = T)

Global Goodness of fit output Chi-Squared = 652.647 with P-value = 0 and on 8 degrees of freedom Fisher's C = 11.939 with P-value = 0.748 and on 16 degrees of freedom

Full output attached as screenshot. PathAnalysisOutput1Of2 PathAnalysisOutput2of2

YellowAAA commented 10 months ago

I also found this problem. The AIC value of the same data running in version 2.1.2 is much lower than that in this version. I don't know why there is such a difference. I hope to get a professional answer.

Arch1985 commented 7 months ago

YellowAAA did you manage to get to the bottom of this by any chance? Picked up this manuscript again and still cannot work it out - sure its cos I don't understand the theory enough so I need to comb the book / paper again for answers, but wondered if you have had any luck?