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]

From |
"Brian P. Poi" <brian@poiholdings.com> |

To |
statalist@hsphsun2.harvard.edu, bne600@gmail.com |

Subject |
Re: st: nl estimation: Error #130 Expression too long |

Date |
Sat, 18 Jun 2011 09:30:43 -0400 |

On 06/18/2011 12:30 AM, Eugene Bempong Nyantakyi wrote:

I am trying to estimate a nonlinear least square equation but I keep on getting this error saying "Expression too long" Here is the equation I am trying to estimate nl (lgexp = log(exp({w_hat = 0.1 }*(z_hat + eta_hat)) - 1) + 1*{xb: ln_distance border n_island n_landlock legalsystem_same common_lang colonial cu fta religion_same eta_hat dum*}) if commcode == 1& eta_hat != ., vce(cluster pairid) no constant dum* is a wildcard for 316 fixed effects. I have two sets of fixed effects exporter fixed effects : dumexporter1 + dumexporter2 + dumexporter3 + ... + dumexporter158 and importer fixed effects: dumimporter1 + dumimporter2 + dumimporter3 + … + dumimporter158. so I use dum* to include all of them in the linear part of the equation. However when I include the dummies with dum* I get the error code that expression is too long and when I exclude them I get some results but I need to include them in the model. Can anybody help me with the programming. I really need help on this. Eugene Kwasi bne600@gmail.com

Eugene,

Try this example: ----------------- clear all sysuse auto drop if missing(rep78) areg mpg gear turn, absorb(rep78) program nlfe version 11 syntax varlist(min=3 max=3) if, at(name) local lhs : word 1 of `varlist' local x1 : word 2 of `varlist' local x2 : word 3 of `varlist' // Compute the first part of the function replace `lhs' = `at'[1,1]*`x1' + `at'[1,2]*`x2' `if' // Now loop over coefficients on rep78 indicators local atcnt = 3 // First element of `at' for // rep78 params is the third. forvalues i = 1/5 { // 5 levels of rep78 replace `lhs' = `lhs' + /// `at'[1, `atcnt']*(rep78 == `i') `if' local `++atcnt' } end nl fe @ mpg gear turn, nparam(7) -----------------

-- Brian Poi -- brian@poiholdings.com * * 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/

**References**:**st: nl estimation: Error #130 Expression too long***From:*Eugene Bempong Nyantakyi <bne600@gmail.com>

- Prev by Date:
**st: how to drop coefficients on fixed effects from the estout command** - Next by Date:
**Re: st: how to drop coefficients on fixed effects from the estout command** - Previous by thread:
**st: nl estimation: Error #130 Expression too long** - Next by thread:
**st: how to drop coefficients on fixed effects from the estout command** - Index(es):