diff --git a/samples/Stata/regress_example.do b/samples/Stata/regress_example.do new file mode 100644 index 00000000..77bd87d5 --- /dev/null +++ b/samples/Stata/regress_example.do @@ -0,0 +1,18 @@ +* Setup +sysuse auto + +* Fit a linear regression +regress mpg weight foreign + +* Fit a better linear regression, from a physics standpoint +gen gp100m = 100/mpg +regress gp100m weight foreign + +* Obtain beta coefficients without refitting model +regress, beta + +* Suppress intercept term +regress weight length, noconstant + +* Model already has constant +regress weight length bn.foreign, hascons