ClustRand {MedianaDesigner}R Documentation

Simulation-based design of cluster-randomized trials

Description

This function performs a simulation-based evaluation of operating characteristics for cluster-randomized trials with normally distributed or binary endpoints. A multi-arm clinical trial is assumed (control arm and several treatment arms). For examples of the function call, see ClustRandExample1 or ClustRandExample2.

Usage

ClustRand(parameters)

Arguments

parameters

List of the trial design and other parameters. The required elements are defined below:

  • endpoint_type: Character value defining the primary endpoint's type. Possible values:

    • "Normal": Normally distributed endpoint.

    • "Binary": Binary endpoint.

  • direction: Character value defining the direction of favorable outcome. Possible values: "Higher" (a higher value of the endpoint indicates a more favorable outcome) and "Lower" (a lower value of the endpoint indicates a more favorable outcome).

  • sample_size: Integer vector defining the number of completers in the trial arms (control arm and several treatment arms). Completers are defined as patients who complete the trial and are included in the final analysis. Each element must be positive.

  • method_type: Character value defining the data analysis method. Possible values:

    • "GEE": Generalized estimating equations.

    • "GLMEM": Generalized linear mixed effects model. The current implementation of the GLMEM method is much less efficient than that for the GEE method and results in longer simulation run times.

  • cluster_scheme: Character value defining the cluster scheme. Possible values:

    • "Fixed": Cluster sizes are pre-defined.

    • "Random": Cluster sizes are randomly generated from a generalized Bernoulli distribution.

  • control_cluster_size: Numeric vector defining the number of cluster sizes in the control arm. This parameter is required only if the cluster sizes are pre-defined (cluster_scheme="Fixed").

  • treatment_cluster_size: Numeric matrix defining the number of cluster sizes in the treatment arms (each row corresponds to a treatment arm). This parameter is required only if the cluster sizes are pre-defined.

  • control_cluster_proportion: Numeric vector of relative cluster sizes in the control arm. The cluster membership is determined using a generalized Bernoulli distribution based on the relative cluster sizes. Each element must be between 0 and 1. This parameter is required only if the cluster sizes are random (cluster_scheme="Random").

  • treatment_cluster_proportion: Numeric matrix of relative cluster sizes in the treatment arms (each row corresponds to a treatment arm). The cluster membership in each treatment arm is determined using a generalized Bernoulli distribution based on the relative cluster sizes. Each element must be between 0 and 1. This parameter is required only if the cluster sizes are random.

  • control_mean: Numeric value defining the mean of the primary endpoint in the control arm. This parameter is required only with normally distributed endpoints (endpoint_type="Normal").

  • treatment_mean: Numeric vector defining the means of the primary endpoint in the treatment arms. This parameter is required only with normally distributed endpoints.

  • control_rate: Numeric value defining the proportion or response rate for the primary endpoint in the control arm. This value must be between 0 and 1. This parameter is required only with binary endpoints
    (endpoint_type="Binary").

  • treatment_rate: Numeric vector defining the proportion or response rate for the primary endpoint in the treatment arms. Each element must be between 0 and 1. This parameter is required only with binary endpoints.

  • control_icc: Numeric value defining the intra-cluster correlation coefficient in the control arm. This value must be between 0 and 1.

  • control_between_cluster_sd: Numeric value defining the between-cluster standard deviation in the control arm. This value must be positive. This parameter is required only with normally distributed endpoints.

  • treatment_icc: Numeric vector defining the intra-cluster correlation coefficients in the treatment arms. Each element must be between 0 and 1.

  • treatment_between_cluster_sd: Numeric vector defining the between-cluster standard deviation in the treatment arms. Each element must be positive. This parameter is required only with normally distributed endpoints.

  • descriptive_statistics: Logical value requesting the computation of descriptive statistics (arm-specific effects and cluster sizes if the cluster sizes are random) from each simulation run. The default value is FALSE.

  • alpha: Numeric value defining the overall one-sided Type I error rate. The default value is 0.025.

  • random_seed: Integer value defining the random number generator seed. The default value is 49283.

  • nsims: Integer value defining the number of simulation runs.

  • ncores: Integer value defining the number of cores for parallel calculations. The number of cores cannot exceed the maximum available number of cores. The default value is 1.

Value

The function returns an object of class ‘⁠ClustRandResults⁠’. This object is a list with the following components:

parameters

List containing the user-specified parameters.

pval_results

Data frame containing the convergence flags and p-values for each simulation run.

coef_results

Data frame containing the convergence flags and model parameter estimares for each simulation run. The data frame is created if the descriptive statistics are requested (descriptive_statistics=TRUE).

cluster_size_results

Data frame containing the cluster sizes for each simulation run if the cluster sizes are random (cluster_scheme="Random"). The data frame is created if the descriptive statistics are requested (descriptive_statistics=TRUE).

sim_summary

List containing the key operating characteristics of the cluster-randomized design.

A detailed summary of the simulation results can be created using the GenerateReport function.

See Also

ClustRandApp


[Package MedianaDesigner version 0.13 Index]