mhqol_LSS {MHQoL}R Documentation

A function to calculate the Level Sum Scores (LSS) of the MHQoL

Description

[Experimental] This function calculates the Level Sum Scores (LSS) per dimension of overall of the MHQoL based on the scores of the different dimensions.

Usage

mhqol_LSS(
  dimensions,
  metric = c("average", "total"),
  ignore_invalid = FALSE,
  ignore_NA = TRUE)

Arguments

dimensions

A dataframe, character vector or list containing the dimensions of the MHQoL. Must contain the following dimensions: SI (Self-Image), IN (INdependence), MO (MOod), RE (RElationships), DA (Daily Activities), PH (Physical Health), FU (FUture).

metric

A character value indicating whether to calculate the "total" or "average" LSS.

ignore_invalid

If TRUE, the function will ignore missing dimensions and continue processing. If FALSE, the function will stop and throw an error.

ignore_NA

If TRUE, the function will ignore NA values in the input data. If FALSE, the function will stop and throw an error.

Value

A dataframe containing the LSS based on the MHQoL manual.

Examples

# Example usage of the mhqol_LSS function

# Get the LSS based on a character vector and calculate the total LSS,
# not all dimensions are present
mhqol_LSS(
  dimensions = c(IN = 2, MO = 3, RE = 2, DA = 1, PH = 2, FU = 3),
  metric = "total", ignore_invalid = TRUE)

# Get the LSS based on a dataframe and calculate the average LSS,
# all dimensions are present
mhqol_LSS(
  dimensions =
  data.frame(SI = 1, IN = 2, MO = 3, RE = 2, DA = 1, PH = 2, FU = 3),
  metric = "average")

[Package MHQoL version 0.14.0 Index]