scoreFACT_M: Score the FACT-M

Description Usage Arguments Details Value Note References Examples

View source: R/ca-scoreFACT_M.R

Description

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

Usage

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

Arguments

df

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

MS

Melanoma subscale

MSS

Melanoma Surgery Scale

FACT_M_TOTAL

FACT-M Total Score (i.e., PWB+SWB+EWB+FWB+MS+MSS)

FACT_M_TOI

FACT-M Trial Outcome Index (e.g., PWB+FWB+MS+MSS)

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

References

FACT-M 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
36
37
38
39
## 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('M1', 'M2', 'M3', 'B1', 'ITU4', 'An10', 'Hep3', 'C1', 'C6',
'M5', 'M6', 'ITU3', 'MS8', 'M8',  'M9', 'HI7')
AC_names2 <- c('M10', 'M11', 'M12', 'M13', 'M14', 'M15', 'M16', 'M17')
AC_names <- c(AC_names1, AC_names2)
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_M(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_M(exampleDat, updateItems = TRUE, keepNvalid = TRUE)
names(scoredDat)
## Descriptives of scored scales
summary(scoredDat[, c('PWB', 'SWB', 'EWB', 'FWB', 'FACTG',
                      'MS', 'MSS', 'FACT_M_TOTAL', 'FACT_M_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"          "M1"           "M2"          
[31] "M3"           "B1"           "ITU4"         "An10"         "Hep3"        
[36] "C1"           "C6"           "M5"           "M6"           "ITU3"        
[41] "MS8"          "M8"           "M9"           "HI7"          "M10"         
[46] "M11"          "M12"          "M13"          "M14"          "M15"         
[51] "M16"          "M17"          "PWB"          "SWB"          "EWB"         
[56] "FWB"          "FACTG"        "MS"           "MSS"          "FACT_M_TOTAL"
[61] "FACT_M_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   9   3   0   1   2   1   1   1   0   2   0   2   0   2
2 ID2   4   0   0   3   3   3   2   0   2   2   3   3   4   4   0   0   3   3
3 ID3   4   4   9   1   9   2   0   4   0   9   2   9   2   4   3   3   1   1
4 ID4   3   2   3   2   0   0   2   3   2   3   0   0   0   0   0   1   3   3
5 ID5   9   3   9   9   9   0   3   9   2   1   9   0   2   9   4   9   3   0
6 ID6   9   1   3   9   1   3   1   9   9   3   9   0   9   9   9   9   1   2
7 ID7   1   9   9   9   9   4   9   0   9   4   2   9   9   3   9   9   2   3
8 ID8   9   1   9   9   9   0   9   9   9   1   9   4   9   9   2   9   9   2
  GE5 GE6 GF1 GF2 GF3 GF4 GF5 GF6 GF7 M1 M2 M3 B1 ITU4 An10 Hep3 C1 C6 M5 M6
1   4   3   0   3   2   0   1   2   2  9  2  1  2    3    0    4  4  4  3  0
2   3   2   3   3   2   3   0   0   2  9  0  2  2    2    9    0  0  3  3  2
3   1   4   1   2   0   2   1   2   2  2  3  2  4    2    1    1  4  3  4  2
4   3   0   4   4   4   1   2   4   0  1  9  3  9    2    0    0  2  0  2  3
5   9   1   2   9   0   9   9   4   1  2  9  2  9    9    9    9  9  9  1  9
6   9   0   9   1   4   3   3   9   9  0  9  4  0    3    9    2  9  3  3  0
7   0   9   0   2   2   9   4   2   2  0  4  0  0    9    9    9  9  3  3  3
8   1   9   2   9   9   9   9   0   0  9  9  3  2    9    1    9  9  9  3  4
  ITU3 MS8 M8 M9 HI7 M10 M11 M12 M13 M14 M15 M16 M17  PWB   SWB EWB   FWB FACTG
1    4   9  2  4   2   2   3   1   2   1   1   0   3 15.4  8.00  13 10.00  46.4
2    2   2  1  9   4   9   3   0   2   1   1   2   3 13.0 18.00   9 13.00  53.0
3    0   1  0  2   1   1   0   0   1   1   1   1   2 12.6 16.80  13 10.00  52.4
4    3   0  2  9   1   0   2   2   0   3   1   4   2 16.0  8.00  12 19.00  55.0
5    2   9  9  3   4   4   9   9   9   1   3   9   4   NA  8.75  12 12.25    NA
6    4   0  4  9   1   9   2   9   9   9   2   3   0 15.4    NA  NA 19.25    NA
7    4   4  0  3   9   9   9   9   3   9   4   3   1   NA 15.75  NA 14.00    NA
8    4   9  9  9   9   0   9   2   9   4   1   9   9   NA    NA  NA    NA    NA
      MS    MSS FACT_M_TOTAL FACT_M_TOI
1 28.571 21.000       74.971     53.971
2 38.154 20.571       91.154     64.154
3 34.000 25.000       86.400     56.600
4 35.692 18.000       90.692     70.692
5     NA     NA           NA         NA
6 34.667     NA           NA     69.317
7 32.000     NA           NA         NA
8     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] "M1"             "M2"             "M3"             "B1"            
[33] "ITU4"           "AN10"           "HEP3"           "C1"            
[37] "C6"             "M5"             "M6"             "ITU3"          
[41] "MS8"            "M8"             "M9"             "HI7"           
[45] "M10"            "M11"            "M12"            "M13"           
[49] "M14"            "M15"            "M16"            "M17"           
[53] "PWB_N"          "SWB_N"          "EWB_N"          "FWB_N"         
[57] "FACTG_N"        "PWB"            "SWB"            "EWB"           
[61] "FWB"            "FACTG"          "MS_N"           "MSS_N"         
[65] "FACT_M_TOTAL_N" "MS"             "MSS"            "FACT_M_TOTAL"  
[69] "FACT_M_TOI"    
      PWB             SWB              EWB            FWB            FACTG     
 Min.   :12.60   Min.   : 8.000   Min.   : 9.0   Min.   :10.00   Min.   :46.4  
 1st Qu.:13.00   1st Qu.: 8.188   1st Qu.:12.0   1st Qu.:11.12   1st Qu.:50.9  
 Median :15.40   Median :12.250   Median :12.0   Median :13.00   Median :52.7  
 Mean   :14.48   Mean   :12.550   Mean   :11.8   Mean   :13.93   Mean   :51.7  
 3rd Qu.:15.40   3rd Qu.:16.538   3rd Qu.:13.0   3rd Qu.:16.50   3rd Qu.:53.5  
 Max.   :16.00   Max.   :18.000   Max.   :13.0   Max.   :19.25   Max.   :55.0  
 NA's   :3       NA's   :2        NA's   :3      NA's   :1       NA's   :4     
       MS             MSS         FACT_M_TOTAL     FACT_M_TOI   
 Min.   :28.57   Min.   :18.00   Min.   :74.97   Min.   :53.97  
 1st Qu.:32.50   1st Qu.:19.93   1st Qu.:83.54   1st Qu.:56.60  
 Median :34.33   Median :20.79   Median :88.55   Median :64.15  
 Mean   :33.85   Mean   :21.14   Mean   :85.80   Mean   :62.95  
 3rd Qu.:35.44   3rd Qu.:22.00   3rd Qu.:90.81   3rd Qu.:69.32  
 Max.   :38.15   Max.   :25.00   Max.   :91.15   Max.   :70.69  
 NA's   :2       NA's   :4       NA's   :4       NA's   :3      

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