sim_crt: Simulate a basic cluster randomised trial

Description Usage Arguments Value

View source: R/sim_crt.R

Description

This function simulates CRTs for a range of cluster and participants

Usage

1
2
3
4
5
6
7
8
sim_crt(
  n_clusters = 10,
  n_cluster_individuals = 100,
  intercept = 0.2,
  trt_effect = 2,
  s2b = 0.05,
  s2w = 0.95
)

Arguments

n_clusters

Number of cluster in the trial

n_cluster_individuals

average number of individuals per cluster

intercept

the value of the outcome in the control group

trt_effect

the treatment effect in the trial

s2b

The between cluster standard devation

s2w

The within cluster standard devation

Value

Data.frame with cluster_id, ind_id, trt, outcome.


jarvisc1/SIMcrt documentation built on March 9, 2020, 12:15 a.m.