scoreFANLTC: Score the FANLTC

Description Usage Arguments Details Value Note References Examples

View source: R/gen-scoreFANLTC.R

Description

Generates all of the scores of the Functional Assessment of Cancer Therapy-General (FANLTC) from item responses.

Usage

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

Arguments

df

A data frame with the FANLTC 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 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.

Details

Given a data frame that includes all of the FANLTC items as variables, appropriately named, this function generates all of the FANLTC 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 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:

PWB

Physical Well-Being subscale

SWB

Social/Family Well-Being subscale

EWB

Emotional Well-Being subscale

FWB

Physical Well-Being subscale

FANLTC

FANLTC Total Score (i.e., PWB+SWB+EWB+FWB)

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, scoreFANLTC 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 scoreFANLTC.

References

FANLTC 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
29
30
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', 'GP1', 'GP2', 'GP3', 'GP4', 'GP5',
    'GP6', 'GP7', 'GS1', 'GS2', 'GS3', 'GS4', 'GS5', 'GS6',
    'GS7', 'GE1', 'GE2', 'GE3', 'GE4', 'GE5', 'GE6', 'GF1',
    'GF2', 'GF3', 'GF4', 'GF5', 'GF6', 'GF7')

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

Example output

 [1] "ID"     "GP1"    "GP2"    "GP3"    "GP4"    "GP5"    "GP6"    "GP7"   
 [9] "GS1"    "GS2"    "GS3"    "GS4"    "GS5"    "GS6"    "GS7"    "GE1"   
[17] "GE2"    "GE3"    "GE4"    "GE5"    "GE6"    "GF1"    "GF2"    "GF3"   
[25] "GF4"    "GF5"    "GF6"    "GF7"    "PWB"    "SWB"    "EWB"    "FWB"   
[33] "FANLTC"
   ID GP1 GP2 GP3 GP4 GP5 GP6 GP7 GS1 GS2 GS3 GS4 GS5 GS6 GS7 GE1 GE2 GE3 GE4
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
  GE5 GE6 GF1 GF2 GF3 GF4 GF5 GF6 GF7  PWB    SWB    EWB   FWB FANLTC
1   4   3   0   3   2   0   1   2   2 14.0  8.750 13.000 10.00 45.750
2   1   2   9   1   0   3   4   0   9 12.6 19.833  7.000 11.20 50.633
3   3   2   3   0   0   9   4   0   9 14.0 19.600  9.000  9.80 52.400
4   9   2   3   4   4   0   1   1   2 17.0 11.667  8.750 15.00 52.417
5   1   2   2   2   9   2   9   2   1   NA     NA 11.250 12.60     NA
6   9   2   3   2   9   0   9   3   2   NA     NA 11.667 14.00     NA
7   1   9   3   9   9   0   9   2   0   NA 17.500 11.250  8.75     NA
8   9   1   9   3   9   2   9   9   9   NA     NA  6.250    NA     NA
 [1] "ID"       "GP1"      "GP2"      "GP3"      "GP4"      "GP5"     
 [7] "GP6"      "GP7"      "GS1"      "GS2"      "GS3"      "GS4"     
[13] "GS5"      "GS6"      "GS7"      "GE1"      "GE2"      "GE3"     
[19] "GE4"      "GE5"      "GE6"      "GF1"      "GF2"      "GF3"     
[25] "GF4"      "GF5"      "GF6"      "GF7"      "PWB_N"    "SWB_N"   
[31] "EWB_N"    "FWB_N"    "FANLTC_N" "PWB"      "SWB"      "EWB"     
[37] "FWB"      "FANLTC"  
      PWB             SWB             EWB              FWB       
 Min.   :12.60   Min.   : 8.75   Min.   : 6.250   Min.   : 8.75  
 1st Qu.:13.65   1st Qu.:11.67   1st Qu.: 8.312   1st Qu.: 9.90  
 Median :14.00   Median :17.50   Median :10.125   Median :11.20  
 Mean   :14.40   Mean   :15.47   Mean   : 9.771   Mean   :11.62  
 3rd Qu.:14.75   3rd Qu.:19.60   3rd Qu.:11.354   3rd Qu.:13.30  
 Max.   :17.00   Max.   :19.83   Max.   :13.000   Max.   :15.00  
 NA's   :4       NA's   :3                        NA's   :1      
     FANLTC     
 Min.   :45.75  
 1st Qu.:49.41  
 Median :51.52  
 Mean   :50.30  
 3rd Qu.:52.40  
 Max.   :52.42  
 NA's   :4      

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