zero30dSU: Adjusts 30 day SU variables to zero if lifetime use is zero

Description Usage Arguments Details Value Note

Description

Adjusts 30 day SU variables to zero if lifetime use is zero

Usage

1
zero30dSU(pDT)

Arguments

pDF

A data.table in the format returned by 'getNQTVCs', i.e. an image of the database table 'SWave' that includes at least the variables for lifetime and 30 day substance use included in the Short Survey.

Details

Survey skip logic skips over 30 day SU questions if no lifetime use of the substance is reported concurrently. This recode allows the 30 day variables to be used in analyses under such circumstances, instead of being missing.

Value

A data.table in the same format as the input DF, with 30 day substance use variables recoded to 0 if no lifetime use of the corresponding substance has been reported concurrently.

Note

This function is a helper function for 'makeTVTbl'.


johninpdx/RSTools documentation built on May 19, 2019, 5:15 p.m.