BookmarkSubscribeRSS Feed
Ruwan
Calcite | Level 5

I tried to run following attachment for biplot analysis. it didn't work. please help me.

13 REPLIES 13
PaigeMiller
Diamond | Level 26

Post the code or log as text in your reply, not as an attachment. Code should be posted into the window that appears when you click on the "little running man" icon. Log should be posted into the window that appears when you click on the </> icon.

PaigeMiller_0-1663012019648.png

--
Paige Miller
JosvanderVelden
SAS Super FREQ
Please do not attach .txt files to posts. Even simple .txt files can pose a security risk and therefore will NOT be opened by experienced security aware participants in this forum! You have the insert sas code option when you compose your post to insert code. If your code seems too BIG for the insert sas code option then create an example that can be placed in the post using the insert code option. Thank you.
Ruwan
Calcite | Level 5
data chili;
input Acc $6. StC NA SP PGH BH LC LS LP NFA FP CC AC SE MS CP CM AS FCI FCM FS FSPA NBF FSBE FBEA FC FSr SC NSF GU PH MLL MLW PHF CWF FL FW FWt FT FPP DFt DFl DFF TSWt FPK Yd;
datalines;
000210 2 5 7 7 3 3 3 5 1 5 1 3 7 0 0 2 0 3 8 1 2 0 1 1 3 2 1 3 2 42.7 5.8 1.6 28.9 18.1 5.8 1.1 49.3 0.1 23.1 74.0 33.0 44.0 3.9 500.0 23.0
000557 2 3 5 7 5 3 3 5 1 5 1 3 7 0 0 2 0 3 8 3 3 0 4 1 5 2 1 2 2 41.0 5.5 1.8 26.5 18.3 66.7 2.0 108.5 0.2 22.1 65.0 27.0 34.0 2.7 200.0 22.0
000692 2 5 3 7 7 3 3 3 1 5 1 3 7 0 0 2 0 2 8 1 2 0 1 1 3 2 1 2 2 39.2 5.9 1.9 28.6 16.4 8.6 1.0 124.0 0.1 50.7 33.0 39.0 65.0 3.1 413.0 51.0
001301 2 7 5 5 5 3 3 3 2 5 1 3 7 0 0 2 0 3 8 1 2 0 1 1 5 2 1 3 2 46.5 5.9 2.0 28.1 19.0 7.4 0.9 147.0 0.1 60.9 32.0 40.0 74.0 8.4 350.0 61.0
001785 2 7 5 5 7 3 2 5 1 5 1 5 7 0 0 3 0 3 9 3 3 0 1 1 5 2 1 3 2 50.8 5.0 1.6 27.9 22.5 9.0 2.4 247.5 0.1 47.0 29.0 35.0 6.0 3.6 100.0 47.0
008149 2 5 7 7 7 3 3 3 1 5 1 3 7 0 0 2 0 3 9 1 1 0 1 1 3 2 1 2 2 40.7 5.4 2.0 27.6 18.7 6.2 0.7 98.8 0.1 80.0 29.0 38.0 74.0 2.4 810.0 80.0
008220 2 5 3 7 3 3 2 3 1 5 1 3 7 0 0 2 0 3 9 1 2 0 1 1 5 2 1 3 2 46.0 6.2 2.3 26.0 17.5 10.0 1.1 115.5 0.1 32.6 33.0 40.0 66.0 4.2 280.0 33.0
008228 2 7 3 7 7 4 3 3 1 7 1 3 7 0 0 2 0 3 9 1 3 0 1 1 3 2 1 3 2 53.3 10.2 5.5 32.5 24.8 9.6 2.9 244.5 0.3 22.5 27.0 34.0 55.0 8.1 60.0 23.0
008230 2 5 7 5 7 3 3 7 1 5 1 3 7 0 0 2 0 3 9 1 2 0 1 1 3 2 1 3 2 37.3 5.6 1.8 23.3 18.5 6.9 0.9 114.8 0.1 48.2 29.0 38.0 74.0 4.3 419.0 48.0
001674 2 7 5 7 7 3 3 3 1 7 1 5 7 0 0 2 0 2 8 1 1 0 1 1 7 3 1 2 2 34.3 4.5 1.7 29.0 17.5 9.7 0.7 143.5 0.1 66.4 32.0 38.0 74.0 5.9 460.0 66.0
005867 2 3 5 7 5 3 3 5 1 5 1 3 7 0 0 2 0 3 8 1 2 0 1 1 7 2 1 3 2 37.2 4.1 1.8 28.8 18.0 7.7 0.8 86.8 0.1 39.5 32.0 39.0 74.0 4.0 455.0 40.0
016132 1 1 5 7 5 3 2 7 2 7 4 3 7 0 0 3 0 2 8 1 2 0 1 1 5 2 1 1 2 35.8 5.0 2.3 21.9 16.5 3.2 0.8 51.9 0.1 42.3 55.0 60.0 100.0 5.8 815.0 42.0
016395 2 5 5 7 5 4 3 5 1 3 1 5 7 0 0 2 1 2 6 3 5 0 3 1 5 2 1 3 3 33.9 5.2 2.2 26.7 20.6 8.3 3.7 211.5 0.3 16.3 29.0 34.0 55.0 3.8 55.0 16.0
016396 2 5 7 7 5 4 1 7 1 3 1 5 7 0 0 2 0 2 6 3 4 0 2 1 5 2 1 3 2 40.9 4.9 2.1 28.3 21.1 9.6 4.0 267.5 0.3 13.7 26.0 34.0 55.0 6.1 40.0 14.0
016400 2 7 5 7 7 3 2 3 1 5 1 3 7 0 0 2 0 3 8 3 3 0 1 1 5 2 1 2 2 33.1 5.5 2.0 25.3 19.0 4.8 0.9 75.0 0.1 36.9 29.0 35.0 74.0 6.3 528.0 37.0
016560 2 7 5 7 7 3 3 3 1 5 1 3 7 0 0 2 0 3 8 1 2 0 1 1 3 2 1 3 2 34.3 5.1 1.8 25.0 19.0 8.4 0.9 126.5 0.1 48.2 20.0 34.0 65.0 4.1 384.0 48.0
016586 1 1 5 7 5 3 2 3 1 7 4 4 7 0 0 2 0 2 8 4 3 0 1 1 7 3 1 2 3 40.4 5.0 2.1 22.0 22.3 4.3 2.0 135.2 0.2 49.8 32.0 48.0 74.0 3.9 368.0 50.0
016588 2 7 7 7 5 3 3 5 1 5 1 3 7 0 0 3 0 4 9 5 4 0 3 1 7 3 1 2 2 35.1 5.6 2.0 28.9 21.7 4.6 1.8 90.8 0.1 27.8 36.0 44.0 74.0 5.1 306.0 28.0
016596 2 5 5 7 5 3 1 7 2 5 4 5 7 0 0 3 1 3 8 3 2 0 1 1 5 3 1 2 2 40.4 5.9 2.1 23.3 20.8 4.6 1.2 67.5 0.1 33.5 49.0 60.0 82.0 3.0 490.0 34.0
016597 1 1 3 7 5 3 2 3 3 5 4 5 7 0 0 3 0 4 8 4 4 0 4 1 7 3 1 3 2 36.0 7.1 2.7 26.7 21.1 4.0 2.0 66.1 0.2 30.5 50.0 54.0 82.0 4.5 461.0 31.0
016599 1 1 5 7 5 3 2 7 2 7 4 3 7 0 0 2 0 2 9 3 3 0 1 1 5 2 1 1 2 54.5 5.4 2.4 35.6 20.8 2.5 0.8 30.1 0.1 55.5 48.0 60.0 114.0 4.2 1500.0 56.0
016600 2 5 7 5 7 3 3 7 1 5 1 3 7 0 0 2 0 3 8 1 2 1 4 1 5 3 1 3 2 41.3 6.5 2.3 24.3 19.8 14.2 1.7 179.0 0.1 76.0 16.0 34.0 55.0 6.7 420.0 76.0
016601 2 7 3 7 7 3 3 3 2 5 1 5 7 0 0 3 0 3 9 3 3 0 1 1 3 2 1 3 2 47.8 5.9 2.0 27.9 19.6 5.5 1.8 131.0 0.1 46.5 29.0 34.0 65.0 6.6 380.0 47.0
016603 3 3 5 7 5 7 2 3 2 7 4 5 7 0 0 2 1 3 8 4 2 0 1 1 7 3 1 1 2 53.2 8.8 4.4 32.5 27.2 5.6 1.7 96.2 0.1 40.3 41.0 51.0 74.0 4.1 418.0 40.0
016604 2 7 7 5 7 3 3 5 1 5 1 3 7 0 0 2 0 3 9 1 2 0 1 1 3 2 1 3 2 56.5 5.9 2.0 367.0 27.8 7.6 1.6 161.9 0.1 36.5 34.0 44.0 65.0 2.0 225.0 36.0
016609 2 3 5 5 7 3 3 3 2 3 1 5 7 0 0 3 0 3 8 1 1 1 3 1 3 2 1 3 2 65.5 7.4 2.8 38.1 21.6 9.0 0.8 153.0 0.1 48.6 34.0 38.0 65.0 4.7 317.0 49.0
0000c1 2 7 7 7 5 7 3 7 2 7 5 5 7 0 1 3 1 7 9 1 2 1 1 1 3 2 1 3 2 65.4 8.9 3.1 44.7 27.7 9.1 1.5 147.5 0.1 39.1 36.0 44.0 72.0 4.2 265.0 39.0
0000c2 2 7 5 7 5 3 2 3 1 7 4 3 7 0 0 2 0 3 9 4 4 0 4 1 7 3 1 2 2 38.0 6.4 2.1 30.3 27.6 4.4 2.2 94.2 0.1 35.2 55.0 59.0 79.0 3.2 373.0 35.0
0000c3 1 1 5 5 5 3 2 7 2 7 2 3 7 0 0 2 0 3 8 1 2 0 1 1 5 2 1 1 2 40.9 5.7 2.3 25.9 21.1 3.4 0.8 43.0 0.1 46.0 42.0 59.0 114.0 5.9 820.0 46.0
0000c4 2 7 7 7 3 7 1 7 1 5 8 5 7 0 0 2 1 6 9 5 3 0 4 1 3 2 1 3 2 70.7 7.5 2.8 35.7 19.2 6.4 2.1 85.0 0.2 19.3 39.0 45.0 72.0 2.9 227.0 19.0
0000c5 2 7 5 5 7 4 1 5 2 5 2 3 7 0 0 2 0 4 8 1 2 0 1 1 3 2 1 1 2 35.1 5.7 2.0 26.6 24.6 4.8 1.4 45.1 0.2 24.8 38.0 51.0 79.0 2.9 550.0 25.0
0000c6 2 7 7 7 5 7 3 7 1 7 5 5 7 0 0 3 1 6 9 1 2 0 1 1 3 2 1 3 2 60.4 7.2 2.6 32.3 18.2 7.6 1.3 169.0 0.1 70.3 34.0 39.0 72.0 2.9 415.0 70.0
0000c7 2 5 3 5 7 3 1 3 3 7 4 3 7 0 0 2 0 3 8 5 4 0 3 1 7 2 1 2 2 37.1 7.2 3.1 24.3 24.0 3.7 2.4 77.0 0.2 28.8 39.0 51.0 79.0 6.6 374.0 29.0
0000c8 2 1 3 7 3 3 1 3 1 5 4 5 7 0 0 2 0 3 8 4 3 0 3 1 7 3 1 2 2 38.9 10.0 4.0 26.3 25.4 3.9 1.7 87.3 0.1 39.1 36.0 60.0 114.0 5.2 400.0 39.0
0013c7 2 7 5 7 7 3 3 5 1 7 1 3 7 0 0 2 0 3 8 1 2 0 1 1 3 2 1 3 2 50.4 6.3 2.1 33.2 18.8 8.3 1.4 152.0 0.1 40.8 17.0 27.0 55.0 8.0 249.0 41.0
0017c8 2 7 7 7 5 3 2 7 1 5 1 5 7 0 0 2 0 2 6 1 3 0 1 1 5 3 1 3 2 42.8 6.2 2.0 28.6 17.6 10.8 2.0 178.0 0.2 23.2 32.0 38.0 55.0 2.3 100.0 23.0
0058c0 2 7 5 7 7 3 2 3 2 5 1 5 7 0 0 1 0 3 8 5 2 0 4 1 5 2 1 2 2 44.7 10.3 3.7 33.7 21.7 9.0 1.4 166.7 0.2 33.0 36.0 40.0 66.0 4.2 198.0 33.0
0058c6 2 7 5 5 5 3 1 7 1 5 9 2 3 0 0 3 0 3 6 4 3 0 4 1 7 3 1 3 2 53.0 6.2 2.8 32.0 23.7 5.8 2.8 78.3 0.2 8.0 36.0 40.0 66.0 5.0 102.0 8.0
;

