Two models are symbolically nested if you can tell they are nested just by looking at the model formula, without knowing what any variables or functions do
The example on the anova.svyglm
web page is
I(sch.wide=="Yes")~ell+meals+mobility
I(sch.wide=="Yes")~ell+meals+mobility+as.numeric(stype)
I(sch.wide=="Yes")~ell+meals+mobility+stype
The second and third models are symbolically nested in the first model; they consist of all the terms in the first model, plus a new term.
The third model is not symbolically nested in the second; you'd need to know what as.numeric
did to know that they were nested. Even more so, if you'd defined a new variable stype_n=as.numeric(type)
and the second model formula was
I(sch.wide=="Yes")~ell+meals+mobility+stype_n
you couldn't tell without looking at the variable definition or variable values that the models were nested.
Another important example of models that aren't symbolically nested is linear and regression spline models in a continuous variable: the regression spline is nested in the linear model, but you need to know quite a bit about the definitions to know this.
The reason for the distinction is that for symbolically nested models it is easy to decompose the larger model's design matrix into a part that's the same as the smaller model and a separate part, just by knowing how model.matrix
works. If they aren't symbolically nested, it's necessary to use something like QR decomposition and to have a threshold for treating columns as linearly dependent. The code is more complicated, and more numerically sensitive.