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" <SJ@SOCI.AU.DK>
To   <>
Subject   Re: st: tricky calculation with dozens of variables
Date   Sun, 9 Oct 2005 11:21:38 +0200


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

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

*   For searches and help try:

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