BookmarkSubscribeRSS Feed
slvaldes_uc_cl
Calcite | Level 5

Hi

I´m using PROC SYSLIN in SAS program to set a system of allometric equations to predict biomass. My goal is to make a weighted restricted SUR fit (or WRSUR, like Parresol, 1999) as there is correlation between the errors of the equations. I´m taking several equations defined by Parresol to predict the biomass of stem, bark, crown and total biomass, for example:


Biomass(stem)=a0+a1*(D2*H)+ε

Biomass(bark)=b0+b1*(D2*H)+ε

Biomass(crown)=c0+c1*(GRANDE)+C2*H+ε

Biomass(total)=d0+d1*(D2*H)+d2*(GRANDE)+d3*H+ε

And the equations of the error variance, wich will be used as weights are:

σ2e(stem)=(D2*H)1.95,

σ2e (bark)=(D2)1.745

σ2e (crown)=(GRANDE)1.646 *exp(-0.0046H2)

σ2e (total)=(D2*H)1.844

"D", "H" and "GRANDE" are exogenous variables.

I had no problems with a restricted SUR fit( without weights) in SYSLIN, the procedure is simple if the restrictions are well established through SRESTRICT.

DATA ONE;

SET PARRESOL;

X11=D**2*H;

W1=1/((D**2*H)**1.95);

X21=D**2*H;

W2=1/((D**2*H)**1.745);

X31=GRANDE;

X32=H;

W3=1/((GRANDE**1.646)*(EXP(-0.00406*H**2)));

X41=D**2*H;

X42=GRANDE;

X43=H;

W4=1/((D**2*H)**1.844);

Y1=WOOD;

Y2=BARK;

Y3=CROWN;

Y4=TREE;

PROC SYSLIN DATA=ONE SUR;

PWOOD: MODEL Y1 = X11;

PBARK: MODEL Y2 = X21;

PCROWN: MODEL Y3 = X31 X32;

TOTAL: MODEL Y4 = X41 X42 X43;

SRESTRICT TOTAL.INTERCEPT=PWOOD.INTERCEPT+PBARK.INTERCEPT+PCROWN.INTERCEPT,

TOTAL.X41=PWOOD.X11+PBARK.X21,

TOTAL.X42=PCROWN.X31,

TOTAL.X43=PCROWN.X32;

RUN;

However, it seems that I have problems syntax to perform a WRSUR, since I do not know how to indicate the weights for the corresponding equation. I just know I should define the four weights in the input data set, but then not as assigning weights to each equation corresponding to conduct a weighted restricted SUR fit. Also, I have to define a variance-covariance previously in SYSLIN?. Can anyone help me with the correct syntax?, I appreciate a lot since I`m stuck.



2 REPLIES 2
kessler
SAS Employee

As you have discovered PROC SYSLIN doesn't provide a mechanism to specify the observation by observation weights for each equation individually.  You may want to consider using PROC MODEL to specify the equation by equation weights.  PROC MODEL is a newer procedure that uses a more flexible syntax for spcifying models.  Instead of using MODEL statements to specify the strucure of each equation in your model PROC MODEL allows you to specify your model using programming statements.  To define the weight for an equation named "x" in PROC MODEL you use an assignemnt to an "h.x" variable.  The "h.x" variable allows you to specify a model for the variance of equation "x." To specify a weight for a model equation you assign the inverse of the equation's weight to the "h.x" variable.  So, in your example, you might specify your model in PROC MODEL using something like the following.

proc model data=one;
   y1 = p11*x11 + int1;
   y2 = p21*x21 + int2;
   y3 = p31*x31 + p32*x32 + int3;
   y4 = p41*x41 + p42*x42 + p43*x43 + int4;

   h.y1 = 1/w1;
   h.y2 = 1/w2;
   h.y3 = 1/w3;
   h.y4 = 1/w4;

   restrict int4 = int1 + int2 + int3,
             p41 = p11  + p21,
             p42 = p31,
             p43 = p32;

   fit y1-y4 / sur;
quit;

The MODEL procedure also allows you to program nonlinear mathematical expressions in your modeling statements, so if you prefer, you could move many of the programmign statements in your DATA step code directly into the PROC MODEL step.

For the SUR method, the covariance of the equations' errors is estimated for you in a preliminary OLS estimation step.

slvaldes_uc_cl
Calcite | Level 5

Thanks for your answer. I`ll try with PROC MODEL.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1968 views
  • 3 likes
  • 2 in conversation