Dear all,
I want to define a group of variables to use in a number of different regressions. The best solution I could come up with is to use 'local' (see example below). This works fine if I run the entire .do file (i.e. the 4 lines in the example below).
However if I only want to run the 3rd regression, by first running a CTRL-D on the first line (local controls age gender inc) and then a CTRL-D on the last line (logit y3 `controls'), it doesn't work anymore : Stata then just estmates logit y3 (i.e. only constant term) : the controls aren't recognized anymore.
----------
local controls age gender inc
logit y1 `controls'
logit y2 `controls'
logit y3 `controls'
----------
Is there a better way to define a group of variables to be used in different regressions than using 'local'?
Thanks for your help,
Mike
I want to define a group of variables to use in a number of different regressions. The best solution I could come up with is to use 'local' (see example below). This works fine if I run the entire .do file (i.e. the 4 lines in the example below).
However if I only want to run the 3rd regression, by first running a CTRL-D on the first line (local controls age gender inc) and then a CTRL-D on the last line (logit y3 `controls'), it doesn't work anymore : Stata then just estmates logit y3 (i.e. only constant term) : the controls aren't recognized anymore.
----------
local controls age gender inc
logit y1 `controls'
logit y2 `controls'
logit y3 `controls'
----------
Is there a better way to define a group of variables to be used in different regressions than using 'local'?
Thanks for your help,
Mike
Comment