How I use Friendly's biplot macro for above data set?

Friendly's %BIPLOT macro

PaigeMiller
Diamond | Level 26

Show us the code you have tried so far. If there are errors in the log, show us the log too. Do not attach files. Show us code and log as text, as explained above.

--
Paige Miller
JosvanderVelden
SAS Super FREQ

Please run the code below and view the log. You'll see an error regarding a missing value and warnings of division by zero.

data reaction;
   input Task $6. Topic1 Topic2 Topic3 Topic4;
datalines;
Easy     2.43     3.12     3.68     4.04
Medium   3.41     3.91     4.07     5.10
Hard     4.21     4.65     5.87     5.69
;
run;

%biplot(var=topic1-topic4, id=task);

data reaction2;
   input Task $6. Topic1 Topic2 Topic3 Topic4;
datalines;
Easy     0        3.12     3.68     0
Medium   3.41     3.91     4.07     0
Hard     4.21     4.65     5.87     0
;
run;

%biplot(var=topic1-topic4, id=task);

I suppose that is similar to what you get with the chili dataset. The chili dataset has a single column with only '0's and several columns with '0's as values for the variable.

Ruwan
Calcite | Level 5
data chili;
input Acc $6. StC NA SP PGH BH LC LS LP NFA FP CC AC SE MS CP CM AS FCI FCM FS FSPA NBF FSBE FBEA FC FSr SC NSF GU PH MLL MLW PHF CWF FL FW FWt FT FPP DFt DFl DFF TSWt FPK Yd;
datalines;
000210 2 5 7 7 3 3 3 5 1 5 1 3 7 0 0 2 0 3 8 1 2 0 1 1 3 2 1 3 2 42.7 5.8 1.6 28.9 18.1 5.8 1.1 49.3 0.1 23.1 74.0 33.0 44.0 3.9 500.0 23.0
000557 2 3 5 7 5 3 3 5 1 5 1 3 7 0 0 2 0 3 8 3 3 0 4 1 5 2 1 2 2 41.0 5.5 1.8 26.5 18.3 66.7 2.0 108.5 0.2 22.1 65.0 27.0 34.0 2.7 200.0 22.0
000692 2 5 3 7 7 3 3 3 1 5 1 3 7 0 0 2 0 2 8 1 2 0 1 1 3 2 1 2 2 39.2 5.9 1.9 28.6 16.4 8.6 1.0 124.0 0.1 50.7 33.0 39.0 65.0 3.1 413.0 51.0
001301 2 7 5 5 5 3 3 3 2 5 1 3 7 0 0 2 0 3 8 1 2 0 1 1 5 2 1 3 2 46.5 5.9 2.0 28.1 19.0 7.4 0.9 147.0 0.1 60.9 32.0 40.0 74.0 8.4 350.0 61.0
001785 2 7 5 5 7 3 2 5 1 5 1 5 7 0 0 3 0 3 9 3 3 0 1 1 5 2 1 3 2 50.8 5.0 1.6 27.9 22.5 9.0 2.4 247.5 0.1 47.0 29.0 35.0 6.0 3.6 100.0 47.0
008149 2 5 7 7 7 3 3 3 1 5 1 3 7 0 0 2 0 3 9 1 1 0 1 1 3 2 1 2 2 40.7 5.4 2.0 27.6 18.7 6.2 0.7 98.8 0.1 80.0 29.0 38.0 74.0 2.4 810.0 80.0
008220 2 5 3 7 3 3 2 3 1 5 1 3 7 0 0 2 0 3 9 1 2 0 1 1 5 2 1 3 2 46.0 6.2 2.3 26.0 17.5 10.0 1.1 115.5 0.1 32.6 33.0 40.0 66.0 4.2 280.0 33.0
008228 2 7 3 7 7 4 3 3 1 7 1 3 7 0 0 2 0 3 9 1 3 0 1 1 3 2 1 3 2 53.3 10.2 5.5 32.5 24.8 9.6 2.9 244.5 0.3 22.5 27.0 34.0 55.0 8.1 60.0 23.0
008230 2 5 7 5 7 3 3 7 1 5 1 3 7 0 0 2 0 3 9 1 2 0 1 1 3 2 1 3 2 37.3 5.6 1.8 23.3 18.5 6.9 0.9 114.8 0.1 48.2 29.0 38.0 74.0 4.3 419.0 48.0
001674 2 7 5 7 7 3 3 3 1 7 1 5 7 0 0 2 0 2 8 1 1 0 1 1 7 3 1 2 2 34.3 4.5 1.7 29.0 17.5 9.7 0.7 143.5 0.1 66.4 32.0 38.0 74.0 5.9 460.0 66.0
005867 2 3 5 7 5 3 3 5 1 5 1 3 7 0 0 2 0 3 8 1 2 0 1 1 7 2 1 3 2 37.2 4.1 1.8 28.8 18.0 7.7 0.8 86.8 0.1 39.5 32.0 39.0 74.0 4.0 455.0 40.0
016132 1 1 5 7 5 3 2 7 2 7 4 3 7 0 0 3 0 2 8 1 2 0 1 1 5 2 1 1 2 35.8 5.0 2.3 21.9 16.5 3.2 0.8 51.9 0.1 42.3 55.0 60.0 100.0 5.8 815.0 42.0
016395 2 5 5 7 5 4 3 5 1 3 1 5 7 0 0 2 1 2 6 3 5 0 3 1 5 2 1 3 3 33.9 5.2 2.2 26.7 20.6 8.3 3.7 211.5 0.3 16.3 29.0 34.0 55.0 3.8 55.0 16.0
016396 2 5 7 7 5 4 1 7 1 3 1 5 7 0 0 2 0 2 6 3 4 0 2 1 5 2 1 3 2 40.9 4.9 2.1 28.3 21.1 9.6 4.0 267.5 0.3 13.7 26.0 34.0 55.0 6.1 40.0 14.0
016400 2 7 5 7 7 3 2 3 1 5 1 3 7 0 0 2 0 3 8 3 3 0 1 1 5 2 1 2 2 33.1 5.5 2.0 25.3 19.0 4.8 0.9 75.0 0.1 36.9 29.0 35.0 74.0 6.3 528.0 37.0
016560 2 7 5 7 7 3 3 3 1 5 1 3 7 0 0 2 0 3 8 1 2 0 1 1 3 2 1 3 2 34.3 5.1 1.8 25.0 19.0 8.4 0.9 126.5 0.1 48.2 20.0 34.0 65.0 4.1 384.0 48.0
016586 1 1 5 7 5 3 2 3 1 7 4 4 7 0 0 2 0 2 8 4 3 0 1 1 7 3 1 2 3 40.4 5.0 2.1 22.0 22.3 4.3 2.0 135.2 0.2 49.8 32.0 48.0 74.0 3.9 368.0 50.0
016588 2 7 7 7 5 3 3 5 1 5 1 3 7 0 0 3 0 4 9 5 4 0 3 1 7 3 1 2 2 35.1 5.6 2.0 28.9 21.7 4.6 1.8 90.8 0.1 27.8 36.0 44.0 74.0 5.1 306.0 28.0
016596 2 5 5 7 5 3 1 7 2 5 4 5 7 0 0 3 1 3 8 3 2 0 1 1 5 3 1 2 2 40.4 5.9 2.1 23.3 20.8 4.6 1.2 67.5 0.1 33.5 49.0 60.0 82.0 3.0 490.0 34.0
016597 1 1 3 7 5 3 2 3 3 5 4 5 7 0 0 3 0 4 8 4 4 0 4 1 7 3 1 3 2 36.0 7.1 2.7 26.7 21.1 4.0 2.0 66.1 0.2 30.5 50.0 54.0 82.0 4.5 461.0 31.0
016599 1 1 5 7 5 3 2 7 2 7 4 3 7 0 0 2 0 2 9 3 3 0 1 1 5 2 1 1 2 54.5 5.4 2.4 35.6 20.8 2.5 0.8 30.1 0.1 55.5 48.0 60.0 114.0 4.2 1500.0 56.0
016600 2 5 7 5 7 3 3 7 1 5 1 3 7 0 0 2 0 3 8 1 2 1 4 1 5 3 1 3 2 41.3 6.5 2.3 24.3 19.8 14.2 1.7 179.0 0.1 76.0 16.0 34.0 55.0 6.7 420.0 76.0
016601 2 7 3 7 7 3 3 3 2 5 1 5 7 0 0 3 0 3 9 3 3 0 1 1 3 2 1 3 2 47.8 5.9 2.0 27.9 19.6 5.5 1.8 131.0 0.1 46.5 29.0 34.0 65.0 6.6 380.0 47.0
016603 3 3 5 7 5 7 2 3 2 7 4 5 7 0 0 2 1 3 8 4 2 0 1 1 7 3 1 1 2 53.2 8.8 4.4 32.5 27.2 5.6 1.7 96.2 0.1 40.3 41.0 51.0 74.0 4.1 418.0 40.0
016604 2 7 7 5 7 3 3 5 1 5 1 3 7 0 0 2 0 3 9 1 2 0 1 1 3 2 1 3 2 56.5 5.9 2.0 367.0 27.8 7.6 1.6 161.9 0.1 36.5 34.0 44.0 65.0 2.0 225.0 36.0
016609 2 3 5 5 7 3 3 3 2 3 1 5 7 0 0 3 0 3 8 1 1 1 3 1 3 2 1 3 2 65.5 7.4 2.8 38.1 21.6 9.0 0.8 153.0 0.1 48.6 34.0 38.0 65.0 4.7 317.0 49.0
0000c1 2 7 7 7 5 7 3 7 2 7 5 5 7 0 1 3 1 7 9 1 2 1 1 1 3 2 1 3 2 65.4 8.9 3.1 44.7 27.7 9.1 1.5 147.5 0.1 39.1 36.0 44.0 72.0 4.2 265.0 39.0
0000c2 2 7 5 7 5 3 2 3 1 7 4 3 7 0 0 2 0 3 9 4 4 0 4 1 7 3 1 2 2 38.0 6.4 2.1 30.3 27.6 4.4 2.2 94.2 0.1 35.2 55.0 59.0 79.0 3.2 373.0 35.0
0000c3 1 1 5 5 5 3 2 7 2 7 2 3 7 0 0 2 0 3 8 1 2 0 1 1 5 2 1 1 2 40.9 5.7 2.3 25.9 21.1 3.4 0.8 43.0 0.1 46.0 42.0 59.0 114.0 5.9 820.0 46.0
0000c4 2 7 7 7 3 7 1 7 1 5 8 5 7 0 0 2 1 6 9 5 3 0 4 1 3 2 1 3 2 70.7 7.5 2.8 35.7 19.2 6.4 2.1 85.0 0.2 19.3 39.0 45.0 72.0 2.9 227.0 19.0
0000c5 2 7 5 5 7 4 1 5 2 5 2 3 7 0 0 2 0 4 8 1 2 0 1 1 3 2 1 1 2 35.1 5.7 2.0 26.6 24.6 4.8 1.4 45.1 0.2 24.8 38.0 51.0 79.0 2.9 550.0 25.0
0000c6 2 7 7 7 5 7 3 7 1 7 5 5 7 0 0 3 1 6 9 1 2 0 1 1 3 2 1 3 2 60.4 7.2 2.6 32.3 18.2 7.6 1.3 169.0 0.1 70.3 34.0 39.0 72.0 2.9 415.0 70.0
0000c7 2 5 3 5 7 3 1 3 3 7 4 3 7 0 0 2 0 3 8 5 4 0 3 1 7 2 1 2 2 37.1 7.2 3.1 24.3 24.0 3.7 2.4 77.0 0.2 28.8 39.0 51.0 79.0 6.6 374.0 29.0
0000c8 2 1 3 7 3 3 1 3 1 5 4 5 7 0 0 2 0 3 8 4 3 0 3 1 7 3 1 2 2 38.9 10.0 4.0 26.3 25.4 3.9 1.7 87.3 0.1 39.1 36.0 60.0 114.0 5.2 400.0 39.0
0013c7 2 7 5 7 7 3 3 5 1 7 1 3 7 0 0 2 0 3 8 1 2 0 1 1 3 2 1 3 2 50.4 6.3 2.1 33.2 18.8 8.3 1.4 152.0 0.1 40.8 17.0 27.0 55.0 8.0 249.0 41.0
0017c8 2 7 7 7 5 3 2 7 1 5 1 5 7 0 0 2 0 2 6 1 3 0 1 1 5 3 1 3 2 42.8 6.2 2.0 28.6 17.6 10.8 2.0 178.0 0.2 23.2 32.0 38.0 55.0 2.3 100.0 23.0
0058c0 2 7 5 7 7 3 2 3 2 5 1 5 7 0 0 1 0 3 8 5 2 0 4 1 5 2 1 2 2 44.7 10.3 3.7 33.7 21.7 9.0 1.4 166.7 0.2 33.0 36.0 40.0 66.0 4.2 198.0 33.0
0058c6 2 7 5 5 5 3 1 7 1 5 9 2 3 0 0 3 0 3 6 4 3 0 4 1 7 3 1 3 2 53.0 6.2 2.8 32.0 23.7 5.8 2.8 78.3 0.2 8.0 36.0 40.0 66.0 5.0 102.0 8.0
;
/* A. Use %BIPLOT macro, which uses SAS/IML to compute the biplot coordinates. 
      Use the OUT= option to get the coordinates for the markers and vectors.
   B. Transpose the data from long to wide form.
   C. Use PROC SGPLOT to create the biplot
*/
%let FACTYPE = SYM;   /* options are GH, COV, JK, SYM */
title "Biplot: &FACTYPE, STD";
%biplot(data=chili, 
        var=StC NA SP PGH BH LC LS LP NFA FP CC AC SE MS CP CM AS FCI FCM FS FSPA NBF FSBE FBEA FC FSr SC NSF GU PH MLL MLW PHF CWF FL FW FWt FT FPP DFt DFl DFF TSWt FPK Yd, 
        id=Acc,
        factype=&FACTYPE,  /* GH, COV, JK, SYM */
        std=std,           /* NONE, MEAN, STD  */
        scale=1,           /* if you do not specify SCALE=1, vectors are auto-scaled */
        out=biplotFriendly,/* write SAS data set with results */ 
        symbols=circle dot, inc=1);
 
