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

st: `x' notation


From   "Terra Curtis" <[email protected]>
To   <[email protected]>
Subject   st: `x' notation
Date   Mon, 24 Oct 2005 16:45:12 -0400

Dear Statalist,

I have a question regarding the `x' notation.  I've looked through the
Statalist archive and found some hints but I can't seem to make it work how
I want.

I have a forvalues loop I'm trying to run:

forvalues x=1989(1)2005 {
	forvalues y=1(1)12 {
		if `x'==2005 & `y'>8 continue
		gen
mktgprof`y'`x'=(det`y'`x')/(det`launchdatemo'`launchdateyr')
		}
}

And when I run that I get the following error:
det ambiguous abbreviation
r(111);

end of do-file
r(111);

After some experimenting I know that the problem lies in
the(det`launchdatemo'`launchdateyr') part.  I need the denominator to refer
to, for example, the variable det11989 if launchdate (one of my variables)
for that observation is equal 1/1/1989.  I have created two variables,
launchdatemo and launchdateyr which are the launch date month and year,
respectively. That's what I'm trying to refer to in the denominator above.
Is there some other way or some other notation I can use to refer to these
values?  

Thanks,
Terra

*
*   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