Professional Documents
Culture Documents
These include:
References This article cites 8 articles, 6 of which can be accessed free at:
http://emj.bmj.com/cgi/content/full/18/3/214#BIBL
Email alerting Receive free email alerts when new articles cite this article - sign up in the box at the
service top right corner of the article
Notes
AN INTRODUCTION TO STATISTICS
Objectives
x Dealing with unpaired (independent) para- Box 1 System for statistical
metric data comparison of two groups
x Discuss common mistakes using the t test x State the null hypothesis and the alterna-
In covering these objectives the following tive hypothesis of the study
terms will be introduced: x Select the level of significance
x Unpaired z test x Establish the critical values
x Unpaired t test x Select the groups and calculate their
x One and two tailed tests means and standard errors of the mean
In the previous article we discussed the com- (SEM)*
parison of paired (dependent) data.1 These x Choose and calculate the test statistic
result when there is a relation between the x Compare the calculated test statistic with
groups, for example investigating the before and the critical values
after eVects of a drug on the same group of x Express the chances of obtaining results
patients. The key measurement here is the at least this extreme if the null hypothesis
diVerence between each pair. If this comes from is true
a population that is normally distributed the * or estimated standard error of the mean
mean diVerence can be calculated along with (ESEM) if using a sample size < 100.2
the standard error of the mean (SEM). The
95% confidence intervals for the true mean dif-
ference can then be derived along with the p Unpaired z test
value for the null hypothesis (table 1). We have shown previously that a systematic
When there is no relation between the approach is used to determine if the null
groups, the data are called “unpaired” or hypothesis is valid (box 1).1
“independent”. A common example of this is To see how this works when dealing with
the controlled trial where the eVect of an inter- unpaired data consider the following example.
vention on one group is compared with a con- Dr Egbert Everard has been working for just
trol group without the intervention. Here the over a year in the emergency department of
selection of the experimental group does not Deathstar General. During this time the
tell you which people will be in the control department has dealt with 100 patients who
group. They are therefore independent of one have ingested a new rave drug “Hothead”. He
another. suspects these people may have an abnormal
It is useful to note at this stage that when you sodium concentration on presentation—how
compare groups you are taking into account can he investigate this?
two variations. One is due to the diVerence
between subjects within the same group and is 1 STATE THE NULL HYPOTHESIS AND
called the intra-group variation. The other ALTERNATIVE HYPOTHESIS OF THE STUDY
results from the diVerence between the groups Having considered the problem, Egbert writes
and so is known as the inter-group variation. down the null hypothesis as:
With paired data the diVerence in subjects is “There is no significant diVerence between
removed because each subject acts as its own the sodium concentration in the patient’s
control. Consequently you are simply measur- ingesting “Hothead” and those of a similar age
ing the inter-group variation. In contrast, when attending the emergency department”. In
using unpaired data, both these variations have other words they are part of the same
Accident and an eVect (table 1). population.
Emergency
Department, Hope Table 1 Comparison of two groups using z and t-tests
Hospital, Salford
M6 8HD, UK Paired test Unpaired test
Deals with the diVerence between the paired values Deals with the diVerence between the means of both groups
Correspondence to: Relies on the population of this diVerence being normally Relies on the population of this diVerence being normally
Mr Driscoll, Consultant in distributed distributed
Accident and Emergency It is not aVected by the distribution of the before and after Is aVected by the inter and intra group distribution
Medicine (pdriscoll@ samples
hope.srht.nwest.nhs.uk)
www.emjonline.com
Downloaded from emj.bmj.com on 16 January 2008
www.emjonline.com
Downloaded from emj.bmj.com on 16 January 2008
Key point 1
When comparing a sample with a large
group you only need to know the ESEM of
the sample.
Frequency
www.emjonline.com
Downloaded from emj.bmj.com on 16 January 2008
t distribution
with df = 10 conversation but does wonder if the same
applies to patients having taken an analogue of
“Hothead” called “Brainboil”. She tackles this
using the previously described systematic
approach but this time considers using an
unpaired t test as her study and control groups
have only 16 patients in each.
[Na+]
The alternative hypothesis is the logical
opposite of this, that is:
Area of Area of “There is a significant diVerence between
rejection rejection the sodium concentration in the patient’s
(2.5% of area (2.5% of area ingesting “Brainboil” and those of a similar age
under the curve) under the curve)
attending the emergency department”.
This can be summarised to:
mean “Brainboil” [Na+] ≠ mean control
[Na+]
tcrit = –2.042 0 tcrit = +2.042
t Score 2 SELECT THE LEVEL OF SIGNIFICANCE
Figure 4 t distribution curve with 30 degrees of freedom demonstrating two tails. These Following convention, Endora picks a signifi-
are demarcated by t(crit) values of −2.042 and 2.042. The area between these values cance level of 0.05 for her study.
represents those values that are in keeping with the null hypothesis and amount to 0.95 of
the area under the curve.
DiVerence between the means of the two 3 ESTABLISH THE CRITICAL VALUES
groups = −3 mmol/l (95% confidence inter- This is carried out in the same way as compar-
vals −5.4 to –0.6 mmol/l); p = 0.012. ing larger groups but this time the t statistic is
used because the group size is less than 100.
The t table enables you to calculate the
Unpaired t test probability of lying within the middle 95% of
When the sample size is less than 100, the the distribution where the null hypothesis is
eVect of intra-group variation becomes greater. valid. The tables also take into account the
In these cases the normal distribution has to be changes in t with variation in sample size.
replaced by the t distribution. Unlike the For mathematical reasons rather than use
normal distribution, the shape of the t distribu- the absolute number in the group you use the
tion is dependent upon the size of the group degrees of freedom. In this type of comparison
(fig 3). It is always symmetrical but with small it is equal to the sum of the number in each
sample sizes the curve is flatter and has longer group minus 1 (that is, (n1 − 1) + (n2 −1)).
“tails”. However, as the sample size increases, Consequently the degrees of freedom is [16
the curve becomes normally distributed. − 1] + [16 − 1] = 30.
Irrespective of which t distribution is chosen, Using the t distribution tables, Endora finds
the same principle applies regarding set areas that the t value for a probability of 0.05 with 30
under the curve representing particular prob- degrees of freedom is 2.042. This is known as
abilities. Consequently the p value for the null the tcrit value. It means that for this study, a t
hypothesis is derived from the test statistic. value of ± 2.042 divides the middle 95% of the
However, tables of the t distribution are used population accepting the null hypothesis from
rather than the z distribution ones. Likewise, the two, 2.5% tails of rejection (fig 4).
the 95% confidence intervals for the true The t statistic from the study (tcalc) can now
diVerence between the means are the experi- be determined.
www.emjonline.com
Downloaded from emj.bmj.com on 16 January 2008
4 SELECT THE GROUPS AND CALCULATE THEIR Table 2 Extract of the table of the t-statistic values. The
MEANS
first column lists the degrees of freedom (df). The headings
of the other columns give probabilities for t to lie within the
After carrying out her study with “Brainboil” two tails of the distribution.
she finds the mean presenting sodium concen-
trations to be 130 mmol/l (s=10 mmol/l). Dr df 0.1 0.05 0.01 0.001
Rooba Tube tells her the mean sodium 1 6.314 12.706 63.657 636.619
concentration in a control group of patients at 5 2.015 2.571 4.032 6.869
St Heartsinc is 135 mmol/l (s=10). 10 1.812 2.228 3.169 4.587
15 1.753 2.131 2.947 4.073
20 1.725 2.086 2.845 3.850
5 CHOOSE AND CALCULATE THE TEST STATISTIC 30 1.697 2.042 2.750 3.646
43 1.681 2.017 2.695 3.532
Unpaired t test
This test requires the data to have two proper-
ties: s represents the pooled variance of the two
(1) The two groups need to come from groups:
populations with normal distributions. s2 = [( n1 − 1)s12 + ( n2 − 1)s22] / [n1 + n2 −2]
It is sometimes possible to determine if the From the data Endora calculates:
distribution is skewed simply by checking the s2 = [(16 − 1)100 + (16 − 1)100] / 30 =
raw data or looking at a distribution curve. A [3000] / 30 = 100
more sophisticated way is to use a computer to Therefore:
develop a “normal plot” of the data. This pro- SE diV = '[(100/16) + (100/16)] = '12.5 =
gramme manipulates normally distributed data 3.5
so that they form a straight line. The closer the Therefore:
data comply with this line, the closer they are t = [130 − 135] / 3.5 = −1.43
to being normally distributed. Altman gives a
good description for those who are interested 6 COMPARE THE CALCULATED TEST STATISTIC
to getting further information about this type WITH THE CRITICAL VALUES
of manipulation.5 It is possible to also prove the The calculated value of −1.43 lies inside the
same thing mathematically using various prob- area of accepting the null hypothesis (that is, a
ability tests. However, these are of little t value of ± 2.042).
additional benefit when populations are less
than 30 and the normal probability plot gives a 7 EXPRESS THE CHANCES THAT THE NULL
reasonably straight line. HYPOTHESIS IS IN KEEPING WITH THE DATA
(2) The groups should be from populations As the t value can be negative or positive, there
with the same standard deviation. are two ways of getting a diVerence with a
It is not possible to know the standard devia- magnitude of 1.43. Consequently the p value is
tions of the populations but an estimation represented by the area demarcated by −1.43
comes from using the s value calculated from to the tip of the left tail plus the area
each group. The closer these values are, the demarcated by +1.43 to the tip of the right tail.
more likely they have similar standard devia- To determine this p value, Endora needs to
tions. As with distributions, it is possible to for- consult the t distribution table using the
mally assess the diVerence in group variance by appropriate degrees of freedom (table 2). In
carrying out an F test (see appendix). this case the degrees of freedom equals two less
Endora checks her datasets for both groups than the total number of subjects in both
and is satisfied that these pre-conditions are groups (that is, 30). The table indicates that
met. She therefore proceeds with the analysis. the size of these two tails is greater than 0.1.
Consequently there is over a 10% chance that a
diVerence of 5 mmol/l, or larger could have
Key points 2 Requirements for resulted if the null hypothesis was true.
unpaired t tests The null hypothesis is therefore accepted
x The groups need to have normal distribu- and Endora can conclude that the sodium con-
tions centrations in patients taking “Brainboil” are
x The groups need to have similar standard not significantly diVerent from the general
deviations population.
www.emjonline.com
Downloaded from emj.bmj.com on 16 January 2008
www.emjonline.com
Downloaded from emj.bmj.com on 16 January 2008
Table 3 Comparison of age and admission temperatures in two groups of patients selected amount of charcoal drunk was 26.5 (13.3) g
for Steele et al’s study9 for Carbomix and 19.5 (13.7) g for Actidose-
Blanket rewarming (7 Forced-air rewarming (9
Aqua. The sample size for the Carbomix group
Characteristic patients) patients) was 47 and 50 for Actidose-Aqua. Assuming
Mean age (s) 54 yr. (14 yr.) 58 yr. (19 yr.)
the prerequisites for carrying out an unpaired,
Mean admission temperature (s) 29.8°C (1.5°C) 28.8°C (2.5°C) two tailed t test are valid, calculate the t statis-
tic.
not comply with the t distribution curve. A 5 One for you to try on your own. Steele et al
possible solution in these cases is to see if carried out a study comparing two types of
transforming the data can make them have a rewarming of hypothermic patients.9 Part of
normal distribution and uniform variance.6 the data are adapted and shown in table 3.
Data that still fail to be achieve these prerequi- Carry out an unpaired, two tailed t test com-
sites cannot be analysed using the t test. paring these datasets in the two groups. Is there
Instead a non- parametric method will have to a significant diVerence between the groups for
be used. the two variables?
www.emjonline.com
Downloaded from emj.bmj.com on 16 January 2008
www.emjonline.com