Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: help with error


From   Rudy Fichtenbaum <rudy.fichtenbaum@wright.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: help with error
Date   Tue, 06 Jun 2006 17:30:19 -0400

Stata users:

Below is a do file generated by Dataferret downloaded by one of my
students. I know that he has to put in the path and file name. The
problem is that when he tries to run this file it generates the
following error:

"F invalid name
r(198);

end of do-file
r(198);

I know this has to do with the label definition and that for some reason
Stata does not like the quotation marks around the F, M and U but I
can't figure out what is wrong.

Thanks,

Rudy

*/************************************************/
*/* Please scroll down to the INFIX step for */
*/* instructions related to providing full path */
*/* name for the input data file. */
*/************************************************/
*/ then scoll to the end of the file and provide the */
*/ path for where to store the data when finished */

#delimit ;


label define FM5X
0 "Unspecified (no longer in current payment status and has no FBR;
indicates a back payment)"
1 "Living in own household ($531 for an individual and $796 for an
eligible couple)"
2 "Living in another=EF=BE=92s household ($354 for an individual and $530.6=
7
for an eligible couple)"
3 "Living in parent=EF=BE=92s household and child under 18 ($531)"
4 "Living in Medicaid institution ($30 for an individual and $60 for an
eligible couple)"
;
label define FM6X
0 "Unspecified"
1 "Aged individual living alone"
2 "Aged individual living with spouse"
3 "Disabled or blind individual living alone"
4 "Disabled or blind individual living with spouse"
5 "Disabled or blind child not living with parents"
6 "Disabled or blind child living with one or more parent"
;
label define $FM8X
"F" "Female"
"M" "Male"
"U" "Unspecified"
;
label define $FM9X
"AK" "Alaska"
"AL" "Alabama"
"AR" "Arkansas"
"AZ" "Arizona"
"CA" "California"
"CO" "Colorado"
"CT" "Connecticut"
"DC" "District of Columbia"
"DE" "Delaware"
"FL" "Florida"
=2E
=2E
=2E
"WI" "Wisconsin"
"WV" "West Virginia"
"WY" "Wyoming"
;
/************************************************/
/* You will need to change the "using" */
/* statement at the end of the "infix" command */
/* statement to include the full directory path */
/* of the directory where you saved the ASCII */
/* data file. For example: */
/* infix... */
/* using "C:\My Documents\bearhardlo5u2ic1.asc";*/
/********************************************************/

infix
ERIN 1 - 11
UEIN 12 - 22
SSIN 23 - 33
FCNT 34 - 44
FPMT 45 - 55
LIVA 56 - 66
HOUS 67 - 77
WEIGHT 78 - 88
SEX 89 - 97
STAT 98 - 106

using "c:\ put path and file name here.asc"
;

label variable ERIN "Earned income";
label variable UEIN "Unearned income other than Social Security income";
label variable SSIN "Social Security income";
label variable FCNT "Federal countable income";
label variable FPMT "Federal money amount paid";
label variable LIVA "Living arrangement code";
label variable HOUS "Household composition";
label variable WEIGHT "Sample Weight for all records";
label variable SEX "Sex of recipient";
label variable STAT "State of residence of recipient";
label values LIVA FM5X;
label values HOUS FM6X;
label values SEX $FM8X;
label values STAT $FM9X;

save "c:\put path and file name here.dta",
replace;

describe;

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index