Learn R Programming

powerlmm (version 0.4.0)

get_DEFT: Calculate the design effect and Type I errors

Description

This functions helps to evaluate the consequences of ignoring a random slope at the cluster level.

Usage

get_DEFT(object)

# S3 method for plcp_3lvl get_DEFT(object)

Arguments

object

A plcp_3lvl-object created by study_parameters

Value

A data.frame with the columns n1, n2, n3, icc_slope, var_ratio, DEFT, and, approx_type1. The number of rows of the data.frame will be equals to the number of different combination of parameters values specified with study_parameters.

Details

The design effect (DEFT) is the ratio of the standard error from the correct three-level model to the standard error from the misspecified model omitting the cluster-level random slope. The standard error for the misspecified model is calculated by assuming that the cluster-level random slope variance is added to the subject-level random slope.

The approximate Type I error under the miss-specified model is also calculated. The effect of wrongly ignoring a third-level random slope on the Type I errors, depends on n1, n2, n3, icc_slope, and, var_ratio.

See Also

simulate.plcp

Examples

Run this code
# NOT RUN {
paras <- study_parameters(n1 = 11,
                          n2 = 30,
                          n3 = 3,
                          T_end = 10,
                          icc_pre_subject = 0.5,
                          icc_pre_cluster = 0,
                          icc_slope = c(0.01,0.05, 0.1),
                          var_ratio = 0.02)

get_DEFT(paras)
# }

Run the code above in your browser using DataLab