Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

SAS Code For Discriminant Analysis For Two Groups

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

20 − 18 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.