Documentation Example 2 for PROC CORRESP
/****************************************************************/
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: CRSPEX2 */
/* TITLE: Documentation Example 2 for PROC CORRESP */
/* PRODUCT: STAT */
/* SYSTEM: ALL */
/* KEYS: marketing research, categorical data analysis */
/* PROCS: CORRESP */
/* DATA: */
/* */
/* SUPPORT: saswfk UPDATE: July 25, 2010 */
/* REF: PROC CORRESP, EXAMPLE 2 */
/* MISC: */
/****************************************************************/
title 'United States Population, 1920-1970';
data USPop;
* Regions:
* New England - ME, NH, VT, MA, RI, CT.
* Great Lakes - OH, IN, IL, MI, WI.
* South Atlantic - DE, MD, DC, VA, WV, NC, SC, GA, FL.
* Mountain - MT, ID, WY, CO, NM, AZ, UT, NV.
* Pacific - WA, OR, CA.
*
* Note: Multiply data values by 1000 to get populations.;
input Region $14. y1920 y1930 y1940 y1950 y1960 y1970;
label y1920 = '1920' y1930 = '1930' y1940 = '1940'
y1950 = '1950' y1960 = '1960' y1970 = '1970';
if region = 'Hawaii' or region = 'Alaska'
then w = -1000; /* Flag Supplementary Observations */
else w = 1000;
datalines;
New England 7401 8166 8437 9314 10509 11842
NY, NJ, PA 22261 26261 27539 30146 34168 37199
Great Lakes 21476 25297 26626 30399 36225 40252
Midwest 12544 13297 13517 14061 15394 16319
South Atlantic 13990 15794 17823 21182 25972 30671
KY, TN, AL, MS 8893 9887 10778 11447 12050 12803
AR, LA, OK, TX 10242 12177 13065 14538 16951 19321
Mountain 3336 3702 4150 5075 6855 8282
Pacific 5567 8195 9733 14486 20339 25454
Alaska 55 59 73 129 226 300
Hawaii 256 368 423 500 633 769
;
ods graphics on;
* Perform Simple Correspondence Analysis;
proc corresp data=uspop print=percent observed cellchi2 rp cp
short outc=Coor plot(flip);
var y1920 -- y1970;
id Region;
weight w;
run;