Closed AndrewCSlater closed 1 year ago
Hi @AndrewCSlater,
I found a small bug in the Rsquared function (when calculating the null model) that resulted in an underestimation of Rsquared. You can get the updated Rsquared function by installing the development version or simply using the anova workaround.
Note: Due to the Monte Carlo approximation, the Rsquared is not exact and varies slightly. So if you need an exact Rsquared (e.g. for parameter tuning), you should repeat the Rsquared calculation a few times and use the average.
Thanks for the report, I will add the last statement to the anova and Rsquared function.
Hi there, when analysing the R2 of a model I get 2 different results depending on the method I use.
mod = sjSDM(Y = as.matrix(y), env = as.matrix(scale(eo)), spatial = linear(scale(XY), ~0+X1+X2:X1:X2+I(X1^2)+I(X2^2)), se = T, iter = 200, device = "gpu")
a = Rsquared(mod, method = "McFadden") mAn = anova(mod, device = "gpu") mean(mAn$species$R2_McFadden$Full)
Are they providing information on different things, or could you recommend which one is best to use in reporting?
Many thanks for your help! Andrew