Hello everyone,
I'm running a program including regression with as arguments the outcome (=`1') and a group of covariates (=`2'), as the following example :
*******************
capture program drop myreg
program define myreg
xi: reg `1' elec `2'
end
myreg wwork `something to put here'
*******************
So the thing is that my group of covariates is big and varies across groups, so I would like to be able to have only a `2' that will include all of them.
The question is : what do I have to write in `something to put here' to achieve this ?
I tried two things that don't work :
1/ create of vector X = (covariate1, covariate2.....) and then write : myreg wwork X
but when creating X = (...) it doesn't work (because those covariate1 covariate2.... are variables?).
2/ Simply write myreg wwork covariate1 covariate2 covariate3 ..... covariateN, believing that Stata may include all the "extra" arguments into the last one (supposed to be the `2').
I guess it's a basic command in Stata but I didn't find clear documentation for it.
Is anyone who can help ?
Thanks.
I'm running a program including regression with as arguments the outcome (=`1') and a group of covariates (=`2'), as the following example :
*******************
capture program drop myreg
program define myreg
xi: reg `1' elec `2'
end
myreg wwork `something to put here'
*******************
So the thing is that my group of covariates is big and varies across groups, so I would like to be able to have only a `2' that will include all of them.
The question is : what do I have to write in `something to put here' to achieve this ?
I tried two things that don't work :
1/ create of vector X = (covariate1, covariate2.....) and then write : myreg wwork X
but when creating X = (...) it doesn't work (because those covariate1 covariate2.... are variables?).
2/ Simply write myreg wwork covariate1 covariate2 covariate3 ..... covariateN, believing that Stata may include all the "extra" arguments into the last one (supposed to be the `2').
I guess it's a basic command in Stata but I didn't find clear documentation for it.
Is anyone who can help ?
Thanks.
Comment