# tau2 estimation using reml in SAS

I would like to obtain tau2 estimation using REML by making use of PROC MIXED procedure in SAS to compare the estimation result obtained from rma function in R.

I have used the following SAS code;

proc mixed data= dat method=reml;
class pubid;
weight Weight;
model Effectsize=  / cl solution;
random intercept / subject=pubid;
parms (1)(1)/ hold=2;
run;


Here the data consists of Effectsize, pubid as well as Weight(which is calculated from 1/variance for each study)

This code gives the same tau2 estimate as seen in the results from rma function but I am not really clear how this weight function specified in SAS procedure is working. Could you please explain what role does it exactly play in the tau2 calculation? I am confused especially because weight is said to 1/ Se2+tau2reml in most of the books where tau2 reml estimation is explained...

I read that since here I don't have repeated statement specified in my SAS procedure, WEIGHT statement basically operates exactly like PROC GLM and replaces X’X and Z’Z with X’WX and Z’WZ, where W is the diagonal weight matrix. I am not really clear with what is meant by this. Could you please clarify?

Many thanks in advance.

## 1 Answer

If you go to the documentation for the WEIGHT statement in PROC GLM there is a good explanation. The key bit is at the beginning:

When a WEIGHT statement is used, a weighted residual sum of squares: $$\sum{w_i(y_i - \hat{y}_i)^2}$$ is minimized, where $w_i$ is the value of the variable specified in the WEIGHT statement, $y_i$ is the observed value of the response variable and $\hat{y}_i$ is the predicted value of the response variable.

So, it basically just changes what is minimized. It does the same in MIXED unless there is a REPEATED statement. If you do have a REPEATED statement then WEIGHT also changes the R matrix.