/* transpose from long to wide */
data Biplot;
set biplotFriendly(where=(_TYPE_='OBS') rename=(dim1=Prin1 dim2=Prin2 _Name_=_ID_))
    biplotFriendly(where=(_TYPE_='VAR') rename=(dim1=vx dim2=vy _Name_=_Variable_));
run;
 
proc sgplot data=Biplot aspect=1 noautolegend;
   refline 0 / axis=x; refline 0 / axis=y;
   scatter x=Prin1 y=Prin2 / datalabel=_ID_;
   vector  x=vx    y=vy    / datalabel=_Variable_
                             lineattrs=GraphData2 datalabelattrs=GraphData2;
   xaxis grid offsetmin=0.1 offsetmax=0.2;
   yaxis grid;
run;

This is what I tried.

Ruwan
Calcite | Level 5

data chili;
input Acc $6. StC NA SP PGH BH LC LS LP NFA FP CC AC SE MS CP CM AS FCI FCM FS FSPA NBF FSBE FBEA FC FSr SC NSF GU PH MLL MLW PHF CWF FL FW FWt FT FPP DFt DFl DFF TSWt FPK Yd;
datalines;
000210 2 5 7 7 3 3 3 5 1 5 1 3 7 0 0 2 0 3 8 1 2 0 1 1 3 2 1 3 2 42.7 5.8 1.6 28.9 18.1 5.8 1.1 49.3 0.1 23.1 74.0 33.0 44.0 3.9 500.0 23.0
000557 2 3 5 7 5 3 3 5 1 5 1 3 7 0 0 2 0 3 8 3 3 0 4 1 5 2 1 2 2 41.0 5.5 1.8 26.5 18.3 66.7 2.0 108.5 0.2 22.1 65.0 27.0 34.0 2.7 200.0 22.0
000692 2 5 3 7 7 3 3 3 1 5 1 3 7 0 0 2 0 2 8 1 2 0 1 1 3 2 1 2 2 39.2 5.9 1.9 28.6 16.4 8.6 1.0 124.0 0.1 50.7 33.0 39.0 65.0 3.1 413.0 51.0
001301 2 7 5 5 5 3 3 3 2 5 1 3 7 0 0 2 0 3 8 1 2 0 1 1 5 2 1 3 2 46.5 5.9 2.0 28.1 19.0 7.4 0.9 147.0 0.1 60.9 32.0 40.0 74.0 8.4 350.0 61.0
001785 2 7 5 5 7 3 2 5 1 5 1 5 7 0 0 3 0 3 9 3 3 0 1 1 5 2 1 3 2 50.8 5.0 1.6 27.9 22.5 9.0 2.4 247.5 0.1 47.0 29.0 35.0 6.0 3.6 100.0 47.0
008149 2 5 7 7 7 3 3 3 1 5 1 3 7 0 0 2 0 3 9 1 1 0 1 1 3 2 1 2 2 40.7 5.4 2.0 27.6 18.7 6.2 0.7 98.8 0.1 80.0 29.0 38.0 74.0 2.4 810.0 80.0
008220 2 5 3 7 3 3 2 3 1 5 1 3 7 0 0 2 0 3 9 1 2 0 1 1 5 2 1 3 2 46.0 6.2 2.3 26.0 17.5 10.0 1.1 115.5 0.1 32.6 33.0 40.0 66.0 4.2 280.0 33.0
008228 2 7 3 7 7 4 3 3 1 7 1 3 7 0 0 2 0 3 9 1 3 0 1 1 3 2 1 3 2 53.3 10.2 5.5 32.5 24.8 9.6 2.9 244.5 0.3 22.5 27.0 34.0 55.0 8.1 60.0 23.0
008230 2 5 7 5 7 3 3 7 1 5 1 3 7 0 0 2 0 3 9 1 2 0 1 1 3 2 1 3 2 37.3 5.6 1.8 23.3 18.5 6.9 0.9 114.8 0.1 48.2 29.0 38.0 74.0 4.3 419.0 48.0
001674 2 7 5 7 7 3 3 3 1 7 1 5 7 0 0 2 0 2 8 1 1 0 1 1 7 3 1 2 2 34.3 4.5 1.7 29.0 17.5 9.7 0.7 143.5 0.1 66.4 32.0 38.0 74.0 5.9 460.0 66.0
005867 2 3 5 7 5 3 3 5 1 5 1 3 7 0 0 2 0 3 8 1 2 0 1 1 7 2 1 3 2 37.2 4.1 1.8 28.8 18.0 7.7 0.8 86.8 0.1 39.5 32.0 39.0 74.0 4.0 455.0 40.0
016132 1 1 5 7 5 3 2 7 2 7 4 3 7 0 0 3 0 2 8 1 2 0 1 1 5 2 1 1 2 35.8 5.0 2.3 21.9 16.5 3.2 0.8 51.9 0.1 42.3 55.0 60.0 100.0 5.8 815.0 42.0
016395 2 5 5 7 5 4 3 5 1 3 1 5 7 0 0 2 1 2 6 3 5 0 3 1 5 2 1 3 3 33.9 5.2 2.2 26.7 20.6 8.3 3.7 211.5 0.3 16.3 29.0 34.0 55.0 3.8 55.0 16.0
016396 2 5 7 7 5 4 1 7 1 3 1 5 7 0 0 2 0 2 6 3 4 0 2 1 5 2 1 3 2 40.9 4.9 2.1 28.3 21.1 9.6 4.0 267.5 0.3 13.7 26.0 34.0 55.0 6.1 40.0 14.0
016400 2 7 5 7 7 3 2 3 1 5 1 3 7 0 0 2 0 3 8 3 3 0 1 1 5 2 1 2 2 33.1 5.5 2.0 25.3 19.0 4.8 0.9 75.0 0.1 36.9 29.0 35.0 74.0 6.3 528.0 37.0
016560 2 7 5 7 7 3 3 3 1 5 1 3 7 0 0 2 0 3 8 1 2 0 1 1 3 2 1 3 2 34.3 5.1 1.8 25.0 19.0 8.4 0.9 126.5 0.1 48.2 20.0 34.0 65.0 4.1 384.0 48.0
016586 1 1 5 7 5 3 2 3 1 7 4 4 7 0 0 2 0 2 8 4 3 0 1 1 7 3 1 2 3 40.4 5.0 2.1 22.0 22.3 4.3 2.0 135.2 0.2 49.8 32.0 48.0 74.0 3.9 368.0 50.0
016588 2 7 7 7 5 3 3 5 1 5 1 3 7 0 0 3 0 4 9 5 4 0 3 1 7 3 1 2 2 35.1 5.6 2.0 28.9 21.7 4.6 1.8 90.8 0.1 27.8 36.0 44.0 74.0 5.1 306.0 28.0
016596 2 5 5 7 5 3 1 7 2 5 4 5 7 0 0 3 1 3 8 3 2 0 1 1 5 3 1 2 2 40.4 5.9 2.1 23.3 20.8 4.6 1.2 67.5 0.1 33.5 49.0 60.0 82.0 3.0 490.0 34.0
016597 1 1 3 7 5 3 2 3 3 5 4 5 7 0 0 3 0 4 8 4 4 0 4 1 7 3 1 3 2 36.0 7.1 2.7 26.7 21.1 4.0 2.0 66.1 0.2 30.5 50.0 54.0 82.0 4.5 461.0 31.0
016599 1 1 5 7 5 3 2 7 2 7 4 3 7 0 0 2 0 2 9 3 3 0 1 1 5 2 1 1 2 54.5 5.4 2.4 35.6 20.8 2.5 0.8 30.1 0.1 55.5 48.0 60.0 114.0 4.2 1500.0 56.0
016600 2 5 7 5 7 3 3 7 1 5 1 3 7 0 0 2 0 3 8 1 2 1 4 1 5 3 1 3 2 41.3 6.5 2.3 24.3 19.8 14.2 1.7 179.0 0.1 76.0 16.0 34.0 55.0 6.7 420.0 76.0
016601 2 7 3 7 7 3 3 3 2 5 1 5 7 0 0 3 0 3 9 3 3 0 1 1 3 2 1 3 2 47.8 5.9 2.0 27.9 19.6 5.5 1.8 131.0 0.1 46.5 29.0 34.0 65.0 6.6 380.0 47.0
016603 3 3 5 7 5 7 2 3 2 7 4 5 7 0 0 2 1 3 8 4 2 0 1 1 7 3 1 1 2 53.2 8.8 4.4 32.5 27.2 5.6 1.7 96.2 0.1 40.3 41.0 51.0 74.0 4.1 418.0 40.0
016604 2 7 7 5 7 3 3 5 1 5 1 3 7 0 0 2 0 3 9 1 2 0 1 1 3 2 1 3 2 56.5 5.9 2.0 367.0 27.8 7.6 1.6 161.9 0.1 36.5 34.0 44.0 65.0 2.0 225.0 36.0
016609 2 3 5 5 7 3 3 3 2 3 1 5 7 0 0 3 0 3 8 1 1 1 3 1 3 2 1 3 2 65.5 7.4 2.8 38.1 21.6 9.0 0.8 153.0 0.1 48.6 34.0 38.0 65.0 4.7 317.0 49.0
0000c1 2 7 7 7 5 7 3 7 2 7 5 5 7 0 1 3 1 7 9 1 2 1 1 1 3 2 1 3 2 65.4 8.9 3.1 44.7 27.7 9.1 1.5 147.5 0.1 39.1 36.0 44.0 72.0 4.2 265.0 39.0
0000c2 2 7 5 7 5 3 2 3 1 7 4 3 7 0 0 2 0 3 9 4 4 0 4 1 7 3 1 2 2 38.0 6.4 2.1 30.3 27.6 4.4 2.2 94.2 0.1 35.2 55.0 59.0 79.0 3.2 373.0 35.0
0000c3 1 1 5 5 5 3 2 7 2 7 2 3 7 0 0 2 0 3 8 1 2 0 1 1 5 2 1 1 2 40.9 5.7 2.3 25.9 21.1 3.4 0.8 43.0 0.1 46.0 42.0 59.0 114.0 5.9 820.0 46.0
0000c4 2 7 7 7 3 7 1 7 1 5 8 5 7 0 0 2 1 6 9 5 3 0 4 1 3 2 1 3 2 70.7 7.5 2.8 35.7 19.2 6.4 2.1 85.0 0.2 19.3 39.0 45.0 72.0 2.9 227.0 19.0
0000c5 2 7 5 5 7 4 1 5 2 5 2 3 7 0 0 2 0 4 8 1 2 0 1 1 3 2 1 1 2 35.1 5.7 2.0 26.6 24.6 4.8 1.4 45.1 0.2 24.8 38.0 51.0 79.0 2.9 550.0 25.0
0000c6 2 7 7 7 5 7 3 7 1 7 5 5 7 0 0 3 1 6 9 1 2 0 1 1 3 2 1 3 2 60.4 7.2 2.6 32.3 18.2 7.6 1.3 169.0 0.1 70.3 34.0 39.0 72.0 2.9 415.0 70.0
0000c7 2 5 3 5 7 3 1 3 3 7 4 3 7 0 0 2 0 3 8 5 4 0 3 1 7 2 1 2 2 37.1 7.2 3.1 24.3 24.0 3.7 2.4 77.0 0.2 28.8 39.0 51.0 79.0 6.6 374.0 29.0
0000c8 2 1 3 7 3 3 1 3 1 5 4 5 7 0 0 2 0 3 8 4 3 0 3 1 7 3 1 2 2 38.9 10.0 4.0 26.3 25.4 3.9 1.7 87.3 0.1 39.1 36.0 60.0 114.0 5.2 400.0 39.0
0013c7 2 7 5 7 7 3 3 5 1 7 1 3 7 0 0 2 0 3 8 1 2 0 1 1 3 2 1 3 2 50.4 6.3 2.1 33.2 18.8 8.3 1.4 152.0 0.1 40.8 17.0 27.0 55.0 8.0 249.0 41.0
0017c8 2 7 7 7 5 3 2 7 1 5 1 5 7 0 0 2 0 2 6 1 3 0 1 1 5 3 1 3 2 42.8 6.2 2.0 28.6 17.6 10.8 2.0 178.0 0.2 23.2 32.0 38.0 55.0 2.3 100.0 23.0
0058c0 2 7 5 7 7 3 2 3 2 5 1 5 7 0 0 1 0 3 8 5 2 0 4 1 5 2 1 2 2 44.7 10.3 3.7 33.7 21.7 9.0 1.4 166.7 0.2 33.0 36.0 40.0 66.0 4.2 198.0 33.0
0058c6 2 7 5 5 5 3 1 7 1 5 9 2 3 0 0 3 0 3 6 4 3 0 4 1 7 3 1 3 2 53.0 6.2 2.8 32.0 23.7 5.8 2.8 78.3 0.2 8.0 36.0 40.0 66.0 5.0 102.0 8.0
;
/* A. Use %BIPLOT macro, which uses SAS/IML to compute the biplot coordinates.
Use the OUT= option to get the coordinates for the markers and vectors.
B. Transpose the data from long to wide form.
C. Use PROC SGPLOT to create the biplot
*/
%let FACTYPE = SYM; /* options are GH, COV, JK, SYM */
title "Biplot: &FACTYPE, STD";
%biplot(data=chili,
var=StC NA SP PGH BH LC LS LP NFA FP CC AC SE MS CP CM AS FCI FCM FS FSPA NBF FSBE FBEA FC FSr SC NSF GU PH MLL MLW PHF CWF FL FW FWt FT FPP DFt DFl DFF TSWt FPK Yd,
id=Acc,
factype=&FACTYPE, /* GH, COV, JK, SYM */
std=std, /* NONE, MEAN, STD */
scale=1, /* if you do not specify SCALE=1, vectors are auto-scaled */
out=biplotFriendly,/* write SAS data set with results */
symbols=circle dot, inc=1);

