I'm having problems using betareg. I have a dataset that always shows different results depending on how I perform the analysis. I'm using lrtest to compare the models as follows:
snf.null <- betareg(overlay_of_niche_flowers ~ 1, data = data)
snf.tra <- betareg(overlay_of_niche_flowers ~ treatment, data = data)
snf.tam <- betareg(overlay_of_niche_flowers ~ size_of_net, data = data)
snf.traetam <- betareg(overlay_of_niche_flowers ~ treatment + size_of_net, data = data)
snf.traxtam <- betareg(overlay_of_niche_flowers ~ treatment * size_of_net, data = data)
lrtest(snf.nulo, snf.tam, snf.tra, snf.traetam, snf.traxtam)
When I do this, snf.traetam is the only significant model, but comparing the models independently with the null model, all of which are significant.
I also tried to make a simplification of the models:
# testing the best model
lrtest(snf.traxtam, snf.traetam) #no - continue traetam
# best model snf.traetam
simplifying - treatment
snf.traetamstr <- update(snf.traetam, . ~ . treatment)
lrtest(snf.traetamstr, snf.traetam ) #yes - continue with treatment
lrtest(snf.traetam)
summary(snf.traetam)
#size
snf.traetamsta <- update(snf.traetam, . ~ . - net_size)
lrtest(snf.traetam, snf.traetamsta) #yes - size stays
I don't know if I'm approaching it the right way.
lrtest()with multiple models: stats.stackexchange.com/questions/173375/likelihood-ratio-test-for-three-models – Sal Mangiafico Aug 04 '22 at 15:06betareg(data$y ~ data$x)but always usebetareg(y ~ x, data = data)instead. First, it's easier to read. Second, and more importantly, other methods likepredict()will not work correctly with thedata$syntax. Same forlm()andglm()etc. I've edited your question correspondingly. – Achim Zeileis Aug 05 '22 at 10:14