<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", messageHandlersFilter: gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER, messageHandlers: { 'blogger-ping': function() {} } }); } }); </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 | Thursday, July 03, 2008

Multivariate Statistics. SAS program code for Discriminant Analysis for Two Groups. SAS software has a procedure "PROC DISCRIM" for performing Discriminant Analysis. The procedure can create a linear discriminant function for a given dataset. The linear discriminant function can be used to classify new observations to one of the two available populations.

Discriminant analysis is sometimes know as classification analysis. It can be used to build rules that can classify new observations into two or more labeled classes. The emphasis is on deriving a rule that can be used to optimally assign new observations to the labeled classes.

Suppose there are two populations, each of them has p variables and follows a multivariate normal distribution. Suppose a new observation vector is known to come from either population 1 or population 2. A rule is needed that can be used to predict from which of the two populations the new observation vector is most likely to have come. The most commonly used discriminant rule for two populations is the linear discriminant function rule.

Run the sample SAS program for Discriminant Analysis below:
****

dm log 'clear';
dm output 'clear';
options nodate;
data Twogroups;
input Groups X1 X2 X3 X4 X5 X6 @@;
datalines;
1 242.0 23.2 25.4 30.0 38.4 13.4
1 290.0 24.0 26.3 31.2 40.0 13.8
1 340.0 23.9 26.5 31.1 39.8 15.1
1 363.0 26.3 29.0 33.5 38.0 13.3
1 500.0 26.8 29.7 34.5 41.1 15.3
1 390.0 27.6 30.0 35.0 36.2 13.4
1 98.0 17.5 18.8 21.2 26.3 13.7
1 340.0 23.9 26.5 31.1 39.8 15.1
1 450.0 27.6 30.0 35.1 39.9 13.8
1 500.0 28.5 30.7 36.2 39.3 13.7
1 475.0 28.4 31.0 36.2 39.4 14.1
1 500.0 28.7 31.0 36.2 39.7 13.3
2 40.0 12.9 14.1 16.2 25.6 14.0
2 69.0 16.5 18.2 20.3 26.1 13.9
2 78.0 17.5 18.8 21.2 26.3 13.7
2 187.0 18.2 19.8 22.2 25.3 14.3
2 150.0 20.4 22.0 24.7 23.5 15.2
2 145.0 20.5 22.0 24.3 27.3 14.6
2 160.0 20.5 22.5 25.3 27.8 15.1
2 140.0 21.0 22.5 25.0 26.2 13.3
2 160.0 21.1 22.5 25.0 25.6 15.2
2 169.0 22.0 24.0 27.2 27.7 14.1
;
proc discrim data=Twogroups list crosslist;
class Groups;
title 'Discriminant Analysis for Two Groups';
run;
quit;

****

Leave me a comment if you have questions.

Acknowledgments goes to Weiming Ke, PhD (SDSU, Department of Mathematics and Statistics).

Labels:

0 Comments:

<< Home

More Interesting Stories

Related Posts with Thumbnails