/* transpose from long to wide */
data Biplot;
set biplotFriendly(where=(_TYPE_='OBS') rename=(dim1=Prin1 dim2=Prin2 _Name_=_ID_))
biplotFriendly(where=(_TYPE_='VAR') rename=(dim1=vx dim2=vy _Name_=_Variable_));
run;

proc sgplot data=Biplot aspect=1 noautolegend;
refline 0 / axis=x; refline 0 / axis=y;
scatter x=Prin1 y=Prin2 / datalabel=_ID_;
vector x=vx y=vy / datalabel=_Variable_
lineattrs=GraphData2 datalabelattrs=GraphData2;
xaxis grid offsetmin=0.1 offsetmax=0.2;
yaxis grid;
run;

PaigeMiller
Diamond | Level 26

What is wrong with this code?

--
Paige Miller
JosvanderVelden
SAS Super FREQ

The warning and error that lead to halting og proc iml in the biplot macro

NOTE: Paused in module BIPLOT.
NOTE: Exiting IML.
 1093       title "Biplot: &FACTYPE, STD";
 1094       
 1095       
 1096       %biplot(data = chili,
 1097                var = StC NA SP PGH BH LC LS LP NFA FP CC AC SE
 1098                      CM FCI FCM FS FSPA FSBE FBEA
 1099                      FC FSr SC NSF GU PH MLL MLW PHF CWF FL FW
 1100                      FWt FT FPP DFt DFl DFF TSWt FPK Yd,
 1101                      /* removed MS CP AS NBF since these result in division by zero error */
 1102                 id = Acc,
 1103            factype = &FACTYPE,  /* GH, COV, JK, SYM */
 1104                std = std,           /* NONE, MEAN, STD  */
 1105              scale = 1,           /* if you do not specify SCALE=1, vectors are auto-scaled */
 1106                out = biplotFriendly,/* write SAS data set with results */
 1107            symbols = circle dot, inc = 1);
 NOTE: IML Ready
 NOTE: Module BIPLOT defined.
 NOTE: Module POWER defined.
 NOTE: Module STR2VEC defined.
 NOTE: Module READTAB defined.
 NOTE: Module READLAB defined.
 NOTE: Module CELLNAME defined.
 NOTE: Module NOMISS defined.
 WARNING: Division by zero, result set to missing value.
 
  count     : number of occurrences is 2
  operation : / at line 5035 column 115
  operands  : *LIT1004, S
 
 *LIT1004      1 row       1 col     (numeric)
          1
 S      1 row      41 cols    (numeric)
  statement : ASSIGN at line 5035 column 99
  traceback : module BIPLOT at line 5035 column 99
 ERROR: (execution) Invalid argument or operand; contains missing values.

 

