Skip to contents

Mean amounts and mean compositions presented in a complr object.

Usage

# S3 method for complr
mean(x, weight = c("equal", "proportional"), ...)

Arguments

x

An object of class complr.

weight

A character value specifying the weight to use in calculation of the reference composition. If "equal", give equal weight to units (e.g., individuals). If "proportional", weights in proportion to the frequencies of units being averaged (e.g., observations across individuals) Default is equal.

...

generic argument, not in use.

Examples

cilr <- complr(data = mcompd, sbp = sbp, 
                parts = c("TST", "WAKE", "MVPA", "LPA", "SB"), 
                idvar = "ID")
mean(cilr)
#> $mean_comp
#>                    TST       WAKE       MVPA       LPA        SB
#> comp         0.3256777 0.03941706 0.08364547 0.3785304 0.1727294
#> between_comp 0.3109103 0.04219850 0.09859328 0.3816460 0.1666520
#> within_comp  0.2145624 0.19638789 0.17412177 0.2065891 0.2083389
#> 
#> $mean_lr
#>                    TST       WAKE       MVPA       LPA        SB
#> comp         0.3256777 0.03941706 0.08364547 0.3785304 0.1727294
#> between_comp 0.3109103 0.04219850 0.09859328 0.3816460 0.1666520
#> within_comp  0.2145624 0.19638789 0.17412177 0.2065891 0.2083389
#>