You are on page 1of 18

T

MATHEMATICAL ASPECTS
Target Population
Let (X1 , X2 , . . . , Xn ) and (Y1 , Y2 , . . . , Yn ) be
The concept of the target population is two samples of dimension n. The objective
defined as a population to which we would is to test the following two hypotheses:
like to apply the results of an inquiry.
Null hypothesis H0 : The two variables X
and Y are independent.
EXAMPLES
Alternative hypothesis H1 : The two vari-
We want to conduct an inquiry on foreigners ables X and Y are not independent.
living in city X. The population is represent-
ed by the list of foreigners registered in the The test of independence consists in compar-
city. ing the empirical distribution with the theo-
The target population is defined by the col- retical distribution by calculating an indica-
lection of foreigners living in city X, includ- tor.
ing those not on the list (unannounced, clan- The test of independence applied to two con-
destine, etc.). tinuous variables is based on the ranks of the
observations. Such is the case if the tests are
based on the Spearman rank correlation
FURTHER READING
coefficient or on the Kendall rank corre-
 Population
lation coefficient.
In the case of two categorical variables, the
most widely used test is the chi-square test
Test of Independence of independence.
A test of independence is a hypothesis test
where the objective is to determineif two ran- DOMAINS AND LIMITATIONS
dom variables are independent or not. To make a test of independence each couple
(Xi , Yi ), i = 1, 2, . . . , n must come from the
same bivariate population.
HISTORY
See Kendall rank correlation coefficient,
Spearman rank correlation coefficient, EXAMPLES
and chi-square test of independence. See chi-square test of independence.
536 Time Series

FURTHER READING ing to Kendall this is the oldest time dia-


 Chi-square test of independence gram known in the western world.
 Hypothesis testing It is adequate to look to astronomy for the
 Kendall rank correlation coefficient origins of the time series. The observation
 Nonparametric test of the stars was popular in antiquity.
 Spearman rank correlation coefficient In the 16th century, astronomy was again
a source of important discoveries. The works
of Brahe, Tycho (1546–1601), whose collec-
Time Series tion of data on the movement of the plan-
ets allowed Kepler, Johannes (1571–1630)
A time series is a sequence of observations to formulate his laws on planetary motion.
measured at succesive times. Time series are A statistical analysis of data, as empirical as
monthly, trimestrial, or annual, sometimes it could be at that time, was at the base of this
weekly, daily, or hourly (study of road traffic, great scientist’s work.
telephone traffic), or biennial or decennial. The development of mathematics in the 18th
Time series analysis consists of methods that and 19th centuries made it possible to bypass
attempt to understand such time series to graphical visualization to arrive at the first
make predictions. techniques of time series analysis. Using the
Time series can be decomposed into four frequency approach, scientists developed the
components, each expressing a particular first works in this domain.
aspect of the movement of the values of the Frequency analysis (also called harmonic
time series. analysis) was originally designed to high-
These four components are: light one or more cyclical “components” of
• Secular trend, which describe the move- a time series.
ment along the term; In 1919, Persons, W.M. proposed a decom-
• Seasonal variations, which represent position of time series in terms of tenden-
seasonal changes; cy (secular trends), cyclical cyclical fluc-
• Cyclical fluctuations, which correspond tuations), seasonal (seasonal variation),
to periodical but not seasonal variations; and accidental (irregular variation) com-
• Irregular variations, which are oth- ponents. Many works have been devoted to
er nonrandom sources of variations of the determination and elimination of one or
series. another of these components.
The analysis of time series consists in mak- The determination of tendencies has often
ing mathematical descriptions of these ele- been related to problems of regression anal-
ments, that is, estimating separately the four ysis, also developed researchers relative to
components. nonlinear tendencies, as for example the
Gompertz curve (established in 1825 by
HISTORY Gompertz, Benjamin) or the logistic curve
In an article in 1936 Funkhauser, H.G. repro- (introduced in 1844 by Verhulst, Pierre
duced a diagram of the 10th century that François). Another approach to determin-
shows the inclination of the orbit of sev- ing tendencies concerns the use of moving
en planets in function of time. Accord- averages because they allow one to treat the
Time Series 537

problem of tendencies when they serve to 3. Mixed model:


