multivariate (mv) data consist of observations on two or more

244
Multivariate (MV) data consist of observations on two or more variables from two or more individuals (objects, human subjects, etc.). Multivariate analysis (MVA) is an increasingly important area of statistics for several reasons: 1. The vast majority of data actually collected is multi- variate. 2. MV data can have a complex structure, requiring a rich set of models and offering a great variety of ana- lytic approaches. 3. Many statistical problems in MVA remain unsolved. 4. There is a synergism between MVA and modern sta- tistical computing. 1

Upload: hangoc

Post on 03-Jan-2017

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Multivariate (MV) data consist of observations on two or more

Multivariate (MV) data consist of observations on twoor more variables from two or more individuals (objects,human subjects, etc.).

Multivariate analysis (MVA) is an increasingly importantarea of statistics for several reasons:

1. The vast majority of data actually collected is multi-variate.

2. MV data can have a complex structure, requiring arich set of models and offering a great variety of ana-lytic approaches.

3. Many statistical problems in MVA remain unsolved.

4. There is a synergism between MVA and modern sta-tistical computing.

1

Page 2: Multivariate (MV) data consist of observations on two or more

Hypothetical example of MV data:

Subject P. Hudson S. Atkins J. Abraham D. Zimmerman M. Hartman D. Mercier Average

History 51.7Math 43.7Physics 50.2Literature 47.2Geography 47.8

Average 48.0 52.1 41.7 48.5 43.9 54.5

Questions of interest:

• Which subjects were most difficult? (Look at row av-erages.)

• Which individuals had better academic performancethan others? (Look at column averages.)

• Are results for different subjects correlated? For ex-ample, do students who perform above average in physicsand math tend to perform below average in literature?(Need table entries to answer this.)

2

Page 3: Multivariate (MV) data consist of observations on two or more

Notation for data:

• p = # variables, n = # individuals.

• Let xjk be the value of the kth variable for the jthindividual.

• Data matrix is the n× p matrix

X = (xjk) =

x11 . . . x1p... ...

xn1 . . . xnp

• Note: some authors define X as a p× n matrix.

• Some measurements could be missing.

3

Page 4: Multivariate (MV) data consist of observations on two or more

MVA techniques can be classified as:

• variable-directed, i.e. primarily concerned with rela-tionships between variables (pooled over individuals);or

• individual-directed, i.e. primarily concerned with rela-tionships between individuals (pooled over variables).

This distinction is not always clearcut, however.

4

Page 5: Multivariate (MV) data consist of observations on two or more

Major Specific Objectives of MVA:

1. Analysis of Interdependence Among Variables. Ap-plicable to variables that “arise on an equal footing.”The strength of the interdependence may range fromcomplete independence to exact collinearity. Includessuch things as:

• Inference on correlation coefficient (p = 2) or cor-relation/covariance matrix (p > 2)

• Determining whether the variables fall into groupssuch that the correlation is high between variablesin the same group but low between variables indifferent groups (Clustering of variables); and thentrying to explain what’s responsible for this (FA)

• Transforming the variables to a new set of uncor-related variables, ranked in order of importance indescribing variability (PCA)

The above methods generally are variable-directed.

5

Page 6: Multivariate (MV) data consist of observations on two or more

2. Analysis of Dependence. Applicable when the vari-ables do not “arise on an equal footing,” i.e. one ormore of the variables are sensibly regarded as depen-dent variables and the others are sensibly regardedas explanatory variables. Then we want to study thefunctional relationship between the dependent vari-able(s) and the explanatory variable(s), and possiblypredict the values of unobserved dependent variablesgiven values of the explanatory variables. Includes:

• Hotelling’s T 2 test

• Multivariate ANOVA (MANOVA)

• Multivariate Regression

These methods also are generally variable-directed.

6

Page 7: Multivariate (MV) data consist of observations on two or more

3. Classification. Generally individual-directed. Includessuch things as:

• Techniques for grouping individuals that are similarin some sense (Cluster Analysis)

• Techniques for assigning an individual to one oftwo or more pre-established groups (DiscriminantAnalysis)

7

Page 8: Multivariate (MV) data consist of observations on two or more

Some final introductory remarks:

1. Most MVA methods in this course assume that allthe variables are continuous (or discrete with manylevels). For discrete MV data, many objectives can beaccomplished via methods of categorical data analysis.The mixed case is trickier and has received relativelyless attention.

2. Most MVA methods in this course assume that thedata have a multivariate normal (MVN) distribution.Why?

• Mathematical beauty and simplicity

• CLT for large samples

• Nonparametric procedures not as well-developed asin univariate case

In practice, we should examine the data to check theassumption, consider how robust our inferences areto departures from normality, and consider making atransformation to more nearly attain normality.

3. Principles of good sampling design or experimentaldesign (randomization, blocking, etc.) are just as im-portant in MVA as in UVA, but we focus on analysisrather than design in this course.

8

Page 9: Multivariate (MV) data consist of observations on two or more

Some Basic Summary Statistics

Analysis of UV data usually begins with construction ofa histogram and computation of two numerical summarystatistics: the mean and standard deviation.

Analysis of MV data usually begins with construction ofsome graphical displays (to be described shortly) and thecalculation of three sets of numerical summary statistics:means, standard deviations, and correlation coefficients.

• Sample means:

xk =1

n

n∑

j=1xjk (k = 1, . . . , p)

• Sample variances:

s2k =1

n

n∑

j=1(xjk− xk)

2 ≡ skk (k = 1, . . . , p)

(note the divisor of n rather than n− 1)

• Sample standard deviations:

sk =√s2k (k = 1, . . . , p)

• Sample covariances:

sik =1

n

n∑

j=1(xji − xi)(xjk − xk)

(i, k = 1, . . . , p)

9

Page 10: Multivariate (MV) data consist of observations on two or more

• Sample correlation coefficients:

rik =sik√siiskk

(i, k = 1, . . . , p)

These quantities can be arranged in vectors or matrices:

x =

x1x2...xp

, Sn = ,

R = .

10

Page 11: Multivariate (MV) data consist of observations on two or more

Interpretations of summary statistics:

• Means and standard deviations — straightforward mea-sures of central tendency and variability

• Covariances — not straightforward as measures of as-sociation between pairs of variables

• Correlation coefficients

– Measures strength and sign of linear association

– −1 ≤ r ≤ 1

– r

< 0 ⇒= 0 ⇒> 0 ⇒

– Invariant to affine linear transformations with same-sign multiplicative coefficients

– Very sensitive to outliers

11

Page 12: Multivariate (MV) data consist of observations on two or more

Interpretation of the correlation matrix:

• The R produced by a computer may often be in arather unsuitable format for interpretation.

– too many significant digits are given

– if p > 8 or so, then some rows of R may be spreadover 2 or more rows of computer output

– Example: Correlation matrix produced by R’s “cor()”function, for the 100K race data (correlations among“split times” only)

[, 1] [, 2] [, 3] [, 4] [, 5] [, 6] [, 7]

1.0000000 0.9510603 0.8445874 0.7855553 0.6205346 0.6178917 0.5313965

0.9510603 1.0000000 0.8903106 0.8258111 0.6414427 0.6327655 0.5409319

0.8445874 0.8903106 1.0000000 0.9209633 0.7559463 0.7250990 0.6050262

0.7855553 0.8258111 0.9209633 1.0000000 0.8868723 0.8417992 0.6905362

0.6205346 0.6414427 0.7559463 0.8868723 1.0000000 0.9364149 0.7541974

0.6178917 0.6327655 0.7250990 0.8417992 0.9364149 1.0000000 0.8395763

0.5313965 0.5409319 0.6050262 0.6905362 0.7541974 0.8395763 1.0000000

0.4773400 0.5054450 0.6199920 0.6980539 0.7858444 0.8403821 0.7795431

0.5428235 0.5342275 0.5836350 0.6669173 0.7413846 0.7727374 0.6970670

0.4143086 0.4381649 0.4672829 0.5083324 0.5417713 0.6559430 0.7192362[, 8] [, 9] [, 10]

0.4773400 0.5428235 0.4143086

0.5054450 0.5342275 0.4381649

0.6199920 0.5836350 0.4672829

0.6980539 0.6669173 0.5083324

0.7858444 0.7413846 0.5417713

0.8403821 0.7727374 0.6559430

0.7795431 0.6970670 0.7192362

1.0000000 0.7634270 0.6634246

0.7634270 1.0000000 0.7794122

0.6634246 0.7794122 1.0000000

12

Page 13: Multivariate (MV) data consist of observations on two or more

• The correlation matrix produced by SAS’s PROCCORRis no better.

• Some ways to improve the presentation of R:

– Round coefficients to ≤ 2 decimal places

– Suppress the ones on the main diagonal

– Suppress 0’s before the decimal point

Applying these to the 100K race data yields:

R =

.95 .84 .79 .62 .62 .53 .48 .54 .41.95 .89 .83 .64 .63 .54 .51 .53 .44.84 .89 .92 .76 .73 .61 .62 .58 .47.79 .83 .92 .89 .84 .69 .70 .67 .51.62 .64 .76 .89 .94 .75 .79 .74 .54.62 .63 .73 .84 .94 .84 .84 .77 .66.53 .54 .61 .69 .75 .84 .78 .70 .72.48 .51 .62 .70 .79 .84 .78 .76 .66.54 .53 .58 .67 .74 .77 .70 .76 .78.41 .44 .47 .51 .54 .66 .72 .66 .78

• In some cases the pattern of the correlations may be-come clearer if the variables are re-ordered. However,any natural ordering (e.g. with respect to time of mea-surement) should be respected.

13

Page 14: Multivariate (MV) data consist of observations on two or more

Some Elementary Graphical Summaries

• Univariate histograms for each variable

– Can create in R using the “hist()” function.

– Histograms for Women’s National Track RecordsData:

Histogram of femtrack$X100m

femtrack$X100m

Freq

uenc

y

10.5 11.0 11.5 12.0 12.5 13.0

05

1015

20

Histogram of femtrack$X200m

femtrack$X200m

Freq

uenc

y

21 22 23 24 25 26 27 28

05

1015

Histogram of femtrack$X400m

femtrack$X400m

Freq

uenc

y

50 55 60

05

1015

Histogram of femtrack$X800m

femtrack$X800m

Freq

uenc

y

1.9 2.0 2.1 2.2 2.3

02

46

810

Histogram of femtrack$X1500m

femtrack$X1500m

Freq

uenc

y

4.0 4.5 5.0 5.5 6.0

05

1015

Histogram of femtrack$X3000m

femtrack$X3000m

Freq

uenc

y

8 9 10 11 12 13

05

1015

Histogram of femtrack$marathon

femtrack$marathon

Freq

uenc

y

150 200 250 300

05

1015

20

14

Page 15: Multivariate (MV) data consist of observations on two or more

• Matrix scatterplot — a collection of all two-variablescatterplots, laid out in a two-dimensional array. Plotson the main diagonal can be left empty, or a boxplotcan be placed there instead.

– Can be created in R using the “pairs()” function.

– Matrix scatterplot forWomen’s National Track RecordsData:

X100m

22 24 26 1.9 2.1 2.3 9 11 13

11.0

12.0

2224

26

X200m

X400m

4852

5660

1.92.0

2.12.2

2.3

X800m

X1500m4.0

4.55.0

5.5

910

1112

13

X3000m

11.0 12.0 48 52 56 60 4.0 5.0 150 250

150

200

250

300

marathon

15

Page 16: Multivariate (MV) data consist of observations on two or more

• 3-D scatterplot — mostly useless (in DZ’s opinion)unless the positions of the points are represented un-ambiguously.

– Can create in R using the “scatterplot3d” functionwithin the library of the same name (not part ofUI’s default R load).

– 3-D scatterplot of lizard data from Table 1.3:

2 4 6 8 10 12 14 16

9010

011

012

013

014

015

016

017

0

40

50

60

70

80

90

lizard[, 1]

lizar

d[, 2]

lizar

d[, 3]

16

Page 17: Multivariate (MV) data consist of observations on two or more

• Profile plot (growth curve plots) — Applicable gener-ally, but most useful in a situation where the data rep-resent a single characteristic measured on several oc-casions (repeated measurements, longitudinal data).Plots the characteristic versus time, with line segmentsconnecting consecutive measurements from the sameindividual.

– Can create in R using code saved in file“profileplot” within the course directory.

– Profile plot of 100K race data:

Split number

Spl

it tim

e (m

inut

es)

2 4 6 8 10

4060

8010

0

17

Page 18: Multivariate (MV) data consist of observations on two or more

• Stars and Chernoff faces — never mind

• Dynamic graphics

– Brushing linked plots (e.g. within a matrix scatter-plot)

– Rotating a 3-D scatterplot

18

Page 19: Multivariate (MV) data consist of observations on two or more

Statistical Distance

Consider two points, P = (x1, . . . , xp) andQ = (y1, . . . , yp)in p-dimensional Euclidean space. (Can think of P andQ as representing two of the n individuals in the data.)

Euclidean distance between P and Q:

dE(P,Q) =√

(x1 − y1)2 + · · · + (xp − yp)2.

• If Q is fixed, points P satisfying dE(P,Q) = c (aconstant) lie on a hypersphere centered at Q. E.g., ifp = 2:

• Unsatisfactory for most statistical purposes becauseit weights each coordinate equally. Coordinates rep-resent variables that often have different variabilities.

19

Page 20: Multivariate (MV) data consist of observations on two or more

Modified distance measure that allows for different vari-abilities:

dU(P,Q) =

√√√√√√√(x1 − y1)2

s11+ · · · + (xp − yp)2

spp

• If Q is fixed, points P satisfying dU(P,Q) = c lie ona hyperellipsoid centered at Q and aligned with thecoordinate axes. E.g., if p = 2:

• Points which appear farther away from Q visually (i.e.in a Euclidean sense) may be closer using the modifieddistance.

dU(P,Q) is still not suitable for general use because itdoesn’t account for possible correlation among variables.E.g. if p = 2:

20

Page 21: Multivariate (MV) data consist of observations on two or more

In such a case we first rotate the coordinate axes by anangle θ of our choice, thereby transforming the coordi-nate system, and then we measure distance by dU(P,Q)in the new coordinate system. After some algebra, thestatistical distance measure is

dS(P,Q) = [a11(x1 − y1)2 + · · · + app(xp − yp)

2

+2a12(x1 − y1)(x2 − y2)

+2a13(x1 − y1)(x3 − y3) + · · ·+2ap−1,p(xp−1 − yp−1)(xp − yp)]

1/2

where the aij’s are messy functions of θ and the sij’s.

• If Q is fixed, points P satisfying dS(P,Q) = c lieon a hyperellipsoid centered at Q, but not necessarilyaligned with the original coordinate axes.

• A tidier way to represent dS(P,Q) will be possibleusing matrix notation (it’s an example of a quadraticform).

21

Page 22: Multivariate (MV) data consist of observations on two or more

Other distance measures are possible. d(P,Q) is a dis-tance measure if and only if:

1. d(P,Q) = d(Q,P )

2. d(P,Q) > 0 if P 6= Q

3. d(P,Q) = 0 if P = Q

4. d(P,Q) ≤ d(P,R) + d(R,Q) (triangle inequality)

22

Page 23: Multivariate (MV) data consist of observations on two or more

Notation for vectors and matrices

Column vector: x

Row vector: x′

Matrix: X

Scalar: x

Students’ knowledge of vector and matrix dimensionality,addition, multiplication, and transposition is assumed forthis course.

Some properties of vectors

• Length of vector x: Lx =

• Angle between two vectors x and y:

cos θ =

Example:

23

Page 24: Multivariate (MV) data consist of observations on two or more

• Vectors x and y are orthogonal iffExamples:

• A set of vectors x1, . . . ,xk is linearly dependent ifconstants c1, . . . , ck exist which are not all equal to 0and for which

k∑

i=1cixi = 0.

Note that this implies that at least one vector in theset can be expressed as a linear combination of theothers.

If a set of vectors is not linearly dependent it is linearlyindependent.

24

Page 25: Multivariate (MV) data consist of observations on two or more

Examples:

• Projection of a vector x onto another vector y:

25

Page 26: Multivariate (MV) data consist of observations on two or more

Some properties, types, facts, and functions of matrices

• A matrix A is symmetric if A′ = A.

Fact: If AB is well-defined, then (AB)′ = B′A′.

• Identity matrix I and null matrix 0:

• A square matrix A is nonsingular if there exists amatrix B such that AB = I. In this case, B is calledthe inverse of A and written as A−1.

Fact: If A and C are both nonsingular and of thesame dimensions, then (AC)−1 = C−1A−1.

Fact: A square matrix is nonsingular iff its columnsare linearly independent.

26

Page 27: Multivariate (MV) data consist of observations on two or more

• A square matrix Q is orthogonal if Q′ = Q−1. Ex-ample:

• If A is square, its determinant is well-defined (def-inition unnecessary for our purposes) and written as|A|. The determinant measures the magnitude of thematrix, in some sense.

Fact: |A| = 0 iff A is singular.

• If A = (aij) is k × k, its trace is defined as tr(A) =∑ki=1 aii. The trace also measures the magnitude of the

matrix, in a different sense than the determinant.

27

Page 28: Multivariate (MV) data consist of observations on two or more

Eigenvalues and eigenvectors

Let A be k × k and let x 6= 0 be k × 1.

• A has an eigenvalue λ, with corresponding eigenvec-tor x, if λ and x satisfy

Ax = λx.

• There are k such eigenvalue/eigenvector pairs (notnecessarily all distinct).

• IfA is symmetric, then the eigenvectors can be chosento be orthogonal to each other and normalized to beof length 1.

Notation: (λ1, e1), . . . , (λk, ek)

e′iej =

1 if i = j0 otherwise

Example:

28

Page 29: Multivariate (MV) data consist of observations on two or more

Quadratic forms

Let x = (xi) be k × 1. A quadratic form is a functionf(x) of the form

f(x) =k∑

i=1

k∑

j=1aijxixj = x′Ax

where A = (aij) is a specified symmetric matrix. A iscalled the matrix of the quadratic form.

29

Page 30: Multivariate (MV) data consist of observations on two or more

Example:

30

Page 31: Multivariate (MV) data consist of observations on two or more

