Forms a pointer of factors representing a multiple-response (R.W. Payne).
Options
MRESPONSE = pointer |
Pointer with a factor for each code, indicating the units where it occurs in the CODE texts or variates |
---|---|
RESPONSECODES = text or variate |
Saves the set of distinct multiple-response codes |
CODENULL = text or variate |
Code(s) used to represent a null value in the CODE texts or variates; default * or '' |
EXCLUDENULL = string token |
Whether to exclude the null factor recording the respondents that made no reply (yes , no ); default no |
SUFFIXNULL = scalar |
Suffix to use to represent the null factor in MRESPONSE ; default 0 |
LABELNULL = text |
Label to use to represent the null factor in MRESPONSE ; default 'none' |
LDIRECTION = string token |
How to order the labels from textual codes (ascending , given ); default asce |
Parameter
CODE = texts, variates or factors |
Codes from the respondents |
---|
Description
Multiple responses occur in surveys as the result of open-ended questions like “Which cities have you visited this year?” or “What languages do you speak?”. The easiest way to input these into Genstat is in a set of text vectors. Each text has a unit for every respondent, and the set contains as many texts as the maximum number of the replies from any respondent. Alternatively, if the responses are numerical, they can be input in a set of variates. The MTABULATE
procedure can form tables with multiple responses. However, these raw codes must first be converted by FMFACTORS
into a set of factors.
The texts or variates containing the raw data are listed using the CODE
parameter. You can also supply the raw data in factors. If CODE
specifies a mixture of texts and factors, FMFACTORS
uses the labels of the factors (and they must all have labels). Alternatively, if CODE
specifies a mixture of variates and factors, FMFACTORS
uses the factor levels. Finally, if CODE
specifies only factors, FMFACTORS
will use their labels if they all have labels; otherwise their levels. FMFACTORS
will give a fault if you specify a mixture of texts and variates.
The multiple-response factors are saved, in a pointer, using the MRESPONSE
option. The pointer contains a factor for every recorded code, with levels 0 and 1, and corresponding labels 'absent'
and 'present'
. If the codes are textual, the various strings are used as labels of the pointer; while if they are numerical, the numbers are used as the pointer suffixes.
By default, the texts or variates are assumed to contain a missing values for any null response: for example these would occur in the third and fourth text, if there were four CODE
texts and the respondent concerned had made only two replies. However, you can use the CODENULL
option to supply alternative codings (for example '-'
for textual responses).
The EXCLUDENULL
option controls whether or not the pointer contains a factor to make an explicit record of the respondents that made no replies at all (default no
). This will be needed if the later tables are to contain a line for “no response”. The SUFFIXLNULL
option specifies the suffix to be used for this factor in the pointer while, for textual codes, the LABELNULL
option specifies its label in the pointer.
The LDIRECTION
option controls whether the labels defined from textual codes are put into ascending alphabetic order (the default), or kept in the order in which they occur in the CODE
texts.
Options: MRESPONSE
, RESPONSECODES
, CODENULL
, EXCLUDENULL
, SUFFIXNULL
, LABELNULL
, LDIRECTION
.
Parameter: CODE
.
Method
FMFACTORS
uses the standard Genstat calculation commands.
Action with RESTRICT
FMFACTORS
takes account of any restrictions on the CODE
texts or variates.
See also
Procedures: FFREERESPONSEFACTOR
, MTABULATE
.
Commands for: Calculations and manipulation, Survey analysis.
Example
CAPTION 'FMFACTORS example',\ 'Preprocess multiple responses from passenger survey.';\ STYLE=meta,plain FACTOR [LABELS=!t(male,female)] sex TEXT nationality,citycode[1...5],languagecode[1...5] READ nationality,age,sex,citycode[1...5],languagecode[1...5];\ FREPRESENTATION=labels British 26 male Amsterdam Berlin '-' '-' '-' English French German '-' '-' British 52 male Barcelona Lisbon Geneva Capetown Helsinki English French German '-' '-' British 48 female Barcelona Lisbon '-' '-' '-' English French '-' '-' '-' British 16 female Barcelona Brussels '-' '-' '-' English French '-' '-' '-' British 21 male Athens Dublin '-' '-' '-' English French '-' '-' '-' British 32 male Paris Capetown '-' '-' '-' English '-' '-' '-' '-' British 31 female 'Paris' '-' '-' '-' '-' English Japanese '-' '-' '-' British 40 male Paris Barcelona '-' '-' '-' English '-' '-' '-' '-' British 38 female Paris Barcelona '-' '-' '-' English '-' '-' '-' '-' British 51 male Copenhagen Madrid '-' '-' '-' English Spanish French '-' '-' British 50 female Copenhagen Madrid '-' '-' '-' English Spanish French '-' '-' British 17 male Dublin '-' '-' '-' '-' English French '-' '-' '-' British 21 female Paris '-' '-' '-' '-' English French '-' '-' '-' Dutch 25 male Paris '-' '-' '-' '-' Dutch English French '-' '-' Dutch 34 male Rome Florence Madrid Brussels '-' Dutch English French Italian Spanish Dutch 33 female Rome Florence Madrid '-' '-' Dutch English German '-' '-' Dutch 50 male London '-' '-' '-' '-' Dutch English '-' '-' '-' Dutch 48 female London '-' '-' '-' '-' Dutch English '-' '-' '-' Dutch 26 male London Brussels Luxembourg Frankfurt '-' Dutch English German French '-' French 37 female London Oxford '-' '-' '-' French English '-' '-' '-' French 39 male London Oxford '-' '-' '-' French English '-' '-' '-' French 48 male Amsterdam '-' '-' '-' '-' French '-' '-' '-' '-' French 34 female Edinburgh '-' '-' '-' '-' French English '-' '-' '-' French 34 female Edinburgh '-' '-' '-' '-' French English '-' '-' '-' French 26 male London Copenhagen '-' '-' '-' French English German '-' '-' French 24 female London Copenhagen '-' '-' '-' French English '-' '-' '-' French 44 male Berlin '-' '-' '-' '-' French German '-' '-' '-' French 43 female Berlin '-' '-' '-' '-' French German '-' '-' '-' German 59 male London '-' '-' '-' '-' German English '-' '-' '-' German 57 female London '-' '-' '-' '-' German '-' '-' '-' '-' German 24 female Paris Brussels '-' '-' '-' German English French '-' '-' German 21 male Paris '-' '-' '-' '-' German English '-' '-' '-' German 45 male London Brussels Luxembourg Frankfurt Madrid German English French '-' '-' German 37 female London Amsterdam '-' '-' '-' German English '-' '-' '-' Germam 81 female '-' '-' '-' '-' '-' German '-' '-' '-' '-' Swiss 45 male Rome Florence Pisa '-' '-' French German Italian English '-' Swiss 37 male Edinburgh London '-' '-' '-' French German English '-' '-' Swiss 41 female Seville Paris '-' '-' '-' French German '-' '-' '-' Swiss 32 male Venice Florence Rome Brussels Luxembourg German French '-' '-' '-' Swiss 29 female Venice Florence Rome '-' '-' German French English '-' '-' : GROUPS [REDEFINE=yes] nationality FMFACTORS [MRESPONSE=city; RESPONSECODES=cities; CODENULL='-'] citycode[] PRINT [ORIENTATION=across; RLWIDTH=20] cities & city[],citycode[] FMFACTORS [MRESPONSE=language; RESPONSECODES=languages; CODENULL='-';\ EXCLUDENULL=yes] languagecode[] PRINT [ORIENTATION=across; RLWIDTH=20] languages & language[],languagecode[]