Skip to content

[R-meta] Comparing Models Using Anova () Error

2 messages · Jake Downs, Wolfgang Viechtbauer

#
Apparently I have two questions tonight.

I keep receiving an error on two sets of models I'm trying to compare using
LRT via Anova command. I am confused why these models won't compare when my
others are.

I'm conducting a 3 level analysis, and as part of my moderator analysis I
am adding a single fixed variable to the original fit, and then comparing
the two models with anova. The original models were fit using REML, but for
comparison purposes I have refit with ML.

There are two sets of models where I get the following error:

Error in anova.rma(rq1.fit2.ml, rq2.age.ml) : Observed outcomes and/or
sampling variances/covariances not equal in the full and reduced model.

Error in anova.rma(rq1.fit2.ml, rq2.dose.h.ml) : Observed outcomes and/or
sampling variances/covariances not equal in the full and reduced model.

Why might this be the case? And how can I fix it?

Best (again),

Jake Downs
#
Dear Jake,

As the error says, the datasets used to fit the two models are not identical. This is very likely a result of missing values in those moderators. Hence, the dataset used for fitting the model without the moderator is not the same as with. For a meaningful comparison, fit the model without the moderator selecting only those rows where the moderator variable is not missing (use something like subset=!is.na(...)) when fitting the model).

Best,
Wolfgang