Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Understanding Biplots
Understanding Biplots
Understanding Biplots
Ebook817 pages5 hours

Understanding Biplots

Rating: 5 out of 5 stars

5/5

()

Read preview

About this ebook

Biplots are a graphical method for simultaneously displaying two kinds of information; typically, the variables and sample units described by a multivariate data matrix or the items labelling the rows and columns of a two-way table. This book aims to popularize what is now seen to be a useful and reliable method for the visualization of multidimensional data associated with, for example, principal component analysis, canonical variate analysis, multidimensional scaling, multiplicative interaction and various types of correspondence analysis.

Understanding Biplots:

• Introduces theory and techniques which can be applied to problems from a variety of areas, including ecology, biostatistics, finance, demography and other social sciences.

• Provides novel techniques for the visualization of multidimensional data and includes data mining techniques.

• Uses applications from many fields including finance, biostatistics, ecology, demography.

• Looks at dealing with large data sets as well as smaller ones.

• Includes colour images, illustrating the graphical capabilities of the methods.

• Is supported by a Website featuring R code and datasets.

Researchers, practitioners and postgraduate students of statistics and the applied sciences will find this book a useful introduction to the possibilities of presenting data in informative ways.

LanguageEnglish
PublisherWiley
Release dateFeb 23, 2011
ISBN9781119972907
Understanding Biplots

Related to Understanding Biplots

Related ebooks

Mathematics For You

View More

Related articles

Reviews for Understanding Biplots

Rating: 5 out of 5 stars
5/5