eliminate irregular or periodic variations.
The use of moving averages was devel- Yt = St + (Tt · Ct · It )
oped in two directions: for actuarial
problems and for the study of the time or
series in economy. The use of mov- Yt = Ct + (Tt · St · It ) .
ing averages is particularly developed in
frame of the methods of Seasonal Adjust- This type of model is very little used.
ment Methods. More precisely, the sepa- We choose the additive model when seasonal
ration of seasonal variables from the other variations are almost constant and their influ-
components of the time series was studied ence on the tendency does not depend on its
originally by Copeland, M.T. in 1915 and level.
Persons, W.M. in 1919 and continued by When the seasonal variations are of an ampli-
Macauley, F.R. in 1930. tude almost proportional to that of the secular
Macauley, F.R. used the method of ratios trends, we introduce the multiplicative mod-
to the moving average that is still widely el; this is generally the case.
used today (see seasonal variation) see also The analysis of time series consists in deter-
Dufour (2006). mining the values taken by each component.
We always start with the seasonal variations
MATHEMATICAL ASPECTS and end on the cyclical fluctuations. All fluc-
Let Yt be a time series that can be decom- tuations that cannot be attributed to one of the
posed with the help of these four compo- three components will be grouped with the
nents: irregular variations.
• Secular trend Tt Based on the used model the analysis can,
• Seasonal variations St after the components are determined, adjust
• Cyclical fluctuations Ct subsequent data by substraction or division.
• Irregular variations It Thus when we have estimated the secular
We suppose that the values taken by the ran- trend Tt , at each time t, the time series is
dom variable Yt are determined by a rela- adjusted in the following manner:
tion between the four previous components. – If we use the additive model Yt = Tt +
We distinguish three models of composition: Ct + St + It :
1. Additive model: T
Yt − Tt = Ct + St + It .
Yt = Tt + Ct + St + It .
– For the multiplicative model Yt = Tt · Ct ·
The four components are assumed to be
S t · It :
independent of one another.
Yt
2. Multiplicative model: = Ct · St · It .
Tt
Yt = Tt · Ct · St · It .
Successively evaluating each of the three
With the help of logarithms we pass from components and adjusting the time series
the multiplicative model to the additive among them, we obtain the values attributed
model. to the irregular variations.
538 Time Series

DOMAINS AND LIMITATIONS • The great historically observed tenden-


When the time series are not in a long enough ciesaremaintained in themoreor lessnear
period, we group the secular trend and future.
the cyclical fluctuations in one component • The measurable fluctuations of a variable
called extraseasonal movement. are reproduced in regular intervals.
The analysis of time series will be justified
Graphical Representation as long as it allows one to reduce the level of
Thegraphical representationof timeseries uncertainty in the elaboration of forecasts.
helps to analyze observed values depending We distinguish:
on time. 1. Long-term forecast:
To analyze these values, a certain number of Based on the secular trend; generally does
precautions must be taken: not take into account cyclical fluctuations.
1. Each point must be representative to 2. Middle-term forecast:
an observation. If the value represents To take into account the probable effect of
a stock, on a fix date, then the point is the cyclical component, we should mul-
found on the reference date. If there is tiply the forecasted value of the secular
a flow, for example, monthly, then the trend by an estimation of the relative dis-
point is fixed in the middle of the month. counted variation attributable to the cycli-
2. Sometimes one has to report, on the same cal fluctuations.
graph, annual data and monthly data. The 3. Short-term forecast:
representative points of the results should Generally we do not try to forecast irreg-
be 12 times more frequent than those rela- ular variations or make short-term fore-
tive to the annual results. Thus we have to casts or forecasts concerning the longer
pay attention to the representative points periods. Thus we multiply the forecasted
in the right place. values of the secular trend by estimating
3. If many series are represented on the same the cyclical fluctuations and by the sea-
graph, they must be identical in nature. sonal variation of the corresponding date.
Otherwise, we should use different scales During an analysis of time series, we face the
or place graphs below one another. following problems:
1. Is the classical model appropriate?
The principal objectives of the study of the
We expect the quality of the results of
time series are:
analysis to be proportional to the preci-
• Description: determination or elimina- sion and the accuracy of the model itself.
tion of different components The multiplicative model Yt = Tt ·St ·Ct ·It
• Stochastic modeling presupposes that the four components are
• Forecasting independent, which is rarely true in real-
• Filtering: elimination or conversion of ity.
certain characteristics 2. Are our hypotheses of the constancy and
• Control: observation of the past of a pro- regularity valid?
cess to react to future evolution The analysis must be adjusted for subjec-
For forecasting, the analysis of time series is tive and qualitative factors that exist in
based on the following hypotheses: almost any situation.
Trace 539

3. Can we trust the available data? Dufour, I.M.: Histoire de l’analyse de Séries
The problem may arise of breaks of series Chronologues, Université de Montréal,
resulting from insufficiency of data or Canada (2006)
a change in the quality of variables. Funkhauser, H.G.: A note on a 10th century
graph. Osiris 1, 260–262 (1936)
EXAMPLES Kendall, M.G.: Time Series. Griffin, London
A time series is generally represented as fol- (1973)
lows: Macauley, F.R.: The smoothing of time
series. National Bureau of Economic
Research, 121–136 (1930)
Persons, W.M.: An index of general business
conditions. Rev. Econom. Stat. 1, 111–
205 (1919)

Trace
We distinguish four components:
For a square matrix A of order n, we define
• Secular trend, slightly increasing in the
the trace of A as the sum of the terms situated
present case
on the diagonal. Thus the trace of a matrix is
• Seasonal variations, readily apparent
a scalar quantity.
• Cyclical fluctuations, in the form of cycles
of an approximate amplitude of 27 units
MATHEMATICAL ASPECTS
of time
Let A be a square matrix of order n, A =
• Irregular variations, generally weak
aij , where i, j = 1, 2, . . . , n. We define
enough, except t = 38, which repre-
trace A by:
sents a very abrupt fall that would not be 
n
rational tr (A) = aii .
i=1

