blockclustr | R Documentation |
Constructs blocked clusters for blocked and clustered random assignment
blockclustr( data, id_var, block_vars, n_tr, n_units_per_clust, constraint_var = NULL, constraint_list = NULL, algorithm = "optGreedy", distance = "mahalanobis" )
data |
A dataframe with units in rows and variables in columns. |
id_var |
A string specifying which column of |
block_vars |
A string or vector of strings specifying which columns of |
n_tr |
An integer specifying the number of experimental conditions. This is also the number of clusters per block. |
n_units_per_clust |
An integer specifying the number of units that should be assigned to each cluster.
It will not be used if |
constraint_var |
An optional string specifying which column of |
constraint_list |
An optional list of vectors specifying all combinations of |
algorithm |
A string specifying the algorithm used to construct blockettes. See |
distance |
A string specifying the distance calculation used when constructing blockettes. See |
Returns a list of three elements:
design
a dataframe containing information about units
included in the experimental design
id_var
the supplied unique identifier
block_vars
the supplied blocking covariates
constraint_var
the supplied constraint variable, if applicable
block_id
an indicator for which block the unit belongs to
block_id
an indicator for which cluster the unit belongs to
block_id
a treatment indicator, corresponding with the specified number of conditions, n_tr
raw_blockettes
is the output of the blockTools::block
function, used to construct blockettes
unused_units
a dataframe containing information about the units in data
not
included in the experimental design
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.