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

I intend to run a program with SAS for University . The problem is that i have some plot  with Proc Glopt. I know that this procedure is not available in that version. Is there any way of do that??  I attach a program

1 ACCEPTED SOLUTION

Accepted Solutions
adricano
Obsidian | Level 7

Thanks Dan.
your answer was very helpful. I try to run it with these modifications. I'll let you know if i have some trouble.
 This is de data set    I used to generate the plots.

thanks again

 

data sal;

input m q11 q12 q21 q22 ;

datalines;

3209.07 2.24409 3.07872 1.53264 1.81912

;

 

DATA _null_ ;SET Sal;

CALL SYMPUT('dms',dms) ;

CALL SYMPUT('MEDIA',M) ;

CALL SYMPUT ('FV5',Q11);CALL SYMPUT ('FV10',Q12 ); CALL SYMPUT ( 'F5',Q21 ); CALL SYMPUT( 'F10',Q22);

Data labels;

   set STAB;

   retain xsys '2' ysys '2';

length function text $13 ;

   text = cult ;

 

         color='black ';

         size = 0.9;

         style = 'SWISSB';

         x = FV;

         y = MV;

         position='10';

         function = 'LABEL';

         output;

 

View solution in original post

8 REPLIES 8
ballardw
Super User

Proc SGPLOT with a Scatter plot looks like what you may want. Annotate works a bit differently with the SG procedures so you'll need to look that up.

SGPLOT does not use the AXISn or Symboln statements. Axis controls are with the Xaxis and Yaxis statements and the symbols by default come from the current active style.

 

This site http://support.sas.com/sassamples/graphgallery/PROC_SGPLOT.html has some examples you can look at.

adricano
Obsidian | Level 7
Thanks a lot for your help
adricano
Obsidian | Level 7

I was able to do the graphics correctly with some  modifications. I wander if it is possible to convert this kind of graph (biplot) with sgplot or other procedure.

thanks again and your  suggestions were very useful

DanH_sas
SAS Super FREQ

Sure. Just use two SCATTER plots, one for each pair. They will automatically overlay.

DanH_sas
SAS Super FREQ

You will need to convert your PROC GPLOTs to PROC SGPLOTs. To give you a feel for it, I've taken your first GPLOT call and made a "rough" conversion to SGPLOT ( I cannot run it because all of the data is not there).

 

Hope this helps!

Dan

 

/* SGPLOT code */

 

PROC SGPLOT data=STAB noautolegend;

scatter y=MV x=FV / markerattrs=(color=black) datalabel=cult;

refline &FV5 &FV10 / lineattrs=(color=black pattern=3);

refline &MEDIA / axis=x lineattrs=(color=black pattern=3);

run;

 

 

Proc gplot data=STAB;

Plot MV*FV / Annotate=labels frame

Vref=&MEDIA Href =&FV5 &FV10

cvref=black chref=black

lvref=3 lhref=3

vaxis=axis2 haxis=axis1

vminor=1 hminor=1 nolegend;

 

symbol1 v=none c=black h=0.7 ;

symbol2 v=none c=blue i=j line=3 ;

 

axis2

length =3.0 in order=(1800 to 3600 by 200)

label=(f=SWISSB h=1.0 a=90 r=0 'RENDIMIENTO')

value=(h=1)

minor=none;

 

axis1

length =5.0 in

label=(f=SWISSB h=1.0 'TEST DE ESTABILIDAD')

value=(h=1) order=(0 to 7)

minor=none;

 

*Title1 f=SWISSB h=1.0 'AMMI biplot ';

 

run;

quit;

 

 

adricano
Obsidian | Level 7

Thanks Dan.
your answer was very helpful. I try to run it with these modifications. I'll let you know if i have some trouble.
 This is de data set    I used to generate the plots.

thanks again

 

data sal;

input m q11 q12 q21 q22 ;

datalines;

3209.07 2.24409 3.07872 1.53264 1.81912

;

 

DATA _null_ ;SET Sal;

CALL SYMPUT('dms',dms) ;

CALL SYMPUT('MEDIA',M) ;

CALL SYMPUT ('FV5',Q11);CALL SYMPUT ('FV10',Q12 ); CALL SYMPUT ( 'F5',Q21 ); CALL SYMPUT( 'F10',Q22);

Data labels;

   set STAB;

   retain xsys '2' ysys '2';

length function text $13 ;

   text = cult ;

 

         color='black ';

         size = 0.9;

         style = 'SWISSB';

         x = FV;

         y = MV;

         position='10';

         function = 'LABEL';

         output;

 

DanH_sas
SAS Super FREQ

In the LABELS data step, there was a reference to a data set called STAB that I could not find. However, I do not think you will need that data set anyway, as the DATALABEL option can point directly to the "cult" column, and you can use DATALABELATTRS to modify the appearance of the text.

 

Thanks!
Dan

adricano
Obsidian | Level 7
Thank a lot

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 8 replies
  • 1760 views
  • 0 likes
  • 3 in conversation