If x′Ax ≥ 0 for all x then x′Ax and A are nonnegativedefinite (= positive semidefinite for some authors).

If x′Ax is n.n.d. and x′Ax = 0 iff x = 0, then x′Ax

and A are positive definite. Examples:

Note: dS(P,Q) can be written as√(x− y)′A(x− y). It

satisfies the properties of a distance measure iff A is p.d.

31

Page 32: Multivariate (MV) data consist of observations on two or more

The spectral decomposition of a matrix

Any k × k symmetric matrix A can be written as

A =k∑

i=1λieie

′i

where λ1, . . . , λk are the eigenvalues of A and e1, . . . , ekare the corresponding normalized eigenvectors.

Consequences of the spectral decomposition theorem:

1. A symmetric matrix A is n.n.d. (or p.d.) iff all of itseigenvalues are nonnegative (or positive).

2. If A is defined such that x′Ax is a squared distanceof x from the origin, then x′Ax = ∑k

i=1 λiy2i where

yi = e′ix.

Can display for case k = 2:

32

Page 33: Multivariate (MV) data consist of observations on two or more

3. If A is p.d. and symmetric, then A−1 = ∑ki=1

1λieie

′i.

4. IfA is p.d. and symmetric, then a p.d. symmetric ma-trix B exists such that A = BB. B is the squareroot matrix of A, denoted by A1/2, and A1/2 =∑ki=1

√λieie

′i.

33

Page 34: Multivariate (MV) data consist of observations on two or more

Random vectors and random matrices

Example:

X =

X11 X12 X13

X21 X22 X23

Definition: E(X) = (E(Xij)) (if all the expectations ex-ist)

Two results on expectations of random matrices:

1. E(X +Y) = E(X) + E(Y)

2. E(AXB) = AE(X)B

First-order and second-order central moments of a ran-dom vector X = (Xi):

1. Mean vector E(X) ≡ µ

34

Page 35: Multivariate (MV) data consist of observations on two or more

2. Covariance matrix E[(X− µ)(X− µ)′] ≡ Σ

• Σ = (σik) = (cov(Xi, Xk))

• Thus

Σ =

• If Xi and Xk are independent, then cov(Xi, Xk) =0. Converse not true in general, but is true if(Xi, Xk)

′ have a bivariate normal distribution.

• If all p variables are independent, then Σ is a di-agonal matrix, i.e. Σ = diag(σii).

• Fact: Σ = E(XX′)− µµ′

35

Page 36: Multivariate (MV) data consist of observations on two or more

3. Correlation matrix

ρ =

where ρik =σik√

σii√σkk

.

If we define V1/2 = diag(√σii), and if V is positive

definite, then it can be shown that

ρ = V−1/2ΣV−1/2,

where V−1/2 = (V1/2)−1.

36

Page 37: Multivariate (MV) data consist of observations on two or more

Partitioning a p× 1 random vector into two subvectors:

X =

X1

X2...Xq

Xq+1...Xp

=

X(1)

X(2)

.

The mean vector and covariance matrix can be parti-tioned accordingly:

µ =

µ(1)

µ(2)

,

Σ =

Σ11 Σ12

Σ21 Σ22

=

cov(X(1)) cov(X(1),X(2))cov(X(2),X(1)) cov(X(2))

.

Partitioning into more than two groups is straightforward.

37

Page 38: Multivariate (MV) data consist of observations on two or more

Results on first-order and second-order moments of lineartransformations, CX, of a random vector:

1. E(CX) = Cµ

2. cov(CX) = CΣC′

3. cov(CX,DX) = CΣD′

Examples:

38

Page 39: Multivariate (MV) data consist of observations on two or more

Matrix inequalities and maximization

1. Cauchy-Schwartz inequality: For any two p×1 vectorsb and d,

(b′d)2 ≤ (b′b)(d′d),

with equality iff b = cd for some constant c.

Application to sample correlation coefficient:

2. Extended Cauchy-Schwartz inequality: Let B be anyp × p p.d. matrix. Then for any two p × 1 vectors band d,

(b′d)2 ≤ (b′Bb)(d′B−1d),

with equality iff b = cB−1d for some constant c.

39

Page 40: Multivariate (MV) data consist of observations on two or more

3. Maximization lemma (immediate consequence of ex-tended C-S inequality): LetB be any p×p p.d. matrixand let d be any p× 1 vector. Then

maxx 6=0

(x′d)2

x′Bx= d′B−1d,

and the maximum is attained iff x = cB−1d for somec 6= 0.

An application of this lemma to simultaneous confi-dence intervals for the components of a mean vectorwill be given in Chapter 5.

40

Page 41: Multivariate (MV) data consist of observations on two or more

4. Maximization of quadratic forms (for points on theunit sphere): Let B be a p×p p.d. matrix with eigen-values λ1 ≥ λ2 ≥ . . . ≥ λp > 0 and correspondingnormalized eigenvectors e1, . . . , ep. Then:

(a) maxx 6=0x′Bxx′x = λ1, and the maximum is attained

iff x = ce1 for some c 6= 0.

(b) minx 6=0x′Bxx′x = λp, and the minimum is attained iff

x = cep for some c 6= 0.

(c) For any k = 1, 2, . . . , p− 1,

maxx 6=0,x⊥e1,...,ek

x′Bx

x′x= λk+1,

and the maximum is attained iff x = cek+1 forsome c 6= 0.

Thus, the smallest and largest eigenvalues of B rep-resent extreme values of the quadratic form x′Bx forpoints x on the unit sphere.

We will apply this result to principal component anal-ysis in Chapter 8.

41

Page 42: Multivariate (MV) data consist of observations on two or more

The Geometry of the Sample

Recall that the values of p variables measured on n indi-viduals can be arranged in an n× p data matrix:

X =

x11 x12 · · · x1px21 x22 · · · x2p... ... ...

xn1 xn2 · · · xnp

.

Two ways to view X:

1. The rows of X represent n points in Rp:

X =

x′1

x′2

...x′n

2. The columns of X represent p points (or vectors) inRn:

X = [y1,y2, . . . ,yp]

There is merit to each point of view.

42

Page 43: Multivariate (MV) data consist of observations on two or more

The first point of view provides information on the sam-ple’s central location and variation.

Example:

• x measures central location of the n points in Rp.

• Sn measures spread of the n points in Rp.

• A scalar measure of spread, called the generalized sam-ple variance, will be described soon.

43

Page 44: Multivariate (MV) data consist of observations on two or more

From the second point of view, it is more useful to regardy1, . . . ,yp as vectors (rather than points) in Rn.

Example:

To interpret the sample mean vector x = (xi):

1. Consider the vector 1√n1n, and display it in Rn.

2. Next consider the projection of yi on1√n1n:

3. Thus, xi is the multiple of 1n required to yield theprojection of yi onto the line determined by 1n.

44

Page 45: Multivariate (MV) data consist of observations on two or more

Further, for each yi we can define a residual vector

di = yi − xi1n =

x1i − xix2i − xi

...xni − xi

and display it (from an appropriate two-dimensional per-spective) as follows:

Note that di is orthogonal to xi1.

45

Page 46: Multivariate (MV) data consist of observations on two or more

Two more interpretations of the residual vectors:

1. Lengths of the di’s are proportional to the correspond-ing sample standard deviations, since

Similarly, d′idk = nsik.

2. The cosine of the angle between di and dk is the sam-ple correlation coefficient between variables i and k.

46

Page 47: Multivariate (MV) data consist of observations on two or more

Random Samples

Conceptual foundation for MVA: Regard the data matrixX as a realization of a random matrix, in which the rowsX′

1, . . . ,X′n represent independent observations from a

common p-variate distribution.

Note:

• The variables in any individual Xj may be correlated.

• If X1, . . . ,Xn are not independent, the statistical in-ferences we make will be of dubious validity.

Important Result: If X1, . . . ,Xn are a random samplefrom any MV distribution with mean vector µ and co-variance matrix Σ, then

E(X) = µ, cov(X) =1

nΣ,

E(Sn) =n− 1

n

Σ.

47

Page 48: Multivariate (MV) data consist of observations on two or more

Proof:

Note:

• MV normality not needed for any of these results.

• X is unbiased for µ, but Sn is biased for Σ. However,S ≡ ( n

n−1)Sn is unbiased.

48

Page 49: Multivariate (MV) data consist of observations on two or more

Generalized Variance

Motivation: May want a more compact description (infact, a scalar description) of sample variation than thatprovided by Sn or S.

Definition: The generalized sample variance of a ran-dom sample X1, . . . ,Xn is |S|.

Two geometrical interpretations of |S| (don’t dwell onthese):

1. In Rp, |S| = constant× (volume of ellipsoid)2, wherethe ellipsoid isx : (x− x)′S−1(x− x) ≤ c2 (measures statis-tical distance from x to x).

2. In Rn, |S| =(

1n−1

)p(volume)2, where “volume” is the

volume of the hypertrapezoidal region generated bythe p residual vectors d1, . . . ,dp.

49

Page 50: Multivariate (MV) data consist of observations on two or more

Some facts about the generalized sample variance:

• Very different sample covariance matrices can give thesame generalized sample variance, so its usefulness islimited.Example:

• |S| = 0 ⇔ d1, . . . ,dp are linearly dependent.

• If n ≤ p, then |S| = 0 (no matter what X is).

• If a p×1 vector a 6= 0 exists for which a′Xj is constantfor all j, then |S| = 0. If not, and if n > p, then|S| > 0.

50

Page 51: Multivariate (MV) data consist of observations on two or more

Definition: The total sample variance of a random sam-ple X1, . . . ,Xn is s11 + s22 + · · · + spp = tr(S).

Two geometrical interpretations of total sample variance:

1. In Rp, TSV = sum of squared Euclidean distancesfrom the points x1, . . . ,xn to the point x, divided byn− 1.

2. In Rn, TSV = sum of squared lengths of d1, . . . ,dp,divided by n− 1.

51

Page 52: Multivariate (MV) data consist of observations on two or more

Sample mean, covariance, and correlation as matrixoperations on data matrix X

• x = 1nX′1

• S = 1n−1

X′(I− 1n11′)X

• R = [diag(1/√s11, . . . , 1/

√spp)]S

×[diag(1/√s11, . . . , 1/

√spp)]

52

Page 53: Multivariate (MV) data consist of observations on two or more

Sample moments for linear combinations of variables

Let x′j be an arbitrary row of the data matrixX. Consider

c′xj = c1xj1 + · · · + cpxjp,

d′xj = d1xj1 + · · · + dpxjp.

Facts:

• Sample mean of the n c′xj’s: c′x

• Sample variance of the n c′xj’s: c′Sc

• Sample covariance of the n c′xj’s and d′xj’s: c′Sd

Example:

53

Page 54: Multivariate (MV) data consist of observations on two or more

The multivariate normal density function

Recall the univariate normal density function:

Note that the exponential part can be written as follows:

Generalization to MV. Here X represents a p×1 randomvector, and we write X ∼ Np(µ,Σ). Assume Σ is p.d.Then the density function for X is:

Note that contours of constant density are ellipsoids de-fined by the x-values that satisfy

(x− µ)′Σ−1(x− µ) = c2.

These ellipsoids are centered atµ and have axes±c√λiei,

where λ1, . . . , λp are the eigenvalues of Σ and e1, . . . , epare the corresponding eigenvectors.

54

Page 55: Multivariate (MV) data consist of observations on two or more

The bivariate normal density function, in detail

Two examples of contours of constant density:

55

Page 56: Multivariate (MV) data consist of observations on two or more

Properties of the Multivariate Normal Distribution

Until noted otherwise, let X ∼ N(µ,Σ).

I. Linear combinations of the components of X arenormally distributed.

More precise: If X ∼ Np(µ,Σ), then every linear com-bination a′X + d is distributed as N(a′µ + d, a′Σa).Incidentally, the converse is also true.

Can extend to a vector of linear combinations, as follows:If X ∼ Np(µ,Σ) and A and d are a q × p matrix andq× 1 vector, respectively, then AX+ d is distributed asNq(Aµ + d,AΣA

′).

Examples:

56

Page 57: Multivariate (MV) data consist of observations on two or more

II. All subsets of the components of X have a MVNdistribution.

More precise: If X ∼ Np(µ,Σ) and we partition X, µ,and Σ as

X =

X1

X2

, µ =

µ1

µ2

, Σ =

Σ11 Σ12

Σ21 Σ22

,

where X1 is q × 1, then X1 ∼ Nq(µ1,Σ11).

(It is also true that X2 ∼ Np−q(µ2,Σ22).)

57

Page 58: Multivariate (MV) data consist of observations on two or more

III. Zero covariance implies that the corresponding com-ponents of X are distributed independently.

More precise: Suppose X1 and X2 are q1× 1 and q2× 1,respectively, and

X1

X2

∼ Nq1+q2

µ1

µ2

,

Σ11 Σ12

Σ21 Σ22

.

Then X1 and X2 are independent iff Σ12 = 0.

A related result: IfX1 ∼ Nq1(µ1,Σ11) andX2 ∼ Nq2(µ2,Σ22),and X1 and X2 are independent, then

X1

X2

∼ Nq1+q2

µ1

µ2

,

Σ11 0

0 Σ22

.

58

Page 59: Multivariate (MV) data consist of observations on two or more

IV. The conditional distribution of any subset of com-ponents of X given any other disjoint subset of com-ponents is MVN.

More precise: With X partitioned as in III, the condi-tional distribution of X1, given X2 = x2, is MVN, with

• mean µ1 +Σ12Σ−122 (x2 − µ2) and

• covariance matrix Σ11 −Σ12Σ−122 Σ21.

Note:

• The conditional mean is a linear function of the valuesof the variables being conditioned upon.

• The conditional covariance matrix does not depend onthe values of variables being conditioned upon.

59

Page 60: Multivariate (MV) data consist of observations on two or more

Examples:

60

Page 61: Multivariate (MV) data consist of observations on two or more

V. Certain quadratic forms in a MVN vector have achi-square distribution.

More precise: If X ∼ Np(µ,Σ), then

(X− µ)′Σ−1(X− µ) ∼ χ2p.

A special case you’re familiar with:

Another example:

A consequence of this result is that the region in Rp en-closed by the contour

(x− µ)′Σ−1(x− µ) = χ2p,α

has probability 1− α.

61

Page 62: Multivariate (MV) data consist of observations on two or more

VI. Linear combinations of independent MVN randomvectors, each having the same covariance matrix, areMVN.

More precise: LetX1, . . . ,Xn be independent whereXj ∼Np(µj,Σ) for every j. Define

V1 = c1X1 + · · · + cnXn, V2 = b1X1 + · · · + bnXn.

Then the joint distribution of V1 and V2 is

N2p

∑nj=1 cjµj

∑nj=1 bjµj

,

(c′c)Σ (b′c)Σ(b′c)Σ (b′b)Σ

.

Example:

62

Page 63: Multivariate (MV) data consist of observations on two or more

Maximum Likelihood Estimators (MLEs) of theParameters of Np(µ,Σ), and Their Properties

Suppose we have a random sampleX1, . . . ,Xn fromNp(µ,Σ).How should we estimate µ and Σ? A well-establishedmethod of estimation is MLE, which consists of maxi-mizing the joint density function of the random samplewith respect to the parameters. Here, this joint density(also called the likelihood function) is as follows:

Fact 1: The unique MLEs, µ and Σ, in this setting are

µ = X, Σ = Sn =n− 1

nS.

63

Page 64: Multivariate (MV) data consist of observations on two or more

A nice property of MLE’s is the following: Suppose wehave obtained MLEs of some parameters, but would liketo have the MLE of some function of those parameters. Itturns out that the MLE of that function of the parame-ters is the same function of the MLEs of those parameters.Examples:

Fact 2: In this setting, X and S are sufficient statistics,i.e. the conditional distribution of the random sample,given X and S, does not depend on µ and Σ.

Our next two facts give distributional results for the MLEs.Before giving them, recall the following UV result:

64

Page 65: Multivariate (MV) data consist of observations on two or more

Back to the MV case (taking X1, . . . ,Xn to be a randomsample from Np(µ,Σ)), we have the following.

Fact 3:

• X ∼ Np(µ,1nΣ)

• (n − 1)S ∼ Wishart with n − 1 df and covarianceparameter Σ, i.e. Wn−1(Σ)

• X and S are independent.

TheWishart distribution is defined as follows: IfZ1, . . . ,Zm

are iid Np(0,Σ), then the distribution of ∑mj=1ZjZ

′j is

called the Wishart distribution with m df and covariance(matrix) parameter Σ.

65

Page 66: Multivariate (MV) data consist of observations on two or more

Fact 4 (A CLT): Let X1, . . . ,Xn be a random samplefrom ANY p-variate distribution with mean µ and p.d.covariance matrix Σ. Then for large n− p,

√n(X− µ)

is distributed approximately as Np(0,Σ), and

n(X− µ)′S−1(X− µ)

is distributed approximately as χ2p.

66

Page 67: Multivariate (MV) data consist of observations on two or more

Assessing the MVN Assumption

• Important because many MV inferences depend onthe extent to which the data are MVN (or at leastapproximately so).

• A single, all-encompassing diagnostic is elusive.

• The text emphasizes diagnostics that assess UV andBV normality.

• UV and BV assessments not foolproof, but the risk ofthere existing some higher-dimensional non-normalityis regarded as small in most practical situations.

67

Page 68: Multivariate (MV) data consist of observations on two or more

A. Assessments of UVN (done separately for each of thep variables)

1. Dot diagrams or histograms

2. Chi-square test on numbers of observations within in-tervals

3. Kolmogorov-Smirnov and Cramer-vonMises tests basedon the sample cumulative distribution function

4. Normal probability (or Q-Q) plots — a plot of thesample quantiles versus the quantiles of a standardnormal distribution. “Straightness” of the points inthe plot indicate conformance to a MVN assumption.

68

Page 69: Multivariate (MV) data consist of observations on two or more

Details of construction:

Example (see handout).

69

Page 70: Multivariate (MV) data consist of observations on two or more

A Q-Q plot is a graphical diagnostic for UVN. It wouldbe good to have an objective measure of “straightness”to accompany the plot. Such a measure is the correlationcoefficient between the x(j)’s and q(j)’s:

