scoreFACT_B: Score the FACT-B

Description Usage Arguments Details Value Note References Examples

View source: R/ca-scoreFACT_B.R

Description

Generates all of the scores of the Functional Assessment of Cancer Therapy - Breast Cancer (FACT-B, v4) from item responses.

Usage

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

Arguments

df

A data frame with the FACT-B 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 FACT-B (Version 4) items as variables, appropriately named, this function generates all of the FACT-B 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

FACTG

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

BCS

Breast Cancer subscale

FACT_B_TOTAL

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

FACT_B_TOI

FACT-B Trial Outcome Index (e.g., PWB+FWB+BCS)

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

References

FACT-B 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
31
32
33
34
35
## 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_names <- c('B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8', 'B9', 'P2')
itemNames <- c(G_names, AC_names)
## Generating random item responses for 8 fake respondents
set.seed(6375309)
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 <- as.data.frame(cbind(ID = paste0('ID', 1:8),
    as.data.frame(exampleDat)))
names(exampleDat) <- c('ID', itemNames)

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

Example output

 [1] "ID"           "GP1"          "GP2"          "GP3"          "GP4"         
 [6] "GP5"          "GP6"          "GP7"          "GS1"          "GS2"         
[11] "GS3"          "GS4"          "GS5"          "GS6"          "GS7"         
[16] "GE1"          "GE2"          "GE3"          "GE4"          "GE5"         
[21] "GE6"          "GF1"          "GF2"          "GF3"          "GF4"         
[26] "GF5"          "GF6"          "GF7"          "B1"           "B2"          
[31] "B3"           "B4"           "B5"           "B6"           "B7"          
[36] "B8"           "B9"           "P2"           "PWB"          "SWB"         
[41] "EWB"          "FWB"          "FACTG"        "BCS"          "FACT_B_TOTAL"
[46] "FACT_B_TOI"  
   ID GP1 GP2 GP3 GP4 GP5 GP6 GP7 GS1 GS2 GS3 GS4 GS5 GS6 GS7 GE1 GE2 GE3 GE4
1 ID1   9   3   1   2   2   3   0   1   2   1   1   1   0   9   0   9   0   2
2 ID2   0   9   3   2   4   2   2   3   1   2   1   9   0   3   4   0   0   3
3 ID3   3   0   0   2   4   0   2   2   2   1   0   0   3   3   2   2   2   1
4 ID4   3   9   3   2   4   9   3   1   1   1   4   1   2   0   2   1   2   2
5 ID5   1   1   9   1   2   3   2   3   9   9   0   9   3   9   3   0   9   9
6 ID6   9   9   9   0   2   3   9   9   2   0   1   0   9   9   0   3   9   4
7 ID7   2   1   9   4   9   9   4   4   1   9   9   9   9   9   9   9   2   9
8 ID8   9   3   9   1   9   9   1   9   9   9   9   4   9   2   0   0   9   1
  GE5 GE6 GF1 GF2 GF3 GF4 GF5 GF6 GF7 B1 B2 B3 B4 B5 B6 B7 B8 B9 P2    PWB
1   4   9   0   3   2   0   1   2   2  4  2  1  2  3  0  4  4  4  3 15.167
2   3   3   2   0   2   2   3   3   4  4  0  0  3  9  9  2  3  3  2 12.833
3   0   4   3   3   9   2   1   1   2  3  4  4  0  9  1  2  0  4  0 17.000
4   2   3   2   4   2   1   1   4   3  4  9  0  1  0  2  1  1  0  0  7.000
5   9   9   1   9   9   9   9   9   9  4  1  9  9  9  9  4  3  9  9 16.333
6   9   0   3   3   9   1   9   9   9  2  9  9  0  2  2  4  9  3  9     NA
7   1   9   2   0   9   9   9   4   0  9  9  1  9  9  4  9  1  3  9  8.750
8   4   9   9   9   9   0   0   9   0  9  4  2  0  3  3  9  4  9  4     NA
     SWB  EWB  FWB  FACTG    BCS FACT_B_TOTAL FACT_B_TOI
1  7.000 15.0 10.0 47.167 17.000       64.167     42.167
2 11.667  7.0 16.0 47.500 23.750       71.250     52.583
3 11.000 13.0 14.0 55.000 20.000       75.000     51.000
4 10.000 10.0 17.0 44.000 23.333       67.333     47.333
5     NA   NA   NA     NA     NA           NA         NA
6  5.250 16.5   NA     NA 15.000           NA         NA
7     NA   NA 10.5     NA     NA           NA         NA
8     NA 10.5   NA     NA  5.714           NA         NA
 [1] "ID"             "GP1"            "GP2"            "GP3"           
 [5] "GP4"            "GP5"            "GP6"            "GP7"           
 [9] "GS1"            "GS2"            "GS3"            "GS4"           
[13] "GS5"            "GS6"            "GS7"            "GE1"           
[17] "GE2"            "GE3"            "GE4"            "GE5"           
[21] "GE6"            "GF1"            "GF2"            "GF3"           
[25] "GF4"            "GF5"            "GF6"            "GF7"           
[29] "B1"             "B2"             "B3"             "B4"            
[33] "B5"             "B6"             "B7"             "B8"            
[37] "B9"             "P2"             "PWB_N"          "SWB_N"         
[41] "EWB_N"          "FWB_N"          "FACTG_N"        "PWB"           
[45] "SWB"            "EWB"            "FWB"            "FACTG"         
[49] "BCS_N"          "FACT_B_TOTAL_N" "BCS"            "FACT_B_TOTAL"  
[53] "FACT_B_TOI"    
      PWB              SWB              EWB             FWB      
 Min.   : 7.000   Min.   : 5.250   Min.   : 7.00   Min.   :10.0  
 1st Qu.: 9.771   1st Qu.: 7.000   1st Qu.:10.12   1st Qu.:10.5  
 Median :14.000   Median :10.000   Median :11.75   Median :14.0  
 Mean   :12.847   Mean   : 8.983   Mean   :12.00   Mean   :13.5  
 3rd Qu.:16.041   3rd Qu.:11.000   3rd Qu.:14.50   3rd Qu.:16.0  
 Max.   :17.000   Max.   :11.667   Max.   :16.50   Max.   :17.0  
 NA's   :2        NA's   :3        NA's   :2       NA's   :3     
     FACTG            BCS          FACT_B_TOTAL     FACT_B_TOI   
 Min.   :44.00   Min.   : 5.714   Min.   :64.17   Min.   :42.17  
 1st Qu.:46.38   1st Qu.:15.500   1st Qu.:66.54   1st Qu.:46.04  
 Median :47.33   Median :18.500   Median :69.29   Median :49.17  
 Mean   :48.42   Mean   :17.466   Mean   :69.44   Mean   :48.27  
 3rd Qu.:49.38   3rd Qu.:22.500   3rd Qu.:72.19   3rd Qu.:51.40  
 Max.   :55.00   Max.   :23.750   Max.   :75.00   Max.   :52.58  
 NA's   :4       NA's   :2        NA's   :4       NA's   :4      

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