fixPSQNA: Internal function used by PSQIScore

View source: R/ScoringFuncs.R

fixPSQNAR Documentation

Internal function used by PSQIScore

Description

Internal function used by PSQIScore

Usage

fixPSQNA(inTb)

Arguments

inTb

A tbl_df with SSID, then all raw PSQI numeric items in order.
Hence it is N x 19 (SSID + 18 PSQI items).
inTb cols 2 & 4 must be of type c('hms', 'difftime' )
inTb cols 3 and 5:19 must include either 'double' or 'numeric' in their class.
intTb 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

Value

A tbl_df with the same format as the input tbl_df, only with NAs re-scored to 0's, as appropriate.


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