See my previous post for an example that is easier to analyze.

Rick_SAS
SAS Super FREQ

A few thoughts:

1. It appears that you copied the code from https://blogs.sas.com/content/iml/2019/11/13/create-biplots-sas.html It is always helpful if you cite references so that others can see where the code came from and read the accompanying discussion.

2. Your first mistake is that you didn't add an ID variable to your data set. Re-read the blog post to see how to add an ID variable.

3. The second problem is that three of your variables are constant. Freidnly's %BIPLOT macro does not handle constant variables, so you must remove them from the analysis.

 

%let VarNames = StC NA SP PGH BH LC LS LP NFA FP CC AC SE MS 
                CP CM AS FCI FCM FS FSPA NBF FSBE FBEA 
                FC FSr SC 
                NSF GU PH MLL MLW PHF CWF FL FW FWt FT FPP 
                DFt DFl DFF TSWt FPK Yd;
proc means data=chili;
var &VarNames;
run;

/* Note that the MS, FBEA, and SC variables are constant.
   You need to exclude those variables.
*/
%let VarNames = StC NA SP PGH BH LC LS LP NFA FP CC AC SE 
                CP CM AS FCI FCM FS FSPA NBF FSBE 
                FC FSr 
                NSF GU PH MLL MLW PHF CWF FL FW FWt FT FPP 
                DFt DFl DFF TSWt FPK Yd;

