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]
Re: st: RE: Re: proper use of if
From
Rodrigo Briceño <[email protected]>
To
[email protected]
Subject
Re: st: RE: Re: proper use of if
Date
Wed, 17 Nov 2010 08:59:04 -0600
thanks Nick and Cristopher. I decided to use "if e(sample)" and it
worked perfectly.
2010/11/17 Nick Cox <[email protected]>:
> I agree that -if e(sample)- is a good piece of syntax to know, but otherwise I don't see a practical difference here.
>
> If the observations couldn't be included, the result will be missing and the consequence is the same.
>
> Nick
> [email protected]
>
> Christopher Baum
>
> A perhaps even better solution is to predict... if e(sample), as that will not only incorporate the if condition on the regression, but avoid predicting for any observations which could not be included in the estimation.
>
> On Nov 17, 2010, at 2:33 AM, Nick wrote:
>
>> 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-.
>
>
>
> *
> * 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/
>
--
Rodrigo Briceño
Economist
[email protected]
MSN: [email protected]
SKYPE: rbriceno1087
*
* 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/