calcIntraInter: Calculate Intra- and Interclass Correlation Coefficients

View source: R/functions.R

calcIntraInterR Documentation

Calculate Intra- and Interclass Correlation Coefficients

Description

Takes the dataset as provided in argument 'fmddf' and calculates intra- and interclass correlation coefficients for some pre-defined and some customisable groupings / data-splits.

Usage

calcIntraInter(
  fmddf,
  exclOneMT = FALSE,
  inclOneMT = TRUE,
  ther.sub = NULL,
  lmer = TRUE,
  verbose = TRUE,
  fnOut = "results_stat",
  toXls = TRUE
)

Arguments

fmddf

A dataframe containing FMD data.

exclOneMT

Logical, if additional groupings with one muscle test excluded should be performed. Defaults to FALSE.

inclOneMT

Logical, if additional groupings with only one muscle test included should be performed. Defaults to TRUE.

ther.sub

NULL or List. If left at the default NULL, no additional splitting with therapist subgroups is performed. Provide a list with n therapist IDs in each list element to calculate additional inter-rater correlation coefficients on data split by therapist subgroups defined in each list element; see examples.

lmer

Logical. Should the lmer function from packakge lme4 be used for calculating the ICC via package psych.

verbose

Logical, if status info should be given; defaults to TRUE.

fnOut

Character length one. The filename (without the ending '.xlsx') of the xlsx file where the statistics results will be saved to.

toXls

Logical, if statistics results should be saved to xlsx. Defaults to TRUE.

Details

For calculating the resp. ICC, function ICC from package psych is used.

Value

A list length two, with a dataframe holding the statistics results for the intra-class correlation coefficients in the first list element, and the inter-class correlation coefficients in the second.

See Also

runFmdenq

Examples

## Not run: 
fmdf <- importData()
res <- calcIntraInter(fmdf) # run with everything left at defaults
# additionally split one excluded muscle test, save under different name
res <- calcIntraInter(fmdf, exclOneMT=TRUE, fnOut="results_stat_MTex")
# define two therapist subgroups (in a list length two)
tsList <- list(c("Ther#1", "Ther#2", "Ther#3"), c("Ther#4", "Ther#5", "Ther#6"))
res <- calcIntraInter(fmdf, exclOneMT=FALSE, ther.sub=tsList, fnOut="results_stat_Thersub")
res

## End(Not run)

bpollner/fmdenq documentation built on March 27, 2022, 4:26 p.m.