{smcl} {* 26oct2002}{...} {hline} help for {hi:mrdum} {right:version 1.3.1 25 October 2002} {hline} {title:Creation of dummy variables and summary table for multiple response data} {p 8 14}{cmd:mrdum} {it:varlist} [{cmd:if} {it:exp}] [{cmd:in} {it:range}]{cmd:,} {cmdab:s:tub(}{it:string}{cmd:)} [{cmdab:res:ponses(}{it:numlist}{cmd:)} {cmdab:lab:els}[{cmd:(}{it:valuelabelname}{cmd:)}]] {title:Description} {p}For general use, {cmd:mrdum} searches across {it:varlist} for integer codes and creates corresponding binary dummy variables. Each dummy is equal to 1 if the integer code was found anywhere in {it:varlist}, 0 if not, and missing if all of {it:varlist} is missing. It also displays a table summarizing the results. {p}This program was created specifically to deal with survey questions wherein the respondent can give multiple responses to a single question (e.g. "Check all that apply"). Sometimes these data are coded as a series of variables with the responses entered in the order that the respondent indicated them. Often, however, it is useful to have instead a set of binary dummy variables that indicate whether the respondent indicated a particular response regardless of the order in which it was indicated. {p}If you are interested in the order that responses were indicated, see Eric Zbinden's {cmd:zb_qrm}. {title:Options} {p 0 4}{cmd:stub(}{it:string}{cmd:)} specifies a stub for the resulting dummy variables. The stub should be short enough for all the complete names to be legal. This is a required option. {p_end} {p 0 4}{cmd:responses(}{it:numlist}{cmd:)} allows the user to specify exactly which responses (integer codes) are of interest. If this option is not specified, the command will assume that the responses are coded from 1 to {it:n}, where {it:n} is the number of variables in {it:varlist}. {p 0 4}{cmd:labels} has two possible syntaxes. With no argument, this option displays any value labels attached rather than the numeric codes. Any or all of {it:varlist} can be labelled. This option can also take a previously defined value label name as an argument. {title:Examples} {p 8 12}{inp:. mrdum f4m1-f4m7, stub(q4) lab}{break} This produces seven dummy variables for responses coded 1-7 {break} plus a dummy to indicate which cases are completely missing {break} (if there are any that are completely missing). The table {break} produced will show value labels rather than numeric codes. {p 8 12}{inp:. mrdum f4m1-f4m7, stub(q4) res(1/4,7)}{break} This produces four dummy variables for responses coded 1-4, {break} one dummy for responses coded 7, and one to indicate which {break} cases are completely missing. {p 8 8}{inp:. lab define colour 1 "red" 2 "blue" 3 "green"}{break} {inp:. mrdum f4m1-f4m3, stub(q4) labels(colour)}{break} {title:Author} {p 8 8 8}Lee E. Sieswerda {break} Thunder Bay District Health Unit {break} Lee.Sieswerda@tbdhu.com {title:Acknowledgements} {p 8 8 8}Nicholas J. Cox made significant improvements to the code. Manual: {hi:[R] numlist, [U] 14.1.8 numlist, [R] egen, eqany} {p 1 19}On-line: help for {help numlist}; {help egen}{p_end} See Also: help for {help zb_qrm} if installed