rQ =∑nj=1(x(j) − x)(q(j) − q)

√∑nj=1(x(j) − x)2 ∑nj=1(q(j) − q)2

Reject UVN at significance level α if rQ < rQ,α,n, wherethe critical values rQ < rQ,α,n are found in Table 4.2 ofthe textbook. For example, when n = 100, the criticalvalues are as follows:

.01 .05 .10.9822 .9873 .9895

Return to example on handout.

70

Page 71: Multivariate (MV) data consist of observations on two or more

B. Assessments of BVN (done separately for each pair ofvariables)

1. Two-dimensional scatterplots of each pair of variables

• BVN ⇒ the conditional mean appears roughly lin-ear.

• BVN ⇒ the points’ convex hull appears roughlyelliptical.

71

Page 72: Multivariate (MV) data consist of observations on two or more

2. Quadratic forms in each pair of variables

Partition X as follows:

X =

X1

X2

where X1 is 2× 1. Partition µ, X, Σ, and S accord-ingly. Then

X ∼ Np(µ,Σ)

⇒ X1 ∼ N2(µ1,Σ11)

⇒ (X1 − µ1)′Σ−1

11 (X1 − µ1) ∼ χ22.

Thus, BVN ⇒ approximately 100(1− α)% of the bi-variate observations should lie in the ellipse

(X1 − X1)′S−1

11 (X1 − X1) ≤ χ22,α.

Can take α = 0.5.

72

Page 73: Multivariate (MV) data consist of observations on two or more

C. A more MV approach: Chi-square plots

Uses the same idea as in method B2, but applies it to theentire p×1 vector of observed variables (and incorporatesthe Q-Q plot idea).

Three-step procedure:

1. Compute d2j = (Xj−X)′S−1(Xj−X) for j = 1, . . . , nand rank them to obtain d2(1) ≤ d2(2) ≤ · · · ≤ d2(n).

2. Obtain quantiles of the χ2p distribution, i.e. χ

2p,1−j−0.5

n

(j = 1, . . . , n).

3. Plot the d2(j)’s versus the χ2p,1−j−0.5

n’s.

XMVN⇒ the points in the plot should lie approximatelyon a straight line.

Can also check whether approximately 50% of the d2j ’sare less than χ2

p,.50.

See radiotherapy data example once more.

73

Page 74: Multivariate (MV) data consist of observations on two or more

Transformations to Normality

Suppose we find that the random sample does not appearto have been drawn from a MVN distribution. One wayto proceed is to seek transformations of the variables suchthat the joint distribution of the transformed variables isconsistent with a MVN assumption (or more nearly so).

How do we select a transformation?

1. On the basis of theoretical considerations

• known physical laws

• common statistical experience

2. On the basis of what the data tell us

Consider power transformations, i.e. xλ. Special cases:

Power transformations generally “work” when the his-togram departs from normality by being skewed eitherright or left.

How does a power transformation affect symmetry aboutthe mean?

• If λ < 1, large values of x are pulled in.

74

Page 75: Multivariate (MV) data consist of observations on two or more

• If λ > 1, large values of x are pushed out.

Some trial and error with different choices of λ may leadto a satisfactory result.

A more formal way to select a power transformation is bythe Box-Cox procedure. Recall that the Box-Cox familyof power transformations is

x(λ) =

xλ−1λ if λ 6= 0

log x if λ = 0

75

Page 76: Multivariate (MV) data consist of observations on two or more

In this non-regression context, the “best” value of λ is

the one that minimizes the sample variance of the y(λ)j ’s,

where

y(λ)j =

xλj−1

λ[(∏ni=1 xi)

1/n]λ−1 if λ 6= 0

(∏ni=1 xi)1/n log x if λ = 0

Remarks:

• Minimizing the sample variance of the y(λ)j ’s can be

shown to be equivalent to maximizing

logL(λ) = −n

2log(S(λ)) + (λ− 1)

n∑

j=1log xj

where S(λ) is the sample variance of the x(λ)j ’s.

• The required calculations can be performed using PROCTRANSREG of SAS.

• There is no guarantee that the chosen value of λ trans-forms the data to normality, so we need to examineQ-Q plots of the transformed data.

Refer to the radiotherapy data example, handed out inclass.

The application of the Box-Cox method described abovefocuses on making the UV marginals more nearly normal.We can also apply it to the entire p-variate distribution,

76

Page 77: Multivariate (MV) data consist of observations on two or more

by seeking the vector λ = [λ1, . . . , λp]′ that maximizes

logL(λ) = −n

2log |S(λ)| + (λ1 − 1)

n∑

j=1log xj1

+ · · · + (λp − 1)n∑

j=1log xjp.

SAS PROC TRANSREG does not do this, so we have toprogram it ourselves. See the radiotheraphy example fordetails.

77

Page 78: Multivariate (MV) data consist of observations on two or more

Hotelling’s T 2-test for H0 : µ = µ0

Recall the following UV problem:

Suppose X1, . . . , Xn are a random sample fromN(µ, σ2), where both µ and σ2 are unknown (butσ2 is positive). Suppose further that we want totest H0 : µ = µ0 versus H1 : µ 6= µ0. Then asize-α test is to reject H0 if

t ≡ |X − µ0|S/

√n

> tα/2,n−1.

This is the well-known one-sample t-test.

The MV analogue of this problem is as follows:

Suppose X1, . . . ,Xn are a random sample fromNp(µ,Σ), where both µ and Σ are unknown (butΣ is p.d.). Suppose further that we want to testH0 : µ = µ0 versus H1 : µ 6= µ0.

78

Page 79: Multivariate (MV) data consist of observations on two or more

TheMV analogue of the UV t-statistic is called Hotelling’sT 2-statistic:

T 2 = n(X− µ0)′S−1(X− µ0).

Note:

• T 2 is a measure of statistical distance from X to µ0.

• T 2 reduces to t2 when p = 1:

What is (are) the critical value(s) for T 2? It turns outthat under H0,

T 2 ∼ (n− 1)p

n− pFp,n−p.

So a size-α test is to reject H0 if T2 > (n−1)p

n−p Fα,p,n−p.

79

Page 80: Multivariate (MV) data consist of observations on two or more

Now refer to the sweat data example, on handout pro-vided in class.

Issues regarding Hotelling’s T 2 test:

• The test is based on an assumption of MVN, so weshould check this assumption (at least when n− p <25 or 30).

– Radiotherapy data: n = 98, so test is OK eventhough the data aren’t MVN.

– Sweat data: n = 20, so outcome of our check forMVN is important.

• It’s instructive to compare the structure of T 2 with t2

in terms of the random variables, vectors, or matricesinvolved:

80

Page 81: Multivariate (MV) data consist of observations on two or more

• T 2 is invariant under nonsingular linear transforma-tions of the p× 1 vector of measurements on an indi-vidual. That is, if we let

Yj = CXj + d (j = 1, . . . , n)

where C is nonsingular, then T 2 for the transformeddata will be identical to T 2 for the original data. ThusT 2 does not depend on the units of measurement.

• Hotelling’s T 2 test is (equivalent to) the likelihood ra-tio test of H0 : µ = µ0 versus H1 : µ 6= µ0.

• Usually data analysts are (or should be) more inter-ested in a confidence region for µ than in hypothesistesting. That is, they want to determine a region ofµ-values within which the true value of µ is likely tolie.

81

Page 82: Multivariate (MV) data consist of observations on two or more

Confidence Regions for µ (one-sample situation)

General definition: Let X be the data matrix, let α ∈(0, 1), and let θ be a vector of parameters belonging toa parameter space Θ. A 100(1 − α)% confidence regionfor θ is a set R(X) of θ-values in Θ such that, prior tocollecting the data,

P [θ ∈ R(X)] = 1− α.

Application of definition to the problem at hand: We seeka subset R(X) of Rp such that P [µ ∈ R(X)] = 1− α.

Derivation of such a confidence region:

82

Page 83: Multivariate (MV) data consist of observations on two or more

Example: 95% confidence region for µ in the sweat dataexample is:

Remarks:

• This confidence region is a p-dimensional ellipsoid.E.g., if p = 2 the region is as follows:

• The orientation and lengths of the axes of the ellip-soid can be determined from the eigenvalues λi andeigenvectors ei of S.

83

Page 84: Multivariate (MV) data consist of observations on two or more

• There is an equivalence between the T 2 test and thisconfidence region. Specifically, the size-α T 2 test ofH0 : µ = µ0 versus H1 : µ 6= µ0 is rejected ⇔ µ0

lies outside the aforementioned confidence region.

• Because this confidence region is “curved,” from itsalgebraic specification it is not easy to determine at aglance if a specified µ-value belongs to it. This is adeficiency relative to a univariate confidence interval.For ease of interpretation it would be better for theconfidence region to be “rectangular,” i.e. the Carte-sian product of intervals (one for each scalar compo-nent of µ). This motivates the idea of simultaneousconfidence intervals.

84

Page 85: Multivariate (MV) data consist of observations on two or more

One-at-a-time Confidence Intervals for µ1, . . . , µp

Fact: For any p× 1 vector ℓ 6= 0,

ℓ′X− ℓ′µ√ℓ′Sℓ/n

∼ tn−1

and therefore a 100(1 − α)% confidence interval for ℓ′µis given by

ℓ′X± tα/2,n−1

ℓ′Sℓ/n.

For the specific case of ℓ′iµ = µi (i = 1, . . . , p) we obtainthe following set of intervals, each of which is a 100(1 −α)% confidence interval for the respective µi:

X1 ± tα/2,n−1

√s11/n

X2 ± tα/2,n−1

√s22/n

...

Xp ± tα/2,n−1

spp/n

85

Page 86: Multivariate (MV) data consist of observations on two or more

Now think in terms of events and probabilities. Let Ci

represent the event that the ith 100(1−α)% one-at-a-timeconfidence interval for µi contains µi. Three questions:

1. What is P (Ci)?

2. The simultaneous coverage probability (SCP) is de-fined as P (C1 ∩ C2 ∩ · · · ∩ Cp). How does the SCPcompare to P (Ci)?

3. If the Ci’s are independent, what is the SCP?

Since the Ci’s are generally not independent, we needsome alternative strategies to obtain a desired SCP.

86

Page 87: Multivariate (MV) data consist of observations on two or more

Bonferroni-based Simultaneous Confidence Intervalsfor µ1, . . . , µp

The Bonferroni Inequality says that if A1, . . . , Am areevents, then

P (A1 ∩ A2 ∩ · · · ∩ Am) ≥ 1− m∑

i=1(1− P (Ai)).

Applied to the setting we’re currently interested in, wehave

P (C1 ∩ C2 ∩ · · · ∩ Cp) ≥ 1−p∑

i=1α = 1− pα.

Example calculation: If we have a collection of 95% one-at-a-time confidence intervals for µ1, . . . , µ7, their SCPwill be at least what?

Consequently, the Bonferroni-based intervals

X1 ± tα/(2p),n−1

√s11/n

X2 ± tα/(2p),n−1

√s22/n

...

Xp ± tα/(2p),n−1

spp/n

have SCP at least 1− α.

87

Page 88: Multivariate (MV) data consist of observations on two or more

Remarks:

• The Bonferroni-based intervals result from a simplemodification of the expressions for the one-at-a-timeintervals.

• As the number of components ofµ increase, the Bonferroni-based intervals get wider.

• The Bonferroni-based intervals are conservative (i.e.they may be wider than necessary).

• Comparison of widths of Bonferroni-based intervalsand one-at-a-time intervals:

88

Page 89: Multivariate (MV) data consist of observations on two or more

• The Bonferroni method can also be applied to varia-tions of the problem currently under consideration.E.g., simultaneous confidence intervals for a subsetof the components of µ, or for all pairwise contrastsµi − µj (i 6= j).

89

Page 90: Multivariate (MV) data consist of observations on two or more

T 2-based Simultaneous Confidence Intervalsfor µ1, . . . , µp

The distributional result at the top of page 36 impliesthat for every ℓ 6= 0,

P

n[ℓ′(X− µ)]2

ℓ′Sℓ≤ t2α/2,n−1

= 1− α.

In fact, for each ℓ 6= 0 the interval

ℓ′X± tα/2,n−1

ℓ′Sℓ/n

contains ℓ′µ iff the inequality in the probability statementabove is satisfied.

Take c > 0 and let Cℓ be the event

n[ℓ′(X− µ)]2

ℓ′Sℓ≤ c

.

Consider the infinite collection of intervals of the formℓ′X ± √

c√ℓ′Sℓ/n (one interval for every ℓ 6= 0). The

event that every interval in this collection contains itsrespective ℓ′µ is ∩ℓ 6=0

Cℓ. But note that

∩ℓ6=0Cℓ =

maxℓ 6=0

n[ℓ′(X− µ)]2

ℓ′Sℓ

≤ c

=n(X− µ)′S−1(X− µ) ≤ c

=T 2 ≤ c

.

Thus, if we want the probability to be 1 − α that thecollection of all intervals of the form ℓ′X ± √

c√ℓ′Sℓ/n

90

Page 91: Multivariate (MV) data consist of observations on two or more

contain their respective ℓ′µ, we can take the cut-off pointc to be (n−1)p

n−p Fα,p,n−p.

Therefore, the infinite collection of intervals

ℓ′X±√√√√√√√(n− 1)p

n− pFα,p,n−p

ℓ′Sℓ/n : ℓ ∈ Rp

has SCP 1 − α. Choosing the ℓ’s to give us the compo-nents of µ yields the 100(1− α)% T 2-intervals

91

Page 92: Multivariate (MV) data consist of observations on two or more

X1 ±√√√√√√√(n− 1)p

n− pFα,p,n−p

√s11/n

X2 ±√√√√√√√(n− 1)p

n− pFα,p,n−p

√s22/n

...

Xp ±√√√√√√√(n− 1)p

n− pFα,p,n−p

spp/n

Remarks:

• T 2-based intervals are wider than the correspondingBonferroni-based intervals when you’re only interestedin the p components of µ.

• T 2-based intervals are ideal for “data snooping.”

Sweat data example again:

92

Page 93: Multivariate (MV) data consist of observations on two or more

Inference when some values are missing: TheEM Algorithm

In the UV context, missing values are easily handled ifthey are “missing at random.”

But in the MV context, some observations (which arevectors) may be only partially missing. For example, theobserved data matrix could be

X =

— 0 37 2 65 1 2— — 5

.

Most MV techniques require all components of the datamatrix X to be observed.

If X is not complete, we can use the EM algorithm toimpute the missing values, and then proceed as thoughthe imputed values were actually observed.

93

Page 94: Multivariate (MV) data consist of observations on two or more

The EM algorithm has two steps:

1. Prediction step — Given an estimate θ of the un-known parameters, predict the contribution of anymissing observation to the sufficient statistics for thecomplete data set.

2. Estimation step — Use the predicted sufficient statis-tics to compute a revised estimate of the parameters.

In our settingX1, . . . ,Xn is a random sample fromNp(µ,Σ)and the complete-data sufficient statistics are

T1 =n∑

j=1Xj = nX,

T2 =n∑

j=1XjX

′j = (n− 1)S + nXX′.

94

Page 95: Multivariate (MV) data consist of observations on two or more

Notation: Let x(1)j and x

(2)j represent the missing com-

ponents and observed components, respectively, of the“complete” observation xj. Let µ and Σ be estimatesof µ and Σ, with components arranged to correspond to

the ordering of xj =

x(1)j

x(2)j

.

Predicted contribution of x(1)j to T1:

x(1)j = E(X

(1)j |X(2)

j = x(2)j , µ, Σ)

= µ(1) + Σ12Σ−1

22 (x(2)j − µ(2))

Predicted contribution of x(1)j to T2:

˜x(1)j x

(1)j

′= E(X

(1)j X

(1)′j |X(2)

j = x(2)j , µ, Σ)

= Σ11 − Σ12Σ−1

22 Σ21 + x(1)j x

(1)′j ,

˜x(1)j x

(2)j

′= E(X

(1)j X

(2)′j |X(2)

j = x(2)j , µ, Σ)

= E(X(1)j |X(2)

j = x(2)j , µ, Σ)x

(2)′j = x

(1)j x

(2)′j

95

Page 96: Multivariate (MV) data consist of observations on two or more

Estimation step:

µ =1

nT1, Σ =

1

nT2 − µµ′.

Continue cycling between the steps until “convergence.”

Once final estimates µ and Σ are obtained, we can, forexample, test H0 : µ = µ0 versus H1 : µ 6= µ0 by

comparing n(µ − µ0)′Σ

−1(µ − µ0) to χ2

α,p. This is ap-proximately a size-α test.

See section 5.7 of text for a numerical example.

The validity of this approach requires the data to be“missing at random.”

96

Page 97: Multivariate (MV) data consist of observations on two or more

Large-Sample Inference for µ1, . . . , µp

The exact validity of Hotelling’s T 2 test, the associated el-lipsoidal confidence region, and the associated Bonferroni-based and T 2-based simultaneous confidence intervals restson the assumption that X1, . . . ,Xn is a random samplefrom Np(µ,Σ).

However, as a result of the CLT, these inference proce-dures are approximately valid for a dataset of sufficientlylarge sample size, even when the normality assumption isnot satisfied.

For large-sample inference, the authors suggest replacingtα/2,n−1 with zα/2 and replacing(n−1)pn−p Fα,p,n−p with χ2

α,p in the expressions for test statis-

tics and confidence regions/intervals. For example, thelarge-sample Hotelling’s T 2 test:

97

Page 98: Multivariate (MV) data consist of observations on two or more

But it’s OK (it’s a little more conservative) to just leavethe expressions alone.

An application to categorical data:

• Suppose that a nominal attribute variable with q + 1levels or categories is measured on every individual ina population.

• An individual from category k will be assigned thefollowing value:

• So the possible values are the vectors

and the corresponding probabilities are p1, p2, . . . , pq, pq+1

where pq+1 = 1− (p1 + · · · + pq).

• Regard the observations as a random sampleX1, . . . ,Xn

from this distribution. Let Xij be the ith componentof Xj.

98

Page 99: Multivariate (MV) data consist of observations on two or more

• It can be shown that

E(Xj) = p = (pi), var(Xij) = pi(1− pi),