%let FACTYPE = SYM;   /* options are GH, COV, JK, SYM */
title "Biplot: &FACTYPE, STD";
%biplot(data=chili, 
        var=&VarNames, 
        id=id,
        factype=&FACTYPE,  /* GH, COV, JK, SYM */
        std=std,           /* NONE, MEAN, STD  */
        scale=1,           /* if you do not specify SCALE=1, vectors are auto-scaled */
        out=biplotFriendly,/* write SAS data set with results */ 
        symbols=circle dot, inc=1);
 
/* transpose from long to wide */
data Biplot;
set biplotFriendly(where=(_TYPE_='OBS') rename=(dim1=Prin1 dim2=Prin2 _Name_=_ID_))
    biplotFriendly(where=(_TYPE_='VAR') rename=(dim1=vx dim2=vy _Name_=_Variable_));
run;
 
proc sgplot data=Biplot aspect=1 noautolegend;
   refline 0 / axis=x; refline 0 / axis=y;
   scatter x=Prin1 y=Prin2 / datalabel=_ID_;
   vector  x=vx    y=vy    / datalabel=_Variable_
                             lineattrs=GraphData2 datalabelattrs=GraphData2;
   xaxis grid offsetmin=0.1 offsetmax=0.2;
   yaxis grid;
run;
Ruwan
Calcite | Level 5
data chili;
input Acc $6. StC NA SP PGH BH LC LS LP NFA FP CC AC SE MS CP CM AS FCI FCM FS FSPA NBF FSBE FBEA FC FSr SC NSF GU PH MLL MLW PHF CWF FL FW FWt FT FPP DFt DFl DFF TSWt FPK Yd;
datalines;
000210 2 5 7 7 3 3 3 5 1 5 1 3 7 0 0 2 0 3 8 1 2 0 1 1 3 2 1 3 2 42.7 5.8 1.6 28.9 18.1 5.8 1.1 49.3 0.1 23.1 74.0 33.0 44.0 3.9 500.0 23.0
000557 2 3 5 7 5 3 3 5 1 5 1 3 7 0 0 2 0 3 8 3 3 0 4 1 5 2 1 2 2 41.0 5.5 1.8 26.5 18.3 66.7 2.0 108.5 0.2 22.1 65.0 27.0 34.0 2.7 200.0 22.0
000692 2 5 3 7 7 3 3 3 1 5 1 3 7 0 0 2 0 2 8 1 2 0 1 1 3 2 1 2 2 39.2 5.9 1.9 28.6 16.4 8.6 1.0 124.0 0.1 50.7 33.0 39.0 65.0 3.1 413.0 51.0
001301 2 7 5 5 5 3 3 3 2 5 1 3 7 0 0 2 0 3 8 1 2 0 1 1 5 2 1 3 2 46.5 5.9 2.0 28.1 19.0 7.4 0.9 147.0 0.1 60.9 32.0 40.0 74.0 8.4 350.0 61.0
001785 2 7 5 5 7 3 2 5 1 5 1 5 7 0 0 3 0 3 9 3 3 0 1 1 5 2 1 3 2 50.8 5.0 1.6 27.9 22.5 9.0 2.4 247.5 0.1 47.0 29.0 35.0 6.0 3.6 100.0 47.0
008149 2 5 7 7 7 3 3 3 1 5 1 3 7 0 0 2 0 3 9 1 1 0 1 1 3 2 1 2 2 40.7 5.4 2.0 27.6 18.7 6.2 0.7 98.8 0.1 80.0 29.0 38.0 74.0 2.4 810.0 80.0
008220 2 5 3 7 3 3 2 3 1 5 1 3 7 0 0 2 0 3 9 1 2 0 1 1 5 2 1 3 2 46.0 6.2 2.3 26.0 17.5 10.0 1.1 115.5 0.1 32.6 33.0 40.0 66.0 4.2 280.0 33.0
008228 2 7 3 7 7 4 3 3 1 7 1 3 7 0 0 2 0 3 9 1 3 0 1 1 3 2 1 3 2 53.3 10.2 5.5 32.5 24.8 9.6 2.9 244.5 0.3 22.5 27.0 34.0 55.0 8.1 60.0 23.0
008230 2 5 7 5 7 3 3 7 1 5 1 3 7 0 0 2 0 3 9 1 2 0 1 1 3 2 1 3 2 37.3 5.6 1.8 23.3 18.5 6.9 0.9 114.8 0.1 48.2 29.0 38.0 74.0 4.3 419.0 48.0
001674 2 7 5 7 7 3 3 3 1 7 1 5 7 0 0 2 0 2 8 1 1 0 1 1 7 3 1 2 2 34.3 4.5 1.7 29.0 17.5 9.7 0.7 143.5 0.1 66.4 32.0 38.0 74.0 5.9 460.0 66.0
005867 2 3 5 7 5 3 3 5 1 5 1 3 7 0 0 2 0 3 8 1 2 0 1 1 7 2 1 3 2 37.2 4.1 1.8 28.8 18.0 7.7 0.8 86.8 0.1 39.5 32.0 39.0 74.0 4.0 455.0 40.0
016132 1 1 5 7 5 3 2 7 2 7 4 3 7 0 0 3 0 2 8 1 2 0 1 1 5 2 1 1 2 35.8 5.0 2.3 21.9 16.5 3.2 0.8 51.9 0.1 42.3 55.0 60.0 100.0 5.8 815.0 42.0
016395 2 5 5 7 5 4 3 5 1 3 1 5 7 0 0 2 1 2 6 3 5 0 3 1 5 2 1 3 3 33.9 5.2 2.2 26.7 20.6 8.3 3.7 211.5 0.3 16.3 29.0 34.0 55.0 3.8 55.0 16.0
016396 2 5 7 7 5 4 1 7 1 3 1 5 7 0 0 2 0 2 6 3 4 0 2 1 5 2 1 3 2 40.9 4.9 2.1 28.3 21.1 9.6 4.0 267.5 0.3 13.7 26.0 34.0 55.0 6.1 40.0 14.0
016400 2 7 5 7 7 3 2 3 1 5 1 3 7 0 0 2 0 3 8 3 3 0 1 1 5 2 1 2 2 33.1 5.5 2.0 25.3 19.0 4.8 0.9 75.0 0.1 36.9 29.0 35.0 74.0 6.3 528.0 37.0
016560 2 7 5 7 7 3 3 3 1 5 1 3 7 0 0 2 0 3 8 1 2 0 1 1 3 2 1 3 2 34.3 5.1 1.8 25.0 19.0 8.4 0.9 126.5 0.1 48.2 20.0 34.0 65.0 4.1 384.0 48.0
016586 1 1 5 7 5 3 2 3 1 7 4 4 7 0 0 2 0 2 8 4 3 0 1 1 7 3 1 2 3 40.4 5.0 2.1 22.0 22.3 4.3 2.0 135.2 0.2 49.8 32.0 48.0 74.0 3.9 368.0 50.0
016588 2 7 7 7 5 3 3 5 1 5 1 3 7 0 0 3 0 4 9 5 4 0 3 1 7 3 1 2 2 35.1 5.6 2.0 28.9 21.7 4.6 1.8 90.8 0.1 27.8 36.0 44.0 74.0 5.1 306.0 28.0
016596 2 5 5 7 5 3 1 7 2 5 4 5 7 0 0 3 1 3 8 3 2 0 1 1 5 3 1 2 2 40.4 5.9 2.1 23.3 20.8 4.6 1.2 67.5 0.1 33.5 49.0 60.0 82.0 3.0 490.0 34.0
016597 1 1 3 7 5 3 2 3 3 5 4 5 7 0 0 3 0 4 8 4 4 0 4 1 7 3 1 3 2 36.0 7.1 2.7 26.7 21.1 4.0 2.0 66.1 0.2 30.5 50.0 54.0 82.0 4.5 461.0 31.0
016599 1 1 5 7 5 3 2 7 2 7 4 3 7 0 0 2 0 2 9 3 3 0 1 1 5 2 1 1 2 54.5 5.4 2.4 35.6 20.8 2.5 0.8 30.1 0.1 55.5 48.0 60.0 114.0 4.2 1500.0 56.0
016600 2 5 7 5 7 3 3 7 1 5 1 3 7 0 0 2 0 3 8 1 2 1 4 1 5 3 1 3 2 41.3 6.5 2.3 24.3 19.8 14.2 1.7 179.0 0.1 76.0 16.0 34.0 55.0 6.7 420.0 76.0
016601 2 7 3 7 7 3 3 3 2 5 1 5 7 0 0 3 0 3 9 3 3 0 1 1 3 2 1 3 2 47.8 5.9 2.0 27.9 19.6 5.5 1.8 131.0 0.1 46.5 29.0 34.0 65.0 6.6 380.0 47.0
016603 3 3 5 7 5 7 2 3 2 7 4 5 7 0 0 2 1 3 8 4 2 0 1 1 7 3 1 1 2 53.2 8.8 4.4 32.5 27.2 5.6 1.7 96.2 0.1 40.3 41.0 51.0 74.0 4.1 418.0 40.0
016604 2 7 7 5 7 3 3 5 1 5 1 3 7 0 0 2 0 3 9 1 2 0 1 1 3 2 1 3 2 56.5 5.9 2.0 367.0 27.8 7.6 1.6 161.9 0.1 36.5 34.0 44.0 65.0 2.0 225.0 36.0
016609 2 3 5 5 7 3 3 3 2 3 1 5 7 0 0 3 0 3 8 1 1 1 3 1 3 2 1 3 2 65.5 7.4 2.8 38.1 21.6 9.0 0.8 153.0 0.1 48.6 34.0 38.0 65.0 4.7 317.0 49.0
0000c1 2 7 7 7 5 7 3 7 2 7 5 5 7 0 1 3 1 7 9 1 2 1 1 1 3 2 1 3 2 65.4 8.9 3.1 44.7 27.7 9.1 1.5 147.5 0.1 39.1 36.0 44.0 72.0 4.2 265.0 39.0
0000c2 2 7 5 7 5 3 2 3 1 7 4 3 7 0 0 2 0 3 9 4 4 0 4 1 7 3 1 2 2 38.0 6.4 2.1 30.3 27.6 4.4 2.2 94.2 0.1 35.2 55.0 59.0 79.0 3.2 373.0 35.0
0000c3 1 1 5 5 5 3 2 7 2 7 2 3 7 0 0 2 0 3 8 1 2 0 1 1 5 2 1 1 2 40.9 5.7 2.3 25.9 21.1 3.4 0.8 43.0 0.1 46.0 42.0 59.0 114.0 5.9 820.0 46.0
0000c4 2 7 7 7 3 7 1 7 1 5 8 5 7 0 0 2 1 6 9 5 3 0 4 1 3 2 1 3 2 70.7 7.5 2.8 35.7 19.2 6.4 2.1 85.0 0.2 19.3 39.0 45.0 72.0 2.9 227.0 19.0
0000c5 2 7 5 5 7 4 1 5 2 5 2 3 7 0 0 2 0 4 8 1 2 0 1 1 3 2 1 1 2 35.1 5.7 2.0 26.6 24.6 4.8 1.4 45.1 0.2 24.8 38.0 51.0 79.0 2.9 550.0 25.0
0000c6 2 7 7 7 5 7 3 7 1 7 5 5 7 0 0 3 1 6 9 1 2 0 1 1 3 2 1 3 2 60.4 7.2 2.6 32.3 18.2 7.6 1.3 169.0 0.1 70.3 34.0 39.0 72.0 2.9 415.0 70.0
0000c7 2 5 3 5 7 3 1 3 3 7 4 3 7 0 0 2 0 3 8 5 4 0 3 1 7 2 1 2 2 37.1 7.2 3.1 24.3 24.0 3.7 2.4 77.0 0.2 28.8 39.0 51.0 79.0 6.6 374.0 29.0
0000c8 2 1 3 7 3 3 1 3 1 5 4 5 7 0 0 2 0 3 8 4 3 0 3 1 7 3 1 2 2 38.9 10.0 4.0 26.3 25.4 3.9 1.7 87.3 0.1 39.1 36.0 60.0 114.0 5.2 400.0 39.0
0013c7 2 7 5 7 7 3 3 5 1 7 1 3 7 0 0 2 0 3 8 1 2 0 1 1 3 2 1 3 2 50.4 6.3 2.1 33.2 18.8 8.3 1.4 152.0 0.1 40.8 17.0 27.0 55.0 8.0 249.0 41.0
0017c8 2 7 7 7 5 3 2 7 1 5 1 5 7 0 0 2 0 2 6 1 3 0 1 1 5 3 1 3 2 42.8 6.2 2.0 28.6 17.6 10.8 2.0 178.0 0.2 23.2 32.0 38.0 55.0 2.3 100.0 23.0
0058c0 2 7 5 7 7 3 2 3 2 5 1 5 7 0 0 1 0 3 8 5 2 0 4 1 5 2 1 2 2 44.7 10.3 3.7 33.7 21.7 9.0 1.4 166.7 0.2 33.0 36.0 40.0 66.0 4.2 198.0 33.0
0058c6 2 7 5 5 5 3 1 7 1 5 9 2 3 0 0 3 0 3 6 4 3 0 4 1 7 3 1 3 2 53.0 6.2 2.8 32.0 23.7 5.8 2.8 78.3 0.2 8.0 36.0 40.0 66.0 5.0 102.0 8.0
;
%let VarNames = StC NA SP PGH BH LC LS LP NFA FP CC AC SE MS 
                CP CM AS FCI FCM FS FSPA NBF FSBE FBEA 
                FC FSr SC 
                NSF GU PH MLL MLW PHF CWF FL FW FWt FT FPP 
                DFt DFl DFF TSWt FPK Yd;
