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

Dear SAS Experts,

I am new to SAS but using SAS Studio 3.8 (SAS University Edition) for my data analysis. I am trying to graph biplot using a macro called FixedBiplot with peanut data set from multi environment trial, the macro runs well until GPLOT procedure but after then shows 'ERROR: Procedure GPLOT not found.' Is it possible to convert the GPLOT procedure as follows into SGPLOT? I think GPLOT is not for SAS University Edition but SGPLOT is. It would be a great help if any of the experts can provide me the solution.

title ' ';
proc gplot data = vectors;
symbol1 v=none i=none color=white;
plot PC1*ydoteye=1 PC1*ydoteye=1/anno=vecann21 overlay vref=0 href=0;
*title 'First Multiplicative Component vs. Mean Response';
run;

I used the following SAS codes but axis coordinates and labels are not as given in the book. 

proc sgplot data=vectors sganno=vecann21 aspect=1 ;
refline 0 / axis=x; refline 0 / axis=y;
scatter x=ydoteye y=PC1 / datalabel=_ID_;
vector x=ydoteye y=PC1 / datalabel=_Variable_
lineattrs=GraphData2 datalabelattrs=GraphData2;
xaxis grid offsetmin=0.1 offsetmax=0.2;
yaxis grid;
run;

Can the labels of data point be customized with any code? Can you help me, please? I can send the log details if needed. I am hopeful that the experts must have the answer. Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@dip_ayer wrote:
The outputs are similar but I cannot display exact labels to genotype and environment using sganno data set as done by proc gplot. Proc sgplot is not applying annotation dataset. That is the issue. Thanks for your response and query.

So the issue is the content of the SGANNO data set.

The annotate data set intended to work with Proc Gplot likely will not work unmodified with Sgplot.

 

Look at the documentation for an SGANNO data set.

 

And if the purpose of that annotate data set is to display Text at specific points you may just be able to add a variable with the desired text and add a Text plot to the Sgplot code. The annotate may be better if you are attempting to change colors, fonts and such for specific values.

View solution in original post

9 REPLIES 9
ballardw
Super User

University Edition does not include a license for the older device graphics procedures like Gplot and Gchart.

 

The Xaxis and Yaxis statement would use a VALUES option to specify which tick marks to display. You could list specific values:

xaxis values = (1 5 10 12)

A range with an interval

xaxis values = (0 to 20 by 5)

or a combination.

 

Depending on what you want to show for the datalabel values a Format is likely the easiest approach. Or create additional variables. Without knowing exactly what you want to show and what the actual values are we are kind of shooting in the dark.

 

dip_ayer
Fluorite | Level 6

Thank you @ballardw  for your response. Actually, I am trying to see if there is any matrix kind of relationship between genotype yield and different environments, the genotype and environment interaction (GEI) effect. I used data set peanut and FixedBiplot macro ( ref book: Genetic Analysis of Complex Traits using SAS) to generate a GEI biplot under the fixed model framework as given in the book but couldn't get the outputs.

I have used following SAS codes to invoke a FixedBiplot macro to produce GEI or GGE biplots:

goptions cback=white;
options nodate ls=75;
proc import datafile="c:\peanut.xls" out=peanut replace; run;
%include 'c:\FixedBiplot.sas';
%FixedBiplot(peanut,15,10,4,yield,env,gen,rep,geno);

When I run this code in SAS University Edition, it shows error at GPLOT procedure as said above, I just thought that if SGPLOT is advanced than GPLOT, then older codes must have been possible to convert in the SGPLOT format, there may some other ways to produce biplots using this macro, I don't know. The peanut data set and macro and expected biplots are attached for your information. Hope for the solution. Thank you.

dip_ayer
Fluorite | Level 6

Thank you @ballardw for your response. Actually, I was trying to see if there is any relationship between genotypes and environments in a peanut trial. I have referenced a book entitled 'genetic analysis of complex traits using SAS' for this macro and procedures. I tried following code for invoking FixedBiplot macro but couldn't get the outputs as given in the book.

goptions cback=white;
options nodate ls=75;
proc import datafile="c:\peanut.xls" out=peanut replace; run;
%include 'c:\FixedBiplot.sas';
%FixedBiplot(peanut,15,10,4,yield,env,gen,rep,geno);

I have also attached peanut dataset, FixedBiplot macro and biplot outputs for your information. I hope this will help to overcome 'GPLOT not found' error in SAS University Edition. Thank you.

ballardw
Super User

I don't have access to Proc IML in the SAS installation I have so can't test code.

 

When you say "couldn't get the outputs as given in the book" do your results seem "close" or completely unrelated?

 

Note, since someone else's code included Proc Import the results there could be quite different than yours if you use files with any difference. And since XLS files are old the example you follow might be old enough that minor issues of precision in newer computers, not to mention changes to code behind Proc Mixed, may result in small differences.

dip_ayer
Fluorite | Level 6
The outputs are similar but I cannot display exact labels to genotype and environment using sganno data set as done by proc gplot. Proc sgplot is not applying annotation dataset. That is the issue. Thanks for your response and query.
ballardw
Super User

@dip_ayer wrote:
The outputs are similar but I cannot display exact labels to genotype and environment using sganno data set as done by proc gplot. Proc sgplot is not applying annotation dataset. That is the issue. Thanks for your response and query.

So the issue is the content of the SGANNO data set.

The annotate data set intended to work with Proc Gplot likely will not work unmodified with Sgplot.

 

Look at the documentation for an SGANNO data set.

 

And if the purpose of that annotate data set is to display Text at specific points you may just be able to add a variable with the desired text and add a Text plot to the Sgplot code. The annotate may be better if you are attempting to change colors, fonts and such for specific values.

dip_ayer
Fluorite | Level 6
I tried using data set with separate column for gen and env annotation and it worked. Thanks, just want to know, is there any program by SAS for GGE biplot? Using sgplot not gplot.
ballardw
Super User

Once someone attaches a specific name to like GGE Biplot I consider that jargon. The trick is getting the data in the correct form. If that plot in the PDF posted above is one, then GGE Biplot is a fancy term for a specific use of an overlayed scatter plot, of if the data is constructed properly not even an overlay.

 

While many of the modeling procedures will create graphics, and some pretty complex, they are generally to help in providing insight into the models usability. Other processes you organize the data and plot as desired. There are lots of graphing options.

 

 

dip_ayer
Fluorite | Level 6
Thanks, yeah GGE biplot actually are overlay plots ( can be regression, scatter or spline or else) with their position approximated in two dimensions so that the relationship between those variables can be visualized. The discussions really helped and I now got the biplot similar to theat one in the book.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 9 replies
  • 2414 views
  • 3 likes
  • 2 in conversation