Resources

Random Effects Estimation

/*--------------------------------------------------------------

                    SAS Sample Library

        Name: tmoex02.sas
 Description: Example program from SAS/ETS User's Guide,
              The TMODEL Procedure
       Title: Random Effects Estimation
     Product: SAS/ETS Software
        Keys: nonlinear simultaneous equation models
        DATA: Orange tree data, Draper and Smith (1981)
        PROC: TMODEL
       Notes:

--------------------------------------------------------------*/

data tree;
   input tree day y;
   datalines;
1  118   30
1  484   58
1  664   87
1 1004  115
1 1231  120
1 1372  142
1 1582  145
2  118   33
2  484   69
2  664  111
2 1004  156
2 1231  172
2 1372  203
2 1582  203
3  118   30
3  484   51
3  664   75
3 1004  108
3 1231  115
3 1372  139
3 1582  140
4  118   32
4  484   62
4  664  112
4 1004  167
4 1231  179
4 1372  209
4 1582  214
5  118   30
5  484   49
5  664   81
5 1004  125
5 1231  142
5 1372  174
5 1582  177
;

proc sgplot data=tree;
   series x=day y=y / group=tree;
quit;

proc tmodel data=tree;
   parms    b1  200
            b2  800
            b3  800
            s2u;
   num = b1 + u1;
   ex  = exp(-(day-b2)/b3);
   den = 1 + ex;
   y = num/den;
   crosssection tree;
   random u1 ~ normal(0,s2u);
   fit y;
quit;