{smcl} {* 21May2009}{...} {cmd:help stata2pvd}{right:also see: {help pathview}} {hline} {title:Converting Stata data to a file for PathView-Interactive} {p2colset 5 18 20 2}{...} {p2col :{hi:stata2pvd} {hline 2}}Sort, select & save data for PathView Interactive{p_end} {p2colreset}{...} {title:Syntax} {p 8 14 2} {cmd:stata2pvd} [{varlist}] {ifin} {helpb using} {it:filename} {cmd:,} {cmd:id(}{it:id_var}{cmd:)} {cmdab:out:labels(}{it:outcome_labels}{cmd:)} {cmdab:item:labels(}{it:item_labels}{cmd:)} [{it:optional options}] {p 4 4 2} If no variables are listed, all will be used. {cmd:if} and {cmd:in} can be used to select cases to be written. {synoptset 20 tabbed}{...} {synopthdr} {synoptline} {synopt :{opt id(id_variable)}}adds {it:id_variable} to the output as an ID variable.{p_end} {synopt :{opt out:labels(string)}}names the outcome categories.{p_end} {synopt :{opt item:labels(string)}}provides labels for the items/sequencess.{p_end} {synopt :{opt sort(string|_all)}}indicates which variables to include when sorting the data before saving (details below). _all to sort all variables; a sequence of y's and n's to specify which variables (e.g., yyynyn).{p_end} {synopt :{opt title(string)}}adds a header to the pvd file.{p_end} {synopt :{opt replace}}overwrite existing {it:filename}.pvd.{p_end} {synopt :{opt nom:iss}}deletes all observations with missing data{p_end} {synopt :{opt stable}}uses the stable option of {helpb sort}.{p_end} {synopt :{opt test}}runs program in test mode for debugging.{p_end} {synoptline} {p 4 6 2} If {it:filename} is specified without a suffix, {opt .pvd} is assumed. If your {it:filename} contains embedded spaces, remember to enclose it in double quotes.{p_end} {synoptline} {title:Description} {pstd} {opt stata2pvd} writes data into a file in comma-separated ASCII format for use by the data visualization program PathView. {opt stata2pvd} allows you optionally to select variables, specify an id variable, delete missing values, and sort on selected variables. {title:Details on Options} {phang} {opt sort(string|_all)}} indicates which variables to include when sorting the data before saving. If you specify sort(_all), the data will be sorted using all varaibles in {it:varlist}. Otherwise, {it:string} is a sequence of y's and n's (e.g., sort({it:yyny}) corresponding to the sequence of variables in {it:varlist}. A y indicates a variable is to be included when sorting; a n indicates is is not included. For examples, sort(yyny) would use the first, second and fourth variables from {it:varlist} when sorting the data before it is saved. {title:Examples} {phang2}{cmd:stata2pvd v4-v8 using testfile, id(v2) sort(yyyn) nomiss replace} {phang2}{cmd:stata2pvd b_mpg b_weight using pvout, replace} {pmore} {title:Author} {p 5 5} J. Scott Long{break} Indiana University{break} Departments of Sociology & Statistics{break} jslong{@}indiana.edu{break} {browse "http://www.indiana.edu/~jslong/"}{p_end} {title:Also see} {p 4 6 2}See {help pathview} for information about the PathView program. {p_end}