Dear all,
I am using
variables in a program and I use them with
.
I would like to see tempvar names, instead of __000001, in the regression output.
How can I do?
I past an example where I square the independent variables and then I use them in a regression.
Thanks!
Best,
Raffaele
I am using
Code:
tempvar
Code:
regress
I would like to see tempvar names, instead of __000001, in the regression output.
How can I do?
I past an example where I square the independent variables and then I use them in a regression.
Thanks!
Best,
Raffaele
Code:
sysuse auto, clear
capture program drop regsquare
program regsquare
syntax varlist
gettoken depvar indepvars: varlist
local sqvars
foreach var of varlist `indepvars' {
tempvar `var' sq_`var'
gen `sq_`var'' = `var'^2
local sqvars `sqvars' `sq_`var''
}
regress `depvar' `indepvars' `sqvars'
end
regsquare price weight length

Comment