Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: -movestay- issue with variable abbreviation


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: -movestay- issue with variable abbreviation
Date   Mon, 20 Sep 2004 10:23:42 +0100

The authors of -movestay- do not appear 
to be members of Statalist. 

I think Renzo is right. His example is 
fixed in the following way. Copy the program 
to a new file. After the block of code 

tokenize "`select'", parse("=");         // define vars for regression equation
	   if ("`2'"!="=") {;
	         tokenize "`select'";
                 local y_prob `1';
	         macro shift;
	         local x_prob `*';
	   };
           else {;
	         local y_prob `1';
                 local x_prob `3';
                   };

a new line is needed to unpack wildcards: 

	unab x_prob : `x_prob' ; 

My hunch is that this should not prove problematic
in other ways. 

Nick 
[email protected] 

Renzo Comolli
> 
> I want to thank the authors of -movestay-. It is an important 
> contribution,
> and it will help me a lot.
> 
> I think there might be an issue with varlist abbreviations though. 
> Sometimes, abbreviating a varlist with an * causes the error message
> "initial values not feasible".
> It does not happen with the dataset the authors use for their 
> example, so I
> posted my own (admittedly contrived) dataset.
> 
> E.g.
> . use http://www.econ.yale.edu/~rc255/data/for_question_movestay.dta
> . movestay income age, select(group race_2 race_3) // this 
> works as intended
> . movestay income age, select(group race_*)
> 
> The first instruction works as expected; 
> the second one does not (albeit in this dataset race_* 
> corresponds to race_2
> race_3)

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index