cov(Xij, Xkj) = −pipk.

• Sample mean vector is X = 1n∑nj=1Xj = sample pro-

portion vector = p = (pi).

• Covariance matrix of sample mean vector is 1nΣ where

Σ is the (q + 1)× (q + 1) matrix with elements giventwo bullets ago.

• By CLT,√n(p−p) ∼ Nq+1(0,Σ) approximately, for

large n.

• Thus, can do large-sample Hotelling’s T 2-test of H0 :p = p0 versus H1 : p 6= p0 as follows:

where Σ is obtained by replacing the pi’s in Σ withthe pi’s.

• How large must n be for approximately valid infer-ence? A rule of thumb is: npi ≥ 20 for all i =1, . . . , q + 1.

99

Page 100: Multivariate (MV) data consist of observations on two or more

Example:

100

Page 101: Multivariate (MV) data consist of observations on two or more

Multivariate Two-Sample Inference

In the UV situation, the simplest kind of 2-sample situa-tion is paired data, i.e. a case where 2 “treatments” areapplied to the same units or to units that are probablymuch more similar than randomly selected units. Exam-ples:

Review of inference for UV paired data:

• Let X1j = response to Treatment 1 for jth replicate;let X2j = response to Treatment 2 for jth replicate;and let Dj = X1j −X2j.

• If Dj’s are iid N(δ, σ2d), then

D − δ

sd/√n∼ tn−1,

where D and sd are the sample mean and standarddeviation of the Dj’s.

101

Page 102: Multivariate (MV) data consist of observations on two or more

• Thus, we can test H0 : δ = 0 versus H1 : δ 6= 0 usingthe test statistic

√nD/sd, and a confidence interval

for δ can be obtained easily.

• In essence, the two-sample inference problem is changedto a one-sample problem by reducing the data to within-pair differences.

There are two important ways in which this UV situationcan be extended to a MV one:

1. Still have 2 treatments, but measure p > 1 responseson each replicate (= MV paired comparisons)

2. Still measure 1 response variable, but have q > 2treatments for each replicate(= Repeated measures)

102

Page 103: Multivariate (MV) data consist of observations on two or more

Multivariate Paired Comparisons

Notation:

Result: Assuming that the Dj’s are a random samplefrom Np(δ,Σd),

n(D− δ)′S−1d (D− δ) ∼ T 2 ∼ (n− 1)p

n− pFp,n−p

where D and Sd are the sample mean vector and covari-ance matrix of the Dj’s.

Ramification: Can proceed with inference on δ as thoughit were µ in a one-sample situation.

103

Page 104: Multivariate (MV) data consist of observations on two or more

Two features not generally shared with the one-samplesituation:

• The scientific hypothesis of interest is usually whetherthere is any difference between the average effects ofthe two treatments, i.e. the null hypothesis isH0 : δ =0. So our test statistic is usually nD′S−1

d D.

• It is possible for the original data to be non-normaland yet the Dj’s be MVN. Example:

Consequently, we should check theDj’s, not theXij’s,for consistency with MVN.

104

Page 105: Multivariate (MV) data consist of observations on two or more

Repeated Measures

Each individual receives each treatment once, on succes-sive occasions. There are q treatments and n individ-uals. The data on the jth individual are thus X′

j =[Xj1, . . . , Xjq].

The scientific hypothesis of interest usually is whetherthere is any difference between the average effects of anytwo treatments. I.e.,

H0 : µ1−µ2 = 0, µ1−µ3 = 0, . . . , µ1−µq = 0 versus H1

i.e.,H0 : Cµ = 0 versus H1 : Cµ 6= 0

where

C =

1 −1 0 · · · 01 0 −1 · · · 0...1 0 0 · · · −1

.

C is a contrast matrix.

Assuming thatX1, . . . ,Xn is a random sample fromNq(µ,Σ),then:

• CX1, . . . ,CXn is a random sample fromNq−1(Cµ,CΣC′).

• The sample mean and covariance matrix of the CXj’sare CX and CSC′.

105

Page 106: Multivariate (MV) data consist of observations on two or more

Consequently,

T 2 = n(CX−Cµ)′(CSC′)−1(CX−Cµ)

∼ (n− 1)(q − 1)

n− q + 1Fq−1,n−q+1

and a size-α test of the above hypotheses is to reject H0

if

n(CX)′(CSC′)−1CX >(n− 1)(q − 1)

n− q + 1Fα,q−1,n−q+1.

100(1−α)% simultaneous confidence intervals for all contrastsc′µ are the set of all intervals

c′X ±√√√√√√√(n− 1)(q − 1)

n− q + 1Fα,q−1,n−q+1

√√√√√√c′Sc

n:

c is a contrast vector

106

Page 107: Multivariate (MV) data consist of observations on two or more

Remarks:

• n(CX)′(CSC′)−1CX is invariant to the choice of C,provided that C is a (q− 1)× q contrast matrix withlinearly independent rows.

• In essence, the q-treatment UV problem is changed toa one-sample MV problem in which the CXj’s are theobservations.

See hypothetical headache medicine example, handed outin class.

107

Page 108: Multivariate (MV) data consist of observations on two or more

Inference for the Difference of Two Means Basedon Independent Samples

Recall the following UV problem. If X11, . . . , X1,n1 andX21, . . . , X2,n2 are independent random samples fromN(µ1, σ

2)and N(µ2, σ

2), respectively, then a size-α test of H0 :µ1 = µ2 versus H1 : µ1 6= µ2 is to reject H0 if

|X1 − X2|√s2p(

1n1+ 1

n2)> tα/2,n1+n2−2.

Distinguishing feature (compared to paired data): Thereis no defensible rationale for pairing individuals, even ifthe two sample sizes are equal.

Notation for MV problem:

• Samples X11, . . . ,X1,n1 and X21, . . . ,X2,n2

• Sample means X1 and X2

• Sample covariance matrices S1 and S2.

108

Page 109: Multivariate (MV) data consist of observations on two or more

Assumption: The two samples are independent randomsamples from Np(µ1,Σ1) and Np(µ2,Σ2), respectively.Initially we shall also assume that Σ1 = Σ2.

Hypotheses of interest:

• H0 : µ1 = µ2 versus H1 : µ1 6= µ2 (primary)

• H0 : Σ1 = Σ2 versus H1 : Σ1 6= Σ2 (secondary)

How the first pair of hypotheses are tested depends onthe outcome of a test of the second pair of hypotheses.Formal tests of equality of the covariance matrices exist,but here we will use the following informal rule of thumb:

109

Page 110: Multivariate (MV) data consist of observations on two or more

If, on the basis of this informal check (or a formal test),we decide to assume Σ1 = Σ2, then we pool the twosample covariance matrices to obtain an estimate of thecommon covariance matrix:

Spooled =(n1 − 1)S1 + (n2 − 1)S2

n1 + n2 − 2

We have the following distributional result:

[X1 − X2 − (µ1 − µ2)]′[(

1

n1+

1

n2)Spooled]

−1

×[X1 − X2 − (µ1 − µ2)]

∼ (n1 + n2 − 2)p

n1 + n2 − p− 1Fp,n1+n2−p−1.

From this distributional result, we can do the followinginference procedures:

110

Page 111: Multivariate (MV) data consist of observations on two or more

• Two-sample size-α Hotelling’s T 2 test for H0 : µ1 =µ2 versus H1 : µ1 6= µ2 is to reject H0 if

(X1 − X2)′[1

n1+

1

n2

Spooled]

−1(X1 − X2)

>(n1 + n2 − 2)p

n1 + n2 − p− 1Fα,p,n1+n2−p−1 ≡ cα.

• A 100(1−α)% ellipsoidal confidence region for µ1−µ2

is given byµ1 − µ2 : [X1 − X2 − (µ1 − µ2)]

×[1

n1+

1

n2

Spooled]

−1[X1 − X2 − (µ1 − µ2)]

≤ cα .The directions and lengths of the confidence ellipsoid’saxes are determined from the eigenvectors and eigen-values of Spooled.

111

Page 112: Multivariate (MV) data consist of observations on two or more

• Bonferroni-based 100(1−α)% simultaneous confidenceintervals for the p population mean differences aregiven by

(X1i − X2i) ± tα/(2p),n1+n2−2

√√√√√√

1

n1+

1

n2

sii,pooled

(i = 1, . . . , p).

• T 2-based 100(1− α)% simultaneous confidence inter-vals for all linear combinations of the components ofµ1 − µ2 are given by

ℓ′(X1 − X2)±

√cα

√√√√√√

1

n1+

1

n2

ℓ′Spooledℓ :

ℓ ∈ Rp.

112

Page 113: Multivariate (MV) data consist of observations on two or more

Large-sample inference: If the assumption of equal co-variance matrices is dubious, and/or the assumption ofMVN is dubious for either population, but n1 − p andn2 − p are both “large,” then we can test the equality ofmeans hypothesis at approximate size α by rejecting H0

if

(X1 − X2)′1

n1S1 +

1

n2S2

−1

(X1 − X2) ≥ χ2α,p.

The corresponding ellipsoidal confidence region and si-multaneous confidence intervals are straightforward.

Now see an example using the effluent data, on a classhandout.

113

Page 114: Multivariate (MV) data consist of observations on two or more

Inference for the Mean Vectors of More ThanTwo Populations: The One-Way MANOVA

Recall the following UV problem. Suppose we observeindependent random samples from g normal populationswith means µ1, . . . , µg and common variance σ2, i.e.

Suppose we want to test whether the means are all equal,i.e. H0 : µ1 = µ2 = · · · = µg versus H1 : at least one ofthe µl’s is different from the others. By writing

µl = µ + (µl − µ) ≡ µ + τl,

for any number µ, we see that the H0 above is equivalentto H0 : τ1 = τ2 = · · · = τg.

114

Page 115: Multivariate (MV) data consist of observations on two or more

It is useful to cast the problem in terms of a linear modelfor the data:

Xlj = µ + τl + elj, elj ∼ iid N(0, σ2)

(j = 1, . . . , nl; l = 1, . . . , g).

This model is not “identified,” i.e. one or more of its pa-rameters are not uniquely determined. The constraint∑gl=1 nlτl = 0 identifies the model, so we add it to the

model specification. (Note: this is not the only constraintthat identifies the model.)

Least squares estimates: µ = X , τl = Xl − X.

Fitted residual: elj = Xlj − (µ+ τl) = Xlj − [X + (Xl−X)] = Xlj − Xl.

So we have the decomposition

Xlj = X + (Xl − X) + (Xlj − Xl) = µ + τl + elj.

115

Page 116: Multivariate (MV) data consist of observations on two or more

Partitioning the variability in the data accordingly yieldsthe following decomposition of the total sum of squares(corrected for the mean), also called the one-way analysisof variance (ANOVA):

g∑

l=1

nl∑

j=1(Xlj − X)2 =

g∑

l=1nl(Xl − X)2

+g∑

l=1

nl∑

j=1(Xlj − Xl)

2,

i.e.SScor = SStr + SSres.

This decomposition plus some additional information canbe laid out in a table, called the ANOVA table, as follows:

116

Page 117: Multivariate (MV) data consist of observations on two or more

The hypotheses of interest can be tested based on thistable. Specifically, we reject H0 : τ1 = τ2 = · · · = τg infavor of H1 : not H0 at the α level of significance if

F ≡ SStr/(g − 1)

SSres/(∑gl=1 nl − g)

> Fα,g−1,∑gl=1 nl−g.

Note, for future reference, that rejecting H0 for large F isequivalent to rejecting H0 for large values of SStr/SSres,which in turn is equivalent to rejectingH0 for small valuesofSSres/(SSres + SStr).

Now for the MV extension of these ideas.

117

Page 118: Multivariate (MV) data consist of observations on two or more

An identified model for Xlj:

Xlj = µ + τ l + elj,g∑

l=1nlτ l = 0,

elj ∼ iid Np(0,Σ) (j = 1, . . . , nl; l = 1, . . . , g).

Least squares estimates of parameters:

µ = X, τ l = Xl − X.

Decomposition of an observation in terms of least squaresestimates:

Xlj = X + (Xl − X) + (Xlj − Xl) = µ + τ l + elj.

The decomposition above gives rise to the following de-composition of the total (mean-corrected) sum of squaresand cross-products matrix:g∑

l=1

nl∑

j=1(Xlj − X)(Xlj − X)′ =

g∑

l=1nl(Xl − X)(Xl − X)′

+g∑

l=1

nl∑

j=1(Xlj − Xl)(Xlj − Xl)

′,

i.e.

Total SS+CP matrix = Between SS+CP matrix

+Within SS+CP matrix.

118

Page 119: Multivariate (MV) data consist of observations on two or more

We can lay this out in a table called the multivariateanalysis of variance (MANOVA) table, as follows:

119

Page 120: Multivariate (MV) data consist of observations on two or more

Suppose that we wish to use a scalar-valued statistic com-putable from this MANOVA as a test statistic for testingH0 : τ 1 = τ 2 = · · · = τ g versus H1 : not H0. Whatstatistic is a reasonable extension of the univariate F-test?

Although several test statistics are possible, we will fea-ture Wilks’ lambda statistic,

Λ∗ =|W|

|B +W|.

We reject H0 if Λ∗ is too small. How small is too small?

• If p = 1 or g = 2, a multiple of (1 − Λ∗)/Λ∗ has aparticular F distribution under H0, so we reject H0

if this statistic is larger than an appropriate size-α Fcutoff point. See Table 6.3 for details.

120

Page 121: Multivariate (MV) data consist of observations on two or more

• If p = 2 or g = 3, a multiple of (1 −√Λ∗)/

√Λ∗ has

a particular F distribution under H0, so we reject H0

if this statistic is larger than an appropriate size-α Fcutoff point. See Table 6.3 for details.

• If p > 2 and g > 3 , the following result can be usedif n ≡ ∑g

l=1 nl is large: Reject H0 at level α if

−(n− 1− p + g

2) log Λ∗ > χ2

α,p(g−1).

• In most applications we just use the P -value providedin the computer output to judge statistical signifi-cance.

Now refer to the supplemental class handouts for someexamples, analyzed using SAS.

121

Page 122: Multivariate (MV) data consist of observations on two or more

Simultaneous Confidence Intervals for Componentsof Differences of Mean Vectors

Suppose that a MANOVA has indicated that not all thepopulation means are equal, or equivalently that there aresignificant differences due to “treatments.” Then we’dlike to know which variable(s) differ significantly, and forwhich treatments they do so.

We will learn the following Bonferroni-based approach:

• The treatment difference vectors are τ k−τ l (l < k =2, . . . , g).

• The ith component of τ k − τ l is

• So the number of scalar differences that we want con-fidence intervals for, such that their SCP is at least1− α, is

• Our point estimate of τki − τli is

122

Page 123: Multivariate (MV) data consist of observations on two or more

• The variance of our point estimate is var(Xki−Xli) =

• A good estimate of the variance of our point estimateis var(Xki − Xli) =

• Thus, a set of confidence intervals for all differencesτki − τli (l < k = 2, . . . , g; i = 1, . . . , p) whose SCPis at least 1− α is given by

(Xki − Xli)± tα/[pg(g−1)],n−g

√√√√√√√wii

n− g

1

nk+

1

nl

.

Application to the turtle example:

123

Page 124: Multivariate (MV) data consist of observations on two or more

The Two-Way MANOVA

The MANOVA described previously is appropriate whena model with only one factor of classification is appropri-ate.

We want to extend the same ideas to a setting where thereare two factors of classification, such as:

• A randomized blocks experiment

• A completely randomized experiment, with treatmentsthat have a factorial structure

• An observational study in which individuals are cross-classified by two factors (e.g. socioeconomic class andregion of the country)

124

Page 125: Multivariate (MV) data consist of observations on two or more

The UV model and ANOVA:

• Notation: Xlkr is the rth observation at level l ofFactor 1 and level k of Factor 2 (l = 1, . . . , g; k =1, . . . , b; r = 1, . . . , n). Note that for simplicity weconsider only the “balanced” case.

• Model:

Xlkr = µ + τl + βk + γlk + elkr,

elkr iid N(0, σ2),g∑

l=1τl =

b∑

k=1βk =

g∑

l=1γlk =

b∑

k=1γlk = 0.

The γlk’s are “interaction” terms. Note: This modelcannot be fit unless n ≥ 2; if n = 1, however, we canfit the model without interaction terms.

• ANOVA:

125

Page 126: Multivariate (MV) data consist of observations on two or more

• Using F-tests, we first test for interaction. If we findno significant interaction, then we test for main effectsof each of the two factors.

Now for the MV analogue:

• Model:

• Assume n ≥ 2.

126

Page 127: Multivariate (MV) data consist of observations on two or more

• MANOVA:

As in the UV case, begin by testing for no interaction, i.e.for testing H0 : γ11 = γ12 = · · · = γgb = 0 versus H1:not H0.

• Test statistic is

• Reject H0 at level α if

−[gb(n− 1)− p + 1− (g − 1)(b− 1)

2] log Λ∗

> χ2α,(g−1)(b−1)p

127

Page 128: Multivariate (MV) data consist of observations on two or more

If the test for no interaction is rejected, it is inadvisableto proceed with tests on the other effects. Instead, do UVtwo-way ANOVA’s on each variable to see which of thevariables have significant interaction effects. For thosevariables, do interaction plots. The variables that haveno significant interaction may be used for further tests.

Test for main effect of Factor 1, i.e. H0 : τ 1 = τ 2 =· · · = τ g = 0 versus H1: not H0.

• Test statistic is

• Reject H0 at level α if

−[gb(n− 1)− p + 1− (g − 1)

2] log Λ∗ > χ2

α,(g−1)p

128

Page 129: Multivariate (MV) data consist of observations on two or more

Test for main effect of Factor 2, i.e. H0 : β1 = β2 =· · · = βb = 0 versus H1: not H0.

• Test statistic is

• Reject H0 at level α if

−[gb(n− 1)− p + 1− (b− 1)

2] log Λ∗ > χ2

α,(b−1)p

A very nice example of a two-way MANOVA, replete withSAS code and output, can be found on pp. 318-323 of text.

129

Page 130: Multivariate (MV) data consist of observations on two or more

Simultaneous Confidence Intervals for Componentsof Differences in Main Effect Vectors

