get_VPC: Calculate the variance partitioning coefficient

Description Usage Arguments Details Value References See Also Examples

Description

Calculate the variance partitioning coefficient

Usage

1
2
3
4
get_VPC(object)

## S3 method for class 'plcp'
get_VPC(object)

Arguments

object

An object created by study_parameters

Details

For partially nested studies, the VPC is calculated for the treatment group.

Value

a data.frame with class plcp_VPC containing the percentage of variance per level and time point. The column between_clusters is also the intraclass correlation for level three, i.e. the correlation between two subjects belonging to the same cluster at a specific time point. With random slopes in the model the variances per time point will be a quadratic function of time. tot_var is the percentage increase or decrease in total variance relative to baseline variance.

The plot method returns a ggplot2::ggplot object.

References

Goldstein, H., Browne, W., & Rasbash, J. (2002). Partitioning variation in multilevel models. Understanding Statistics: Statistical Issues in Psychology, Education, and the Social Sciences, 1(4), 223-231.

See Also

plot.plcp_VPC

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
paras <- study_parameters(n1 = 11,
                          n2 = 10,
                          n3 = 3,
                          T_end = 10,
                          icc_pre_subject = 0.5,
                          icc_pre_cluster = 0,
                          icc_slope = 0.05,
                          var_ratio = 0.03)

res <- get_VPC(paras)
res

# Plot
plot(res)

Example output

# Percentage (%) of total variance at each level and time point
   time between_clusters between_subjects within_subjects tot_var
1     0            0.000               50              50     0.0
2     1            0.074               51              49     1.5
3     2            0.283               53              47     6.0
4     3            0.595               55              44    13.5
5     4            0.968               59              40    24.0
6     5            1.364               62              36    37.5
7     6            1.753               66              32    54.0
8     7            2.118               69              29    73.5
9     8            2.449               72              26    96.0
10    9            2.743               75              23   121.5
11   10            3.000               77              20   150.0

powerlmm documentation built on May 2, 2019, 3:10 a.m.