14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

400 <strong>Scripting</strong> Graphs Chapter 12<br />

Graphing Elements<br />

Figure 12.6 Egg Carton Function<br />

Normal Contour draws normal probability contours for k populations and two variables. The first<br />

argument is a scalar probability or a matrix of probability values for the contours, and subsequent arguments<br />

are matrices to specify means, standard deviations, and correlations. The mean and standard deviation<br />

matrices have dimension k × 2 . The correlation matrix should be k × 1 , where the first row pertains to the<br />

first contour, the second row to the second contour, and so on. The first column is for x and the second<br />

column for y. For example:<br />

Normal Contour(<br />

[ prob1,<br />

prob2,<br />

prob3, ...],<br />

[ xmean1 ymean1,<br />

xmean2 ymean2,<br />

xmean3 ymean3, ...],<br />

[ xsd1 ysd1,<br />

xsd2 ysd2,<br />

xsd3 ysd3, ...],<br />

[ xycorr1,<br />

xycorr2,<br />

xycorr3, ...]);<br />

The following script draws contours at probabilities 0.1, 0.5, 0.7, and 0.99 for two populations and two<br />

variables. The first population has x mean 0 and y mean 1, with standard deviation 0.3 along the x axis and<br />

0.6 along the y-axis, and with correlation 0.5. The second has x mean 4 and y mean 6, with standard<br />

deviation 0.8 along the x axis and 0.4 along the y-axis, and with correlation 0.9.<br />

New Window( "Normal contours",<br />

Graph Box(<br />

X Scale( -5, 10 ),<br />

Y Scale( -5, 10 ),<br />

Normal Contour( [.1, .5, .7, .99], [0 1, 4 6], [.3 .6, .8 .4], [.5, .9] )

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!