Closed IndrajeetPatil closed 6 years ago
How do I check for singularity?
I am actually not sure if this is the problem. Because, as seen in the example above, even if the model is singular, the stats::aov
function still works, and so does broom::tidy
.
Here is a look at the process tree-
1: sjstats::omega_sq(model = stats::aov(formula = mpg ~ wt + qsec + Error(disp/am), data = dplyr::filter(mtcars, cyl == 6), na.action = na.omit), ci.lvl = 0.95
2: es_boot_fun(model = model, type = "pomega", ci.lvl = ci.lvl, n = n)
3: dplyr::bind_cols(x, es[, -1])
4: cbind_all(x)
So this is the line where the function is failing- https://github.com/strengejacke/sjstats/blob/1ec2a2cb55e92de1452fba9988624840998051b1/R/eta_sq.R#L442
It's then worth having a look at what's going on here- https://github.com/strengejacke/sjstats/blob/1ec2a2cb55e92de1452fba9988624840998051b1/R/eta_sq.R#L426-L439
Will do some digging myself sometime this week, in case you don't manage to resolve this before.
I'm on holiday and won't get back to this before August.
If the error model for
aovlist
objects is singular, then eta-squared and omega-squared functions don't work (only ifpartial = FALSE
).Any way to safeguard against this? Maybe just produce
NA
s?Created on 2018-07-13 by the reprex package (v0.2.0).