scoreFACT_P: Score the FACT-P

Description Usage Arguments Details Value Note References Examples

View source: R/ca-scoreFACT_P.R

Description

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

Usage

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

Arguments

df

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

PCS

Prostate Cancer subscale

FACT_P_TOTAL

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

FACT_P_TOI

FACT-P Trial Outcome Index (e.g., PWB+FWB+PCS)

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_P 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_P.

References

FACT-P 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('C2', 'C6', 'P1', 'P2', 'P3', 'P4', 'P5', 'P6', 'P7', 'BL2', 'P8', 'BL5')
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_P(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_P(exampleDat, updateItems = TRUE, keepNvalid = TRUE)
names(scoredDat)
## Descriptives of scored scales
summary(scoredDat[, c('PWB', 'SWB', 'EWB', 'FWB', 'FACTG',
                      'PCS', 'FACT_P_TOTAL', 'FACT_P_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"          "C2"           "C6"          
[31] "P1"           "P2"           "P3"           "P4"           "P5"          
[36] "P6"           "P7"           "BL2"          "P8"           "BL5"         
[41] "PWB"          "SWB"          "EWB"          "FWB"          "FACTG"       
[46] "PCS"          "FACT_P_TOTAL" "FACT_P_TOI"  
   ID GP1 GP2 GP3 GP4 GP5 GP6 GP7 GS1 GS2 GS3 GS4 GS5 GS6 GS7 GE1 GE2 GE3 GE4
1 ID1   3   3   1   9   2   3   0   1   2   1   1   1   0   2   0   2   0   2
2 ID2   3   2   4   2   2   3   1   2   1   1   0   3   4   9   9   3   3   3
3 ID3   4   0   9   2   2   1   0   0   3   3   2   9   2   1   0   4   3   3
4 ID4   3   1   1   1   4   1   9   0   2   1   2   2   2   3   2   4   2   1
5 ID5   9   9   9   2   3   9   9   9   9   0   0   9   9   9   9   9   0   4
6 ID6   9   0   9   9   0   3   1   4   9   0   9   3   1   9   0   9   9   2
7 ID7   9   0   9   9   2   9   1   3   9   9   1   9   4   9   9   1   9   9
8 ID8   0   0   2   9   4   9   3   0   9   9   0   4   0   3   4   9   9   3
  GE5 GE6 GF1 GF2 GF3 GF4 GF5 GF6 GF7 C2 C6 P1 P2 P3 P4 P5 P6 P7 BL2 P8 BL5
1   4   3   0   3   9   0   1   2   2  4  2  1  2  3  9  4  4  4   3  0   4
2   2   0   2   2   3   3   4   4   0  0  3  3  3  2  3  3  2  3   0  0   2
3   9   2   1   1   9   3   4   4   0  1  1  2  0  4  0  3  2  3   2  4   3
4   9   4   3   4   2   0   1   0   2  1  1  0  0  1  1  1  1  2   3  2   3
5   4   9   9   2   4   0   1   9   9  1  2  9  0  9  0  2  3  9   0  9   9
6   1   0   9   9   9   9   9   9   9  2  9  2  9  0  1  9  9  9   2  2   9
7   9   9   4   9   1   3   1   9   3  1  9  9  9  9  0  0  9  4   9  1   2
8   3   9   9   0   9   4   9   0   9  9  1  9  9  9  0  1  9  4   4  9   4
     PWB    SWB  EWB    FWB  FACTG    PCS FACT_P_TOTAL FACT_P_TOI
1 14.000  8.000 13.0  9.333 44.333 22.909       67.242     46.242
2 11.000 12.833 13.2 18.000 55.033 30.000       85.033     59.000
3 17.500 12.833 14.4 15.167 59.900 21.000       80.900     53.667
4 15.167 12.000 13.2 12.000 52.367 28.000       80.367     55.167
5     NA     NA   NA 12.250     NA 27.429           NA         NA
6 21.000 14.000 19.5     NA     NA     NA           NA         NA
7     NA     NA   NA 16.800     NA     NA           NA         NA
8 15.400  9.800   NA     NA     NA     NA           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] "C2"             "C6"             "P1"             "P2"            
[33] "P3"             "P4"             "P5"             "P6"            
[37] "P7"             "BL2"            "P8"             "BL5"           
[41] "PWB_N"          "SWB_N"          "EWB_N"          "FWB_N"         
[45] "FACTG_N"        "PWB"            "SWB"            "EWB"           
[49] "FWB"            "FACTG"          "PCS_N"          "FACT_P_TOTAL_N"
[53] "PCS"            "FACT_P_TOTAL"   "FACT_P_TOI"    
      PWB             SWB             EWB             FWB        
 Min.   :11.00   Min.   : 8.00   Min.   :13.00   Min.   : 9.333  
 1st Qu.:14.29   1st Qu.:10.35   1st Qu.:13.20   1st Qu.:12.062  
 Median :15.28   Median :12.42   Median :13.20   Median :13.709  
 Mean   :15.68   Mean   :11.58   Mean   :14.66   Mean   :13.925  
 3rd Qu.:16.98   3rd Qu.:12.83   3rd Qu.:14.40   3rd Qu.:16.392  
 Max.   :21.00   Max.   :14.00   Max.   :19.50   Max.   :18.000  
 NA's   :2       NA's   :2       NA's   :3       NA's   :2       
     FACTG            PCS         FACT_P_TOTAL     FACT_P_TOI   
 Min.   :44.33   Min.   :21.00   Min.   :67.24   Min.   :46.24  
 1st Qu.:50.36   1st Qu.:22.91   1st Qu.:77.09   1st Qu.:51.81  
 Median :53.70   Median :27.43   Median :80.63   Median :54.42  
 Mean   :52.91   Mean   :25.87   Mean   :78.39   Mean   :53.52  
 3rd Qu.:56.25   3rd Qu.:28.00   3rd Qu.:81.93   3rd Qu.:56.13  
 Max.   :59.90   Max.   :30.00   Max.   :85.03   Max.   :59.00  
 NA's   :4       NA's   :3       NA's   :4       NA's   :4      

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