View Full Document

View Full Document
View Full Document

4 views

Unformatted text preview:

SAS Work Shop PROC REG Handout 4 Statistical Programs College of Agriculture HTTP WWW UIDAHO EDU AG STATPROG Additional Topics and Techniques Weighted Regression The regression analysis assumes a constant variance of responses across all levels of the regressors If this is not the case and the data is replicated at each value of the regressor s it is possible to use a weighted regression to deal with the heteroskedasticity This requires the data set to have a weight variable which is proportional to the inverse of the variance at each regressor value Thus before getting into the PROC REG procedure the user must use a combination of DATA step and the PROC MEANS procedure to produce the weights Example PROC MEANS NOPRINT DATA PHOTO VAR PHOTO OUTPUT OUT VARIANCE VAR VAR BY IRRAD DATA PHOTO MERGE PHOTO VARIANCE BY IRRAD WT 1 VAR PROC REG DATA PHOTO WEIGHT WT MODEL PHOTO IRRAD 1 5 SAS Work Shop PROC REG Handout 4 Statistical Programs College of Agriculture HTTP WWW UIDAHO EDU AG STATPROG The first step is to call PROC MEANS The NOPRINT option is used because the printed output from MEANS is not of interest The variances for each level of IRRAD are put in the variable VAR in the data set VARIANCE NOTE This requires more than one observation at each level of IRRAD which is not the actual case with our data This new data set is then merged to the PHOTO data set by matching up the values of IRRAD The weight variable WT is calculated by 1 variance The last step calls PROC REG and invokes the WEIGHT statement with the WT variable Typically if weighting is done in this manner and is appropriate the regression estimates will change little in value while their associated standard errors will be smaller Model Comparison One of the most common uses of regression is the comparison of models based on different subsets of the data This requires that the models be of the same mathematical form i e parameter estimates from a linear model can not be statistcally compared to those of a

Unlocking...