scoreFACT_any: Master function to score most FACT/FACIT instruments

View source: R/util-scoreFACT_any.R

scoreFACT_anyR Documentation

Master function to score most FACT/FACIT instruments

Description

Master function to score most FACT/FACIT instruments

Usage

scoreFACT_any(
  df,
  id = NULL,
  namesAC = NULL,
  namesRev = NULL,
  nameSub = "XX_SUB",
  nameTot = "FACT_XX",
  AConly = FALSE,
  updateItems = FALSE,
  keepNvalid = FALSE
)

Arguments

df

A data frame with the questionnaire items, appropriately-named.

id

(optional) The quoted name of a variable in df with a unique value for each row of df. If an id variable is provided here, it will also be included with the scale scores in the output data frame. This can facilitate accurate merging of the scale scores back into the input df.

namesAC

A character vector of quoted variable names.

namesRev

A character vector of quoted variable names (or a single quoted variable name) that should be reverse scored. The variable names must be among those given to the namesAC argument.

nameSub

(optional) A single quoted name that will become the name of the scored AC subscale. If this argument is omitted, the default value will be used, "AC_SUB".

nameTot

(optional) A single quoted name that will form the root of the "_TOTAL" and "_TOI" score names. For example, if nameTot = "FACT_B" then the names in the resulting data frame will be "FACT_B_TOTAL" and "FACT_B_TOI". If this argument is omitted, the default value will be used, "FACT_AC".

AConly

(optional) Logical, if omitted or set to FALSE (the default) then the function will expect df to contain the FACT-General items as well as the items given to namesAC. If TRUE, then the function will only find the items given to namesAC in df, and will only score the subscale produced by those items.

updateItems

(optional) Logical, if TRUE then updated versions of the items (i.e., re-coded for score calculation) will be returned in the output data frame with the scale scores. The default, FALSE, does not save any updated versions of the items in the resulting data frame. Most users will want to omit this argument or, equivalently, set it to FALSE.

keepNvalid

(optional) Logical, if TRUE then the output data frame will have additional variables containing the number of valid, non-missing responses from each respondent to the items on a given scale (see Details). If FALSE (the default), these variables will not be in the returned data frame. Most users will want to omit this argument or, equivalently, set it to FALSE.

Details

This is the workhorse function called by most of the other functions in this package. It can score the majority of the instruments in the FACT/FACIT family of questionnaires. Specifically, it can score any instrument that fits one of these two formats:

  1. FACT-G + AC: Measures comprised of the FACT-G (General) items plus a set of "Additional Concerns" (AC) items that produce a single subscale score. Most of the FACT/FACIT instruments conform to this format, and follow a uniform scoring procedure that produces all of the FACT-G scores (PWB, SWB, EWB, FWB, and FACT-G Total Score), the AC subscale score (AC_SUB), the AC-specific Trial Outcome Index (TOI, PWB+FWB+AC_SUB), and the AC-specific Total Score (PWB+SWB+EWB+FWB+AC_SUB).

  2. AC Only: Measures comprised of only "Additional Concerns" (AC) items (or any set of items) that produce a single score. This is relevant for cases in which only the AC items were administered from a more comprehensive instrument (e.g., one that originally included FACT-G + AC items). This is also relevant for some of the symptom indexes and other single-score measures. These AC-only and single-score measures can be scored by setting AConly = TRUE.

Value

A data frame with the following scale scores is returned:

  • PWB - Physical Well-Being subscale

  • SWB - Social/Family Well-Being subscale

  • EWB - Emotional Well-Being subscale

  • FWB - Physical Well-Being subscale

  • FACTG - FACT-G Total Score (PWB+SWB+EWB+FWB)

  • AC_SUB - AC subscale score

  • FACT_AC_TOTAL - The AC-Specific Total Score (PWB+SWB+EWB+FWB+AC_SUB)

  • FACT_AC_TOI - The AC-Specific Trial Outcome Index (PWB+FWB+AC_SUB)

If AConly = TRUE, the only scale score returned is AC_SUB.

If a variable was given to the id argument, then that variable will also be in the returned data frame. Additional, relatively unimportant, variables will be returned if updateItems = TRUE or keepNvalid = TRUE.

Examples

## Create vectors of item names
FACT_B_names <- c("B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "P2")
FACT_B_rev   <- c("B1", "B2", "B3", "B5", "B6", "B7", "B8", "P2")
## Make example data
exampleDat <- make_FACTdata(namesAC = FACT_B_names)

## Score FACT-G + AC items
scoredDat <- scoreFACT_any(df = exampleDat,
               namesAC = FACT_B_names,
               namesRev = FACT_B_rev,
               nameSub = "BCS",
               nameTot = "FACT_B")
scoredDat

## Score only AC items
scoredDat <- scoreFACT_any(df = exampleDat,
               namesAC = FACT_B_names,
               namesRev = FACT_B_rev,
               nameSub = "BCS",
               AConly = TRUE)
scoredDat

raybaser/FACTscorer documentation built on March 29, 2022, 7:50 p.m.