02-10-2015 11:37 AM
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:
And the equations of the error variance, wich will be used as weights are:
σ2e (crown)=(GRANDE)1.646 *exp(-0.0046H2)
"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.
PROC SYSLIN DATA=ONE SUR;
PWOOD: MODEL Y1 = X11;
PBARK: MODEL Y2 = X21;
PCROWN: MODEL Y3 = X31 X32;
TOTAL: MODEL Y4 = X41 X42 X43;
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.
02-12-2015 09:54 AM
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;
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.