dot-detect_L2_only: Detect whether the predictors are L2-only

.detect_L2_onlyR Documentation

Detect whether the predictors are L2-only


Detects whether the predictors are level-2 only. E.g., whether location and scale are covariates are the same across all n_k observations of each K. This is important for efficiency reasons. If the covariates are invariant across repeated observations of the given group k, for all K, then we can compute predicted values once, and broadcast the prediction, rather than compute the prediction for every single row. Specifically, it detects if all x == x[1], where x is a group's data, for each column in mf.


.detect_L2_only(mf, group)



Data frame for predictors. Should contain no missings.


Grouping variable for the model frame.


Logical. TRUE if the covariates appear to be level-2 only.


Stephen R. Martin

LMMELSM documentation built on Dec. 28, 2022, 1:32 a.m.