ddi_derivation: derivation and its child nodes

View source: R/variables.R

ddi_derivationR Documentation

derivation and its child nodes

Description

Used only in the case of a derived variable, this element provides both a description of how the derivation was performed and the command used to generate the derived variable, as well as a specification of the other variables in the study used to generate the derivation. The "var" attribute provides the ID values of the other variables in the study used to generate this derived variable. More information on these elements, especially their allowed attributes, can be found in the references.

Usage

ddi_derivation(...)

ddi_drvdesc(...)

ddi_drvcmd(...)

Arguments

...

Child nodes or attributes.

Details

Parent nodes

derivation is included in var.

derivation specific child nodes

  • ddi_drvcmd() is the actual command used to generate the derived variable. The "syntax" attribute is used to indicate the command language employed (e.g., SPSS, SAS, Fortran, etc.). The element may be repeated to support multiple language expressions of the content.

  • ddi_drvdesc() is a textual description of the way in which this variable was derived. The element may be repeated to support multiple language expressions of the content.

Value

A ddi_node object.

References

derivation documentation

drvcmd documentation

drvdesc documentation

Examples

ddi_derivation()

# Functions that need to be wrapped in ddi_derivation()

ddi_drvcmd(syntax = "SPSS",
           "RECODE V1 TO V3 (0=1) (1=0) (2=-1) INTO DEFENSE WELFARE HEALTH.")

ddi_drvdesc("VAR215.01 'Outcome of first pregnancy' (1988 NSFG=VAR611 PREGOUT1) 
            If R has never been pregnant (VAR203 PREGNUM EQ 0) then OUTCOM01 is 
            blank/inapplicable. Else, OUTCOM01 is transferred from VAR225 
            OUTCOME for R's 1st pregnancy.")


Global-TIES-for-Children/rddi documentation built on Oct. 24, 2022, 9:50 p.m.