Description Usage Arguments Details Value Note References Examples
View source: R/sx-scoreFACIT_F.R
Generates all of the scores of the Functional Assessment of Chronic Illness Therapy - Fatigue (FACIT-F, v4) from item responses.
1 | scoreFACIT_F(df, updateItems = FALSE, keepNvalid = FALSE)
|
df |
A data frame with the FACIT-F items, appropriately-named. |
updateItems |
Logical, if |
keepNvalid |
Logical, if |
Given a data frame that includes all of the FACIT-F (Version 4) items as variables, appropriately named, this function generates all of the FACIT-F 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.
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:
Physical Well-Being subscale
Social/Family Well-Being subscale
Emotional Well-Being subscale
Physical Well-Being subscale
FACT-G Total Score (i.e., PWB+SWB+EWB+FWB)
Fatigue subscale
FACIT-F Total Score (i.e., PWB+SWB+EWB+FWB+FS)
FACIT-F Trial Outcome Index (e.g., PWB+FWB+FS)
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_F
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_F
.
FACIT-F Scoring Guidelines, available at http://www.facit.org
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 | ## 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('HI7', 'HI12', 'An1', 'An2', 'An3', 'An4', 'An5', 'An7', 'An8',
'An12', 'An14', 'An15', 'An16')
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 <- scoreFACIT_F(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_F(exampleDat, updateItems = TRUE, keepNvalid = TRUE)
names(scoredDat)
## Descriptives of scored scales
summary(scoredDat[, c('PWB', 'SWB', 'EWB', 'FWB', 'FACTG',
'FS', 'FACIT_F_TOTAL', 'FACIT_F_TOI')])
|
[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"
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8 10.5 43.300 26.000 69.300 50.500
2 2 4 0 11.200 9.00 13.0 16.0 49.200 27.083 76.283 54.283
3 3 1 1 18.667 16.80 16.0 15.0 66.467 28.167 94.634 61.834
4 0 0 2 17.000 17.50 7.0 5.0 46.500 36.000 82.500 58.000
5 9 2 0 NA 15.75 NA 17.5 NA 34.125 NA NA
6 9 2 9 15.750 NA 12.0 NA NA NA NA NA
7 4 3 3 NA 16.80 NA 12.6 NA 23.111 NA NA
8 2 0 3 NA NA NA 11.2 NA 16.250 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] "HI7" "HI12" "AN1" "AN2"
[33] "AN3" "AN4" "AN5" "AN7"
[37] "AN8" "AN12" "AN14" "AN15"
[41] "AN16" "PWB_N" "SWB_N" "EWB_N"
[45] "FWB_N" "FACTG_N" "PWB" "SWB"
[49] "EWB" "FWB" "FACTG" "FS_N"
[53] "FACIT_F_TOTAL_N" "FS" "FACIT_F_TOTAL" "FACIT_F_TOI"
PWB SWB EWB FWB
Min. :11.20 Min. : 8.00 Min. : 7.00 Min. : 5.00
1st Qu.:14.00 1st Qu.:10.69 1st Qu.:10.80 1st Qu.:10.85
Median :15.75 Median :16.27 Median :12.00 Median :12.60
Mean :15.32 Mean :13.97 Mean :11.76 Mean :12.54
3rd Qu.:17.00 3rd Qu.:16.80 3rd Qu.:13.00 3rd Qu.:15.50
Max. :18.67 Max. :17.50 Max. :16.00 Max. :17.50
NA's :3 NA's :2 NA's :3 NA's :1
FACTG FS FACIT_F_TOTAL FACIT_F_TOI
Min. :43.30 Min. :16.25 Min. :69.30 Min. :50.50
1st Qu.:45.70 1st Qu.:24.56 1st Qu.:74.54 1st Qu.:53.34
Median :47.85 Median :27.08 Median :79.39 Median :56.14
Mean :51.37 Mean :27.25 Mean :80.68 Mean :56.15
3rd Qu.:53.52 3rd Qu.:31.15 3rd Qu.:85.53 3rd Qu.:58.96
Max. :66.47 Max. :36.00 Max. :94.63 Max. :61.83
NA's :4 NA's :1 NA's :4 NA's :4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.