Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: -Predict- after multi-equation ml command


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: -Predict- after multi-equation ml command
Date   Thu, 20 Sep 2007 21:06:11 +0100 (BST)

--- Rachel <academicgirl@gmail.com> wrote:
> I have a simulataneous equation logit model which is estimated using
> an ml program that I wrote.  Afterwards, I can run a linear
> prediction using the command
> 
> -predict linvalue, equation(equationname)
> 
> But is there any way that I can use predict to predict the value of a
> positive outcome, as it does after the -logit- command with the -pr-
> option?  (I realize that I may need to modify the ml program, since
> Stata doesn't "know" that the dependent variables are all binary.)

There are two answers possible depending on whether you want to write a
program which can easily be used by others, or you are just want a
program that is only occationally going to be used by you. If you are
writing a program for others you could write a program that is going to
be read by -predict-. You have to return the name of that program in 
e(predict). Common practice is to call it programname_p, where
programname is the name of the main program. -help _pred_se- gives you
lots of pointers on how to write such a program for a single equation
model, and with some puzzeling and looking at already existing predict
programs you can figure out how to generalize it to a multi equation
model.

If you are just creating the program for your own use it is probably
much more easy to figure out how to derive the quantities you want
using the linear predictor (you will have to do that also when you are
writing the -predict- command).

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      ___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index