Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: proper use of if
From
"Allan Reese (Cefas)" <[email protected]>
To
<[email protected]>
Subject
st: RE: proper use of if
Date
Wed, 17 Nov 2010 18:41:49 -0000
Nick Cox <[email protected]> recommended
> If you read -help predict- you will see that it explains that
-predict- also takes -if- if you wish.
> As you did not specify -if-, predictions were generated for the whole
dataset, which people sometimes do want.
> So, just repeat -if isin2 == 1- on the -predict-.
True, but more generally, after any model fit you can use the saved flag
on the estimation commands:
predict ... if e(sample)
Another corollary of the -if- notation is you can predict from one model
into more than one variable, making it easier to graph fitted values and
extrapolations with different line styles.
Allan
***********************************************************************************
This email and any attachments are intended for the named recipient only. Its unauthorised use, distribution, disclosure, storage or copying is not permitted. If you have received it in error, please destroy all copies and notify the sender. In messages of a non-business nature, the views and opinions expressed are the author's own and do not necessarily reflect those of the organisation from which it is sent. All emails may be subject to monitoring.
***********************************************************************************
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/