CRAN_Status_Badge

Coverage Status

PROscorerTools

Overview

PROscorerTools provides tools to score patient-reported outcome (PRO) measures and other quality of life (QoL) and psychometric instruments. PROscorerTools also provides the building blocks of the functions in the PROscorer package.

PROscorerTools contains several “helper” functions, each of which performs a specific task that is common when scoring PRO-like instruments (e.g., reverse coding items). But most users will find that the scoreScale() function alone can address their scoring needs.

The scoreScale() Function

The workhorse function in PROscorerTools is the scoreScale() function. Its basic job is to take a data frame containing responses to some items, and output a single score for those items.

The scoreScale() function has simple, flexible arguments that enable it to handle nearly all scoring situations.

Features:

Installation and Basic Usage

Install the stable version from CRAN (recommended):

install.packages("PROscorerTools")

If you want to contribute to the development of the PROscorerTools or PROscorer packages, then you can install the development version from GitHub (generally NOT recommended):

devtools::install_github("MSKCC-Epi-Bio/PROscorerTools")

Load PROscorerTools in your R workspace:

library(PROscorerTools)

As an example, we will use the makeFakeData() function to make a data frame of responses to 6 fake items from 20 imaginary respondents. The created data set (named “dat”) has an “id” variable, plus responses to 6 items (named “q1”, “q2”, etc.) from 20 imaginary respondents. There are also missing responses (“NA”) scattered throughout.

dat <- makeFakeData(n = 20, nitems = 6, values = 0:4, id = TRUE)

Below we use the scoreScale function to score the fake responses in “dat”. We use the items argument to tell scoreScale which variables are the items we want to score. We will score the items by summing the responses (type = "sum"). We will save the scores from the fake questionnaire in a data frame named “dat_scored”.

dat_scored <- scoreScale(df = dat, items = 2:7, type = "sum")
dat_scored

By default, scoreScale will score the items for a given respondent as long as the respondent is missing no more than 50% of the items. This can be changed with the okmiss argument. Above, okmiss = 0.50 by default, so a respondent could be missing 3 of the 6 items and still be assigned a score (if missing 4 or more items, they were assigned a score of NA). Below, we again score the items, but this time we allow less than half of the items to be missing to be scored (okmiss = 0.49).

dat_scored <- scoreScale(df = dat, items = 2:7, type = "sum", okmiss = 0.49)
dat_scored

For more information on the scoreScale function, you can access its “help” page by typing ?scoreScale into R.

Resources for More Information