FURTHER READING DOMAINS AND LIMITATIONS


 Cyclical fluctuation As we are interested only in diagonal ele-
 Forecasting
T
ments, the trace is defined only for square
 Graphical representation matrices.
 Irregular variation 1. The trace of the sum of two matrices
 Seasonal variation equals the sum of the traces of the matri-
 Secular trend ces:
tr (A + B) = tr (A) + tr (B) .
REFERENCES 2. The trace of the product of two matrices
Copeland, M.T.: Statistical indices of busi- does not change with the commutations
ness conditions. Q. J. Econ. 29, 522–562 of the matrices. Mathematically:
(1915) tr (A · B) = tr (B · A) .
540 Transformation

EXAMPLES DOMAINS AND LIMITATIONS


Let A and B be two square matrices of order 2: We transform variables for many reasons:
   
1 2 5 2 1. When we are in the presence of a data set
A= and B = .
1 3 −2 3 relative to many variables and we want to
express one of them, Y (dependent vari-
The calculation of traces gives:
  able), with the help of others (called inde-
1 2 pendent variables) and we want to lin-
tr (A) = tr =1+3=4,
1 3 earize the relation between the variables.
  For example, when the relation between
5 2
tr (B) = tr =5+3=8, independent variables is multiplicative,
−2 3
a logarithmic transformation of the
and
  data makes it additive and allows the use
6 4 of linear regression to estimate the param-
tr (A + B) = tr
−1 6 eters of the model.
= 6 + 6 = 12 . 2. When we are in the presence of a data
set relative to a variable and its variance
We verify that tr (A) + tr (B) = 12. On the
is not constant, it is generally possible to
other hand:
  make it almost constant by transforming
1 8
A·B= and this variable.
−1 11 3. When a random variable follows any
 
7 16 distribution, an adequate transformation
B·A= ,
1 5 of it allows to obtain a new random vari-
  able that approximately follows a normal
1 8
tr (A · B) = tr distribution.
−1 11
The advantages of transforming data set rel-
= 1 + 11 = 12 ,
  ative to a variable are largely summarized as
7 16
tr (B · A) = tr follows:
1 5
• It simplifies existing relations with other
= 7 + 5 = 12 . variables.
Thus tr (A · B) = tr (B · A) = 12. • A remedy for outliers, linearity and
homoscedasticity.
FURTHER READING • It produces a variable that is approximate-
 Matrix ly normally distributed.

FURTHER READING
Transformation  Dependent variable
A transformation is a change in one or many  Independent variable
variables in a statistical study.  Logarithmic transformation
We transform variables, for example,  Normal distribution
by replacing them with their logarithms  Regression analysis
(logarithmic transformation).  Variance
Treatment 541

REFERENCES The transpose of A is the matrix (2 × 3):


Cox, D.R., Box, G.E.P.: An analysis of trans-  
formations (with discussion). J. Roy. Stat.  1 0 2
A = .
Soc. Ser. B 26, 211–243 (1964) 2 3 5

We can also verify that the transpose of A


equals the initial matrix A:
Transpose
 
The (matrix) transpose of a matrix A of order A =A.
(m × n) is a matrix (n × m), denoted by A , 

obtained by writing the lines of A in columns FURTHER READING


of A and vice versa.  Matrix
Thus we effect simple “inversion” of the  Vector
table.

MATHEMATICAL ASPECTS
Treatment

If A = aij , i = 1, 2, . . . , m and j = In an experimental design, a treatment is
1, 2, . . . , n is a matrix of order (m × n), then a particular combination of levels of various
the transpose of A is the matrix A of order factors.
(n × m) given by:

A = aji with j = 1, 2, . . . , n EXAMPLES
Experiments are often carried out to compare
and i = 1, 2, . . . , m .
two or more treatments, for example two dif-
Transposition is a reversible and recipro- ferent fertilizers on a particular type of plant
cal operation; thus taking the transpose of or many types of drugs to treat a certain ill-
the transpose of a matrix, we find the initial ness. Another example consists in measur-
matrix. ing the time of coagulation of blood sam-
ples of 16 animals having supported different
regimes A, B, C, and D.
DOMAINS AND LIMITATIONS In this case, different examples of treat-
We use the transpose of a matrix, or more ments are, respectively, fertilizers, drugs, T
precisely the transpose of a vector, while cal- and regimes.
culating the scalar product. On the other hand, in experiments that test
a particular fertilizer, for example azote, on
EXAMPLES a harvest of wheat, we can consider differ-
Let A be the following matrix of order ent quantities of the same fertilizer as dif-
(3 × 2): ferent treatments. Here, we have one factor
(azote) on different levels (quantities), for
⎡ ⎤
1 2 example 30 kg, 50 kg, 100 kg, and 200 kg.
A = ⎣ 0 3 ⎦. Each of these levels corresponds to a treat-
2 5 ment.
542 Tukey, John Wilder