proc means data=chili;
var &VarNames;
run;

/* Note that the MS, FBEA, and SC variables are constant.
   You need to exclude those variables.
*/
%let VarNames = StC NA SP PGH BH LC LS LP NFA FP CC AC SE 
                CP CM AS FCI FCM FS FSPA NBF FSBE 
                FC FSr 
                NSF GU PH MLL MLW PHF CWF FL FW FWt FT FPP 
                DFt DFl DFF TSWt FPK Yd;

%let FACTYPE = SYM;   /* options are GH, COV, JK, SYM */
title "Biplot: &FACTYPE, STD";
%biplot(data=chili, 
        var=&VarNames, 
        id=id,
        factype=&FACTYPE,  /* GH, COV, JK, SYM */
        std=std,           /* NONE, MEAN, STD  */
        scale=1,           /* if you do not specify SCALE=1, vectors are auto-scaled */
        out=biplotFriendly,/* write SAS data set with results */ 
        symbols=circle dot, inc=1);
 
/* transpose from long to wide */
data Biplot;
set biplotFriendly(where=(_TYPE_='OBS') rename=(dim1=Prin1 dim2=Prin2 _Name_=_ID_))
    biplotFriendly(where=(_TYPE_='VAR') rename=(dim1=vx dim2=vy _Name_=_Variable_));
