get_DEFT: Calculate the design effect and Type I errors

Description Usage Arguments Details Value See Also Examples

View source: R/DEFT.R

Description

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

Usage

1
2
3
4
get_DEFT(object)

## S3 method for class 'plcp_3lvl'
get_DEFT(object)

Arguments

object

A plcp_3lvl-object created by 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.

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.

See Also

simulate.plcp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

rpsychologist/powerlmm documentation built on May 5, 2018, 11:54 p.m.