The goal of an experiment is to determine Selected principal works and articles of


if there is a real (significative) difference Tukey, John Wilder:
between these treatments. 1977 Exploratory Data Analysis. 1st edn.
Addison-Wesley, Reading, MA.
FURTHER READING 1980 We need both exploratory and confir-
 Design of experiments matory. Am. Stat. 34, 23–25.
 Experiment 1986 Data analysis and behavioral science
 Experimental unit or learning to bear the quantitative
 Factor man’s burden by shunning badmand-
ments. In: Collected Works of John W.
Tukey, Vol III: Philosophy and Prin-
REFERENCES ciples of Data Analysis, 1949–1964.
Senn, St.: Cross-over Trials in Clinical (Jones, L.V., ed.) Wadsworth Advanced
Research. Wiley (1993) Books & Software, Monterey, CA.
1986 Collected Works of John W. Tukey,
Vol III: Philosophy and Principles of
Tukey, John Wilder Data Analysis, 1949–1964. (Jones,
L.V., ed.) Wadsworth Advanced Books
Tukey, John Wilder was born in Bedford, & Software, Monterey, CA.
MA in 1915. He studied chemistry at Brown 1986 Collected Works of John W. Tukey,
University and received his doctorate in Vol IV: Philosophy and Princi-
mathematics at Princeton University in ples of Data Analysis, 1965–1986.
1939. At the age of 35, he became pro- (Jones, L.V., ed.) Wadsworth Advanced
fessor of mathematics at Princeton. He was Books & Software, Monterey, CA.
a key player in the formation in the Dept of
Statistics in Princeton University in 1966. 1988 Collected Works of John W. Tukey,
He served as its chairman during 1966– Vol V: Graphics, 1965–1985. (Cleve-
1969. He is the author of Exploratory Data land, W.S., ed.) Waldsworth and
Analysis (1977) (translated into Russian) Brooks/Cole, Pacific Grove, CA.
and eight volumes of articles. He is coau-
thor of Statistical Problems of the Kinsey FURTHER READING
Report on Sexual Behavior in the Human  Box plot
Male; Data Analysis and Regression (also  Exploratory data analysis
translated into Russian), Index to Statistics
and Probability. He is coeditor of the fol-
lowing books: Understanding Robust and
Two-Sided Test
Exploratory Data Analysis, Exploring Data A two-sided test concerning a population is
Tables, Trends Shapes, Configural Polysam- a hypothesis test that is applied when we
pling, and Fundamentals of Exploratory want to compare an estimate of a param-
Analysis of Variance. He died in New Jer- eter to a given value against the alternative
sey in July 2000. hypothesis not equal to the statet value.
Two-Sided Test 543

MATHEMATICAL ASPECTS We find the acceptance region of the null


A two-tail test is a hypothesis test on a pop- hypotheses (see rejection region):
ulation of the type:
σ
μ ± zα/2 · √ ,
Null hypothesis H0 : θ = θ0 n
Alternative hypothesis H1 : θ = θ0 ,
where σ is the standard deviation of the
where θ is a parameter of the population population. Since the standard deviation σ is
whose value is unknown and θ0 is the pre- unknown, we estimate it using the standard
sumed value of this parameter. deviation S of the sample (S = 0.12), which
For a test concerning the comparison of two gives:
populations, the hypotheses are: D
0.12 0.8765
0.9 ± 1.96 · √ =
Null hypothesis H0 : θ1 = θ2 100 0.9235 .
Alternative hypothesis H1 : θ1 = θ2 ,
The acceptance region of the null hypoth-
where θ1 and θ2 are the unknown parameters esis equals the interval [0.8765, 0.9235].
of two underlying populations. Because the mean of the sample (0.93 cm)
is outside this interval, we must reject the
DOMAINS AND LIMITATIONS null hypothesis for the alternative hypoth-
In a two-sided test, the rejection region is esis. We conclude that at a significance level
divided into two parts, the left and the right of 5% and depending on the studied sample,
sides of the considered parameter. the diameter of the cables does not conform
to the norm.
A study is carried out to compare the mean
EXAMPLES
lifetime of two types of tires. A sample of
A company produces steel cables. It wants to
50 tires of brand 1 gives a mean lifetime of
verify if the diameter μ of much of the pro-
72000 km, and a sample of 40 tires of brand 2
duced cable conforms tothe standard diam-
has a mean lifetime of 74400 km. Suppos-
eter of 0.9 cm.
ing that the standard deviation for brand 1 is
It takes a sample of 100 cables whose mean
σ1 = 3200 km and that of brand 2 is σ2 =
diameter is 0.93 cm with a standard devia-
2400 km, we want to know if there is a sig-
tion of S = 0.12.
The hypotheses are the following:
nificative difference in lifetimes between the T
two brands, at a significance level α =
Null hypothesis H0 : μ = 0.9 1%.
Alternative hypothesis H : μ = 0.9 , The hypotheses are the following:
1

