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
Problem in generating simple mean and graphDear all, It might be a silly a question but I've a simple problem in generating a mean variable. I…
Drop all observations with similar variables, except for the earliest?Dear statalists I have struggled with a problem in STATA 16.0 for a couple of days now, and hope th…
xtreg by groupI have a pooled panel data. The model is Yi,t+j=aj*Xi,t +bi,t (fixed effect) +... To make it simple,…
Adding new vce options to existing command?Dear Statalist, I am currently working on a project that incorporates Regression Discontinuity in T…
Spost packageI use STATA 13.1 however I cannot find and isntall the spost packages . When I search for these pack…
Subscribe to:
Post Comments (Atom)
0 Response to making loop with the values within the variable
Post a Comment