help regeq

Title

regeq -- Postestimation command to regress, logit, logistic, stcox:
generate macro for fitted equation

Syntax

regeq [, format(string) prefix(string)]

Description

List estimated equation and equation and
Generate global macros, with estimated coefficents and estimated equation.
The option prefix speficify the prefix for the macros - default is "b".
$prefix0,... ,$prefixk: the k+1 estimated coeffcients

Examples

. xi:regress mpg weight i.foreign i.rep78
. regeq, format(%10.6f)prefix(v)
estimated equation
40.502274 -0.006291 * weight -2.923268 * _Iforeign_1 ///
-0.278645 * _Irep78_2 -0.022420 * _Irep78_3 +0.681358 * _Irep78_4 ///
+3.865535 * _Irep78_5

equation
v0 + v1 * weight + v2 * _Iforeign_1 + v3 * _Irep78_2 ///
+ v4 * _Irep78_3 + v5 * _Irep78_4 + v6 * _Irep78_5

. twoway ///
. (function $v0+ $v1 * x + $v4 ,range(weight) lcolor(red)) ///
. (function $v0+ $v1 * x + $v5 ,range(weight) lcolor(blue)) ///
. (function $v0+ $v1 * x + $v2 + $v4 ,range(weight) lcolor(red)) ///
. (function $v0+ $v1 * x + $v2 + $v5 ,range(weight) lcolor(blue) ) ///
. ,legend( label(1 "domestic 3 repairs") label(2 "domestic 4 repairs") ///
. label(3 "foreign 3 repairs") label(4 "foreign 4 repairs") )

Authors

Morten Frydenberg
School of Public Health, Aarhus University, Denmark
Email: morten@biostat.au.dk