Notation:

• E = SSPres, and Eii is ith diagonal element of E.

• Xl·i is ith component of Xl·

• X·ki is ith component of X·k

Bonferroni-based 100(1−α)% simultaneous confidence in-tervals for all Factor 1 differences τli−τmi (i = 1, . . . , p; l <m = 2, . . . , g):

(Xl·i − Xm·i)± tα/[pg(g−1)],gb(n−1)

√√√√√√√Eii

gb(n− 1)· 2

nb

Bonferroni-based 100(1−α)% simultaneous confidence in-tervals for all Factor 2 differences βki−βqi (i = 1, . . . , p; k <q = 2, . . . , b):

(X·ki − X·qi)± tα/[pb(b−1)],gb(n−1)

√√√√√√√Eii

gb(n− 1)· 2

ng

Note: Don’t compute these intervals if the interactioneffect is significant.

130

Page 131: Multivariate (MV) data consist of observations on two or more

Profile Analysis (for 2 groups)

Suppose that we have obtained independent random sam-ples from two populations, and that the p measurementvariables are commensurable, i.e. they are expressed inthe same units. Then, we may not only be interested intesting the equality of mean vectors hypothesis (whichwe already know how to do), but also in testing whethercertain other linear functions of components of the meanvectors are equal.

Assume subsequently that all p variables are commensu-rable, that the two populations are MVN, and that thetwo groups have a common covariance matrix. In thiscase it is very useful to graph the mean vector for eachgroup as a profile, as follows:

Relevant hypotheses to be tested:

1. Are the two groups’ profiles equal?

131

Page 132: Multivariate (MV) data consist of observations on two or more

2. Are the two groups’ profiles parallel?

3. Assuming that the profiles are parallel, are they coin-cident?

4. Assuming that the profiles are coincident, are theylevel?

132

Page 133: Multivariate (MV) data consist of observations on two or more

Methodology for addressing these questions:

1. Been there, done that. A size-α test is to reject H0 if

(X1 − X2)′[1

n1+

1

n2

Spooled]

−1(X1 − X2)

>(n1 + n2 − 2)p

n1 + n2 − p− 1Fα,p,n1+n2−p−1

(or equivalently can use Wilks’ lambda).

2. To address the parallelism hypothesis, define the con-trast matrix

C =

1 −1 0 · · · 01 0 −1 · · · 0...1 0 0 · · · −1

.

Then, parallelism holds iff H01 : Cµ1 = Cµ2, orequivalently C(µ1 − µ2) = 0. A size-α test is toreject H01 if

(X1 − X2)′C′[

1

n1+

1

n2

CSpooledC

′]−1C(X1 − X2)

>(n1 + n2 − 2)(p− 1)

n1 + n2 − pFα,p−1,n1+n2−p.

Can interpret this as a test for the equality of themeans of the CX1j’s and the CX2j’s.

3. To test for coincidence given parallelism, first notethat two parallel profiles never cross, and thus they

133

Page 134: Multivariate (MV) data consist of observations on two or more

are coincident iff the “total heights,”

are equal. So the hypothesis is equivalent to H02 :1′µ1 = 1′µ2.

We can test this hypothesis by a UV t-test for theequality of means of the 1′X1j’s and the 1

′X2j’s. Equiv-alently, a size-α test is to reject H02 if

(X1 − X2)′1[

1

n1+

1

n2

1′Spooled1]

−11′(X1 − X2)

> t2α/2,n1+n2−2 = Fα,1,n1+n2−2.

134

Page 135: Multivariate (MV) data consist of observations on two or more

4. To test for level profiles given coincidence, first notethat:

(a) Coincidence occurs iff the two populations have thesame mean vector µ = (µi), the UMVUE of whichis

X =

(b) Level profiles occur iff every consecutive difference,µi − µi−1, is 0.

Thus, the null hypothesis is H03 : Cµ = 0. A size-αtest is to reject H03 if

(n1 + n2)X′C′[CSC′]−1CX

>(n1 + n2 − 1)(p− 1)

n1 + n2 − p + 1Fα,p−1,n1+n2−p+1,

where S is the sample covariance matrix of the X1j’sand X2j’s assuming they have a common mean.

135

Page 136: Multivariate (MV) data consist of observations on two or more

Each of the hypotheses of interest can be tested equiva-lently using Wilks’ lambda in the context of a particularMANOVA.

Now see the maternal attitudes example on the classhandout.

Three questions and their answers:

1. If we determine that the profiles are parallel, what isthe advantage of the test for coincidence (given underPoint 3 on the previous page) over the standard testfor equality of two mean vectors (given under Point 1on the previous page)?

136

Page 137: Multivariate (MV) data consist of observations on two or more

2. If we determine that the profiles are parallel but notcoincident, can we test for levelness of the profiles, andif so, how?

137

Page 138: Multivariate (MV) data consist of observations on two or more

3. If we reject parallelism, it is possible that one (butnot both) of the profiles is level. How can we test forlevelness of each profile individually?

138

Page 139: Multivariate (MV) data consist of observations on two or more

Univariate Regression Analysis

Our next major topic is MV regression. To warm up,let’s briefly review the UV regression model and assump-tions, and mention some of the standard UV regressionmethodology.

UV multiple linear regression model:

yj = β0 + β1zj1 + β2zj2 + · · · + βrzjr + ǫj,

ǫj’s uncorrelated, E(ǫj) = 0, var(ǫj) = σ2

(j = 1, . . . , n).

Can write in vector/matrix notation as

y = Zβ + ǫ, E(ǫ) = 0, cov(ǫ) = σ2I.

Note: The above assumptions are sufficient to do leastsquares point estimation for the model parameters. Todo interval estimation and/or hypothesis testing, we gen-erally also assume normality of the ǫj’s.

139

Page 140: Multivariate (MV) data consist of observations on two or more

Least squares estimates:

β = (Z′Z)−1Z′y,

S2 = (y − Zβ)′(y − Zβ)/(n− r − 1)

provided that Z has full rank r + 1.

Fitted values: y = Zβ = Z(Z′Z)−1Z′y

Fitted residuals: ǫ = y − y = [I− Z(Z′Z)−1Z′]y

Additional topics to review:

• Partition of total variation of y (the ANOVA)

• Sampling properties of least squares estimators

• Confidence ellipsoid for β; simultaneous confidence in-tervals for elements of β

• Tests for the general linear hypothesis H0 : Cβ = d;full-versus-reduced model testing approach

• Inference for E(y|z) and for prediction of y

• Diagnostics: residual plots, testing for outliers, influ-ence and leverage, collinearity

• Variable selection: R2, Mallow’s Cp, PRESS, stepwisetechniques

140

Page 141: Multivariate (MV) data consist of observations on two or more

The Multivariate Regression Model

Now suppose we have more than one dependent variable,say m of them. Suppose further that each dependentvariable follows its own regression model, with the stip-ulation that the explanatory variables in each dependentvariable’s regression equation are identical. An exampleand non-example:

More generally, the model is

141

Page 142: Multivariate (MV) data consist of observations on two or more

For each fixed i, the ǫji’s are assumed to be uncorrelatedand such that E(ǫji) = 0, var(ǫji) = σii for j = 1, . . . , n.However, the errors associated with different measure-ments on the same individual may be correlated. Thus,

• cov(ǫji, ǫjk) = σik for all j = 1, . . . , n

• cov(ǫji, ǫlk) = 0 if j 6= l

The model is more convenient to represent using matrixnotation. Define

142

Page 143: Multivariate (MV) data consist of observations on two or more

Then we can write the MV regression model as

Y = Zβ + ǫ, E(ǫ) = 0, cov(ǫ(i), ǫ(k)) = σikI

(i, k = 1, . . . ,m).

We will assume that Z has full rank, so that Z′Z is in-vertible.

In terms of a model for each dependent variable, we have

y(i) = Zβ(i) + ǫ(i), (i = 1, . . . , m)

E(ǫ(i)) = 0, cov(ǫ(i), ǫ(k)) = σikI.

143

Page 144: Multivariate (MV) data consist of observations on two or more

Point Estimation of Parameters

Because of the possible dependence between ǫ(i) and ǫ(k),it would seem inappropriate to perform inference on theelements of β by running m separate UV regression anal-yses.

In fact, this is only partly true. It turns out that de-spite the possible dependence, the least squares estimate(LSE) of β(i) can be obtained exclusively from the ithUV regression. That is, the LSE of β(i) is

β(i) = (Z′Z)−1Z′y(i).

Can put these all into one big matrix:

Matrix of predicted (or fitted) values: Y =

Matrix of fitted residuals: ǫ =

144

Page 145: Multivariate (MV) data consist of observations on two or more

The residuals are orthogonal to the columns of Z, andthus to the predicted values, i.e.

Consequently, the Total SS&CP matrix, Y′Y, can bedecomposed into 2 parts, as follows:

Likewise the mean-corrected Total SS&CP matrix, (Y−1n1n1

′nY)′(Y− 1

n1n1′nY), can be decomposed as follows,

to yield the so-called overall MANOVA:

Can estimate Σ = (σik) by the Residual SS&CP matrixdivided by its df, i.e.,

Σ =1

n− r − 1ǫ′ǫ.

145

Page 146: Multivariate (MV) data consist of observations on two or more

Some sampling properties of the LSE’s and related quan-tities:

1. β(i) is unbiased, i.e., E(β(i)) = β(i) (i = 1, . . . , m)

2. cov(β(i), β(k)) = σik(Z′Z)−1 (i, k = 1, . . . ,m)

3. E(ǫ(i)) = 0 (i = 1, . . . , m)

4. E(Σ) = Σ.

5. ǫ and β are uncorrelated, i.e. every column of ǫ isuncorrelated with every column of β.

Now suppose that we are also willing to assume that theǫji’s have a MVN distribution. More precisely, assumethat

146

Page 147: Multivariate (MV) data consist of observations on two or more

Then:

• β is the MLE of β

• β, when its columns are strung out as one long vector,has a MVN distribution

• Σ = 1nǫ′ǫ =

(n−r−1

n

)Σ is the MLE of Σ

• nΣ ∼ Wn−r−1(Σ)

Hypothesis Testing

The first general type of hypothesis we shall test is of theform

H0 : β(2) = 0 where β =

β(1)

β(2)

Examples:

• An overall test of the regression, i.e. testing whetherall of the coefficients corresponding to the explanatoryvariables (other than the intercept) are equal to 0. Forthis case, q = 0.

• Testing for the importance of any single explanatoryvariable in the absence of any others (except for theintercept). For this case, q = 0 and r = 1.

147

Page 148: Multivariate (MV) data consist of observations on two or more

• Testing for the importance of any single explanatoryvariable in the presence of t others (plus the intercept).For this case, q = t and r = t + 1.

• The previous two could be strung together to yield asequence of “single-variable hypotheses.”

• Testing for the importance of s explanatory variablesin the presence of t others (plus the intercept). Forthis case, q = t and r = t + s.

148

Page 149: Multivariate (MV) data consist of observations on two or more

To test these hypotheses, consider a “reduced-model ver-sus full-model” testing approach. Under H0 : β(2) = 0,the model is

Y = Z1β(1) + ǫ

and the Error SS&CP matrix is

Under H1 : β(2) 6= 0, the model is

Y = Z1β(1) + Z2β

(2) + ǫ

and the Error SS&CP matrix is

Now, the reduced model cannot fit the data any betterthan full model (in the sense of minimizing the residualSS&CP matrix). If the reduced model fits almost as wellas the full model, then the two Error SS&CP matricesshould be about equal. But if the reduced model fitssubstantially worse than the full model, then nΣ will be“smaller” (in some sense) than nΣ0.

Specifically, we will reject H0 if

Λ∗ =|Σ||Σ0|

,

is too small. This coincides with the likelihood ratio test.

149

Page 150: Multivariate (MV) data consist of observations on two or more

Equivalently, we could reject H0 if

−n log

|Σ||Σ0|

is too large.

To obtain an actual cut-off value, we will use a large-sample result. Specifically, we will reject H0 at approxi-mate level α if

−[n− r− 1− 1

2(m− r + q + 1)] log

|Σ||Σ0|

> χ2

m(r−q),α.

To yield a good approximation, both n − r and n − mshould be “large.”

Now see the first two handouts on the analysis of the“girls9” data.

150

Page 151: Multivariate (MV) data consist of observations on two or more

Hypothesis Testing (Continued)

Next, consider testing hypotheses of the formH0 : CβM =0 versus H1 : CβM 6= 0.

• C picks out or compares coefficients corresponding todifferent explanatory variables.

• M picks out or compares coefficients corresponding todifferent dependent variables.

• The general hypothesis we considered previously, H0 :β(2) = 0, is the special case of this hypothesis obtainedby putting C = [0(r−q)×(q+1), Ir−q] and M = Im.

Examples, in the particular case of the “girls9” data:

• Overall test of significance of the regression

• Test of importance of ht in a model with age in it

• Test of difference in slope coefficients of ht in a model

151

Page 152: Multivariate (MV) data consist of observations on two or more

with age in it

All of these hypotheses can be tested by an appropriateWilk’s lambda statistic.

Now see the third handout of the analysis of the “girls9”data.

152

Page 153: Multivariate (MV) data consist of observations on two or more

Confidence ellipsoids and simultaneous confidenceintervals

1. For the vector of mean responses (and its elements) ata given z0

• Point estimate of (z′0β)′ = β′z0 is β

′z0.

• 100(1− α)% confidence ellipsoid for β′z0:

(β′z0 − β′z0)

′[z′0(Z′Z)−1z0Σ]−1(β′z0 − β

′z0)

≤ m(n− r − 1)

n− r −mFα,m,n−r−m

• 100(1− α)% Bonferroni-based simultaneous confi-dence intervals for z′0β(i):

z′0β(i) ± tα/(2m),n−r−1

√σiiz′0(Z

′Z)−1z0

(i = 1, . . . , m)

• 100(1−α)% T 2-based simultaneous confidence in-tervals for z′0β(i):

z′0β(i) ±√√√√√√√m(n− r − 1)

n− r −mFα,m,n−r−m

×√σiiz′0(Z

′Z)−1z0 (i = 1, . . . , m)

153

Page 154: Multivariate (MV) data consist of observations on two or more

2. For the vector of new responses (and its elements) ata given z0

• Point estimate of y0 ≡ (z′0β + ǫ′0)′ = β′z0 + ǫ0 is

β′z0.

• 100(1− α)% confidence ellipsoid for y0:

(y0 − β′z0)

′[(1 + z′0(Z′Z)−1z0)Σ]−1(y0 − β

′z0)

≤ m(n− r − 1)

n− r −mFα,m,n−r−m

• 100(1− α)% Bonferroni-based simultaneous confi-dence intervals for y0i:

z′0β(i) ± tα/(2m),n−r−1

√σii(1 + z′0(Z

′Z)−1z0)

(i = 1, . . . , m)

• 100(1−α)% T 2-based simultaneous confidence in-tervals for y0i:

z′0β(i) ±√√√√√√√m(n− r − 1)

n− r −mFα,m,n−r−m

×√σii(1 + z′0(Z

′Z)−1z0) (i = 1, . . . ,m)

154

Page 155: Multivariate (MV) data consist of observations on two or more

3. 100(1−α)% Bonferroni-based simultaneous confidenceintervals for the elements of β:

βqi ± tα/[2m(r+1)],n−r−1

√σiicqq

(q = 1, . . . , r + 1; i = 1, . . . , m)

where cqq is the qth diagonal element of (Z′Z)−1.

Since normality is assumed for hypothesis testing and in-terval estimation, this assumption should be checked ifthese inference procedures are to be used. The techniquesof Chapter 4 can be applied to the rows of ǫ.

155

Page 156: Multivariate (MV) data consist of observations on two or more

The Concept of Linear Regression

Suppose we take independent observations of a p×1 ran-dom vector X, which we partition into two subvectors Yand Z as follows (note that we’re using some symbols torepresent different things now than they represented lasttime):

X =

Y

Z

.

Recall from Chapter 4 that if X ∼ Np(µ,Σ) where

µ =

µY

µZ

and Σ =

ΣY Y ΣY Z

ΣZY ΣZZ

,

then the conditional distribution of Y|Z = z is

The two quantities

µY ·Z ≡

and

ΣY Y ·Z ≡

are useful whenX has any distribution, not just the MVNdistribution (though they are not necessarily the condi-tional mean and conditional covariance matrix ofY givenZ for other distributions).

156

Page 157: Multivariate (MV) data consist of observations on two or more

• µY ·Z is called the (population) regression functionof Y on Z. It has certain optimality properties as apredictor of Y, regardless of the distribution of X.

• β = ΣY ZΣ−1ZZ is called the matrix of (population)

regression coefficients.

• ΣY Y ·Z is called the partial covariance matrix of Y(adjusted for Z). Its diagonal elements are calledthe partial variances and its off-diagonal elementsare called the partial covariances of Y (adjusted forZ). They convey how much variation and covariationthere is among the elements of Y after adjusting forany linear relationship existing between Y and Z.

157

Page 158: Multivariate (MV) data consist of observations on two or more

Example:

Now suppose that we have observed a random sampleX1, . . . ,Xn of the random vector denoted by X on theprevious page. Then:

• A “good” estimate of the regression function is

µY ·Z(z) = Y + SY ZS−1ZZ(z− Z)

where

S =1

n− 1

n∑

j=1(Xj − X)(Xj − X)′ =

SY Y SY Z

SZY SZZ

158

Page 159: Multivariate (MV) data consist of observations on two or more

Note that µY ·Z(z) is identical to the fitted value atZ = z from a MV regression analysis.

Note also that µY ·Z(z) is equal to the MLE if theoriginal distribution is MVN.

• A “good” estimate of the partial covariance matrix is

SY Y ·Z = SY Y − SY ZS−1ZZSZY .

Example (continued):

159

Page 160: Multivariate (MV) data consist of observations on two or more

LetΣY Y ·Z = (σij·Z), SY Y ·Z = (Sij·Z).

Also let

σ′YiZ

= [cov(Yi, Z1), . . . , cov(Yi, Zr)],

S′YiZ

= the corresponding vector within S.

Certain functions of these quantities describe certain typesof linear association:

1. The partial correlation coefficient

ρij·Z =σij·Z√

