.detect_L2_only | R Documentation |
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)
mf |
Data frame for predictors. Should contain no missings. |
group |
Grouping variable for the model frame. |
Logical. TRUE if the covariates appear to be level-2 only.
Stephen R. Martin
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.