Description Usage Arguments Value Examples
View source: R/HOOS_Scoring_Algorithm.R
At least half of the items in each subscale require a response in order for that subscale score to be calculated.
1 |
data |
A data frame |
symptomvars |
A character vector of length 5 specifying the names of the symptom variables (which include symptoms and stiffness) |
painvars |
A character vector of length 10 specifying the names of the pain variables |
adlvars |
A character vector of length 17 specifying the names of the function in activities of daily living variables |
sportvars |
A character vector of length 4 specifying the names of the function in sport and recreation variables |
qolvars |
A character vector of length 4 specifying the names of the hip-related quality of life variables |
This function returns the original data frame provided as input with five additional variables storing each subscale score.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | fai <- read.csv("FAI test data.csv", stringsAsFactors = F)
hoosvars <- names(fai)[c(31:109)]
symptoms <- names(fai)[seq(31, 39, 2)]
pain <- names(fai)[c(41, 59, 2)]
adl <- names(fai)[c(61, 93, 2)]
sport <- names(fai)[c(95, 101, 2)]
qol <- names(fai)[c(103, 109, 2)]
library(dplyr)
test <- cbind.data.frame(select(fai, -(hoossy1r:hoosq4l)),
apply(fai[hoosvars],
2,
function(x) ifelse(x %in% c(1,2,3,4,5), x-1, x)))
df <- hoos(df, symptoms, pain, adl, sport, qol)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.