hoos: Calculates the Hip Disability and Osteoarthritis Outcomes...

Description Usage Arguments Value Examples

View source: R/HOOS_Scoring_Algorithm.R

Description

At least half of the items in each subscale require a response in order for that subscale score to be calculated.

Usage

1
hoos(data, symptomvars, painvars, adlvars, sportvars, qolvars)

Arguments

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

Value

This function returns the original data frame provided as input with five additional variables storing each subscale score.

Examples

 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)

mccartqm/proms documentation built on May 29, 2019, 11:40 a.m.