Hello,
I have one of the variables G1 which has values from 1 to 17.
Then I want to make a loop as below,but it didn't work out.
Anyone can help what is the problem? thanks in advance.
foreach i in G1 {
sum sw20h if G1==`i'
global Ng`i'=r(sum)
}
Related Posts with making loop with the values within the variable
Annual constant increase rate from monthly data*Dear all! I have some monthly inflation CPI data and wanted to create two new time series. First, t…
Calculating response rates to surveysDear all, I have a project which sends surveys to participants based on certain events. I would li…
difficulty in exporting summary stat using asdocDear members I am trying to export summary stata for my study key variables per country. I want the…
psacalc with sureg - sharing codeHi, I have been working on bounds analysis using psacalc for my regress and xtreg, fe models. I nee…
Matching Panel Data to Diff-in-DiffHowdy, Statalisters, I'm trying to create comparison groups to ultimately move into a diff-in-diff e…
Subscribe to:
Post Comments (Atom)
0 Response to making loop with the values within the variable
Post a Comment