1 rating0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Understanding Biplots - John C. Gower

    Title Page

    This edition first published 2011

    © 2011 John Wiley & Sons, Ltd

    Registered office

    John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West Sussex, PO19 8SQ, United Kingdom

    For details of our global editorial offices, for customer services and for information about how to apply for permission to reuse the copyright material in this book please see our website at www.wiley.com.

    The right of the author to be identified as the author of this work has been asserted in accordance with the Copyright, Designs and Patents Act 1988.

    All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, except as permitted by the UK Copyright, Designs and Patents Act 1988, without the prior permission of the publisher.

    Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books.

    Designations used by companies to distinguish their products are often claimed as trademarks. All brand names and product names used in this book are trade names, service marks, trademarks or registered trademarks of their respective owners. The publisher is not associated with any product or vendor mentioned in this book. This publication is designed to provide accurate and authoritative information in regard to the subject matter covered. It is sold on the understanding that the publisher is not engaged in rendering professional services. If professional advice or other expert assistance is required, the services of a competent professional should be sought.

    Library of Congress Cataloguing-in-Publication Data

    Gower, John.

    Understanding biplots / John Gower, Sugnet Lubbe, Niel le Roux.

    p. cm.

    Includes bibliographical references and index.

    ISBN 978-0-470-01255-0 (cloth)

    1. Multivariate analysis–Graphic methods. 2. Graphical modeling (Statistics) I. Lubbe, Sugnet, 1973- II. le Roux, Niel. III. Title.

    QA278.G685 2010

    519.5′35–dc22

    2010024555

    A catalogue record for this book is available from the British Library.

    Print ISBN: 978-0-470-01255-0

    ePDF ISBN: 978-0-470-97320-2

    oBook ISBN: 978-0-470-97319-6

    Preface

    This book grew from an earlier book, Biplots (Gower and Hand, 1996), the first monograph on the subject of biplots, written in a fairly concentrated and not easily understood style. Colleagues tactfully suggested that there was a need for a friendlier book on biplots. This book is our response. Although it covers similar ground to the Gower and Hand (1996) book, it omits some topics and adds others. No attempt has been made to be encyclopedic and many biplot methods, especially those concerned with three-way tables, are totally ignored.

    Our aims in writing this book have been threefold: first, to provide the geometric background, which is essential for understanding, together with its algebraic manifestations, which are essential for writing computer programs; second, to provide a wealth of illustrative examples drawn from a wide variety of fields of application, illustrating different representatives of the biplot family; and third, to provide computer functions written in R that allow routine multivariate descriptive methods to be easily used, together with their associated biplots. It also provides additional tools for those wishing to work interactively and to develop their own extensions.

    We hope that research workers in the applied sciences will find the book a useful introduction to the possibilities for presenting certain types of data in informative ways and give them the background to make valid interpretations. Statisticians may find it of interest both as a source of potential research projects and useful examples.

    This project has taken longer than we had planned and we are keenly aware that some topics remain less friendly than we might have hoped. We thank Kathryn Sharples, Susan Barclay, Richard Davies, Heather Kay and Prachi Sinha-Sahay at Wiley for both their forbearance and support. We also thank our long-suffering spouses, Janet, Pieter and Magda, if not for their active support, then at least for their forbearance.

    John Gower

    Sugnet Lubbe

    Niël le Roux

    www.wiley.com/go/biplots

    Chapter 1

    Introduction

    Biplots have been with us at least since Descartes, if not from the time of Ptolemy who had a method for fixing the map positions of cities in the ancient world. The essential ingredients are coordinate axes that give the positions of points. From the very beginning, the concept of distance was central to the Cartesian system, a point being fixed according to its distance from two orthogonal axes; distance remains central to much of what follows. Descartes was concerned with how the points moved in a smooth way as parameters changed, so describing straight lines, conics and so on. In statistics, we are interested also in isolated points presented in the form of a scatter diagram where, typically, the coordinate axes represent variables and the points represent samples or cases. Cartesian geometry soon developed three-dimensional and then multidimensional forms in which there are many coordinate axes. Although two-dimensional scatter diagrams are invaluable for showing data, multidimensional scatter diagrams are not. Therefore, statisticians have developed methods for approximating multidimensional scatter in two, or perhaps three, dimensions. It turns out that the original coordinate axes can also be displayed as part of the approximation, although inevitably they lose their orthogonality. The essential property of all biplots is the two modes, such as variables and samples. For obvious reasons, we shall be concerned mainly with two-dimensional approximations but should stress at the outset that the bi- of biplots refers to the two modes and not the usual two dimensions used for display.

    Biplots, not necessarily referred to by name, have been used in one form or another for many years, especially since computer graphics have become readily available. The term ‘biplot’ is due to Gabriel (1971) who popularized versions in which the variables are represented by directed vectors. Gower and Hand (1996) particularly stressed the advantages of presenting biplots with calibrated axes, in much the same way as for conventional coordinate representations. A feature of this book is the wealth of examples of different kinds of biplots. Although there are many novel ideas in this book, we acknowledge our debts to many others whose work is cited either in the current text or in the bibliography of Gower and Hand (1996).

    1.1 Types of Biplots

    We may distinguish two main types of biplot:

    asymmetric (biplots giving information on sample units and variables of a data matrix);

    symmetric (biplots giving information on rows and columns of a two-way table).

    In symmetric biplots, rows and columns may be interchanged without loss of information, while in asymmetric biplots variables and sample units are different kinds of object that may not be interchanged.

    Consider the data on four variables measured on 21 aircraft in Table 1.1. The corresponding biplot in Figure 1.1 represents the 21 aircraft as sample points and the four variables as biplot axes. It will not be sensible to exchange the two sets, representing the aircraft as continuous axes and the variables as points. Next, consider the two-way table in Table 1.2. Exchanging the rows and columns of this table will have no effect on the information contained therein. For such a symmetric data set, both the rows and columns are represented as points as shown in Figure 1.2. Details on the construction of these biplots are deferred to later chapters.

    Table 1.1 Values of four variables, SPR (specific power, proportional to power per unit weight), RGF (flight range factor), PLF (payload as a fraction of gross weight of aircraft) and SLF (sustained load factor), for 21 aircraft labelled in column 2. From Cook and Weisberg (1982, Table 2.3.1), derived from 1979 RAND Corporation report.

    NumberTable

    Figure 1.1 Principal component analysis biplot according to the Gower and Hand (1996) representation.

    1.1

    Table 1.2 Species × Temperature two-way table of percentage cellulose measured in wood pulp from four species after a hot water wash.

    NumberTable

    Figure 1.2 Biplot for a two-way table representing Species × Temperature.

    1.2

    We shall see that this distinction between symmetric and asymmetric biplots affects what is permissible in the construction of a biplot. Within this broad classification, other major considerations are:

    the types of variable (quantitative, qualitative, ordinal, etc.);

    the method used for displaying samples (multidimensional scaling and related methods);

    what the biplot display is to be used for (especially for prediction or for interpolation).

    The following can be represented in an asymmetric biplot:

    distances between samples;

    relationships between variables;

    inner products between samples and variables.

    However, only two of these characteristics can be optimally represented in a single biplot. In the simple biplot in Figure 1.1 all the calibration scales are linear with evenly spaced calibration points. Other types of scale are possible and we shall meet them later in other types of biplots. Figure 1.3 shows the main possibilities.

    Figure 1.3 Different types of scale. (a) A linear scale with equally spaced calibration as used in principal component analysis. (b) A linear scale with logarithmic calibration. (c) A linear scale with irregular calibration. (d) A curvilinear scale with irregular calibration. (e) A linear scale for an ordered categorical variable. (f) Linear regions for ordered categorical variables (g) A categorical variable, colour, defined over convex regions.

    1.3

    Figure 1.3(a) is the familiar equally spaced calibration of a linear axis that we have already met in Figure 1.1. Figure 1.3(b) shows logarithmic calibration of a linear axis; this is an example of regular but unequally spaced calibration. In Figure 1.3(c) the axis remains linear but the calibrations are irregularly spaced. In Figure 1.3(d) the axis is nonlinear and calibrations are irregularly spaced; in principle, nonlinear axes could have equally spaced calibrations or regularly space calibrations, but in practice such combinations are unlikely. Figure 1.3(e) shows an ordered categorical variable, size, not recorded numerically but only as small, medium and big. The calibration is indicated as a set of correctly ordered markers on a linear axis, but this is shown as a dotted line to indicate that intermediate markers are undefined (i.e. interpolation is not permitted). In Figure 1.3(f) the ordered categorical variable size is represented by linear regions; all samples in a region are associated with that level of size. Figure 1.3(g) shows an unordered categorical variable, colour, with five levels: blue, green, yellow, orange and red. These levels label convex regions. In general, the levels of unordered categorical variables may be represented by convex regions in many dimensions. Examples of these calibrations occur throughout the book.

    1.2 Overview of the Book

    The basic steps for constructing many asymmetric biplots are summarized in Figure 1.4. Starting from a data matrix X, first we calculate a distance matrix D: n × n. The essence of the methodology is approximating the distance matrix D by a matrix of Pythagorean distances Δ: n × n. Operationally, this is achieved iteratively by updating r-dimensional coordinates Y, that generate Δ, to improve the approximation to D. It is hoped that a small choice of r (hopefully 2) will give a good approximation. Finally, the curved arrow represents two ideas: (i) in principal component analysis (PCA) Y approximates X; and (ii) more generally, information on X can be represented in the map of Y (the essence of biplots). These are the basic steps of multidimensional scaling (see Cox and Cox, 2001).

    Figure 1.4 Construction of an asymmetric biplot.

    1.4

    In general, the points given by Y generate distances in Δ that approximate the values in D. In addition, and this is the special contribution of biplots, approximations to the true values X may be deduced from Y. In the simplest case, the PCA biplot, this approximation is made by projecting the orthogonal axes of X onto a subspace occupied by Y. In the subsequent chapters, we will discuss more general forms of asymmetric biplots. The most general of these, appropriately named the generalized biplot, has as special case the PCA biplot when all variables in X are continuous and the matrix D consists of Pythagorean distances. When restricting the variables in X to be continuous only, the rows of X represent the samples as points in p-dimensional space with an associated coordinate system. In the biplot, we represent the samples as points whose coordinates are given by the rows of Y and the coordinate system of X by appropriately defined biplot axes. These axes become nonlinear biplot trajectories when the definition of distance in the matrix D necessitates a nonlinear transformation from X to Y. The methodology outlined by Figure 1.4 allows us to also include categorical variables. Even though a categorical variable cannot be represented in the space of X by a linear coordinate axis, we can calculate the matrix D and proceed from there.

    Thus, a biplot adds to Y information on the variables given in X. In multidimensional scaling, D may be observed directly and not derived from X, and then biplots cannot be constructed. The different types of asymmetric biplots discussed above depend on the properties of the variables in the matrix X and the distance metric producing the matrix D. Many special cases of importance fall within this general framework and are illustrated by applications in the following chapters. Several definitions of distance used in constructing D occur using both quantitative and qualitative variables (or mixtures of the two). For symmetric biplots, the position is simpler as we have only two main possibilities: (i) a quantitative variable classified in a two-way table and (ii) a two-way table of counts.

    In Figure 1.5 the biplots to be discussed in the designated chapters are represented diagrammatically. The distances associated with the matrix D in Figure 1.4 is divided into subsets for the different types of biplots. The matrix Δ always consists of Pythagorean distances to allow intuitive interpretation of the rows of Y.

    Figure 1.5 Summary of the different types of biplots discussed in subsequent chapters.

    1.5

    In a symmetric biplot, rows and columns have equal status and we aim to find two sets of coordinates A and B, one for the rows and one for the columns respectively. Now, the main interest is in the inner product AB′ and there is less interest in distance interpretations. A popular version of correspondence analysis (CA) approximates chi-squared distance, treating either the rows or columns as if they were ‘variables’ and thus giving two asymmetric biplots, not linked by a useful inner product. This form of CA is not a biplot and is sometimes referred to as a joint plot (see also Figure 10.4); other forms of CA do treat X symmetrically.

    1.3 Software

    A library of functions has been developed in the R language (R Development Core Team, 2009) and is available on the website www.wiley.com/go/biplots. Throughout this book reference will be made to the functions associated with the biplots being discussed. Examples of the commands to reproduce the figures in this book are given in the text. Sections are also included with specific information about the core functions needed for the different types of biplots.

    1.4 Notation

    Matrices are used extensively to enable the mathematically inclined reader to understand the algebra behind the different biplots. Bold upper-case letters indicate matrices and bold lower-case letters indicate vectors. Any column vector x: p × 1 when presented as a row vector will be denoted by x′:1 × p. The following symbols are used extensively throughout the text:

    The notion of distance is discussed in Chapter 5. Here we mention two concepts which the reader will need throughout the book. Pythagorean distance is the ordinary Euclidean distance between two samples xi and xj with

    equation

    Any distance metric that can be embedded in a Euclidean space is termed Euclidean embeddable.

    1.4.1 Acronyms

    Chapter 2

    Biplot Basics

    In accordance with our aim of understanding biplots, the focus in this chapter is to look at biplot basics from the viewpoint of an ordinary scatterplot.

    The chapter begins by introducing two- and three-dimensional biplots as ordinary scatterplots of two or three variables. In Section 2.2 biplots are considered as extensions of the ordinary scatterplot by providing for more than three variables. Generalizing, a biplot provides for a graphical display, in at most three dimensions, of data that typically exist in a higher-dimensional space. The concept of approximating a data matrix is thus crucial in biplot methodology. Subsequent sections explore how to represent multidimensional sample points in a biplot, how to equip the biplot with calibrated axes representing the variables and how to refine the biplot display. Emphasis is placed on how to use biplot axes analogously to axes in a scatterplot, that is, for adding new samples to the plot (interpolation) and reading off for any sample point its values for the different variables (prediction). It is then shown how to use a regression method for adding new variables to the plot. Various enhancements to configurations of sample points in a biplot, including how to describe large data sets, are discussed next. Finally, some examples are given, together with the R code for constructing all the graphical displays shown in the chapter. We strongly suggest that readers work through these examples for a thorough understanding of the basics of biplot construction. In later chapters, we provide only the function calls to more elaborate R functions for fine-tuning the various types of biplot.

    2.1 A Simple Example Revisited

    The data of Table 1.1 are available in the accompanying R package UBbipl in the form of the dataframe aircraft.data. We first convert columns 3 to 6 to a data matrix, aircraft.mat, with row names the first column of Table 1.1 and column names the abbreviations used for the variables in Table 1.1. This is done by issuing the following instructions from the R prompt:

    > aircraft.mat <- aircraft.data[, 2:5]

    > aircraft.mat

          SPR  RGF   PLF  SLF

      a 1.468 3.30 0.166 0.10

      b 1.605 3.64 0.154 0.10

      .......................

      v 7.105 5.40 0.089 3.20

      w 8.548 4.20 0.222 2.90

    Next, we construct a scatterplot of the two variables SPR and RGF with the instructions:

    > plot(x = aircraft.mat[,1], y = aircraft.mat[,2], xlab = ,  

      ylab = , xlim = c(0,10), ylim = c(2,6), pch = 15,  

      col = green, yaxp = c(2,6,4), bty = n)

    > text(x = aircraft.mat[,1], y = aircraft.mat[,2], 

      labels = dimnames(aircraft.mat)[[1]], pos = 1)

    > mtext(RGF, side = 2, at = 6.4, line = -0.35)

    > mtext(SPR, side = 1, at = 10.4, line = -0.50)

    The scatterplot in Figure 2.1 is an example of what is probably the simplest form of an asymmetric biplot. It shows a plot of the columns SPR and RGF, giving performance figures for power and range of the 21 types of aircraft introduced in Table 1.1. It is a scatterplot of two variables referred to orthogonal axes. The familiar elements of Figure 2.1 are:

    points representing the aircraft;

    a directed line for each of the variables, known as a coordinate axis, with its label;

    scales marked on the axes giving the values of the variables.

    Figure 2.1 Scatterplot of variables SPR and RGF from the aircraft data in Table 1.1: (top) constructed with default settings; (bottom) constructed with an aspect ratio of unity.

    2.1

    Note also the convention followed of labelling the axes at the end where the calibrations are at their highest values. It is an asymmetric biplot because it gives information of two types, (i) concerning the 21 aircraft and (ii) concerning the two variables, which cannot be interchanged. When a point representing an aircraft is projected orthogonally onto an axis, one may read off the value of the corresponding variable and this will agree precisely with the value given in Table 1.1. Indeed, this is not surprising, because the values of the variables were those used in the first place to construct the coordinate positions of the points. Notice the difference between the top and bottom panels of Figure 2.1. Which of k and n is nearest to j? From the top panel, it appears to be n, but a simple calculation shows the true distances to be

    equation

    so that k is nearer to n, as is correctly displayed in the bottom panel. This example clearly demonstrates how one can go seriously wrong by constructing biplots that do not respect the aspect ratio. An aspect ratio of unity is not necessary for the validity of reading the scales by projection but, in much of what follows, we shall see that the relative scaling (or aspect ratio) of axes is crucial. The scatterplot in the bottom panel of Figure 2.1 has an aspect ratio of one. The call to the plot function to reproduce this scatterplot requires asp = 1 instead of the asp default. The window for plotting is then set up so that one data unit in the x direction is equal in length to one data unit in the y direction. If this precaution is not taken when constructing biplots the inter-point distances in the biplot are distorted.

    Figure 2.1 happens to be in two dimensions, but this is not necessary for a biplot. Indeed, if we make a three-dimensional Cartesian plot of the first three variables, this too would be a biplot (see Figure 2.2). The three-dimensional biplot in Figure 2.2 can be obtained by first using the following code and then interactively rotating and zooming the biplot to the desired view by using the left and right mouse buttons, respectively.

    > library(rgl)

    > open3d()

    > view3d(theta = 180, phi = 45, fov = 40, zoom = 0.8)

    > points3d(aircraft.mat, size = 10, col = green, box = FALSE, 

      xlim = c(3,6), ylim = c(1,9), zlim = c(0,0.5))

    > text3d(aircraft.mat, texts = dimnames(aircraft.data)[[1]], 

      adj = c(0.25, 1.2), cex = 0.75)

    > axes3d(c(y,x,z−+), cex = 0.75)

    > aspect3d(1, 1, 0.5)

    > title3d(,,SPR,RGF,PLF)

    It is also possible to construct one-dimensional biplots, and although we consider such biplots as well as three-dimensional biplots in later chapters; for the remainder of this chapter we restrict ourselves to two-dimensional biplots.

    Figure 2.2 Three-dimensional scatterplot of variables SPR, RGF and PLF of the aircraft data in Table 1.1.

    2.2

    2.2 The Biplot as a Multidimensional Scatterplot

    Although the plots in Figures 2.1 and 2.2 are commonly known as scatterplots, they are simple examples of biplots. Suppose now that we wish to show all four variables of Table 1.1. A perfect Cartesian representation would require four dimensions, so we would find it convenient if we could approximate the information in a two-dimensional (say) display. There are many ways of representing the aircraft by points in two dimensions so that their actual inter-point distances in the four dimensions are approximated. This is the concern of multidimensional scaling (MDS). We shall meet several methods of MDS in later chapters, but here we use one of the simplest methods by expressing the data matrix in terms of its singular value decomposition (SVD). We shall see that many of the ideas introduced in this chapter carry over easily into various forms of biplot discussed in later chapters.

    Figure 2.3 shows the resulting plot where we have first subtracted the means of the individual variables from each aircraft's measurements. The same plot appears in both panels of Figure 2.3, the only difference being that the axes have been translated to pass through the point (0, 0) in the bottom panel. The orthogonal axes give the directions of what are known as the two principal axes. These mathematical constructs do not necessarily have any substantive interpretation. Nevertheless, attempts at interpretation in terms of latent variables are commonplace and sometimes successful. Any two oblique axes may determine the two-dimensional space, so there is an extensive literature on the search for interpretable oblique coordinate axes. Rather than dealing with latent variables, biplots offer the complementary approach of representing the original variables. Clearly, it is not possible to show four sets of orthogonal axes in two dimensions, so we are forced to use oblique representations. The axes representing the latent variables will generally not be shown; they form only what may be regarded as one-, two- or three-dimensional scaffolding axes on which the biplot is built.

    Figure 2.3 Principal axes ordination resulting from an SVD of the data matrix giving a two-dimensional scatterplot of the four-dimensional aircraft data. The bottom panel is similar to the top panel, except for the translation of the axes to pass through zero and an aspect ratio of unity.

    2.3

    How is Figure 2.3 constructed? The usual way of proceeding (Gabriel, 1971) is based on the SVD,

    2.1 2.1

    where, assuming that n p, U* is an n × n orthogonal matrix with columns known as the left singular vectors of X, the matrix V* is a p × p orthogonal matrix with columns known as the right singular vectors of X, while the matrix equation is of the form

    2.2 2.2

    In (2.2), k denotes the rank of X while equation is a k × k diagonal matrix with diagonal elements the nonzero singular values of X, assumed to be presented in nonincreasing order. It follows that (2.1) can also be written as

    2.3 2.3

    where equation and equation consist of the first k columns of U* and V*, respectively. The matrices U and V are both orthonormal.

    An r-dimensional approximation of X is given by

    equation

    where equation replaces the p r smallest diagonal values of equation by zero. In the remainder of this chapter we discuss approximation, axes, interpolation, prediction, projection, and the like, from the viewpoint of extending scatter diagrams to more than two or three dimensions. We use mainly a simple type of biplot, the principal component analysis (PCA) biplot, as the instrument for introducing these concepts. In Chapter 3 we shall consider the PCA biplot as a distinct type of biplot in more detail while in subsequent chapters we shall show how the basic concepts generalize to more complicated data structures. Underpinning PCA is a result, proved by Eckart and Young (1936), that the r-dimensional approximation of X given by equation is optimal in the least-squares sense that

    2.4 2.4

    is minimized for all matrices equation of rank not larger than r.

    It turns out to be convenient to express these results in terms of what we term J-notation. Here the p × p matrix J is defined by

    2.5

    2.5

    Note that J² = J and (I J)² = I J and recall that diagonal matrices commute. With this notation we can write the above as

    equation

    Of course, the final p r columns of UJ and VJ vanish but the matrices UJ and VJ remain p × p. In some instances, it is more convenient to use the notation Ur and Vr to denote the first r columns of U and V, respectively.

    In the biplot, we want to represent the approximated rows and columns of our data matrix X, that is, we want to represent the rows and columns of equation . A standard result is that the orthogonal projections of all the rows of X onto the two dimensions v1 and v2, given by the first two columns of V, are given by the rows of

    2.6 2.6

    The projections (2.6) are points expressed in terms of the coordinates of the original p dimensions. When they are referred to the coordinates of the orthogonal vectors v1 and v2 they become

    2.7 2.7

    We can now construct a scatterplot of the two-dimensional approximation of X by plotting the samples as the rows of (2.7) as is shown in Figure 2.3. The R code for obtaining these scatterplots is as follows:

    > aircraft.mat.centered <- scale(aircraft.mat, center = TRUE,

         scale = FALSE)

    > svd.X.centered <- svd(aircraft.mat.centered)

    > x <- aircraft.mat.centered %*% svd.X.centered$v[,1]

    > y <- aircraft.mat.centered %*% svd.X.centered$v[,2]

    > plot(x = x, y = y, xlim = c(-6,4), ylim = c(-2,2), pch = 15,

      col = green, cex = 1.2, xlab = V1, ylab = V2,

      frame.plot = FALSE)

    > text(x = x, y = y, label = dimnames(aircraft.mat)[[1]],

      pos = 1)

    > windows()

    > PCAbipl(cbind(x,y), colours = c(green,rep(black,8)),

      pch.samples = 15, exp.factor = 14, n.int = c(5,3),

      offset = c(0, 0, 0.5, 0.5), pos.m = c(1,4),

      offset.m = c(-0.25, -0.25))

    The scatterplot in the bottom panel of Figure 2.3 is similar to that appearing in the top panel except for the translation of the ordination axes to pass through the origin and for the aspect ratio of unity. The effect of the difference in aspect ratios is clear. The R function PCAbipl is discussed in detail in Chapter 3.

    Figure 2.3 is not yet a biplot because only the rows of X have a representation, and no representation of the columns (variables) is given. Chapter 3 gives the detailed algebraic and geometrical justifications of how to provide for the variables. Here, the following outline suffices, writing X = AB, then each element of X is given by equation , the inner product of a row marker (rows of A) and a column marker (columns of B). From (2.3) we have equation , which implies that equation . Since (2.7) approximates the row markers, we set equation and it follows that B = V′. Therefore the columns of X are approximated by the first two rows of V.

    An r-dimensional approximation of X is shown in Figure 2.4 for r = 2. In the top panel the rows are represented by green markers as in Figure 2.3, together with red markers for the columns (the variables). Therefore Figure 2.4 is a two-dimensional biplot of X. In the bottom panel the variables are represented by vectors as suggested by Gabriel (1971). Figure 2.4 is obtained by adding the following R code to the code given above for Figure 2.3:

    > plot(x = x, y = y, xlim = c(-6,4), ylim = c(-2,2), pch = 15,

      col = green,  cex = 1.2, xlab = V1, ylab = V2,

      frame.plot = FALSE)

    > text(x = x, y = y, label = dimnames(aircraft.mat)[[1]], pos = 1)

    > text(x = svd.X.centered$v[,1], y = svd.X.centered$v[,2], label

      = dimnames(aircraft.mat)[[2]], pos = 2, offset = 0.4, cex = 0.8)

    > windows()

    > PCAbipl(cbind(x,y), reflect = y, colours = c(green,

      rep(black,8)), pch.samples = 15, pch.samples.size = 1.2,

      exp.factor = 1.4, n.int = c(5,3), offset = c(0, 0, 0.5, 0.5),

      pos.m = c(1,4), offset.m = c(-0.25, -0.25), pos = Hor)

    > arrows(0, 0, svd.X.centered$v[-3,1], svd.X.centered$v[-3,2],

      length = 0.15, angle = 15, lwd = 2, col = red)

    > text(x = -svd.X.centered$v[,1], y = svd.X.centered$v[,2],

      label = dimnames(aircraft.mat)[[2]], pos = 2, offset = 0.075,

      cex = 0.8)

    Figure 2.4 The Gabriel form of a biplot that is

    Enjoying the preview?
    Page 1 of 1