For example: I have variable country with values 1 = 'sweden', 2 = 'austria', 3 = 'france'
I want to run a for leap for a regression per country and afterwards store a scalar (coefficients) but would want to append the name of the countries to the scalarname
what I'm doing now is
foreach num in numlist 1/3 {
reg y x1 x2 if country=`num'
scalar 'num'beta = _b[x1]
}
It saves the scalars as 1beta etc. but I would love for it to save it as swedenbeta.
I want to run a for leap for a regression per country and afterwards store a scalar (coefficients) but would want to append the name of the countries to the scalarname
what I'm doing now is
foreach num in numlist 1/3 {
reg y x1 x2 if country=`num'
scalar 'num'beta = _b[x1]
}
It saves the scalars as 1beta etc. but I would love for it to save it as swedenbeta.
Comment