Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: using matrix as lookup table
From
"Knott, Anne Marie" <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: using matrix as lookup table
Date
Wed, 22 Jan 2014 23:44:33 +0000
I'm trying to use a matrix of exchange rates as a lookup table for another database. I've created and verified the matrix, and am following the command structure in Cox 2012 to call it, but I keep getting the following error message:
`j' is an invalid name.
I deleted all the j references, but then got the same error message for i. I've tried alternative names, so assume the problem is with the quotes--I'm using a mac.
Here's the code:
local i=colsof(xchgrates)
local j=rowsof(xchgrates)
forvalues i=1/89 {
forvalues j=1/26 {
quietly replace revtUSD=revt*xchgrates[`j’, `i’] if curcd==`i’ & year==`j’
}
}
thanks for your help.
Anne Marie Knott
Professor of Strategy
Olin Business School
Washington University in St. Louis
Campus Box 1133
One Brookings Drive
St. Louis, MO 63130-4899
(314) 935-4679
[email protected]
<http://apps.olin.wustl.edu/faculty/knott/>website<http://apps.olin.wustl.edu/faculty/knott/>
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/