what are appropriate graphical methods used to identify a relationship between two variables in sas?

what are appropriate graphical methods used to identify a relationship between two variables in sas?
what are appropriate graphical methods used to identify a relationship between two variables in sas?

Open in new window

craig1899Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

wigmeisterCommented:
What is meant by graphical methods?  Do you mean like a bar chart, or something completely different?  Just looking for clarification to know if I can be of any help.
0
craig1899Author Commented:
any form of chart including bar or box plot will do as a graphical method.
0
wigmeisterCommented:
Here is an outline of what you would do to create a bar chart.  You will still have to research what some of this means, but this will produce a bar chart with an x,y axis.  I am not familiar with plotting, so I don't know if that would be any more simple or not.

data testfile;
  input excel file here;
titletxt = "Students Weights';
y_by = 10;  /*this is by value for y axis*/

%macro barcht(flname, grname)

  %local flname grname;

proc sql;
  select unique titletxt into :titletxt from &flname;
  select unique max_y into :max_y from &flname;
  select unique y_by into :y_by from &flname;
quit;

/*get rid of blanks*/
%let titletxt = %trim(&titletxt);
  ...do same for each var in sql above

goptions reset = all;
goptions unit=pct htitle=8 htext=4 device=gif xpixels=300 ypixels=200 border; /*change these options to control the chart*/

axis1 label=(a=100 'Count') order=(0 to &max_y by &y_by) minor=(number=1) major=(h=3) offset=(0,0);
axis2 label=('This Title') offset=(7,10);

/*set up titles and footnotes*/
title h=8 "Student Weights";
title2......etc

data annodata;
  set testfile;
  xsys = '3';ysys='2';
function = label;
position = '2';
/*based on your data set up your x,y coordinate, or hard code them for each segment*/
/*once you test this you should see what it's doing*/
if year = '2006' then do;
  x = 20;
  y = 30;
  output;
end;
if year ='2007' then do;
...etc.;
end;
run;

proc gchart data=testfile anno=annodata;
  vbar3d yourvalue / discrete
  type=sum
  sumvar = yoursumvar
  raxis = axis1
  maxis = axis2
  patternid = midpoint
  space = 10
  nolegend
  des = ' '
  name="&grname";

pattern1 color=blue;
pattern2 color=red;
....etc.
run;
quit;
 
%mend barcht;

proc sql;
  select max(y axis field here) into :max_val from testfile;
quit;

data testfile;
  set testfile;
max_y = &max_val + 100 /*height of y axis*/

/*create chart*/
ods listing close;
ods html path=youroutputpath body="outputfilename.htm"
   (title="your title")
  style = minimal;

%barcht(testfile,barchart);

ods html close;
ods listing;

I hope you can follow this.  There are still many things for you to figure out like the inputting of the data and getting it summarized and formatted correctly.  What I am trying to show you here is how to build the bar chart.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
craig1899Author Commented:
thanks wigmeister for a comprehensive answer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.