Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Nick Cox <n.j.cox@durham.ac.uk> |
To | "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu> |
Subject | st: RE: proper use of if |
Date | Tue, 16 Nov 2010 16:37:40 +0000 |
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-. Nick n.j.cox@durham.ac.uk Rodrigo Briceño I'm using Stata 9.2 and Windows XP. I have a panel with 324 bonds (identified with the variable isin2) with 54 observations in time (monthly series). I'm running several individual (for each bond) time series regression: quietly regress liq sap liqmk m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12 mes pprom if isin2==1 predict ehat, res When I run the command the residuals are generated for all the 17496 observations, instead of just 54 observations as correctly corresponds. My question to the list is if there are some command that allows me to produce the required results just for the 54 observations considered each time. I'm using if, since not all the 324 bonds are going to be used in the regression process. * * 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/