Variable definitions when writing to Triple-S files
The following list describes how the Triple-S DSC maps Metadata Model (MDM) variable types to Triple-S variable types when writing Triple-S metadata and case data files.
The “Triple-S variable type” is as defined by the value of the type attribute in the Triple-S <variable> element.
MDM variable types
Single-response categorical
Triple-S variable type: single
If there is a
DataFormat custom property (see
Custom properties used when writing to Triple-S files) on the MDM variable and it has a value of "literal", the Triple-S DSC adds a
format attribute to the corresponding Triple-S variable and sets its value to "literal". Note that the
format attribute is not supported in version 1.2 of the Triple-S standard.
Multiple-response categorical
Triple-S variable type: multiple
If there is a
DataFormat custom property (see
Custom properties used when writing to Triple-S files) on the MDM variable and it has a value of "packed", the Triple-S DSC adds a
<spread> element to the corresponding Triple-S variable. The Triple-S DSC then sets the value of the
<spread> element's
subfields attribute to the value of the MDM variable's
EffectiveMaxValue property. The Triple-S DSC also sets the value of the
<spread> element's
width attribute to the value of the MDM variable's
CodeWidth custom property if it exists, otherwise it sets the value of the
width attribute to 1.
Long
Triple-S variable type: quantity
Double
Triple-S variable type: quantity
The Triple-S DSC maps the first MDM variable that has a Weight usage type or whose IsWeight property is set to True to a Triple-S quantity variable that includes a use="weight" attribute setting.
Text
Triple-S variable type: character
The Triple-S DSC sets the value of the Triple-S variable's
<size> element to the value of the
DefTextVarSize custom property (see
Custom properties used when writing to Triple-S files) if set. Otherwise, the Triple-S DSC sets the value of the
<size> element to the value of the corresponding MDM variable's
EffectiveMaxValue property. Note that the Triple-S standard does not support a minimum length for character variables.
Boolean
Triple-S variable type: logical
Date
Triple-S variable type: date, time, or character
If the MDM document's
SssVersion custom property (see
Custom properties used when writing to Triple-S files)has a value of 1.2, the Triple-S DSC writes a Triple-S
character variable. Else, if there is a
DataFormat custom property on the MDM variable and it has a value of "time", the Triple-S DSC writes a Triple-S
time variable, otherwise it writes a Triple-S
date variable.
Missing values
For all Triple-S data types except character, system-missing values (that is, values that indicate that a question was not asked) are represented in a Triple-S case data file by spaces. Therefore, the Triple-S DSC outputs MDM Null values as spaces.
The Triple-S standard does not support user-missing values (that is, values that indicate that a question was asked, but not answered) except in single and multiple variables, where user-missing values are represented in a Triple-S case data file by zeroes. Therefore, the Triple-S DSC outputs MDM empty categorical values as zeroes.
Additional notes for categorical variables
For each category in an MDM single-response or multiple-response categorical variable, the Triple-S DSC adds a <value> element to the corresponding Triple-S variable. A Triple-S <range> element is not written.
The Triple-S DSC sets the value of the
<value> element's
code attribute to the value of the corresponding MDM category's
Value custom property (see
Custom properties used when writing to Triple-S files) if it exists. Otherwise, the Triple-S DSC sets the value of the
code attribute to the index (or "sequential") value of the corresponding MDM category, that is, the Triple-S DSC sets the value of the
code attribute to 1 for the first MDM category, to 2 for the second MDM category, and so on.
If the MDM document's
SssVersion custom property (see
Custom properties used when writing to Triple-S files) has a value of 2.0 and the MDM category's
Factor property contains a value, the Triple-S DSC adds a
score attribute to the corresponding Triple-S
<value> element and sets the attribute's value to the value of the
Factor property. Note that the
score attribute is set only for Triple-S single variables and is not supported in version 1.2 of the Triple-S standard.
The exportation of nonnumeric custom values is only supported for single-response categorical variables.
For multiple-response categorical variables, the following restrictions apply:
▪Custom values are ignored (using the index value) for the bitstring format.
▪Only numeric custom values are supported for the spread format.
Additional notes for non-categorical variables
For MDM variables that are mapped to Triple-S quantity, date, or time variables, the Triple-S DSC adds a <range> element to the corresponding Triple-S variable and might also add <value> elements. The way in which the Triple-S DSC sets the range, and how it decides whether to add <value> elements, depends on the following conditions:
▪The MDM variable has one or more categories.
▪All of the categories have a Factor property.
▪The value of each Factor property is valid for the data type of the MDM variable.
If any of these conditions are false, the Triple-S DSC sets the range of the corresponding Triple-S variable to the values of the MDM variable's EffectiveMinValue and EffectiveMaxValue properties and does not add any <value> elements to the Triple-S variable.
If all of these conditions are true, the Triple-S DSC maps each MDM category to a Triple-S <value> element and sets the value of the element's code attribute to the value of the MDM category's Factor property. In addition, if the value of the Factor property appears in the value of the MDM variable's RangeExpression property as a single value, the Triple-S DSC ignores the single value in the range expression when setting the range of the corresponding Triple-S variable. For example, the following MDM Long variable has two categories that both have integer Factor values:
Q5 "Miles traveled" long [1 .. 499, 500, 999]
{
_500_or_more "500 or more" factor(500),
Not_Stated "Not Stated" factor(999)
};
The Triple-S DSC will map this variable to a Triple-S quantity variable that has two <value> elements, and will set the values of the elements' code attributes to 500 and 999 respectively. Because the values of both Factor properties appear in the MDM variable's range expression as single values, the Triple-S DSC will ignore them and set the range of the Triple-S variable as 1 to 499. The resulting Triple-S <values> element for this variable would be as follows:
<values>
<range from="1" to="499" />
<value code="500">500 or more</value>
<value code="999">Not stated</value>
</values>
See also