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

.detect_L2_onlyR Documentation

Detect whether the predictors are L2-only

Description

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.

Usage

.detect_L2_only(mf, group)

Arguments

mf

Data frame for predictors. Should contain no missings.

group

Grouping variable for the model frame.

Value

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

Author(s)

Stephen R. Martin


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