Dear stata list
I want to generate variables containing lnpindexprice11-lnpindexprice111 and multiply them by wrfoodexpy11-wrfoodexpy111 and replace lnpindexprce*, respectively. I used foreach commond as follows but it works only for the first column i.e lnpindexprice11 but not for the other. Would you assist me please
foreach w of varlist wrfoodexpy11- wrfoodexpy111 {
foreach x of varlist pindexprice11-pindexprice111 {
gen l`x'=ln(`x')
gen lt`x'=l`x'*`w'
}
drop `x'
}
Nigussie
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/