σii·Zσjj·Z

measures the linear association between Yi and Yj af-ter eliminating (adjusting for) the effects ofZ1, . . . , Zr.It can be estimated as follows:

rij·Z =Sij·Z

√Sii·ZSjj·Z

.

160

Page 161: Multivariate (MV) data consist of observations on two or more

2. The multiple correlation coefficient

ρYi(Z) =

√√√√√√√σ′

YiZΣ−1

ZZσYiZ

σii

measures the linear association between Yi and Z.Specifically, for each i it equals the maximum corre-lation between Yi and all possible linear combinationsof Z. It can be estimated as follows:

RYi(Z) =

√√√√√√√S′YiZ

S−1ZZSYiZ

Sii.

Example (continued):

161

Page 162: Multivariate (MV) data consist of observations on two or more

Another example (Problem 7.14 from textbook):

• Y = rate of return on investment

• Z1 = manager’s attitude toward risk (1=very conser-vative, . . . , 5=very aggressive)

• Z2 = years of experience

• Observed correlation matrix based on random sampleof size 25:

R =

1.0 −.35 .82−.35 1.0 −.60.82 −.60 1.0

162

Page 163: Multivariate (MV) data consist of observations on two or more

Principal Components Analysis (PCA)

Introductory remarks:

• PCA is a technique for examining relationships amonga set of p (generally correlated) variables.

• PCA linearly transforms the original set of p variablesto a new set of p uncorrelated variables, and orders thevariables in decreasing order of “importance.” Thenew variables are called the principal components.

• The usual objective of PCA is to see if the first fewPC’s account for most of the variation in the originaldata. If they do, then it is argued that the effectivedimensionality of the variables is less than p.

163

Page 164: Multivariate (MV) data consist of observations on two or more

• If the first few PC’s account for most of the variation,then two main uses of PCA historically have been to:

– Give meaningful interpretations to the PC’s.

– Reduce the dimensionality of the data to simplifyfurther MVA.

Most statisticians now believe their main use shouldonly be the second of these.

• PCA should be applied only to variables that are “onan equal footing,” i.e. not to variables that can beseparated into dependent and explanatory variables.

• PCA is a mathematical technique; it does not requirethe user to specify a probability distribution for thedata.

164

Page 165: Multivariate (MV) data consist of observations on two or more

Mathematical derivation of (population) principal com-ponents (of covariance matrix):

• Suppose X is a p× 1 random vector with p.d. covari-ance matrix Σ.

• Σ has p (eigenvalue, eigenvector) pairs

where λ1 ≥ λ2 ≥ · · · ≥ λp > 0 and the ei’s areorthonormal.

• Consider p arbitrary (for now) linear combinations ofthe elements of X:

165

Page 166: Multivariate (MV) data consist of observations on two or more

The PC’s are special choices of the ℓ′iX’s; loosely, theyare the choices that maximize the variance, subject tobeing uncorrelated with all the others. More precisely,the ith PC is the ℓ′iX that maximizes ℓ′iΣℓi subjectto the constraints ℓ′iℓi = 1 and ℓ′iΣℓk = 0 for k =1, . . . , i− 1.

• It turns out (see Result 8.1 in text) that the ℓi’s thatdo the job are the eigenvectors ofΣ, i.e. the ei’s. Thus,the PC’s are

The magnitude of eki indicates the importance of Xk

to the ith PC.

• Furthermore, the maximized value of var(ℓ′iX) is

That is, the PC’s have variances equal to the eigen-values of Σ.

• Now, the sum of Σ’s eigenvalues is equal to the sumof the variances, i.e.

Thus, the proportion of the total population variancedue to the kth PC is

166

Page 167: Multivariate (MV) data consist of observations on two or more

Example:

167

Page 168: Multivariate (MV) data consist of observations on two or more

PCA of (population) correlation matrix:

• It is quite common to calculate the PC’s of a set ofvariables after they have been standardized to haveunit variance.

• This means that we would be finding the PC’s of thecorrelation matrix ρ, rather than of Σ. The eigenval-ues and eigenvectors of ρ are generally NOT the sameas those of Σ.

• Choosing to do a PCA of ρ rather than Σ involves adefinite but arbitrary decision to regard the originalvariables as equally important. (More discussion tocome later.)

• For ρ, what do the eigenvalues sum up to?

Hence the proportion of total variation accounted forby the ith PC is:

168

Page 169: Multivariate (MV) data consist of observations on two or more

Example (continued):

Now examine the class handout of a PCA of the radio-therapy data using PROC PRINCOMP in SAS.

169

Page 170: Multivariate (MV) data consist of observations on two or more

Principal Components Analysis, Part 2

Geometric Interpretation: PCA can be thought of as arotation of the original coordinate axes in p-dimensionalspace.

Example:

Some important special cases in PCA:

• Uncorrelated original variables. Suppose one origi-nal variable, say Xi is uncorrelated with all the otheroriginal variables and has variance σii. Then the ithcolumn of Σ is

Moreover,

170

Page 171: Multivariate (MV) data consist of observations on two or more

Thus, Xi is itself a PC, and σii is the eigenvalue cor-responding to this PC. Which PC Xi is depends onthe value of σii relative to the other eigenvalues of Σ.

If all p variables are uncorrelated, the PC’s are thesame as the original variables, but arranged in de-creasing order of the variances. PCA is of no benefitin this case.

• Repeated eigenvalues. If, for some q and k,

λq+1 = λq+2 = · · · = λq+k,

then λ ≡ λq+1 is said to be an eigenvalue with multi-plicity k. The eigenvectors corresponding to multipleeigenvalues are NOT unique, so no meaning should beascribed to the corresponding PC’s. If all the eigen-values are equal, then PCA is of little benefit.

171

Page 172: Multivariate (MV) data consist of observations on two or more

• Structured covariance matrices. Some covariancematrices have a certain pattern or structure to them.It is often of interest what the principal componentsare for such a matrix.

A classical example of such a structure is compoundsymmetry:

172

Page 173: Multivariate (MV) data consist of observations on two or more

• Zero eigenvalues. If the original variables are linearlydependent, then at least one of the eigenvalues willbe 0. (The converse is also true.) We excluded thispossibility by assuming thatΣ is positive definite, butif we relaxed this assumption by allowing Σ to benonnegative definite, then we would interpret the PC’scorresponding to zero eigenvalues as explaining noneof the variation.

173

Page 174: Multivariate (MV) data consist of observations on two or more

PCA for a Random Sample (Rather than a Population):

Our discussion to this point has dealt with PCA of apopulation covariance matrix or correlation matrix, thuswe have implicitly assumed that it is known. Generallythis is not so, in which case we apply PCA to the samplecovariance matrix or sample correlation matrix.

• We can regard the PC’s and their estimated variancesas estimates of the population PC’s and their vari-ances.

• If the population is MVN, some asymptotic theory onthe behavior of these estimates has been worked out.

• Modern view: PCA is an exploratory data analytictechnique for dimension reduction. Inferential aspectsare de-emphasized.

174

Page 175: Multivariate (MV) data consist of observations on two or more

The Thorny Issue of Scaling:

PCA depends critically on the scales used to measure thevariables; thus, they are generally not a unique charac-teristic of the data. Some implications of this are:

• If one variable has a much larger variance than theothers, then this variable will dominate the first PCof Σ regardless of the correlation structure.

• If we change the units on this variable so that it hasa much smaller variance, then the first PC of Σ maychange dramatically.

Therefore, there is little point in doing a PCA unless oneof the following is true:

• The variables are unitless (for example, percentages).

• The variables are all measured in the same units.

• The variables have (or are transformed to have) roughlysimilar variances.

Consequently, unless the situation fits into the first orsecond of these cases, the PCA should be based on thecorrelation matrix. Even basing PCA on the correlationmatrix is somewhat arbitrary, since it forces the variablesto be given equal importance.

Scaling problems do not arise in most of the other kindsof MVA procedures we have considered.

175

Page 176: Multivariate (MV) data consist of observations on two or more

Worthwhile uses of PCA — some examples:

• Checking for MVN by bivariate scatterplots and Q-Qplots of the first few PC’s.

• Checking for unusual observations by plots of the samekind as above. Clusters of points may also be revealed.Example of changes in pollen spectrum over time:

• To avoid problems caused by multicollinearity of ex-planatory variables in MV regression analyses. In-stead of regressing Y on all the explanatory variables,we could regress Y on the first few PC’s of the ex-planatory variables.

• To avoid singularity problems in discriminant analy-sis when the number of observations is less than thenumber of variables. (More to come later.)

None of these uses require us to ascribe any meaning tothe PC’s.

176

Page 177: Multivariate (MV) data consist of observations on two or more

Factor Analysis (FA)

In FA, we attempt to represent the p variables inX as lin-ear combinations of a few latent variables F1, F2, . . . , Fm (m <p) called factors.

The factors:

• have values that vary from individual to individual

• are not observed

• are hypothetical constructs

For example, suppose

R =

1 .95 .05 .05 .051 .03 .06 .02

1 .91 .861 .92

1

.

Here, X1 and X2 may be representable by a single factor;also, X3, X4, and X5 may be representable by a singlefactor.

177

Page 178: Multivariate (MV) data consist of observations on two or more

FA is similar to PCA in that both seek a simpler struc-ture in a set of variables (i.e., dimension reduction). Theyhave the following differences, however:

1. PC’s are linear combinations of the original variables.In FA, the original variables are expressed as linearcombinations of the factors.

2. In PCA we seek to explain a large proportion of thetotal variation. In FA we seek to account for the co-variances or correlations among the original variables.

178

Page 179: Multivariate (MV) data consist of observations on two or more

The Orthogonal Factor Model:

X1 − µ1 = ℓ11F1 + ℓ12F2 + · · · + ℓ1mFm + ǫ1...

Xp − µp = ℓp1F1 + ℓp2F2 + · · · + ℓpmFm + ǫp

orX− µ = LF + ǫ.

Here F1, . . . , Fm are the common factors; the ℓij’s arethe loadings. Also assume that

E(F) = 0, E(ǫ) = 0, cov(F) = I,

cov(ǫ) = Ψ (diagonal),

and that F and ǫ are independent. Then Σ = cov(X) =LL

′+Ψ. Note that LL

′is a simplified configuration for

the covariances. FA consists of estimating L and Ψ fromS (or R).

There are several popular methods of estimation; unfortu-nately, they often give quite different answers. If m ≥ 2,the factor loadings are not unique (can post–multiply L

by any orthogonal matrix Q).

179

Page 180: Multivariate (MV) data consist of observations on two or more

Canonical Correlation

Recall that the ordinary correlation coefficient betweentwo scalar variables X1 and X2, i.e. ρ12 = σ12√

σ11σ22, mea-

sures the linear association between X1 and X2. Alsorecall that the multiple correlation coefficient between avariable X1 and a vector X2, i.e.

ρX1(X2) =

√√√√√√√√σ

′X1X2

Σ−1X2X2

σX1X2

σX1X1

,

measures the linear association between X1 and X2, andthat it is equal to maxb corr(X1,b

′X2).

Suppose we want to measure the correlation between twosets of variables, X1 (a p × 1 vector) and X2 (a q × 1vector), by a scalar. How should we measure this? Byanalogy with ρX1(X2), we might consider something like

|Σ12Σ

−122 Σ21|

|Σ11|

12

.

180

Page 181: Multivariate (MV) data consist of observations on two or more

There are other possibilities, however, and it turns outthat the best measure, from several standpoints, is thelargest eigenvalue of

Σ−1

211 Σ12Σ

−122 Σ21Σ

−12

11 .

Denote this largest eigenvalue by ρ∗12 and call ρ∗1 =

√ρ∗1

2

the first canonical correlation coefficient.

It turns out that |ρ∗1| = maxa,b corr(a′X1,b

′X2) and that

this maximum is attained when a′= e

′1Σ

−12

11 , b′= f

′1Σ

−12

22

where e1 is the eigenvector of Σ−1

211 Σ12Σ

−122 Σ21Σ

−12

11 asso-ciated with its largest eigenvalue ρ∗1

2, and f1 is the eigen-

vector of Σ−1

222 Σ21Σ

−111 Σ12Σ

−12

22 associated with its largesteigenvalue (which also happens to be ρ∗1

2).

Let U1 = e′1Σ

−1/211 X1 and V1 = f

′1Σ

−1/222 X2 be the maxi-

mizing linear combinations.

181

Page 182: Multivariate (MV) data consist of observations on two or more

Facts:

• Canonical correlations are invariant to changes of scaleon either the elements ofX1 orX2. (Same for ordinaryand multiple correlation coefficients.)

• |ρ∗1| ≥ maxi ρXi(X2) ≥ maxij ρXiXjwhere i ∈ (1, 2, . . . , p)

and j ∈ (p + 1, . . . , q). (Assuming p ≤ q.)

182

Page 183: Multivariate (MV) data consist of observations on two or more

Example:

R =

1.0 .6328 .2412 .05861.0 −.0553 .0655

1.0 .42481.0

n = 160 children.

X1 =

reading speedreading power

, X2 =

arithmetic speedarithmetic power

We obtain

ρ∗1 = .39,

U1 = 1.26 ∗ (reading speed)− 1.03 ∗ (reading power),

V1 = 1.1 ∗ (arithmetic speed)

−.45 ∗ (arithmetic power).

Thus, reading ability (summarized by U1) correlates mod-erately positively with arithmetic ability (summarized byV1).

183

Page 184: Multivariate (MV) data consist of observations on two or more

Discrimination, Classification, and Clustering

These are all methods for grouping individuals based ontheir values of a multivariate vector of measurements X.They can be distinguished by what one “knows” about

the groups.

1. Discrimination — separating individuals into a speci-fied number of groups. The number of groups is spec-ified and we know which individuals belong to whichgroups, but we need to determine what is the bestvariable or combination of variables for effectively sep-arating the groups.

Example: R.A. Fisher’s classical iris data set. Data onX1 = sepal length,X2 = sepal width,X3 = petal length,and X4 = petal width of 50 flowers from each of threeclosely related species of iris. We may want to deter-mine the linear combination of the 4 variables thatbest separates the 3 species.

184

Page 185: Multivariate (MV) data consist of observations on two or more

2. Classification (Allocation) — classifying a “new” in-dividual, whose group membership is unknown, intoone of two or more groups. The number of groups isknown. We want to classify the new individual in sucha way that the probability or cost of misclassificationis minimized. Often, this is accomplished using theresults of a discriminant analysis.

Example: Good and bad credit risks. A loan officer ata bank could collect data on X1 = income, X2 = age,X3 = length of employment at current job, etc. ofpeople who have previously received loans from thebank, and then try to classify each new loan applica-tion as good or bad using these variables.

3. Clustering — forming groups of similar individuals.Neither the number of groups, nor which individualsbelong to which groups, is pre-specified.

Example: 18 different measurements on 8 hominids.

Classification for Two Populations

Problem: We need to assign a new object, with corre-sponding p × 1 measurement vector x0, to one of twopopulations π1 and π2.

We assume that π1 and π2 are large and that the variablesmeasured are “not too discrete,” so that the probability

185

Page 186: Multivariate (MV) data consist of observations on two or more

distribution of X for each population can be modeled bya pdf. Let

f1(x) = pdf for π1, f2(x) = pdf for π2.

Also let Ω be the combined sample space, i.e. the set ofall possible values of X regardless of which population itcomes from.

186

Page 187: Multivariate (MV) data consist of observations on two or more

In classification, we must partition Ω into two disjointsubsets R1 and R2, such that if x0 ∈ R1 then we willclassify it as belonging to π1 and if x0 ∈ R2 then we willclassify it as belonging to π2. Illustration:

If the support of π1 overlaps with the support of π2, thenerrors (misclassification errors) are possible. In fact, thereare four possible outcomes of the entire classification pro-cess, two of which are errors:

1. Correctly classifying a π1-object

2. Misclassifying a π2-object as belonging to π1

3. Correctly classifying a π2-object

4. Misclassifying a π1-object as belonging to π2

187

Page 188: Multivariate (MV) data consist of observations on two or more

Expressions for the probabilities of each of these possibleoutcomes can be determined, as follows. Let pi be theprior probability that a randomly selected object fromπ1 ∪ π2 belongs to πi (i = 1, 2). Also define

P (i|j) = P (X ∈ Ri|πj) =∫

Rifj(x) dx

(i = 1, 2; j = 1, 2).

Thus, for a randomly selected object from π1 ∪ π2,

1. P (correctly classifying a π1-object)=

2. P (misclassifying a π2-object as belonging to π1)=

3. P (correctly classifying a π2-object)=

4. P (misclassifying a π1-object as belonging to π2)=

188

Page 189: Multivariate (MV) data consist of observations on two or more

A good classification procedure should have small misclas-sification probabilities. Even more important, however, ishaving small expected misclassification costs. Often, inpractice, the cost of one of the misclassification errors isdifferent from the cost of the other (e.g., making a badloan may be more costly than not making a good one).

Cost matrix:

Then the expected cost of misclassification, ECM, is:

189

Page 190: Multivariate (MV) data consist of observations on two or more

Minimum ECM Rule:

(a) General case. The regions R1 and R2 that minimizethe ECM are as follows:

R1 =

x :

f1(x)

f2(x)≥ c(1|2)

c(2|1) ·p2p1

R2 =

x :

f1(x)

f2(x)<

c(1|2)c(2|1) ·

p2p1

Example:

190

Page 191: Multivariate (MV) data consist of observations on two or more

(b) MVN case with common covariance matrix Σ. Sup-pose

f1(x) ∼ Np(µ1,Σ) and f2(x) ∼ Np(µ2,Σ).

Also, suppose initially that the parameters µ1, µ2,and Σ are known. Then after some algebra we findthat the minimum ECM rule is to classify a new objectx0 as π1 if

(µ1 − µ2)′Σ−1x0 −

1

2(µ1 − µ2)

′Σ−1(µ1 + µ2)

≥ log

c(1|2)p2c(2|1)p1

.

In practice the parameters are unknown so we takerandom samples from each population and replace theparameters with sample-based estimates to obtain thefollowing “estimated” ECM rule: Classify a new ob-ject x0 to π1 if

(x1 − x2)′S−1

pooledx0 −1

2(x1 − x2)

