scoreFACT_BRM: Score the FACT-BRM

View source: R/tx-scoreFACT_BRM.R

scoreFACT_BRMR Documentation

Score the FACT-BRM


Generates all of the scores of the Functional Assessment of Cancer Therapy - Biologic Response Modifier (FACT-BRM, v4) from item responses.


scoreFACT_BRM(df, updateItems = FALSE, keepNvalid = FALSE)



A data frame with the FACT-BRM items, appropriately-named.


Logical, if TRUE any original item that is reverse coded for scoring will be replaced by its reverse coded version in the returned data frame, and any values of 8 or 9 will be replaced with NA. The default, FALSE, returns the original items unmodified.


Logical, if TRUE the function returns an additional variable for most of the returned scale scores containing the number of valid, non-missing responses from each respondent to the items on the given scale. If FALSE (the default), these variables are omitted from the returned data frame.


Given a data frame that includes all of the FACT-BRM (Version 4) items as variables, appropriately named, this function generates all of the FACT-BRM scale scores. It is crucial that the item variables in the supplied data frame are named according to FACT conventions. For example, the first physical well-being item should be named GP1, the second GP2, and so on. Please refer to the materials provided by for the particular questionnaire you are using. In particular, refer to the left margin of the official questionnaire (i.e., from for the appropriate item variable names.


The original data frame is returned (optionally with modified items if updateItems = TRUE) with new variables corresponding to the scored scales. If keepNvalid = TRUE, for each scored scale an additional variable is returned that contains the number of valid responses each respondent made to the items making up the given scale. These optional variables have names of the format SCALENAME_N. The following scale scores are returned:


Physical Well-Being subscale


Social/Family Well-Being subscale


Emotional Well-Being subscale


Physical Well-Being subscale


FACT-G Total Score (i.e., PWB+SWB+EWB+FWB)


Biologic Response Modifier Physical subscale


Biologic Response Modifier Cognitive/Emotional subscale




FACT-BRM Trial Outcome Index (e.g., PWB+FWB+BRMP+BRMCE)


Keep in mind that this function (and R in general) is case-sensitive.

All variables should be in numeric or integer format.

This scoring function expects missing item responses to be coded as NA, 8, or 9, and valid item responses to be coded as 0, 1, 2, 3, or 4. Any other value for any of the items will result in an error message and no scores.

Some item variables are reverse coded for the purpose of generating the scale scores. The official (e.g., from SAS and SPSS scoring algorithms for this questionnaire automatically replace the original items with their reverse-coded versions. This can be confusing if you accidentally run the algorithm more than once on your data. As its default, scoreFACT_BRM DOES NOT replace any of your original item variables with the reverse coded versions. However, for consistentcy with the behavior of the other versions on, the updateItems argument is provided. If set to TRUE, any item that is supposed to be reverse coded will be replaced with its reversed version in the data frame returned by scoreFACT_BRM.


FACT-BRM Scoring Guidelines, available at


## Setting up item names for fake data
G_names <- c(paste0('GP', 1:7),
             paste0('GS', 1:7),
             paste0('GE', 1:6),
             paste0('GF', 1:7))
AC_names1 <- c('BMT6', 'HI12', 'C6', 'BRM1', 'BRM2', 'BRM3', 'BRM10')
AC_names2 <- c('HI8', 'HI9', 'BRM7', 'BRM8', 'BRM9', 'HI6')
AC_names <- c(AC_names1, AC_names2)
itemNames <- c(G_names, AC_names)
## Generating random item responses for 8 fake respondents
exampleDat <- t(replicate(8, sample(0:4, size = length(itemNames), replace = TRUE)))
## Making half of respondents missing about 10% of items,
## half missing about 50%.
miss10 <- t(replicate(4, sample(c(0, 9), prob = c(0.9, 0.1),
    size = length(itemNames), replace = TRUE)))
miss50 <- t(replicate(4, sample(c(0, 9), prob = c(0.5, 0.5),
    size = length(itemNames), replace = TRUE)))
missMtx <- rbind(miss10, miss50)
## Using 9 as the code for missing responses
exampleDat[missMtx == 9] <- 9
exampleDat <- = paste0('ID', 1:8),
names(exampleDat) <- c('ID', itemNames)

## Returns data frame with scale scores and with original items untouched
scoredDat <- scoreFACT_BRM(exampleDat)
## Returns data frame with scale scores, with the appropriate items
## reverse scored, and with item values of 8 and 9 replaced with NA.
## Also illustrates the effect of setting keepNvalid = TRUE.
scoredDat <- scoreFACT_BRM(exampleDat, updateItems = TRUE, keepNvalid = TRUE)
## Descriptives of scored scales
summary(scoredDat[, c('PWB', 'SWB', 'EWB', 'FWB', 'FACTG',
                      'BRMP', 'BRMCE', 'FACT_BRM_TOTAL', 'FACT_BRM_TOI')])

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