Hi, I have a dataset which includes information on a person-level for individuals living in different countries. The 'country' variable takes on values such as NL and BE for Netherlands and Belgium, respectively. I need to run the analysis per country, so I limit my regressions to, for instance, the Netherlands.
I would like if the output of my post regressions results incorporate the country for which I did the analysis. For instance, currently (part of my) code is:
margins, at(married=(0 1 ) educ=(0 1 2) hours=(0 1 2)) saving(margins_effort, replace)
Ideally, I would set a parameter at the start of the code, which automatically saves the results in margins_effort_NL instead of margins_effort. I would appreciate any advice on this.
Edit: the goal of course is that when I rerun the analysis for a different country, setting the parameter at the beginning to for instance BE, the file output becomes then margins_effort_BE etc.
Related Posts with Dynamic variable names
Testing if two coefficients are statistical differentDear Stataforum, I am currently investigating the Norwegian electricity market. I am running two r…
Panel Unit Root Tests and Cointegration - Lag ProblemHello! I am a fresh Stata user and not very excellent on econometrics. My data is consisted of N=8 a…
Comparing coefficients between two ivregress modelsTo Statalist I used -gmm- to test the equality between two variables (b1, c1) in different models r…
operating a code only on the "not distinct" observationsHi everyone, I would like to use an if statement with the unique command, in order to operate a code…
When only one independent variable is non stationary does it make sense to run a cointegration test?Dear Stata users, after checking the stationarity of my panel data regression model: Y = f (X1, X2,…
Subscribe to:
Post Comments (Atom)
0 Response to Dynamic variable names
Post a Comment