As the sample size is large enough, the Null hypothesis H0 : μ 1 = μ2


sampling distribution of the mean can be Alternative hypothesis H1 : μ1 = μ2 .
approximated by a normal distribution.
For a significance level α = 5%, we obtain The dimension of the sample is large enough,
a critical value zα/2 in the normal table of and the standard deviations of the popula-
zα/2 = 1.96. tions are known, so that we can approach the
544 Two-way Analysis of Variance

sampling distribution using a normal distri-


Two-Way Analysis
bution.
The acceptance region of the null hypothesis
of Variance
is given by (see rejection region):
The two-way analysis of variance is an
expansion of one-way analysis of variance
μ1 − μ2 ± zα/2 · σx̄1 −x̄2 ,
in which there are two independent factors
where σx̄1 −x̄2 is the standard deviation of the (variables). Each factor has two or more
sampling distribution of thedifferenceof two levels and treatments are formed by making
means, or the standard error of two means. all possible combinations of levels of two
The value zα/2 is found in the normal table. factors.
For a two-tail test with α = 1%, we get
zα/2 = 2.575, which gives:

HISTORY
σ12 σ2
0 ± 2.575 · + 2 It is Fisher, R.A. (1925) who gave the name
n1 n2
 “factorial experiments” to complex expe-
32002 24002 riments.
= 0 ± 2.575 · + Yates, F. (1935, 1937) developed the concept
50 40
and analysis of these factorial experiments.
= 0 ± 2.575 · 590.59
See analysis of variance.
= ±1520.77 .

The acceptance region of the null


hypothesis is given by the interval
MATHEMATICAL ASPECTS
[−1520.77, 1520.77]. Because the differ-
Given an experiment with two factors, fac-
ence in means of the samples (72000 −
tor A having a levels and factor B having b
74400 = −2400) is outside the acceptance
levels.
region, we must reject the null hypothesis
If the design associated with this factorial
for the alternative hypothesis. Thus we can
experiment is a completely randomized
conclude that there is a significative differ-
design, the model is the following:
ence between the lifetimes of the tires of the
tested brands.
Yijk = μ + αi + βj + (αβ)ij + εijk ,
i = 1, 2, . . . , a (levels of factor A)
FURTHER READING
 Acceptance region j = 1, 2, . . . , b (levels of factor B)
 Alternative hypothesis k = 1, 2, . . . , c (number of observations
 Hypothesis testing receiving the treatment ij)
 Null hypothesis
 One-sided test where μ is the general mean common to all
 Rejection region treatments, αi is the effect of level i of fac-
 Sampling distribution tor A, βj is the effect of level j of factor B,
 Significance level (αβ)ij is the effect of the interaction between
Two-way Analysis of Variance 545

αi and βj , and εijk is the experimental error To test the second hypothesis, we create
of observation Yijk . a ratio whose numerator is an estimate of the
This model is subjected to the basic assump- variance of factor B and whose denomina-
tions associated to analysis of variance if tor is an estimate of the variation within treat-
one supposes that the errors εijk are inde- ments.
pendent random variables following a nor- This ratio, denoted by F, follows a Fisher
mal distribution N(0, σ 2 ). distribution with b−1 and ab(c−1) degrees
Three hypotheses can then be tested: of freedom.
1.
Null hypothesis H0 : β1 = β2 = . . . = βb
H0 : α1 = α2 = . . . = αa
will be rejected if the F ratio is greater than or
H1 : At least one αi is different equal to the value of the Fisher table, mean-
from αj , i = j. ing if
2. F ≥ Fb−1,ab(c−1),α .
H0 : β 1 = β 2 = . . . = β b To test the third hypothesis, we create a ratio
whose numerator is an estimate of the
H1 : At least one βi is different
variance of the interaction between fac-
from βj , i = j.
tors A and B and whose denominator is an
3. estimate of the variance within treatments.
H0 : (αβ)11 = (αβ)12 = . . . = (αβ)1b This ratio, denoted by F, follows a Fisher
distribution with (a−1)(b−1) and ab(c−1)
= (αβ)21 = . . . = (αβ)ab
degrees of freedom.
H1 : At least one of the
Null hypothesis H0 :
interactions is different
from the others. (αβ)11 = (αβ)12 = . . . = (αβ)1b
The Fisher distribution is used to test the = (αβ)21 = . . . = (αβ)ab
first hypothesis. This distribution requires will be rejected if the F ratio is greater than or
the creation of a ratio whose numerator is equal to the value in the Fisher table, mean-
an estimate of the variance of factor A and ing if
whose denominator is an estimate of the vari-
ance within treatments known also as error F ≥ F(a−1)(b−1),ab(c−1),α .
or residual. T
This ratio, denoted by F, follows a Fisher Variance of Factor A
distribution with a−1 and ab(c−1) degrees For the variance of factor A, the sum of
of freedom. squaresmustbecalculated for factor A(SSA),
which is obtained as follows:
Null hypothesis H0 : α1 = α2 = . . . = αa a
SSA = b · c (Ȳi.. − Ȳ... )2 ,
will be rejected at the significant level α if i=1
the ratio F is greater than or equal to the value
where Ȳi.. is the mean of all the observations
in the Fisher table, meaning if
of level i of factor A and Ȳ... is the general
F ≥ Fa−1,ab(c−1),α . mean of all the observations.
546 Two-way Analysis of Variance

