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

Re: st: tricky calculation with dozens of variables


From   "Svend Juul" <[email protected]>
To   <[email protected]>
Subject   Re: st: tricky calculation with dozens of variables
Date   Sun, 9 Oct 2005 11:21:38 +0200

Joe,

You wrote:

//calculated total
forvalues i=4(11)386{
local j='i'+4
replace total=total+var'i'*var'j'
}
Then Stata 8.2 informs me
'i' invalid name
r(198)

Your problem is the single quotes. The left single quote is ` (grave).
It may be on the upper left corner of your keyboard, or it may be
elsewhere. It may also be a dead key, displaying nothing until you hit
the spacebar.

The Stata manuals are not very explicit on this, and you are not the
first who had this difficulty.

Svend

________________________________________________________


Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000 Aarhus C,  Denmark
Phone, work:  +45 8942 6090
Phone, home:  +45 8693 7796
Fax:          +45 8613 1580
E-mail:       [email protected]
_________________________________________________________

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