Skip to contents

Predicate test — returns TRUE if x carries the multisitedgp_design S3 class (i.e., was produced by multisitedgp_design or by a preset such as preset_education_modest), FALSE otherwise.

Usage

is_multisitedgp_design(x)

Arguments

x

Object to test.

Value

A single logical value.

Details

Use this in defensive code, custom wrappers, or before calling validate_multisitedgp_design. A failed predicate means the input is not a locked design object — typically a plain list or a multisitedgp_data object passed by mistake.

References

Lee, J., Che, J., Rabe-Hesketh, S., Feller, A., & Miratrix, L. (2025). Improving the estimation of site-specific effects and their distribution in multisite trials. Journal of Educational and Behavioral Statistics, 50(5), 731–764. doi:10.3102/10769986241254286 .

Examples

# A real design object: TRUE.
is_multisitedgp_design(multisitedgp_design(J = 20L))
#> [1] TRUE

# Plain lists / data frames / NULL: FALSE.
is_multisitedgp_design(list(J = 20L))
#> [1] FALSE
is_multisitedgp_design(NULL)
#> [1] FALSE