Minor but annoying problem with locals. I have a long variable list that I would like to add to a file with the following code. I keep on getting errors for invalid syntax and too few variables specified. I have not been able to find a fix to the code. Any suggestions
local vars "site_visits_with_case_worker Indoor_Bathroom Porta_Potty washing_Station ADA_Compliant_Shower"
local num: word count `vars'
foreach i in 1/`num' {
local temp `: word `i' of `vars''
di `temp'
gen `temp' = .
}
Related Posts with Problem with locals
How to label variables taking last part of variable namesI have numerous variables. For example, I have variables var1, var3, var6, var30. And I want to labe…
Cluster SE and Fixed Effects using mlogitDear Statalists, I do not have stata17 so I cannot use xtmlogit. The femlogit does not allow cluste…
Marginsplot for logistic regression?Hi guys Variables explained: splitvoter: 0= not split vote between two elections / 1= split vote b…
How to only keep obvs whose "industry_vertical" value matches a long list of industry verticalsI have a list of firms, firms values, and a variable "industry_verticals" which contains thousands o…
Different combinations in each householdI have individual data set. With my dataset I want to create a living arrangement among elderly for …
Subscribe to:
Post Comments (Atom)
0 Response to Problem with locals
Post a Comment