′S−1pooled(x1 + x2)

≥ log

c(1|2)p2c(2|1)p1

.

191

Page 192: Multivariate (MV) data consist of observations on two or more

Observe that the LHS is a linear function of x0.

Example:

(c) MVN case with Σ1 6= Σ2. The estimated ECM ruleis to classify x0 as π1 if

−1

2x′0(S

−11 − S−1

2 )x0 + (x′1S

−11 − x′

2S−12 )x0 − k

≥ log

c(1|2)p2c(2|1)p1

where k, which doesn’t depend on x0, is defined inthe textbook. Observe that the LHS is a quadraticfunction of x0.

192

Page 193: Multivariate (MV) data consist of observations on two or more

Example:

193

Page 194: Multivariate (MV) data consist of observations on two or more

Discriminant Analysis for Two Populations

Consider again the classification rule given previously:

Classify a new object x0 in π1 if

(X1 − X2)′S−1

pooledx0 −1

2(X1 − X2)

′S−1pooled(X1 + X2)

≥ log

c(1|2)p2c(2|1)p1

.

This rule was motivated as an estimated minimum ECMrule for a situation with two normal populations withcommon covariance matrix.

But there is a completely different motivation that leadsto essentially the same rule. This second motivation isdiscrimination, i.e. maximum separation of two popula-tions.

194

Page 195: Multivariate (MV) data consist of observations on two or more

Suppose we have random samples from two MV popula-tions, π1 and π2, i.e.

X11, . . . ,X1n1 ∼ iid from π1,

X21, . . . ,X2n2 ∼ iid from π2.

Suppose further that the two populations have the samecovariance matrix, but they need not be MVN. Now con-sider how we might linearly transform each MV obser-vation to a UV observation in such a way that the UVobservations from π1 are “separated as much as possi-ble” from the UV observations from π2. (The same lineartransformation is to be applied to all observations.) Now,for any given p × 1 vector ℓ, we could define UV obser-vations

Yij = ℓ′Xij,

and thenY11, . . . , Y1n1 ∼ iid from π1,

Y21, . . . , Y2n2 ∼ iid from π2.

195

Page 196: Multivariate (MV) data consist of observations on two or more

Now suppose we measure the separation of the Y1j’s fromthe Y2j’s by the difference in Y1 and Y2, scaled by thepooled standard deviation of the Y -values. That is, chooseℓ to maximize

|Y1 − Y2|SY

where

S2Y =

∑n1j=1(Y1j − Y1)

2 + ∑n2j=1(Y2j − Y2)

2

n1 + n2 − 2.

Key fact: Maximizing the expression above is equivalentto maximizing

[ℓ′(X1 − X2)]2

ℓ′Spooledℓ.

By the extended Cauchy-Schwartz inequality (from Chap-ter 2), the maximizing value of ℓ is

ℓ ≡ S−1pooled(X1 − X2)

and the maximum value is

D2 ≡ (X1 − X2)′S−1

pooled(X1 − X2).

196

Page 197: Multivariate (MV) data consist of observations on two or more

The function g(x) = ℓ′x = (X1 − X2)

′S−1pooledx is called

Fisher’s discriminant function. Note that it is linear in x,hence the equation obtained by setting the function equalto a constant is a line in R2, a plane in R3, etc.

Toy example:

The discriminant function can be used to construct thefollowing classification rule. Simply classify x0 in π1 if

y0 ≡ ℓ′x0 is closer to Y1 than to Y2.

197

Page 198: Multivariate (MV) data consist of observations on two or more

It turns out that the midpoint between Y1 and Y2 is equalto 1

2(X1− X2)′S−1

pooled(X1+ X2) and that numbers largerthan this are on the “Y1-side” of this midpoint. Thus, theclassification rule above can be expressed as follows:

Classify x0 in π1 if

y0 ≥1

2(X1 − X2)

′S−1pooled(X1 + X2),

or equivalently if

(X1 − X2)′S−1

pooledx0 −1

2(X1 − X2)

′S−1pooled(X1 + X2)

≥ 0.

Observe that this rule is the same as the special caseof the estimated minimum ECM rule for two normalpopulations with common covariance matrix, in whichc(1|2)p2 = c(2|1)p1.

Now see a worked example, using SAS, on a class hand-out.

198

Page 199: Multivariate (MV) data consist of observations on two or more

Error Rates for Classification Procedures

The goal of classification is to assign new observationsto the populations, making as few misclassifications aspossible (perhaps taking costs into account). Thus, it isdesirable to have some way to quantify the performance ofa classification procedure, i.e. to estimate the probabilityof misclassifying a new observation.

For simplicity we will assume that the misclassificationcosts are equal, i.e.

c(1|2) = c(2|1) ≡ c.

Then the total probability of misclassification, TPM, isequal to ECM/c and is given by

TPM = P (misclassify as π1) + P (misclassify as π2)

= P (classify as π1| belongs to π2)p2+P (classify as π2| belongs to π1)p1

=

199

Page 200: Multivariate (MV) data consist of observations on two or more

The smallest value of TPM, i.e. the value obtained by thebest choice of R1 and R2, is called the optimum errorrate (OER).

So for example in the MVN case with common covariancematrix, OER is equal to the expression for TPM abovewith

R1 =x : (µ1 − µ2)

′Σ−1x

−1

2(µ1 − µ2)

′Σ−1(µ1 + µ2)

≥ log

p2p1

.

In practice, of course, we generally do not know the twoprobability distributions’ parameters so we cannot calcu-late OER. Instead, we must replace the minimum TPMrule (R1, R2) with the estimated minimum TPM rule,say (R1, R2), which is calculated from the data sampledfrom the two populations (collectively called the trainingsample).

200

Page 201: Multivariate (MV) data consist of observations on two or more

For example, in the MVN case with common covariancematrix,

R1 =x : (X1 − X2)

′S−1pooledx

−1

2(X1 − X2)

′S−1pooled(X1 + X2)

≥ log

p2p1

.

The error rate of the rule (R1, R2) is called the actualerror rate (AER) and is given by

AER =

But AER, like OER, cannot be calculated in practice be-cause it is still functionally dependent on the probabilitydistributions’ parameters (through f1(·) and f2(·)). Nev-ertheless, we can estimate AER from the same data usedto calculate (R1, R2). Specifically, we estimate AER bythe apparent error rate (APER) defined by

APER =# misclassifications in the training sample

# observations in the training sample.

201

Page 202: Multivariate (MV) data consist of observations on two or more

2× 2 table of outcome frequencies in training sample:

APER =

Unfortunately, APER tends to underestimate AER. (Thisis due to the fact that the same data used to calculate(R1, R2) are used to estimate AER.)

Consequently, some other, more complicated estimates ofAER have been devised. One of these is based on a cross-validation idea similar to the case-deletion diagnostic ideain regression analysis. This approach proceeds as follows:

202

Page 203: Multivariate (MV) data consist of observations on two or more

1. Delete the first observation from the training sample.

2. Calculate the estimated minimum TPM classificationrule based on the remainingn1 + n2 − 1 observations.

3. Classify the deleted observation, and compare the re-sult to its known group membership.

4. Repeat steps 1, 2, and 3 for every observation andtabulate the number of misclassifications.

The resulting estimate of AER is called E(AER) in thetextbook and is given by

E(AER) =

Now return to the class handout to see how to obtainAPER and E(AER) using SAS.

203

Page 204: Multivariate (MV) data consist of observations on two or more

Extension of Classification to More Than TwoPopulations

We will consider the MVN case and estimated minimumTPM rule only.

Suppose we have g MVN populations π1, . . . , πg and wetake a random sample from each:

X11 . . . ,X1n1 ∼ iid N(µ1,Σ1)

X21 . . . ,X2n2 ∼ iid N(µ2,Σ2)...

Xg1 . . . ,Xgng ∼ iid N(µg,Σg)

204

Page 205: Multivariate (MV) data consist of observations on two or more

The estimated minimum TPM rule is as follows:

(a) If Σ1 = Σ2 = · · · = Σg, then assign x to πk if

dk(x) = maxd1(x), . . . , dg(x), where

di(x) = X′iS

−1pooledx− 1

2X′

iS−1pooledXi + log pi

(linear discriminant scores)

(b) If covariance matrices are unequal, then assign x to

πk if dQk (x) = maxdQ1 (x), . . . , dQg (x), where

dQi (x) = −1

2log |Si|−

1

2(x− Xi)

′S−1i (x− Xi)+ log pi

(quadratic discriminant scores)

Now see the class handout analyzing the iris data usingSAS.

205

Page 206: Multivariate (MV) data consist of observations on two or more

Classification Using Logistic Regression

Recall (for most of you) that logistic regression is used tostudy the relationship between a binary response variable,Y , and one or more explanatory variables (which can bediscrete or continuous), Z. The underlying model is

Pr(Yj = y) = py(zj)[1− p(zj)]1−y, y = 0, 1

where

p(z) = p(z : β) =exp(β0 + β

′1z)

1 + exp(β0 + β′1z)

,

or equivalently,

log

p(z)

1− p(z)

= β0 + β

′1z.

By taking Y to be 1 if the observation belongs to π1, and0 if it belongs to π2, we can use logistic regression to doclassification. We simply fit the logistic regression modelto the training dataset by the method of maximum likeli-

hood, obtaining the MLE β = (β0, β′

1)′, and then classify

a new observation with observed explanatory variables zas belonging to π1 if p(z; β) > 0.5, else we classify it toπ2.

206

Page 207: Multivariate (MV) data consist of observations on two or more

Since p(z) is just alternative notation for Pr(Y = 1|Z =z), we see that we can rewrite the last equation on theprevious page as

log

Pr(Y = 1|Z = z)

Pr(Y = 0|Z = z)

= β0 + β

′1z.

Now note that Bayes’ Theorem tells us that for y = 1and y = 0 (correspondingly i = 1 and i = 2),

Pr(Y = y|Z = z) =Pr(Z = z|Y = y)Pr(Y = y)

∑1k=0 Pr(Z = z|Y = k)Pr(Y = k)

=fi(z)pi

∑2k=1 fk(z)pk

.

This implies further that

log

Pr(Y = 1|Z = z)

Pr(Y = 0|Z = z)

= log

f1(z)

f2(z)

+ log

p1p2

,

and we saw earlier that when the LDA assumptions hold(MVN and common covariance matrix), the RHS of thisequation is a linear function of z.

207

Page 208: Multivariate (MV) data consist of observations on two or more

What’s the point? It is that both LDA and logistic re-gression yield linear classifiers. However, they are notidentical, for two reasons:

1. The logistic regression approach is more general interms of assumptions about the distributions; it leavesthe marginal distribution of Z unspecified and modelsthe conditional likelihood, Pr(Y = y|Z = z), instead.

2. The logistic regression approach fits parameters to theconditional likelihood (which is a binomial likelihood)

ℓ(β) =n1+n2∑

j=1yj log p(zj;β)+(1−yj) log(1−p(zj;β))

by iteratively reweighted least squares, accounting forthe dependence of the variance on the mean. LDA, onthe other hand, fits parameters by maximizing the fullMVN likelihood (obtaining MLEs Z1, Z2, and Spooled).

As a result, the logistic regression approach to classifica-tion is less efficient (roughly 30% so) than LDA underLDA assumptions, but it is more robust to departuresfrom LDA assumptions. The prevailing view nowadays isthat the added robustness of logistic regression is worththe possible loss of efficiency.

208

Page 209: Multivariate (MV) data consist of observations on two or more

Classification and Regression Trees

A regression tree is a one-step-ahead, forward selectionalgorithm for inventing predictions that are constant onp-dimensional rectangles that partition the space of ex-planatory variables, by successively make an optimal bi-nary split on one of an existing set of rectangles. A clas-sification tree is similar, except that the prediction isa class label rather than a numeric variable. They arecalled trees because a summary of the optimally chosensplits can be displayed as a tree diagram, i.e., a sequenceof binary decisions. We will describe classification treesonly.

Let Rm denote the mth of the rectangles, and let Nm

denote the number of observations contained in Rm. De-fine the proportion of observations in Rm that belong togroup k as

pmk =1

Nm

xi∈Rm

I(yi = k).

The classifier assigns Rm, and the observations it con-tains, to class k(m) = argmaxk pmk, the majority classinRm. The splits are made to yield the greatest reductionin node impurity, one measure of which is the misclassi-fication error

1

Nm

i∈Rm

I(yi 6= k(m)) = 1− pkm.

209

Page 210: Multivariate (MV) data consist of observations on two or more

Another measure is the Gini index,

K∑

k=1pmk(1− pmk),

which has the advantage of being differentiable (so it ismore amenable to numerical optimization).

After the classification tree is constructed, it is often“pruned.” We will not attempt to describe this part ofthe algorithm.

The R package “tree” can construct a (regression or) clas-sification tree. See an example of its use to classify thehemophilia data on a class handout.

210

Page 211: Multivariate (MV) data consist of observations on two or more

Random Forests

A random forest is a collection of many classification trees.Each tree is grown as follows:

1. Sample n cases (where n is the sample size of the train-ing dataset) randomly, but with replacement, from thetraining dataset. (This is a bootstrap sample.)

2. For each node of the tree, randomly selectm << M ofthe input variables and split the node according to thebest split of thesem variables. (The same value ofm isused throughout, but the specific draw of m variablescan vary over trees and even over nodes within thesame tree.)

3. Grow each tree to the largest extent possible; don’t doany pruning.

For classification, we classify the new object using eachtree in the forest. Each tree gives a classification, and wesay the tree “votes” for that class. The forest chooses theclassification having the most votes.

The R package “randomForest” can carry this out.

211

Page 212: Multivariate (MV) data consist of observations on two or more

Neural Networks

Neural networks are computing algorithms that are basedon a structure of units (neurons) that are connected toeach other in the sense that the output from one unitcan serve as an input to another. There are three basicelements to a neural network:

1. Neurons (aka nodes, computing units) – the basiccomputing elements

2. Network architecture – a description of the connec-tions between nodes

3. Training algorithm – a method for finding values ofnetwork parameters

The neurons exist in “layers,” of which the first is theinput layer and the last is the output layer. In between,there are one or more “hidden layers.” We shall limit ourconsideration to “feed-forward” networks with one hiddenlayer, such as that depicted below:

212

Page 213: Multivariate (MV) data consist of observations on two or more

The input units provide distribute the inputs to the hid-den units in the second layer. The hidden units sum theirinputs, add a constant, and compute a fixed function φh

of the result. The output units are of the same form, butwith output function φo.

Most commonly, φh is taken to be the logistic function

φh(x) =exp(x)

1 + exp(x)

and φo is taken to be a linear, logistic, or indicator func-tion. For classification purposes, φo is the indicator func-tion

φo(x) = I(x > 0).

Thus, for classification the output is

y = Iwo +

hwhoφh(wh +

iwihxi) > 0

.

• This is a nonlinear regression function.

• The parameters (the w’s) of this nonlinear regres-sion function are often estimated by (nonlinear) leastsquares.

• The R package “nnet” can carry this out.

Now see the handout using R’s nnet package to classifythe hemophilia data.

213

Page 214: Multivariate (MV) data consist of observations on two or more

Cluster Analysis: Similarity and DissimilarityMeasures

Clustering is an exploratory technique for discovering re-lationships among objects (thus it is very individual-directed).Objects are formed into groups on the basis of how “sim-ilar” they are (in some sense). Note: the same techniquescan be used to form groups of variables too, but we won’tconsider this.

No prior assumptions are made on howmany groups thereare, nor on which individuals belong to which groups.(This situation is called “unsupervised learning” in thedata mining literature.)

Two important components of a cluster analysis are:

• A similarity (or dissimilarity) measure

• A procedure for grouping similar objects

214

Page 215: Multivariate (MV) data consist of observations on two or more

We begin by considering similarity (and dissimilarity)measures. These may be functions of p-dimensional vec-tors of measurements taken on two objects, xi and xk.Or, they may arise more directly, as in the following ex-ample.

In general, a similarity measure is larger for more similarobjects, and a dissimilarity measure is smaller for moresimilar objects. For any similarity measure s, a dissimi-larity measure can be easily defined as constant−s.

215

Page 216: Multivariate (MV) data consist of observations on two or more

Some common indirect measures:

• Euclidean distance metric

d(xi,xk) =

• Minkowski distance metric

d(xi,xk) = (p∑

j=1|xij − xkj|m)1/m

• Euclidean distance when all variables are binary (i.e.presence or absence of a characteristic is coded as 1 or0, respectively):

(xij − xkj)2 =

1 if xij 6= xkj0 otherwise.

Note that ∑pj=1(xij−xkj)

2 equals the number of “mis-matches” between objects i and k, and thus it treats0-0 matches and 1-1 matches equally. In some situa-tions it may be more sensible to give more similarityweight to the 1-1 matches than to the 0-0 matches.See Table 12.1 in text for several possible ways to dothis; for example, we could use s =# 1-1 matches/p.

Once the similarity or dissimilarity measure is determined,and computed for each pair of individuals, we can usethe resulting similarity or dissimilarity matrix to formgroups. This can be done informally, but less subjectiveapproaches may be preferable.

216

Page 217: Multivariate (MV) data consist of observations on two or more

Cluster Analysis: Hierarchical AgglomerativeClustering

• “Hierarchical” — the smallest groups can be groupedinto larger groups, these larger groups can be groupedinto still larger groups, etc. (like a family tree).

• “Agglomerative” — the algorithm starts with the dis-tinct objects, then groups some together, then groupsthese groups together, etc. until all groups are fusedinto one. (Divisive clustering starts with the entiregroup and partitions it successively.)

General 4-step procedure (in terms of dissimilarity):

1. Obtain the dissimilarity matrix, D, for the N clusters(at this first stage, the clusters are the individuals).

2. Scan D for the most similar pair of clusters; call theseclusters U and V .

217

Page 218: Multivariate (MV) data consist of observations on two or more

3. Merge clusters U and V to form a new cluster, (UV ).Update D by deleting the rows and columns corre-sponding to U and V individually and by adding a rowand column giving the dissimilarities between (UV )and the remaining clusters. (Several ways to definedistance between clusters will be defined very shortly.)

4. Repeat steps 2 and 3 until all objects are in a singlecluster. (Requires N − 1 repetitions.)

