Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: new graphing command -twoway estfit- available on SSC


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   st: new graphing command -twoway estfit- available on SSC
Date   Thu, 17 Jun 2004 15:54:29 -0400

I would like to tell Statalist that a new graphic command that I've
"written" has been posted to SSC (thanks to Kit Baum).  The new graph
command is -twoway estfit- as in :

graph twoway estfit y x , .....

-twoway estfit- plots the fitted values from any estimation command (well,
any command that works with -predict- and just needs an x/y pair).  It is
simply a modified version of -twoway lfit-, which uses -regress- only, and
other similar fitted value plot commands such qfit, fpfit, etc..

-twoway estfit- has an option -estcmd(estimation command name)- which lets
you tell it what estimation command to use.  For example, you can specify
using -rreg- or -qreg- to get more robust linear fits than -lfit- might
provide, or even use it with -logit- or -probit- to show the fitted
relationships.  Although you can get the same effect by
just running your estimation command, running predict and then making a line
graph of the fitted values, by making it a full twoway graph type you get
access to the power of all of Stata's twoway options, by() is especially
useful.  I find myself using this graph type frequently.

This was my first foray into .class programming and all the new graphics
stuff in Stata, but it wasn't too hard since I basically lifted everything
from -lfit-.   I haven't yet tackled -estfitci-, but that should be doable
too if there's interest.

You can find it by -ssc describe t- where twoway_estfit will be listed.


Michael Blasnik
[email protected]


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index