* * Analysis and graphics of Anscombe's data, pp 50-52 * all 11 open data anscombe.dat data(format=prn,org=columns) * * SPGRAPH (Special Purpose GRAPH) is used for a variety of specialty graphs. * Here, it is used to make a 2x2 array of graphs. HFIELDS and VFIELDS specify the * number of horizontal and vertical fields on the page. The SCATTER instructions * then fill in the panes (by default, working down by columns, which is why this * does the third before the second). The SPGRAPH(DONE) instruction at the end * means that the full page of graphs is finished and can be displayed. * * The LINES option on the SCATTER instruction is used to draw straight lines. * lines=%beta draws a line with intercept %beta(1) and slope %beta(2). * spgraph(hfields=2,vfields=2,footer="Figure 3.1 Anscombe's Quartet: Bivariate Scatterplots") linreg yone # constant xone scatter(hlabel="X1",vlabel="Y1",lines=%beta) # xone yone linreg ythree # constant xthree scatter(hlabel="X3",vlabel="Y3",lines=%beta) # xthree ythree linreg ytwo # constant xtwo scatter(hlabel="X2",vlabel="Y2",lines=%beta) # xtwo ytwo linreg yfour # constant xfour scatter(hlabel="X4",vlabel="Y4",lines=%beta) # xfour yfour spgraph(done)