The number of degrees of freedom associ- Variance Within Treatments or Error


ated to this sum is equal to a − 1. For the variance within treatments, the sum
The variance of factor A is then equal to: of squares within treatments is obtained as
SSA follows:
s2A = .
a−1 
a 
b 
c
SSE = (Yijk − Ȳij. )2 ,
Variance of Factor B i=1 j=1 k=1
For the variance of factor B, the sum of
squares must be calculated for factor B (SSB), where a and b are, respectively, the number
which is obtained as follows: of levels of factors A and B, c is the number
of observations receiving treatment ij (con-
b
SSB = a · c (Ȳ.j. − Ȳ... ) ,
2 stant for any i and j), Yijk is observation k from
j=1 level i of factor A and from level j of factor B,
and Ȳij. is the mean of all the observations of
where Ȳi.. is the mean of all the observations
level ij of interaction AB.
of level i of factor B and Ȳ... is the general
The number of degrees of freedom associ-
mean of all the observations.
ated to this sum is equal to ab(c − 1).
The number of degrees of freedom associ-
The variance within treatments is thus equal
ated to this sum is equal to b − 1.
to:
The variance of factor B is then equal to: SSE
s2E = .
SS B ab(c − 1)
s2B = .
b−1 The total sum of squares (SST ) is equal to:

Variance of Interaction AB a  b  c
For the variance of interaction AB, the sum SS T = 2
Yijk .
of squares must be calculated for interac- i=1 j=1 k=1

tion AB (SSAB), which is obtained as follows: The number of degrees of freedom associ-
 a  b ated to this sum is equal to N, meaning the
SSAB = c (Ȳij. − Ȳi.. − Ȳ.j. + Ȳ... )2 , total number of observations.
i=1 j=1
The sum of squares for the mean is equal to:
where Ȳij. is the mean of all the observations
of level ij of interaction AB, Ȳi.. is the mean of SSM = N Ȳ...
2
.
all the observations of level i of factor A, Ȳ.j.
The number of degrees of freedom associ-
is the mean of all the observations of level j
ated to this sum is equal to 1.
of factor B, and Ȳ... is the general mean of all
The total sum of squares (SST ) can be
the observations.
expressed with all the other sums of squares
The number of degrees of freedom associ-
in the following way:
ated to this sum is equal to (a − 1)(b − 1).
The variance of interaction AB is then SST = SSM + SSA + SSB + SSAB + SSE .
equal to:
SSAB Fisher Tests
s2AB = .
(a − 1)(b − 1) We can now calculate the different F ratios.
Two-way Analysis of Variance 547

To test the null hypothesis If F is greater than or equal to the value in the
Fisher table for (a−1)(b−1) and ab(c−1)
H0 : α1 = α2 = . . . = αa , degrees of freedom, the null hypothesis is
rejected and it is concluded that H, is true.
the first F ratio is made whose numerator
is the estimation of the variance of fac-
tor A and denominator is the estimation of Table of Analysis of Variance
the variance within treatments: All the information required to calculate the
two F ratios can be summarized in a table of
s2A
F= 2 . analysis of variance:
sE

If F is greater than or equal to the value in the Source Degrees Sum of Mean of F
Fisher table for a −1 and ab(c−1) degrees of varia- of free- squares squares
of freedom, the null hypothesis is rejected tion dom

and it is concluded that at least one αi is dif- Mean 1 SSM


ferent from αj , i = j. s2A
Factor A a − 1 SSA s2A
To test the null hypothesis s2E

s2B
H0 : β 1 = β 2 = . . . = β b , Factor B b − 1 SSB s2B
s2E
the second F ratio is made whose numerator Inter-
(a − 1) s2AB
is the estimation of the variance of factor B action SSAB s2AB
· (b − 1) s2E
and denominator is the estimation of the vari- AB
ance within treatments: Within
treat- ab(c−1) SSI s2E
s2B ments
F= .
s2E Total abc SST

If F is greater than or equal to the value in the


Fisher table for b −1 and ab(c−1) degrees If c = 1, meaning that there is only one
of freedom, the null hypothesis is rejected observation per treatment ij (or per cell ij),
and it is concluded that H, is true. it is not possible to attribute part of the error
To test the null hypothesis “inside the groups” to the interaction. T
H0 : (αβ)11 = (αβ)12 = . . . = (αβ)1b
= (αβ)21 = . . . = (αβ)ab EXAMPLES
The director of a school wants to test four
the third F ratio is made whose numerator is
brands of typewriters. He asks five profes-
the estimation of the variance of interac-
sional secretaries to try each brand and repeat
tion AB and whose denominator is the esti-
the exercise the next day. They must all type
mation of the variance within treatments:
the same text, and after 15 min the average
s2AB number of words typed in 1 min is recorded.
F= 2 .
sE Here are the results:
548 Two-way Analysis of Variance

