rerandomize_data: Rerandomize a given multisite simulated dataset and...

View source: R/gen_multilevel_data.R

rerandomize_dataR Documentation

Rerandomize a given multisite simulated dataset and recalulate observed outcomes

Description

Permute the treatment vector Z within site ID. Useful for simulations of finite sample inference where the dataset should be held static and only randomization is necessary.

Usage

rerandomize_data(dat)

Arguments

dat

Dataframe from, e.g., generate_multilevel_data() that has two columns, 'sid', and 'Z'.

Value

Same dataframe with treatment shuffled and Yobs recalculated.


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