Title: | Mental Health Quality of Life Toolkit |
---|---|
Description: | Transforms, calculates, and presents results from the Mental Health Quality of Life Questionnaire (MHQoL), a measure of health-related quality of life for individuals with mental health conditions. Provides scoring functions, summary statistics, and visualization tools to facilitate interpretation. For more details see van Krugten et al.(2022) <doi:10.1007/s11136-021-02935-w>. |
Authors: | Stijn Peeters [aut, cre]
|
Maintainer: | Stijn Peeters <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.13.0 |
Built: | 2025-03-11 17:24:14 UTC |
Source: | https://github.com/cran/MHQoL |
This function calculates the utility of the MHQoL based on the scores of the different dimensions.
mhqol( dimensions, country = "Netherlands", metric = c("average", "total"), ignore_invalid = FALSE, ignore_NA = FALSE)
mhqol( dimensions, country = "Netherlands", metric = c("average", "total"), ignore_invalid = FALSE, ignore_NA = FALSE)
dimensions |
A dataframe, character vector, numeric 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). |
country |
A character value indicating the country for which the utilities should be calculated. Standard is the Netherlands |
metric |
A character value indicating whether to calculate the "total" or "average" utility. |
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. |
A dataframe containing the utilities based on the MHQoL valuesets
# Example usage of the mhqol_utilities function # Get the utility based on a numeric vector and calculate the total utility, # not all dimensions and values are present mhqol( dimensions = c(IN = 2, MO = 3, RE = 2, DA = NA, PH = 2, FU = 3), metric = "total", ignore_invalid = TRUE, ignore_NA = TRUE ) # Get the utility based on a dataframe and calculate the average utility mhqol( dimensions = data.frame(SI = 1, IN = 2, MO = 3, RE = 2, DA = 1, PH = 2, FU = 3), metric = "average" )
# Example usage of the mhqol_utilities function # Get the utility based on a numeric vector and calculate the total utility, # not all dimensions and values are present mhqol( dimensions = c(IN = 2, MO = 3, RE = 2, DA = NA, PH = 2, FU = 3), metric = "total", ignore_invalid = TRUE, ignore_NA = TRUE ) # Get the utility based on a dataframe and calculate the average utility mhqol( dimensions = data.frame(SI = 1, IN = 2, MO = 3, RE = 2, DA = 1, PH = 2, FU = 3), metric = "average" )
This function calculates the Level Sum Scores (LSS) per dimension of overall
of the MHQoL based on the scores of the different dimensions.
mhqol_LSS( dimensions, metric = c("average", "total"), ignore_invalid = FALSE, ignore_NA = TRUE)
mhqol_LSS( dimensions, metric = c("average", "total"), ignore_invalid = FALSE, ignore_NA = TRUE)
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. |
A dataframe containing the LSS based on the MHQoL manual.
# 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")
# 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")
This function provides the states of the MHQoL based on the scores provided (as described in the manual).
mhqol_scores_to_states( scores, ignore_invalid = FALSE, ignore_NA = FALSE, retain_old_variables = TRUE)
mhqol_scores_to_states( scores, ignore_invalid = FALSE, ignore_NA = FALSE, retain_old_variables = TRUE)
scores |
A dataframe, numeric vector, or list containing the scores of the MHQoL. |
ignore_invalid |
If TRUE, the function will ignore missing scores and continue processing. |
ignore_NA |
If TRUE, the function will ignore NA values in the input data. |
retain_old_variables |
If TRUE, the function will retain the old variables in the output. |
A dataframe containing the states of the MHQoL based on the scores provided.
# Example usage of the mhqol_scores_to_states function # Get the states based on a numeric vector, not all scores are present mhqol_scores_to_states( scores = c(IN = 2, DA = 1, PH = 2, FU = 3), ignore_invalid = TRUE ) # Get the states based on a dataframe mhqol_scores_to_states( scores = data.frame( SI = 1, IN = 2, MO = 3, RE = 2, DA = 1, PH = 2, FU = 3 ) )
# Example usage of the mhqol_scores_to_states function # Get the states based on a numeric vector, not all scores are present mhqol_scores_to_states( scores = c(IN = 2, DA = 1, PH = 2, FU = 3), ignore_invalid = TRUE ) # Get the states based on a dataframe mhqol_scores_to_states( scores = data.frame( SI = 1, IN = 2, MO = 3, RE = 2, DA = 1, PH = 2, FU = 3 ) )
This function provides the scores of the MHQoL based on textual input as described in the manual of the MHQoL.
mhqol_states_to_scores( states, ignore_invalid = FALSE, ignore_NA = FALSE, retain_old_variables = TRUE)
mhqol_states_to_scores( states, ignore_invalid = FALSE, ignore_NA = FALSE, retain_old_variables = TRUE)
states |
A dataframe, character vector or list containing the states of the MHQoL. Must contain the following states: SI (Self-Image), IN (INdependence), MO (MOod), RE (RElationships), DA (Daily Activities), PH (Physical Health), FU (FUture). |
ignore_invalid |
If TRUE, the function will ignore missing states 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. |
retain_old_variables |
If TRUE, the function will return the original states along with the new scores. If FALSE, the function will only return the new scores. |
A dataframe containing the new scores based on the MHQoL manual.
# Example usage of the mhqol_scores function # Get the MHQoL scores based on a character vector and do not retain old values mhqol_states_to_scores( states = c( SI = "I think very positively about myself", IN = "I am very satisfied with my level of independence", MO = "I do not feel anxious, gloomy, or depressed", RE = "I am very satisfied with my relationships", DA = "I am very satisfied with my daily activities", PH = "I have no physical health problems", FU = "I am very optimistic about my future" ), retain_old_variables = FALSE ) # Get the MHQoL scores based on a DataFrame and retain old values # Define a sample DataFrame before using it df <- data.frame( SI = "I think positively about myself", IN = "I am satisfied with my level of independence", MO = "I feel a little anxious, gloomy, or depressed", RE = "I am satisfied with my relationships", DA = "I am satisfied with my daily activities", PH = "I have some physical health problems", FU = "I am optimistic about my future" ) # Get the MHQoL scores based on a DataFrame mhqol_states_to_scores(states = df) # Get the MHQoL scores based on a DataFrame and ignore missing states mhqol_states_to_scores(states = df, ignore_invalid = TRUE)
# Example usage of the mhqol_scores function # Get the MHQoL scores based on a character vector and do not retain old values mhqol_states_to_scores( states = c( SI = "I think very positively about myself", IN = "I am very satisfied with my level of independence", MO = "I do not feel anxious, gloomy, or depressed", RE = "I am very satisfied with my relationships", DA = "I am very satisfied with my daily activities", PH = "I have no physical health problems", FU = "I am very optimistic about my future" ), retain_old_variables = FALSE ) # Get the MHQoL scores based on a DataFrame and retain old values # Define a sample DataFrame before using it df <- data.frame( SI = "I think positively about myself", IN = "I am satisfied with my level of independence", MO = "I feel a little anxious, gloomy, or depressed", RE = "I am satisfied with my relationships", DA = "I am satisfied with my daily activities", PH = "I have some physical health problems", FU = "I am optimistic about my future" ) # Get the MHQoL scores based on a DataFrame mhqol_states_to_scores(states = df) # Get the MHQoL scores based on a DataFrame and ignore missing states mhqol_states_to_scores(states = df, ignore_invalid = TRUE)
This function provides the utilities of the MHQoL based on
textual, as described in the manual, or numeric input of the MHQoL.
mhqol_utilities( dimensions, country = "Netherlands", ignore_invalid = FALSE, ignore_NA = TRUE, retain_old_variables = TRUE)
mhqol_utilities( dimensions, country = "Netherlands", ignore_invalid = FALSE, ignore_NA = TRUE, retain_old_variables = TRUE)
dimensions |
A dataframe, character vector, numeric vector, or list containing the character or numeric 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). |
country |
The country for which the utilities should be calculated. For now the only option is "Netherlands". |
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. |
retain_old_variables |
If TRUE, the function will return the original dimensions along with the new utilities. If FALSE, the function will only return the new utilities. |
A dataframe containing the new utilities based on the MHQoL manual.
# Example usage of the mhqol_utilities function # Get the MHQoL utilities based on a character vector and do not retain old values mhqol_utilities( dimensions = c( SI = "I think very positively about myself", IN = "I am very satisfied with my level of independence", MO = "I do not feel anxious, gloomy, or depressed", RE = "I am very satisfied with my relationships", DA = "I am very satisfied with my daily activities", PH = "I have no physical health problems", FU = "I am very optimistic about my future" ), retain_old_variables = FALSE ) # Get the MHQoL utilities based on a numeric vector and ignore missing dimensions mhqol_utilities( dimensions = c(IN = 2, MO = 1, RE = 0, DA = 3, PH = 2, FU = 1), ignore_invalid = TRUE )
# Example usage of the mhqol_utilities function # Get the MHQoL utilities based on a character vector and do not retain old values mhqol_utilities( dimensions = c( SI = "I think very positively about myself", IN = "I am very satisfied with my level of independence", MO = "I do not feel anxious, gloomy, or depressed", RE = "I am very satisfied with my relationships", DA = "I am very satisfied with my daily activities", PH = "I have no physical health problems", FU = "I am very optimistic about my future" ), retain_old_variables = FALSE ) # Get the MHQoL utilities based on a numeric vector and ignore missing dimensions mhqol_utilities( dimensions = c(IN = 2, MO = 1, RE = 0, DA = 3, PH = 2, FU = 1), ignore_invalid = TRUE )
This function provides the scores of the MHQoL based on the utilities provided (as described in the valueset).
mhqol_utilities_to_scores( utilities, country = "Netherlands", ignore_invalid = FALSE, ignore_NA = TRUE, retain_old_variables = TRUE)
mhqol_utilities_to_scores( utilities, country = "Netherlands", ignore_invalid = FALSE, ignore_NA = TRUE, retain_old_variables = TRUE)
utilities |
A dataframe, numeric vector, or list containing the utilities of the MHQoL. |
country |
The country for which the utilities should be calculated. For now the only option is "Netherlands". |
ignore_invalid |
If TRUE, the function will ignore missing utilities and continue processing. |
ignore_NA |
If TRUE, the function will ignore NA values in the input data. |
retain_old_variables |
If TRUE, the function will retain the old variables in the output. |
A dataframe containing the scores of the MHQoL based on the utilities provided.
# Example usage of the mhqol_utilities_to_scores function # Get the scores based on a numeric vector, not all utilities are present mhqol_utilities_to_scores( utilities = c(IN = -0.018, DA = -0.021, PH = -0.064, FU = -0.106), ignore_invalid = TRUE ) # Get the scores based on a dataframe mhqol_utilities_to_scores( utilities = data.frame( SI = -0.137, IN = -0.184, MO = -0.063, RE = -0.172, DA = -0.021, PH = -0.243, FU = -0.170 ) )
# Example usage of the mhqol_utilities_to_scores function # Get the scores based on a numeric vector, not all utilities are present mhqol_utilities_to_scores( utilities = c(IN = -0.018, DA = -0.021, PH = -0.064, FU = -0.106), ignore_invalid = TRUE ) # Get the scores based on a dataframe mhqol_utilities_to_scores( utilities = data.frame( SI = -0.137, IN = -0.184, MO = -0.063, RE = -0.172, DA = -0.021, PH = -0.243, FU = -0.170 ) )
This function provides the states of the MHQoL based on the utilities provided (as described in the valueset).
mhqol_utilities_to_states( utilities, country = "Netherlands", ignore_invalid = FALSE, ignore_NA = FALSE, retain_old_variables = TRUE)
mhqol_utilities_to_states( utilities, country = "Netherlands", ignore_invalid = FALSE, ignore_NA = FALSE, retain_old_variables = TRUE)
utilities |
A dataframe, numeric vector, or list containing the utilities of the MHQoL. |
country |
The country for which the utilities should be calculated. For now the only option is "Netherlands". |
ignore_invalid |
If TRUE, the function will ignore missing utilities and continue processing. |
ignore_NA |
If TRUE, the function will ignore NA values in the input data. |
retain_old_variables |
If TRUE, the function will retain the old variables in the output. |
A dataframe containing the states of the MHQoL based on the utilities provided.
# Example usage of the mhqol_utilities_to_states function # Get the states based on a numeric vector, not all states are present mhqol_utilities_to_states( utilities = c(IN = -0.018, DA = -0.021, PH = -0.064, FU = -0.106), ignore_invalid = TRUE ) # Get the states based on a dataframe mhqol_utilities_to_states( utilities = data.frame( SI = -0.137, IN = -0.184, MO = -0.063, RE = -0.172, DA = -0.021, PH = -0.243, FU = -0.170 ) )
# Example usage of the mhqol_utilities_to_states function # Get the states based on a numeric vector, not all states are present mhqol_utilities_to_states( utilities = c(IN = -0.018, DA = -0.021, PH = -0.064, FU = -0.106), ignore_invalid = TRUE ) # Get the states based on a dataframe mhqol_utilities_to_states( utilities = data.frame( SI = -0.137, IN = -0.184, MO = -0.063, RE = -0.172, DA = -0.021, PH = -0.243, FU = -0.170 ) )
This function provides the valueset of the MHQoL based on the country specified.
mhqol_valueset(country)
mhqol_valueset(country)
country |
A character value indicating the country for which the valueset should be provided. For now only the Netherlands is available. |
A dataframe containing the valueset of the MHQoL based on the country specified.
# Example usage of the mhqol_valueset function # Get the valueset for the Netherlands mhqol_valueset(country = "Netherlands")
# Example usage of the mhqol_valueset function # Get the valueset for the Netherlands mhqol_valueset(country = "Netherlands")
shiny_mhqol
launches a Shiny interface for browser-based MHQoL calculations.
shiny_mhqol(display.mode = "normal")
shiny_mhqol(display.mode = "normal")
display.mode |
The display mode to be passed to runApp. Default is "normal". |
This function starts the Shiny app for Mental Health Quality of Life (MHQoL) scoring, allowing users to interactively input data and calculate utility scores.
NULL (launches the Shiny app).
if(interactive()) { shiny_mhqol() shiny_mhqol(display.mode = "normal") }
if(interactive()) { shiny_mhqol() shiny_mhqol(display.mode = "normal") }