3
$\begingroup$

I have fitted a model using proc reg, say, using this

proc reg data = mydata;
  model a = b;
run;

But in this particular application it is better to over-estimate than it is to under-estimate. So I actually want to refit this model this time using the residuals as weights so they an over-estimate is penalised more heavily.

Is there a way to do that without writing my own macro?

$\endgroup$

1 Answer 1

3
$\begingroup$

Check out the REWEIGHT statement in PROC REG. The basic syntax of this is

REWEIGHT <condition | ALLOBS> </ options> ;

condition is of the form variable compare value and the variable can be anything from an OUTPUT data set. So, you could run the original PROC REG and create an OUTPUT data set, then do another PROC REG on the new data set, reweighting whichever cases you want, based on their residuals.

For more see the SAS Documentation

$\endgroup$
1
  • $\begingroup$ I would probably do it in a two-step approach, using the PROC REG (or PROC GENMOD or PROC LOGISTIC etc.) to produce the original regression, get the residuals, and then use that as a weighting variable in a repeat of the analysis. This may, admittedly, be my own internal oddness, but I'd consider the weights to be a separate data-generating step, and I like to keep those separate from my final analysis. $\endgroup$
    – Fomite
    Commented Aug 22, 2011 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.