Hi,
I am trying to run the below loop in stata. But i get an error.
Can someone help me. I am a beginner in using Stata.
The variables fyear, B031, B031_av are already defined and available in the dateset.
forvalues fyear = 2005 / 2022 {
2. local count=0
3. foreach l of local levels {
4.
. count=count+1
5.
. local B031_sum=sum(B031) if loc == 'l'
6. B031_av = B031_sum/count
7. }
8.
. }
=exp not allowed
Many thanks in advance.
Related Posts with Stata for loop error
stataWhich stata command do we run to get the very first time a certain patient showed up for a clinic vi…
Export Value Labels to Excel/CSVHow do i export value labels for each variables that i have to excel or csv -----------------------…
use observation as a varlistHi everyone, I am currently struggling with something that I think is easy but i really couldn't fig…
Help with Threshold regression for Multiple Threshold VariablesHansen's (2000, pp. 587) setting only allows one threshold and one threshold variable. Subsequently,…
How to add a column of minimum wage information to each country?Dear all: I have 73 countries microdata (n range from1 to 73), where I intend to add a column of mi…
Subscribe to:
Post Comments (Atom)
0 Response to Stata for loop error
Post a Comment