run;
 
proc sgplot data=Biplot aspect=1 noautolegend;
   refline 0 / axis=x; refline 0 / axis=y;
   scatter x=Prin1 y=Prin2 / datalabel=_ID_;
   vector  x=vx    y=vy    / datalabel=_Variable_
                             lineattrs=GraphData2 datalabelattrs=GraphData2;
   xaxis grid offsetmin=0.1 offsetmax=0.2;
   yaxis grid;
run;

Sir, I tried with your codes. Still I couldn't get the results. Could you please check what's wrong with It?  

Rick_SAS
SAS Super FREQ

You did not follow my instructions. You need to add an ID variable, which is not currently in your data set. Alternatively, use ID=Acc, if that is your ID variable.

 

%biplot(data=chili, 
        var=&VarNames, 
        id=Acc,
        factype=&FACTYPE,  /* GH, COV, JK, SYM */
        std=std,           /* NONE, MEAN, STD  */
        scale=1,           /* if you do not specify SCALE=1, vectors are auto-scaled */
        out=biplotFriendly,/* write SAS data set with results */ 
        symbols=circle dot, inc=1);

 

 

Ruwan
Calcite | Level 5

Thank you Sir. I got it. thanks again.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 13 replies
  • 797 views
  • 2 likes
  • 4 in conversation