<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d25388941\x26blogName\x3dThrough+Foreign+Eyes\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://wildthoughtsfaq.blogspot.com/search\x26blogLocale\x3den\x26v\x3d2\x26homepageUrl\x3dhttps://wildthoughtsfaq.blogspot.com/\x26vt\x3d-9059364863595816560', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>
MWave 468x60

Lakaw is a journey is a step is a move. I love to travel around the world and this is my travel and travel gadget site. Welcome and Enjoy!

0 comments | Friday, May 30, 2008

The sample SAS program codes for basic statistics given below would compute the mean, median, variance, standard deviation, stem-and-leaf plot, box plot, and normal probability plot for each given variable.

A given dataset is use as an example.

*****
dm log 'clear';
dm output 'clear';

data Example;
input ID X1 X2 X3 X4;
datalines;
1 16 27 32 35
2 19 10 35 38
3 17 28 33 36
4 18 22 31 33
5 22 18 34 38
;
proc univariate data=Example plot;
var X1-X4 ;
title 'Summary Statistics';
run;
quit;

2. Correlation coefficients between each pair of the variables can be obtained by using the following procedure:

proc corr data=Example;
var X1-X4 ;
title2 'Correlation Coefficients';
run;
quit;

3. Three-dimension and two-dimension scatter plots of the data can be obtained by using the following procedures:

dm log 'clear';
dm output 'clear';

data Ex;
input ID X1 X2 X3;
datalines;
1 27 32 35
2 10 35 38
3 28 33 36
4 22 31 43
5 29 38 34
6 14 39 41
7 25 36 37
8 23 30 39
;
proc g3d data=Ex;
scatter x1*x2=x3;
title '3-D scatter plot';
run;

proc gplot data=Ex;
plot x2*x1;
plot x3*x1;
plot x3*x2;
title '2-D scatter plot';
run;
quit;

3-D and 2-D scatter plots can be used to display the data.

The 2-D scatter plot can be used to check the correlation between two variables. An apparent trend of the 2-D scatter plot indicates a strong correlation between two variables.
*****

Thanks to SDSU Math Department.

Labels:

0 Comments:

<< Home

More Interesting Stories

Related Posts with Thumbnails