scoreFACIT_Fatigue: Score the FACIT-Fatigue

Description Usage Arguments Details Value Note References Examples

View source: R/sx-scoreFACIT_Fatigue.R

Description

Generates all of the scores of the 13 short version of the Functional Assessment of Chronic Illness Therapy-Fatigue (FACIT-Fatigue) from item responses.

Usage

1
scoreFACIT_Fatigue(df, updateItems = FALSE, keepNvalid = FALSE)

Arguments

df

A data frame with the FACIT-Fatigue items, appropriately-named.

updateItems

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.

keepNvalid

Logical, if TRUE the function returns an additional variable for each 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.

Details

Given a data frame that includes all of the FACIT-Fatigue items as variables, appropriately named, this function generates all of the FACIT-Fatigue scale scores. It is crucial that the item variables in the supplied data frame are named according to FACT conventions. For example, the first fatigue item should be named HI7, the second HI12, and so on. Please refer to the materials provided by http://www.facit.org for the particular questionnaire you are using. In particular, refer to the left margin of the official questionnaire (i.e., from facit.org) for the appropriate item variable names.

Value

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:

FS

Fatigue subscale

Note

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 http://www.facit.org) 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, scoreFACIT_Fatigue 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 http://www.facit.org, 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 scoreFACIT_Fatigue.

References

FACIT-Fatigue Scoring Guidelines, available at http://www.facit.org

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
set.seed(6375309)
## Generating random item responses for 8 fake respondents
exampleDat <- t(replicate(8, sample(0:4, size = 27, 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 = 27, replace = TRUE)))
miss50 <- t(replicate(4, sample(c(0, 9), prob = c(0.5, 0.5),
    size = 27, replace = TRUE)))
missMtx <- rbind(miss10, miss50)
## Using 9 as the code for missing responses
exampleDat[missMtx == 9] <- 9
exampleDat <- as.data.frame(cbind(ID = paste0('ID', 1:8),
    as.data.frame(exampleDat)))
names(exampleDat) <- c('ID', 'HI7', 'HI12', 'An1', 'An2', 'An3', 'An4', 'An5', 'An7', 'An8',
   'An12', 'An14', 'An15', 'An16')

## Returns data frame with scale scores and with original items untouched
scoredDat <- scoreFACIT_Fatigue(exampleDat)
names(scoredDat)
scoredDat
## 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 <- scoreFACIT_Fatigue(exampleDat, updateItems = TRUE, keepNvalid = TRUE)
names(scoredDat)
## Descriptives of scored scales
summary(scoredDat[, c('FS')])

Example output

 [1] "ID"   "HI7"  "HI12" "An1"  "An2"  "An3"  "An4"  "An5"  "An7"  "An8" 
[11] "An12" "An14" "An15" "An16" NA     NA     NA     NA     NA     NA    
[21] NA     NA     NA     NA     NA     NA     NA     NA     "FS"  
   ID HI7 HI12 An1 An2 An3 An4 An5 An7 An8 An12 An14 An15 An16 NA NA NA NA NA
1 ID1   3    3   1   2   2   3   0   1   2    9    1    1    9  9  0  2  0  2
2 ID2   4    2   1   9   9   0   4   4   4    3    0    4    9  2  4  2  2  3
3 ID3   9    3   3   2   0   2   2   9   3    4    4    9    0  3  3  3  2  3
4 ID4   2    2   1   0   0   3   3   2   2    2    1    0    9  3  9  0  2  1
5 ID5   9    4   9   9   9   9   2   4   9    9    1    9    9  4  1  2  9  2
6 ID6   9    4   9   4   2   9   9   9   9    9    1    9    9  1  1  9  9  2
7 ID7   3    0   9   0   9   9   9   9   3    3    0    9    9  4  1  2  4  0
8 ID8   9    9   9   0   9   0   9   0   9    9    9    3    9  9  9  0  3  3
  NA NA NA NA NA NA NA NA NA     FS
1  4  3  0  3  2  0  1  2  2 22.455
2  1  2  9  1  0  3  4  0  9 28.600
3  3  2  3  0  0  9  4  0  9 22.100
4  9  2  3  4  4  0  1  1  2 34.667
5  1  2  2  2  9  2  9  2  1     NA
6  9  2  3  2  9  0  9  3  2     NA
7  1  9  3  9  9  0  9  2  0     NA
8  9  1  9  3  9  2  9  9  9     NA
 [1] "ID"   "HI7"  "HI12" "AN1"  "AN2"  "AN3"  "AN4"  "AN5"  "AN7"  "AN8" 
[11] "AN12" "AN14" "AN15" "AN16" NA     NA     NA     NA     NA     NA    
[21] NA     NA     NA     NA     NA     NA     NA     NA     "FS_N" "FS"  
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
  22.10   22.37   25.53   26.96   30.12   34.67       4 

FACTscorer documentation built on May 29, 2017, 3:45 p.m.