Data visualization with SAS programming

Question about PROC REG PLOTS with ODS_GRAPHICS

Reply
New Contributor
Posts: 4

Question about PROC REG PLOTS with ODS_GRAPHICS

I am a newcomer to SAS/GRAPH and ODS Graphics and I have what I think is a pretty basic question for the support community.

I am running some regression analyses and I would like to create a simple publication quality graph of my regressions. These are simple polynomial regressions (quartic cubic).  I have come close to the final product I would like but it’s not quite there yet.

Some specifics: I am using SAS PROC REG in 9.2 and the PLOTS command with ODS graphics. Language is below.

proc reg data=Harvest plots=predictions (x=Predation_Level);

      model  Total_Weight_Harvested = Predation_Level Predation_Level2;

title "Total fish Harvest"; run; quit;

The above produces the figure below:

What I would like to do is remove the residuals chart and just print the fit graph in a grey scale publication style format with a DPI of at least 300. I would like to only include the 95% Confidence limits represented as lines not a band and keep the trendline. I would also like the chart be editable (e.g. change fonts type and size, axis titles, legend etc.).

Is this possible and can anyone help me with this?  Providing SAS code and examples would be tremendously helpful.

Thanks

Brian

New Contributor
Posts: 4

Re: Question about PROC REG PLOTS with ODS_GRAPHICS

Geoff,

Thanks, that is getting closer to what I would like but not quite there yet. I still have a few problems.

First I have SAS 9.2 v1 which does not recognize the SGE=ON syntax. I get a syntax error msg. So my graph is not editable. Is there some other syntax for 9.2 v1?

Second the graph still has a band for the 95% CLM rather than say dotted lines and no fill.

Lastly, I would like to change the X and Y axis scales to a default scale. I did not ask about his earlier.

thanks for your help.

SAS Super FREQ
Posts: 863

Re: Question about PROC REG PLOTS with ODS_GRAPHICS

The SGE=ON only works for the LISTING desitnation in SAS 9.2.

ods listing sge=on;

GIve that a try and see if it works for you. As Goeff said, SGPLOT is another good option.

New Contributor
Posts: 4

Re: Question about PROC REG PLOTS with ODS_GRAPHICS

Try using proc sgplot,eg

ods listing sge=on image_dpi=300;

proc sgplot data=harvest;

  reg Y=total_Weight_Harvested x = Predation_Level / degree=2 clm nomarkers clmattrs=(clmfillattrs=(color=lightgray));

  xaxis label="Total Weight Harvested";

  yaxis label="Level of predation";

run;

For full control you could save the predicted values and CIs from proc reg and use these with proc sgplot.

Post a Question
Discussion Stats
  • 3 replies
  • 421 views
  • 0 likes
  • 3 in conversation