Typewriter Secretary The number of degrees of freedom associ-


1 2 3 4 5 ated to this sum is equal to 4 − 1 = 3.
1 33 31 34 34 31 The variance of factor A (mean of squares)
36 31 36 33 31 is then equal to:
2 32 37 40 33 35
SSA
35 35 36 36 36 s2A =
a−1
3 37 35 34 31 37
135
39 35 37 35 40 =
3
4 29 31 33 31 33
= 45 .
31 33 34 27 33

Let us do a two-way analysis of variance, Variance of Factor B “Secretaries”


the first factor being the brands of the type- The sum of squares of factor B is equal to:
writers and the second the secretaries.  5
The null hypotheses are the following: SSB = 4 · 2 (Ȳ.j. − Ȳ... )2
1. j=1

H0 : α1 = α2 = α3 = α4 = 4 · 2 (34 − 34)2 + (33.5 − 34)2
H1 : At least one αi is different
+ . . . + (35.5 − 34)2
from αj , i = j. 
2
2. +(34.5 − 34) = 40 .
H0 : β 1 = β 2 = β 3 = β 4 = β 5 The number of degrees of freedom associ-
H1 : At least one βi is different ated to this sum is equal to 5 − 1 = 4.
from βj , i = j. The variance of factor B (mean of squares)
3. is then equal to:
SSB
H0 : (αβ)11 = (αβ)12 = . . . = (αβ)15 s2B =
b−1
= (αβ)21 = . . . = (αβ)45 40
H1 : At least one of the interactions =
4
is different from the others. = 10 .
Variance of Factor A
Variance of Interaction AB
“Brands of Typewriters”
“Brands of Typewriters – Secretaries”
Variance of factor A
The sum of squares of interaction AB is
The sum of squares of factor A is equal to: equal to:

4 
4 
5
SSA = 5 · 2 (Ȳi.. − Ȳ... ) 2 SSAB = 2 (Ȳij. − Ȳi.. − Ȳ.j. + Ȳ... )2
i=1 i=1 j=1
 
= 5 · 2 (33 − 34)2 + (35.5 − 34)2 = 2 (34.5 − 33 − 34 + 34)2 +

+(36 − 34)2 + (31.5 − 34)2 (31 − 31.5 − 34.5 + 34)2 + . . .

= 135 . +(33 − 31.5 − 34.5 + 34)2
Two-way Analysis of Variance 549

 
= 2 1.52 + (−1.5)2 + . . . + 12 The number of degrees of freedom associ-
= 83 . ated to this sum is equal to the number N of
observations, meaning 40.
The number of degrees of freedom associ- The sum of squares for the mean is equal to:
ated to this sum is equal to (4 − 1)(5 − 1) =
12. SSM = N Ȳ...
2
The variance of interaction AB is then
= 40 · 342
equal to:
= 46240 .
SSAB
s2AB =
(a − 1)(b − 1) The number of degrees of freedom associ-
83 ated to this sum is equal to 1.
=
12
= 6.92 . Fisher Tests
To test the null hypothesis
Variance Within Treatments (Error)
The sum of squares within treatments is H0 : α1 = α2 = α3 = α4 ,
equal to:
we form the first F ratio whose numerator

4 
5 
2
is the estimation of the variance of fac-
SSE = (Yijk − Ȳij. )2 tor A and denominator is the estimation of
i=1 j=1 k=1
the variance within treatments:
= (33 − 34.5)2 + (36 − 34.5)2
s2A
+ (31 − 31)2 + . . . + (33 − 33)2 F=
s2E
= 58 .
45
=
The number of degrees of freedom associ- 2.9
ated to this sum is equal to 4 · 5(2 − 1) = 20: = 15.5172 .

SSI The value of the Fisher table with 3 and 20


s2E =
ab(c − 1) degrees of freedom for a significant level
58 α = 0.05 is equal to 3.10.
= T
20 Since F ≥ F3,20,0.05, we reject the H0
= 2.9 . hypotheses and conclude that the brands of
typewriters have a significant effect on the
The total sum of squares is equal to: number of words typed in 1 min.
To test the null hypothesis

4 
5 
2
SST = (Yijk )2
i=1 j=1 k=1 H0 : β 1 = β 2 = β 3 = β 4 = β 5 ,
= 33 + 36 + 31 + . . .
2 2 2
we form the second F ratio whose numerator
+ 272 + 332 + 332 is the estimation of the variance of factor B
= 46556 . and whose denominator is the estimation of
550 Type I Error

the variance within treatments: Source Degrees Sum of Mean of F


