Closed ozak closed 2 years ago
Another option is defining a value label.
sysuse auto, clear
gen efficient = 1 - (mpg<23)
label var efficient "Efficient" // Not used
label define efficient 1 "Efficient" 0 "Inefficient"
label val efficient efficient
eststo clear
eststo: reg price i.efficient##i.foreign, r
esttab, nobaselevels label
since the key variables you use are binary, maybe you can treat them as continuous variables and type:
label var efficient “Efficient”
label var foreign “Foreign”
eststo: reg price c.efficient##c.foreign
esttab, label
just notice that the key interaction is the 1 x 1 item
As Nils correctly noted, esttab
will use the value label if a value label is defined; otherwise the =1
variant is used. You can also change the symbol used in interaction terms using option interaction()
. Example:
sysuse auto, clear
gen efficient = 1 - (mpg<23)
label var efficient "Efficient" // Not used
label define efficient 1 "Efficient" 0 "Inefficient"
label val efficient efficient
eststo clear
eststo: reg price i.efficient##i.foreign, r
esttab, nobaselevels label interaction(" X ")
If you want a complety different label for the interaction term, i.e. not one that is constructed based on the labels of the involved variables, then your only possibility is to manually assign a label. Example:
esttab, nobaselevels label varlabel(1.efficient#1.foreign "Some interaction!")
ben
Thanks for the help.
Hi. Is there a way of changing the default labels assigned to unary operators (i.X) and interaction terms (i.X1##i.X2)? E.g., if I run
I get
and I'd like to just have
Efficient
instead ofefficient=1
. Are the only options to encode the variable, as in the case offoreign
? Or relabel in the esttab command using thevarlabels
option (which would require labeling each element)? Is there no option to just use the label of the variable and not add the=1
?