Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: predictnl expression too long


From   Richard J Swartz <rswartz@rice.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: predictnl expression too long
Date   Fri, 8 Mar 2013 14:21:48 -0600

Brilliant! (and obvious - don't know why I didn't see it!)  Unfortunately after recoding to use xb()  I get the same message "expression too long".  Do you (or anyone else) know any other possibilities?  (by the way, I noticed some of the slashes were the wrong direction, but fixing this didn't solve the problem either.)

Thanks,
Richard 
-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Maarten Buis
Sent: Friday, March 08, 2013 10:48 AM
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: predictnl expression too long

On Fri, Mar 8, 2013 at 5:17 PM, Richard J Swartz <rswartz@rice.edu> wrote:
> After reading the comments and help files on predict, it looks like predict() and xb() have set quantities they can produce involving the linear portion of the model (XB).  Is this correct?
> If so then, unfortunately the function I'm estimating cannot be simplified by predict() or xb() because  the function I want to predict use a subset of the linear component, (i.e. a subset of the predictors) as opposed to the full XB linear component.

The trick is that if you want the xb excluding the componenent associated with variable x1 than you just type xb() - _b[x1]*x1, which is often a lot shorter than explicitly typing out the components you want to include.

-- Maarten

---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
---------------------------------
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index