of varia- of free- squares squares
s2B tion dom
F=
s2E Mean 1 46240
10 Factor A 3 135 45 15.5172
=
2.9 Factor B 4 40 10 3.4483
= 3.4483 . Inter-
action 12 83 6.92 2.385
The value of the Fisher table with 4 and 20 AB
degrees of freedom for α = 0.05 is equal Within
to 2.87. treat- 20 58 2.9
ments
Since F ≥ F4,20,0.05, we reject the H0
hypotheses and conclude that the secretaries Total 40 46556
have a significant effect on the number of
words typed in 1 min. FURTHER READING
To test the null hypothesis  Analysis of variance
 Contrast
H0 : (αβ)11 = (αβ)12 = . . . = (αβ)15  Fisher table
= (αβ)21 = . . . = (αβ)45 ,  Fisher test
 Interaction
we form the third F ratio whose numerator  Least significant difference test
is the estimation of the variance of interac-  One-way analysis of variance
tion AB and whose denominator is the esti-
mation of the variance within treatments: REFERENCES
2 Cox, D.R., Reid, N.: Theory of the design
s
F = AB of experiments. Chapman & Hall, London
s2E (2000)
6.92
= Fisher, R.A.: Statistical Methods for
2.9 Research Workers. Oliver & Boyd, Edin-
= 2.385 . burgh (1925)
The value of the Fisher table with 12 and 20 Yates, F.: Complex experiments. Suppl. J.
degrees of freedom for α = 0.05 is equal Roy. Stat. Soc. 2, 181–247 (1935)
to 2.28. Yates, F.: The design and analysis of fac-
Since F ≥ F4,20,0.05, we reject the H0 torial experiments. Technical Commu-
hypotheses and conclude that the effect of nication of the Commonwealth Bureau
the interaction between the secretary and the of Soils 35, Commonwealth Agricultural
type of typewriter is significant on the num- Bureaux, Farnham Royal (1937)
ber of words typed in 1 min.

Table of Analysis of Variance


Type I Error
All this information is summarized in the When hypothesis testing is carried out,
table of analysis of variance: a type I error occurs when one rejects the
Type I Error 551

null hypothesis when it is true, and α is the When we leave home in the morning, we
probability of rejecting the null hypothesis wonder what the weather will be like. If we
H0 when it is true: think it is going to rain, we take an umbrella.
If we think it is going to be sunny, we do not
α = P(reject H0 | H0 is true) .
take anything for bad weather.
The probability of type I error α is equal to Therefore we are confronted with the follow-
the significance level of the hypothesis test. ing hypotheses:
Null hypothesis H0 : It is going to rain.
HISTORY Alternative hypothesis H1 : It is going to
In 1928,Neyman, J.and Pearson, E.S. were be sunny.
the first authors to recognize that a ratio-
nal choice of hypothesis testing must take Suppose we accept the rain hypothesis and
into account not only the hypothesis that take an umbrella.
one wants to verify but also the alternative If it really does rain, we have made the right
hypothesis. They introduced the type I error decision, but if it is sunny, we made an error:
and the type II error. the error of accepting a false hypothesis.
In the opposite case, if we reject the rain
hypothesis, we have made a good decision
DOMAINS AND LIMITATIONS
if it is sunny, but we will have made an error
The type I error is one of the two errors the
if it rains: the error of rejecting a true hypoth-
statistician is confronted with in hypothesis
esis.
testing: it is the type of error that can occur
We can represent these different types of
in decision making if the null hypothesis is
errors in the following table:
true.
If the null hypothesis is wrong, another type Situation Decision
of error arises called the type II error, mean- Accept H0 Reject H0
ing accepting the null hypothesis H0 when it (I take an (I do not take
is false. umbrella) an umbrella)
Thedifferenttypesof errorscan berepresent- H0 true Good Type I error
ed by the following table: (it rains) decision
H0 false Type II error β Good
Situation Decision (it is sunny) decision
Accept H0 Reject H0 T
H0 true 1−α α Theprobability α of rejecting atruehypoth-
H0 false β 1−β esis is called level of significance.
The probability β of accepting a false
with α is the probability of the type I error hypothesis is the probability of type II
and β is the probability of the type II error. error.

EXAMPLES FURTHER READING


We will illustrate, using an example from  Hypothesis testing
everyday life, the different errors that onecan  Significance level
commit in making a decision.  Type II error
552 Type II Error

REFERENCES DOMAINS AND LIMITATIONS


Neyman, J., Pearson, E.S.: On the use and The probability of type II error is denoted
interpretation of certain test criteria for by β, the probability of rejecting the null
purposes of statistical inference, Parts I hypothesis when it is false is given by 1−β:
and II. Biometrika 20A, 175–240, 263–
294 (1928) β = P(reject H0 | H0 is false) .

The probability 1 − β is called the power of


the test.
Type II Error Therefore it is always necessary to try and
When carrying out a hypothesis test, minimize the risk of having a type II error,
a type II error occurs when accepting the which means increasing the power of the
null hypothesis given it is false and β is the hypothesis test.
probability of accepting the null hypothe-
sis H0 when it is false: EXAMPLES
See type I error.
β = P(accept H0 | H0 is false) .

FURTHER READING
HISTORY  Hypothesis testing
See type I error.  Type I error

You might also like