The results of any hierarchical clustering algorithm can bedisplayed in the form of a dendrogram, or tree diagram.

218

Page 219: Multivariate (MV) data consist of observations on two or more

There are 3 common ways to measure distance betweenclusters. Here, let dik represent the distance between ob-ject i in cluster (UV ) and object k in cluster W , and letN(UV ) and NW be the numbers of objects in these twoclusters.

• Single linkage (also called minimum distance or nearest-neighbor linkage)

d(UV )W = mindik : i ∈ (UV ), k ∈ W

• Complete linkage (also called maximum distance orfarthest-neighbor linkage)

d(UV )W = maxdik : i ∈ (UV ), k ∈ W

• Average linkage

d(UV )W =∑N(UV )i=1

∑NWk=1 dik

N(UV )NW

219

Page 220: Multivariate (MV) data consist of observations on two or more

Toy Example:

220

Page 221: Multivariate (MV) data consist of observations on two or more

Cluster Analysis: Wrap-Up of HierarchicalAgglomerative Methods

• There are several agglomerative hierarchical cluster-ing procedures besides single linkage, complete link-age, and average linkage.

• It is sensible to try several of these procedures andseveral different similarity or dissimilarity measures.If the dendrograms corresponding to all these choicesare quite consistent with one another, perhaps we canclaim that the grouping is meaningful.

• The stability of a clustering procedure can be checkedby adding or substracting small positive numbers tothe similarities or dissimilarities, and seeing how muchthe dendrogram changes.

221

Page 222: Multivariate (MV) data consist of observations on two or more

• Ties in the similarity or dissimilarity matrix lead tomultiple solutions of a hierarchical agglomerative clus-tering procedure. Single linkage tends to result infewer solutions than average linkage, which in turntends to result in fewer solutions than complete link-age. The dendrograms corresponding to multiple so-lutions should be compared, provided there are not somany solutions that this is infeasible.

222

Page 223: Multivariate (MV) data consist of observations on two or more

Cluster Analysis: Non-Hierarchical Methods

• These methods group objects into K clusters; K gen-erally must be specified to run the algorithm, but thealgorithm should usually be re-run with different val-ues of K to determine its “best” value.

• A popular non-hierarchical clustering method is calledthe K-means method, which is carried out as follows:

1. Partition the objects arbitrarily intoK initial clus-ters.

2. Proceed through the list of objects, reassigning eachobject to the cluster whose centroid (p-dimensionalmean vector) is closest (in a Euclidean distancesense) to the object. Recalculate the centroid forthe cluster receiving the new object and for thecluster losing the object.

3. Repeat the previous step until no more reassign-ments take place.

• Toy example:

223

Page 224: Multivariate (MV) data consist of observations on two or more

Toy example (continued):

A k-means clustering analysis can be carried out in SASusing PROC FASTCLUS, or in R using the “kmeans”function (see handouts).

224

Page 225: Multivariate (MV) data consist of observations on two or more

Model-Based Clustering

The clustering methods described so far are purely de-scriptive, not inferential. In the late 1990’s, a method ofclustering was put forward that is based on a probabilis-tic model, thereby allowing for statistical inference.

The underlying model is a “mixture model”

fMix(x) =K∑

k=1pkfk(x), pk ≥ 0,

K∑

k=1= 1

where the fk(·)’s are pdfs.

The most tractable (and therefore most commonly used)model of this type for continuous x is the normal mixturemodel, with fk(x) ∼ Np(µk,Σk), i.e.,

fMix(x|p1, . . . , pk,µ1, . . . ,µk,Σ1, . . . ,Σk)

= ∑Kk=1 pk(2π)

−p/2|Σk|−1/2 exp−12(x− µk)

′Σ−1

k (x− µk).

225

Page 226: Multivariate (MV) data consist of observations on two or more

• We act as though the N objects are a random samplefrom this mixture distribution, and we estimate itsparameters by maximum likelihood.

• This is computationally difficult, especially if K is“large,” because the group memberships are unknown;so specialized algorithms are required and simplifyingstructure is often imposed on the covariance matrices(e.g., it may be assumed that they are scalar multipleof identity matrices).

• Since K is generally unknown, in practice we try sev-eral values of K and then decide among them basedon which one minimizes a penalized likelihood infor-mation criterion like AIC or BIC.

We can carry out a model-based clustering analysis usingthe R package “mclust.” Now see the handout presentinga model-based clustering analysis of the hemophilia data.

226

Page 227: Multivariate (MV) data consist of observations on two or more

VARIANCE-COVARIANCE STRUCTURES FOR

LONGITUDINAL DATA

For ease of explanation, assume that each subject is ob-served at the same time points t1, t2, . . . , tn.

Notions for proposing reasonable structures:

• The variance is constant over time, and pairs of ob-servations the same length of time apart are equallycorrelated, i.e.

Cov(Yij, Yik) = C(tj, tk) = C(|tj − tk|)(second-order stationarity).

• Observations close together in time tend to be morealike than those further apart, i.e.

C(h1) ≥ C(h2) for h1 < h2

(correlation attenuation).

Let q = # of variance/covariance parameters.

227

Page 228: Multivariate (MV) data consist of observations on two or more

Three ways to specify covariance structures:

1. Covariance Matrix — Specify one or more elements ofΣ; remaining elements are functions thereof.

• This is equivalent to specifying a function

C(tj, tk) = Cov(Yij, Yik).

• This will also be regarded as equivalent to specify-ing the variances and correlations.

2. Concentration Matrix — Specify one or more elementsof Σ−1; remaining elements are functions thereof.

3. Model Equation — Specify one or more equations re-lating model residuals to each other; elements of Σare functions of coefficients in the equations.

E.g., AR(p):

ǫit =p∑

k=1φkǫi,t−k + δit, δit iid N(0, σ2

δ),

for t > p.

228

Page 229: Multivariate (MV) data consist of observations on two or more

Variance-Covariance Structures:

Illustrated for case n = 5.

• Unstructured (General Multivariate Model)

σ11 σ12 σ13 σ14 σ15σ22 σ23 σ24 σ25

σ33 σ34 σ35σ44 σ45

σ55

q =n(n + 1)

2

This is very flexible; no structure is imposed, save forpositive definiteness (and symmetry).

However, it may often be substantially overparame-terized. Overparametrization leads to:

– Inefficient estimation of mean response profiles

– Poor assessment of those estimates’ standard errors

Moreover, if n > N , the sample covariance matrix isnot invertible, which precludes some useful inferenceprocedures.

So we turn to more parsimonious structures.

229

Page 230: Multivariate (MV) data consist of observations on two or more

• Compound Symmetry

σ2

1 ρ ρ ρ ρ1 ρ ρ ρ1 ρ ρ1 ρ1

,−1

n− 1< ρ < 1 q = 2

– Satisfies stationarity.

– Takes the correlation to be functionally indepen-dent of temporal proximity.

– Consequently, it makes no difference if the timepoints are equally or unequally spaced.

• First-order Autoregressive, AR(1)

σ2

1 ρ ρ2 ρ3 ρ4

1 ρ ρ2 ρ3

1 ρ ρ2

1 ρ1

, | ρ |< 1 q = 2

– Generally makes sense only when time points areequally spaced, in which case it satisfies stationarityand correlation attenuation.

– Equivalent to a specification by the model equation

ǫt = ρǫt−1 + δt, δt iid N(0, σ2(1− ρ2)),

with appropriate starting conditions.

230

Page 231: Multivariate (MV) data consist of observations on two or more

– Partial correlations of lag 2 or more are equal to 0.

– Can be extended to unequally spaced time pointsusing the covariance function

C(tj, tk) = σ2 exp(−θ|tj − tk|).

231

Page 232: Multivariate (MV) data consist of observations on two or more

• Higher-order AR and ARMA

– Stationary, and eventually the correlation attenu-ates.

– Generally specified by a model equation becausethe relationship between lag-k and lag-one correla-tions is much less transparent.

– Not so clear how to extend to unequally spacedtime points.

• Toeplitz

σ2

1 ρ1 ρ2 ρ3 ρ41 ρ1 ρ2 ρ3

1 ρ1 ρ21 ρ1

1

q = n

– Generally makes sense only when the time pointsare equally spaced, in which case it satisfies station-arity, but not necessarily correlation attenuation.

– No intrinsic relationship between correlations atlarge lags and correlations at small lags.

– No corresponding model equation specification, ingeneral.

232

Page 233: Multivariate (MV) data consist of observations on two or more

• Heterogeneous Compound Symmetry

σ21 σ1σ2ρ σ1σ3ρ σ1σ4ρ σ1σ5ρ

σ22 σ2σ3ρ σ2σ4ρ σ2σ5ρ

σ23 σ3σ4ρ σ3σ5ρ

σ24 σ4σ5ρ

σ25

q = n + 1

• Heterogeneous First-Order Autoregressive

σ21 σ1σ2ρ σ1σ3ρ

2 σ1σ4ρ3 σ1σ5ρ

4

σ22 σ2σ3ρ σ2σ4ρ

2 σ2σ5ρ3

σ23 σ3σ4ρ σ3σ5ρ

2

σ24 σ4σ5ρ

σ25

q = n+1

• Heterogeneous Toeplitz

σ21 σ1σ2ρ1 σ1σ3ρ2 σ1σ4ρ3 σ1σ5ρ4

σ22 σ2σ3ρ1 σ2σ4ρ2 σ2σ5ρ3

σ23 σ3σ4ρ1 σ3σ5ρ2

σ24 σ4σ5ρ1

σ25

q = 2n−1

All these have stationary correlations (assuming equalspacing) but relax the assumption of constant vari-ances.

233

Page 234: Multivariate (MV) data consist of observations on two or more

• Huynh-Feldt (n = 4)

σ21 (σ2

1 + σ22)/2− λ (σ2

1 + σ23)/2− λ (σ2

1 + σ24)/2− λ

σ22 (σ2

2 + σ23)/2− λ (σ2

2 + σ24)/2− λ

σ23 (σ2

3 + σ24)/2− λσ24

q = n + 1

– Somewhat similar to heterogeneous compound sym-metry, in the sense that here the covariances arearithmetic means of the variances plus a constant,whereas for heterogeneous compound symmetry thecovariances are geometric means of the variancesmultiplied by a constant.

– Orthogonal contrasts of data with this covariancestructure have a diagonal covariance structure. Asa consequence, this structure is the most generalunder which the univariate ANOVA of repeatedmeasures data is valid.

– Generally not stationary.

– Compound symmetry is a special case.

234

Page 235: Multivariate (MV) data consist of observations on two or more

• First-order Antedependence (AD(1))

σ21 σ1σ2ρ1 σ1σ3ρ1ρ2 σ1σ4ρ1ρ2ρ3 σ1σ5ρ1ρ2ρ3ρ4

σ22 σ2σ3ρ2 σ2σ4ρ2ρ3 σ2σ5ρ2ρ3ρ4

σ23 σ3σ4ρ3 σ3σ5ρ3ρ4

σ24 σ4σ5ρ4

σ25

q = 2n− 1

Two equivalent specifications:

1. MVN variables Y1, Y2, . . . , Yn are said to be first-order antedependent if Yt and Yt+k+1 are indepen-dent given Yt+1, Yt+2, . . . , Yt+k for t = 1, . . . , n−k − 1 and for all k ≥ 1.

2. An n-variate normal random vectorY ≡ (Y1, . . . , Yn)′

with mean µ ≡ (µ1, . . . , µn)′ follows an AD(1)

model if

Y1 = µ1 + ǫ1,

Yt = µt + ρt(Yt−1 − µt−1) + ǫt (t = 2, . . . , n)

where

– ǫt ∼ independent N(0, σ2t );

– −1 < ρt < 1.

235

Page 236: Multivariate (MV) data consist of observations on two or more

Thus an AD(1) model is an autoregressive type ofmodel, but the autoregressive coefficients and inno-vation variances are allowed to vary, i.e. the model isnonstationary.

236

Page 237: Multivariate (MV) data consist of observations on two or more

• Higher-order Antedependence Models

MVN variables Y1, Y2, . . . , Yn are said to be sth-orderantedependent if Yt and Yt+k+1 are independent givenYt+1, Yt+2, . . . , Yt+k for t = 1, . . . , n− k − 1 and forall k ≥ s.

Equivalently, an n-variate normal random vectorY ≡(Y1, . . . , Yn)

′ with mean µ ≡ (µ1, . . . , µn)′ follows an

AD(s) model if

Y1 = µ1 + ǫ1,

Yt = µt +s∗∑

k=1φkt(Yt−k − µt−k) + ǫt (t = 2, . . . , n)

where

– s∗ = min(s, t− 1);

– ǫt ∼ independent N(0, σ2t );

– the φkt’s are such that the covariance matrix is pos-itive definite.

This is a generalization of an AR(s) model. As wasthe case for AR(s) models, a covariance matrix spec-ification is not feasible when s ≥ 2.

237

Page 238: Multivariate (MV) data consist of observations on two or more

• Variable-order Antedependence Models

– Allows s to be a function of t.

• Structured First-order Antedependence (SAD(1))

σ2

1 ρtλ2−tλ1 ρt

λ3−tλ1 ρt

λ4−tλ1 ρt

λ5−tλ1

1 ρtλ3−tλ2 ρt

λ4−tλ2 ρt

λ5−tλ2

1 ρtλ4−tλ3 ρt

λ5−tλ3

1 ρtλ5−tλ4

1

q = 3

– This is a structured variance and correlation spec-ification. Structure can be imposed on either theconcentration matrix or model equation specifica-tions also.

– Assuming equal spacing, this prescribes monotonic-ity of the lag-one correlations, i.e.

ρtλ−(t−1)λ < ρ(t+1)λ−tλ if λ < 1

ρtλ−(t−1)λ > ρ(t+1)λ−tλ if λ > 1

• Higher-order SAD Models

• Variable-order SAD Models

238

Page 239: Multivariate (MV) data consist of observations on two or more

• Linear Random Coefficients

1 01 11 21 31 4

σ11 σ12

σ22

1 01 11 21 31 4

+

σ2

σ2

σ2

σ2

σ2

q = 4

This structure derives from the model

Yt = b0 + b1t + ǫt,

whereb0b1

∼ MVN

β0β1

,

σ11 σ12

σ22

and the ǫt’s are iid N(0, σ2), independently of b0 andb1.

• Quadratic Random Coefficients

1 0 01 1 11 2 41 3 91 4 16

σ11 σ12 σ13σ22 σ23

σ33

1 0 01 1 11 2 41 3 91 4 16

+

σ2

σ2

σ2

σ2

σ2

q = 7

239

Page 240: Multivariate (MV) data consist of observations on two or more

• Factor-analytic Model (of order 1)

λ1

λ2

λ3

λ4

λ5

λ1

λ2

λ3

λ4

λ5

+

σ2

σ2

σ2

σ2

σ2

q = n + 1

This structure derives from the model

Yi = µ + λf + ǫ

where ǫ ∼ MVN(0, σ2I) and f ∼ N(0, 1), indepen-dently of ǫ.

• Higher-order factor-analytic models

240

Page 241: Multivariate (MV) data consist of observations on two or more

Estimation of Covariance Parameters

The assumed model can be written as

Yi = Xiβ + ǫi (i = 1, . . . , N)

where

• Xi is a n×m design matrix of rank m;

• ǫi are iid multivariate normal vectors with mean 0 anda parameterized covariance matrix Σ = Σ(θ); and

• β and θ are vectors of unknown parameters with pa-rameter space (β, θ): β ∈ Rm, θ ∈ Θ where Θ isthe set of θ-values for which Σ is positive definite.

The log-likelihood function (apart from an additive con-stant) is

L(β, θ;Y1, . . . ,YN) = −N

2log |Σ(θ)|

−1

2

N∑

i=1(Yi −Xiβ)

′Σ−1(θ)(Yi −Xiβ).

Maximum likelihood (ML) estimates of θ and β are val-

ues θ and β that maximize L.

It turns out that β is given (in terms of θ) by the explicitformula

β(θ) =N∑

i=1X′

iΣ−1(θ)Xi

−1

N∑

i=1X′

iΣ−1(θ)Yi

.

241

Page 242: Multivariate (MV) data consist of observations on two or more

Generally, however, θ must be determined numerically(e.g. by Newton-Raphson, method of scoring, or grid search).

Within the last 15 years, a variation of maximum likeli-hood estimation known as restricted (or residual) maxi-mum likelihood (REML) estimation has overtaken maxi-mum likelihood estimation as the preferred method (be-cause it usually results in a less biased estimate of θ).

The REML estimate of θ is the value of θ that maximizes

LR(θ;Y1, . . . ,YN) = L(β(θ),θ;Y1, . . . ,YN)

−1

2log | N∑

i=1X′

iΣ−1(θ)Xi|.

242

Page 243: Multivariate (MV) data consist of observations on two or more

Comparing Models

• Nested hypotheses about model parameters can betested in standard ways.

Suppose the nested model imposes c independent con-straints on the variance-covariance parameters. Let:

L1 = maximized log-likelihood for the larger model,L0 = maximized log-likelihood for the smaller model.

Compare 2(L1 − L0) to a chosen percentage point ofthe chi-square distribution with c df.

• Alternatively, models can be compared using penal-ized likelihood criteria. Applied to REML, Akaike’sInformation Criterion (AIC) and the Bayesian Infor-mation Criterion (BIC) are defined as follows (in “smaller-is-better” form):

AIC = −2[logLR(θ)− q]

BIC = −2[logLR(θ)−q

2log(N −m)].

BIC imposes a more severe penalty on the number ofcovariance parameters (provided N − m > 8), so ittends to favor more parsimonious models than AIC.

243

Page 244: Multivariate (MV) data consist of observations on two or more

Software for Fitting Covariance Structures

SAS PROC MIXED can fit many of the covariance struc-tures for longitudinal data that we’ve considered.

• By default, it does REML estimation, but it can doMLE as well.

• It lists AIC and BIC (among other penalized likeli-hood criteria).

• It lists the REML (or ML) estimates, but the docu-mentation must be consulted to determine which pa-rameters they’re estimating.

Now see handout illustrating the use of PROC MIXEDto fit various covariance structures to a dataset on cattlegrowth.

244