PSQIScore: Calculates PSQI subscales and total scores

View source: R/ScoringFuncs.R

PSQIScoreR Documentation

Calculates PSQI subscales and total scores

Description

Calculates PSQI subscales and total scores

Usage

PSQIScore(inputTbl, wv = "")

Arguments

inputTbl

A tbl_df with SSID, then all raw PSQI numeric items in order.
Hence it is N x 19 (SSID + 18 PSQI items).
inputTbl cols 2 & 4 must be of type c('hms', 'difftime' )
inputTbl cols 3 and 5:19 must include either 'double' or 'numeric' in their class.
inputTbl col 1 (the ID column), the PSQI ID is normally some numeric but can be anything.
The 18 input items (ignoring SSID, the first column) must be included in this order, though they can be named anything:
- psq1
- psq2
- psq3
- psq4
- psq5a to psq5j (10 items)
- psq6
- psq7
- psq8
- psq9

wv

Character string with the wave number (defaults to empty string). This string is appended (with a period) to the component names, which are all of the form >> pscN << (N = 1, 2, ...7, Tot). So if This string is nonempty, these names will all be of the form pscN.v(wv), where v() means "the value of".

Value

A tbl_df of SSID, PSQI scored items (7), and a total, hence N x 9.
All columns are converted to 'numeric'.


johninpdx/JMLUtils documentation built on Dec. 29, 2024, 1:27 p.m.