BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
das
Obsidian | Level 7 das
Obsidian | Level 7

I'm am interested in producing a panel of probplots, the sort that I can produce using proc univariate. I'm not seeing a way to output the probability data calculated by proc univariate. I think I'm expecting something like the outhistogram function within the univariate procedure but I can't find or recognize it. Perhaps there is another procedure that I should be using. For example, I thought there was an ODS procedure that could capture, essentially, graphs produced in a preceding procedure but then organize differently, like in a sgpanel procedure.

In case it helps, my data set contains a single response variable (Area%threshold) and 4 factors: animal ID (5 levels), antibody (two levels), antibody concentration (4 levels), replicates (two levels, so far). For right now, what I'd like to produce are probplots (x=percentile, y=Area%Threshold, overlay of antibody concentrations) organized as two columns (replicates 1 and 2) and rows as antibody within animal IDs.

Hope that is enough for someone to make a suggestion.

Thank you,

Dave

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

There is a way that you can capture the data. First, say "ods trace on;" before the PROC UNIVARIATE and submit the job. In the log, you will the names of all the output objects from the run. One (or more) of those names should correspond to the graph output. Now, you can turn ODS TRACE to OFF and add this line before the PROC UNIVARIATE:

ods output <object name>=<output data set name>;

This statement will generate an output data set of the data used to create the data. You can then use this data in the SG procedures.

Hope this helps!

Dan

View solution in original post

10 REPLIES 10
DanH_sas
SAS Super FREQ

There is a way that you can capture the data. First, say "ods trace on;" before the PROC UNIVARIATE and submit the job. In the log, you will the names of all the output objects from the run. One (or more) of those names should correspond to the graph output. Now, you can turn ODS TRACE to OFF and add this line before the PROC UNIVARIATE:

ods output <object name>=<output data set name>;

This statement will generate an output data set of the data used to create the data. You can then use this data in the SG procedures.

Hope this helps!

Dan

das
Obsidian | Level 7 das
Obsidian | Level 7

Dan, 

Thank you for the advice. I will give it a try. Sounds like just what I was looking for.

Dave ft

das
Obsidian | Level 7 das
Obsidian | Level 7

Dan,

Here is a screen clipping of the log. I'm not sure what to use for the line of ods code you gave me. I assume I would enter multiple repeats to capture each graph in separate datasets.

Thanks for your help.

Clipboard.jpg

DanH_sas
SAS Super FREQ

The data for all of those ProbPlot output object should have been concatenated into the data set you specified. Did that not happen?

das
Obsidian | Level 7 das
Obsidian | Level 7

Dan,

Dan,

I wasn't sure which of the names in the trace log were to be used in the ods output statement. However, your reply helped me realize that your <objectname> statement could in fact refer to each of the ProbPlots created. So I entered the code as such: ods output ProbPlot=<my dataset name>; and yes it worked just as you said.

Thanks data_null, I figured this out just as you sent this. But that was my question.

Thank you both for such rapid help. I'll post my final figure once I have it just to show that I got it done with your help.

Dave

data_null__
Jade | Level 19

ODS OUTPUT PROBPLOT=sas-data-set-name;

The NAME from ODS TRACE ON.  I usually use the same name for my data set.

ODS OUTPUT PROBPLOT=PROBPLOT.

As Dan mentioned you should get all BY levels stacked into the data set.

das
Obsidian | Level 7 das
Obsidian | Level 7

Below I've inserted two images of the outputs. "Probability Plot for threshold" is one of the panel plots generated by the univariate procedure and is what I am hoping to congregate as a single panel of such images. I used the following proc sgpanel code to generate the other image (sorry, no title). Not quite there but very close.

proc sgpanel data=RMTA_prplot;

panelby class1 replicate  goat / layout=panel onepanel columns=4 rowheaderpos=left;

scatter x=Percentile y=data / group=group;

run ;

Is there a way to get the same unique x-axis scaling into the panel of plots?

Also, these are very large datasets; the ods output dataset has just over a million rows. May need to first regress a curve to each data and plot just the curves. I had to bump up my java head space in order to process this output.

Thanks for any additional pointers or suggestions.

Dave

SGPanel.pngProbPlot15.png

DanH_sas
SAS Super FREQ

What version of SAS are you using?

das
Obsidian | Level 7 das
Obsidian | Level 7

9.3

das
Obsidian | Level 7 das
Obsidian | Level 7

I've discovered that the quantile data (generated by proc univariate for use in qqplots but which was also exported into the ods output for probplot) essentially contains the scaling used in the probplot. So, using that data in an sgpanel procedure, I was able to produce summary graphs for each animal in the study (as seen below for one animal). And I think that is close enough for my purposes.

Thanks again for all the help starting me down the right path.

Dave

proc sgpanel data=RMTA_prplot ;

     by goat ;

     panelby class1 replicate /

                         layout=lattice

                         ROWHEADERPOS= LEFT

                         COLHEADERPOS= TOP

                         ;

     scatter x=Quantile y=data / group=group;

run ;

SGPanel5.png

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 10 replies
  • 2514 views
  • 3 likes
  • 3 in conversation