analysis_functions: Multilevel model based tests for cross site variation

analysis_functionsR Documentation

Multilevel model based tests for cross site variation

Description

These minimal methods test for cross-site variation in a multi-site randomized trial using multilevel models. They assume a passed dataframe with specifically named columns.

In particular, Yobs is the outcome column, Z is the treatment column, W is a site-level covariate column, and sid is the site ID column (categorical).

Usage

analysis_idio(df)

analysis_combination(df)

analysis_systematic(df)

analysis_systematic_RTx(df)

Arguments

df

Dataframe to analyze. Columns of Z, sid, Yobs, and W assumed to exist, with those names.

Value

P-value from the test.

Functions

  • analysis_idio(): The idiosyncratic version tests for cross site variation using a likelihood ratio test vs. a model with no random slope (but random intercept). This is the RIRC version of such a test.

  • analysis_combination(): This is a combination test: it uses a liklihood ratio test on a model with both systematic and idiosyncratic variation (i.e., it has an interaction of the covariate and outcome, and also includes a random effect for treatment), comparing to a model which has neither.

  • analysis_systematic(): Test for cross site variation by testing for a covariate predictive of variation. This version does not allow for random tx variation (random slope).

  • analysis_systematic_RTx(): Systematic test with the random idiosyncratic variation. This tests for systematic variation, ignoring any explicitly modeled random (idiosyncratic) treatment variation.


lmiratrix/blkvar documentation built on Nov. 18, 2024, 1:27 p.m.