全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
1902 1
2013-09-16
Hi all,
I try to solve a system of nonlinear equations with STATA.
My data looks like this:
id        s                   x              e
1  .0064259    -1.008586        ?
1  .2882765        2.701381        ?
1  .1368153        2.010069        ?
where id=1,2,3,...J,


Formula: s_j=exp(x_j+e_j)/A, and A=(1+exp(x_1+e_1)+...+exp(x_j+e_j)+...+exp(x_J+e_J))
I have exactly J equations with J unknowns. I want to know e_js.

I found http://www.stata.com/support/faqs/programming/system-of-nonlinear-equations/ and http://www.stata.com/statalist/archive/2011-06/msg00674.html
but I don't know how to add "A".
I also found "nlsur", which allows me to add "A". Here is what I did.
[1] I reformatted the data as the following:
id             s1              x1                    s2                     x2              s3           x3                     s11            x11             s22                  x22               s33           x33
1        .0064259        -1.008586        .2882765        2.701381        .1368153        2.010069        .0064259        -1.008586                               
1        .0064259        -1.008586        .2882765        2.701381        .1368153        2.010069                                         .2882765        2.701381               
1        .0064259        -1.008586        .2882765        2.701381        .1368153        2.010069                                                                                .1368153        2.010069       

...

code is as the following:
nlsur (s11=exp(x11+{e1})/(1+exp(x1+{e1})+exp(x2+{e2})+...exp(xJ+{eJ}))) /*
*/     (s22=exp(x22+{e2})/(1+exp(x1+{e1})+exp(x2+{e2})+...exp(xJ+{eJ}))) /*
*/ ... (sJJ=exp(xJJ+{eJ})/(1+exp(x1+{e1})+exp(x2+{e2})+...exp(xJ+{eJ})))


STATA returns "cannot have fewer observations than parameters".

Can anyone give me some hint to proceed?

Thanks, Amy

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2013-9-20 02:47:39
Unfortunately, "nlsur" doesn't do the job.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群