Programming the statistical procedures from SAS

Diagnostic plots with proc surveyreg

Reply
Occasional Contributor
Posts: 5

Diagnostic plots with proc surveyreg

Hello, I am using SAS9.3, the diagnostic plots produced by default with proc reg are very helpful! However, I would like to produce the same diagnostic plots with proc surveyreg. Specifically, plots such as Q-Q, residual versus predicted, residual versus fitted, leverage, Cook's D, studentized residuals, etc. I would be great to be able to create a scatter plot showing the OLS and LOESS lines from proc surveyreg. I have looked through the ODS and survey documentation, but I can't figure out how to produce diagnostic plots when using proc surveyreg. Does anyone have a suggestion?

Have a good day.

Respected Advisor
Posts: 2,655

Re: Diagnostic plots with proc surveyreg

Here I sit as SGF2012, so I can't pull up the docs that I would if I were in the office.  What might work: get output datasets from SURVEYREG (not sure if there is an output statement, but as always ODS OUTPUT is your friend).  Then it is off to PROC UNIVARIATE for Q-Q plots, or any of the SAS/GRAPH procedures (SGPLOT comes to mind), and you can plot the values obtained.

Hope this helps some.

Steve Denham

Occasional Contributor
Posts: 5

Re: Diagnostic plots with proc surveyreg

Thanks for the suggestion for using  the output statement. it provdies the predicted values, residuals, standard error of the mean predicted value and the lower/upper bounds of the 95% CI for the PROC SURVEYREG. These are the keyword statistics described in the documentation for the output statement for this PROC. What i am additionally hoping to produce are the DFBETAS for my model specified in PROC SURVEYREG. The documentation for DFBETAS discusses several procedures such as REG, GENMOD, GLIMMIX, MIXED & PHREG. DFBETAS don't seem to be available for PROC SURVEYREG. The INFLUENCE option is not recognized with the MODEL statement in PROC SURVEYREG. Do you have any suggestions for producing DFBETAS when using PROC SURVEYREG?

Respected Advisor
Posts: 2,655

Re: Diagnostic plots with proc surveyreg

Other than getting out the X'X matrix, and then doing a whole boatload of programming, I don't see how to do it in SURVEYREG.  I wonder if the observation-wise deletion even makes sense in a survey setting, so that it is just very difficult to interpret.  What occurs when you look at the results from PROC REG, as a guide to identifying influential observations?

Steve Denham

SAS Super FREQ
Posts: 3,310

Re: Diagnostic plots with proc surveyreg

At SGF12, Sharon Lohr gave a keynote talk that included a discussion of diagnostic plots. Her paper is available online: "Using SAS for the design, analysis, and visualization of complex surveys."  The takeaway from the talk is that you can use the diagnostic procs from PROC REG on survey data, provided that you use the survey weights in the WEIGHT stmt. The diagnostic plots are mostly concerned with predicted/resudual values, and these are identical for PROC REG and PROC SURVEYREG.  However, you don't want to use any PROC REG plots that display variance information, such as confidence bands, because the PROC REG variances aren't adjusted for the survey design.

Rick


Ask a Question
Discussion stats
  • 4 replies
  • 1125 views
  • 0 likes
  • 3 in conversation