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 on April 23, and its replacement, 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 <>
To   "" <>
Subject   RE: st: predictnl expression too long
Date   Fri, 8 Mar 2013 10:17:10 -0600

Thanks Maarten!
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.  If someone had more experience with xb() and predict() to do this kind of estimation I am open to suggestions!  Code for the quantity I am trying to predict using predictnl is below.  `XB010' etc. are macro variables that are the subsets of the linear components.  They are also long expressions.

predictnl eff= normal((`xb111')/`sigma')*((`xb111')+`sigma'*(normalden((`xb111')/`sigma')/normal((`xb111')\`sigma')))/*
                */-normal((`xb000')/`sigma')*((`xb000')+`sigma'*(normalden((`xb000')/`sigma')/normal((`xb000')\`sigma'))), se(inteff_se)


-----Original Message-----
From: [] On Behalf Of Maarten Buis
Sent: Friday, March 08, 2013 2:32 AM
Subject: Re: st: predictnl expression too long

On Thu, Mar 7, 2013 at 8:34 PM, Richard J Swartz wrote:
> I am a new stata user and I'm trying to use the command "predictnl" to create an estimate of a 3-way interaction effect for a Tobit model (a la Ai and Norton 2003: "Interaction terms in logit and probit").  When I run "predictnl" stata gives me the error message:
> Expression too long
> r(130);

You can often dramatically reduce the length of a -predictnl- expression by using the -xb()- function, see: -help predictnl-.

Hope this helps,

Maarten L. Buis
Reichpietschufer 50
10785 Berlin

*   For searches and help try:

*   For searches and help try:

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