Download as xls, pdf, or txt
Download as xls, pdf, or txt
You are on page 1of 40

This Excel file will allow you to do the following

Chi-square test
t-test
Paired t-test
Regression
Simpson's Diversity Index

Click on tabs on the bottom to move to th

(if you don't see the tabs, make sure the window for this worksheet is maximized)

o do the following tests:


Categorical Data: Use this test to compare totals (e.g., number of saguaros on northversus south-facing slope). This test can handle any number of categories (not just two).
Continuous Data: Use this test to compare averages (e.g., average saguaro height on
north- versus south-facing slopes).
Use this test to compare averages when the two numbers come in pairs
(e.g., if you wanted to compare number of holes in the north versus south sides of cacti, each
cactus will have a number of holes for its north side and a number of holes for its south side, which
make up one pair of observations. You could use this test to compare all of these pairs of numbers,
to see if there were typically more holes on one side or the other.
Use this test to look for a relationship between two numeric variables (such as saguaro
height and number of holes in the saguaro).
Use this test to compare species diversity between locations.

m to move to the test you want.

or this worksheet is maximized)

CHI SQUARE TEST


WHEN TO USE: Use this test to compare totals or counts between different categories (such as numbers of cacti per 100m
Steps to using Excel to do chi-square test:
First decide how many categories you have (e.g., north vs south would be 2 categories; tree, shrubs, succulents would be 3).
Use the table that has the same number of categories as you have (change categories to yours if you want).
Type your data in the gray boxes; make sure you press enter after entering all data
The p-value gives the chance that the numbers are evenly randomly distributed.
Note: you cannot use chi square test for comparing percentages.
Note: you should not use chi square test for sample sizes less than 30
2 categories
Your Data >>>

Category 1
51

Category 2
60

3 categories
Your Data >>>

Category 1

Category 2

4 categories
Your Data >>>

Category 1
40

Category 2
50

Category 3
60

Category 4
104

5 categories
Your Data >>>

Category 1

Category 2

Category 3

Category 4

Category 5

8 categories
Your Data >>>

Category 1

Category 2

Category 3

Category 4

Category 5

P value

0.393 Is the p value less than


If no, then the totals are no
If yes, then the totals are s

Category 3
P value

#DIV/0!

P value

Category 6

Example 1: if you counted 120 saguaros on the N slope and 150 saguaros on the S slope,
then p = 0.068 so there is no significant difference in # of saguaros on the two slopes.

Example 2: if you counted 40 holes on the N side, 50 on E side, 60 on W side, and 104 on S side of saguaros,
then p < 0.01 so there is a significant difference in # of saguaros on the two slopes.
The chi square test compares the observed values to the values expected by the null hypothesis.

umbers of cacti per 100m 2 in a wash versus on a hill slope).

bs, succulents would be 3).

the p value less than 0.05?


no, then the totals are not significantly different (cannot reject null hypothesis)
yes, then the totals are significantly different (accept an alternative hypothesis)
Is the p value less than 0.05?
If no, then the totals are not significantly different (cannot reject null hypothesis)
If yes, then the totals are significantly different (accept an alternative hypothesis)
p<0.01

P value

Category 7

04 on S side of saguaros,

hypothesis.

Is the p value less than 0.05?


If no, then the totals are not significantly different (cannot reject null hypothesis)
If yes, then the totals are significantly different (accept an alternative hypothesis)
#DIV/0! Is the p value less than 0.05?
If no, then the totals are not significantly different (cannot reject null hypothesis)
If yes, then the totals are significantly different (accept an alternative hypothesis)
Category 8
P value

#DIV/0! Is the p value less than 0.05?


If no, then the totals are not significantly different
If yes, then the totals are significantly different (ac

hypothesis)
hypothesis)

not reject null hypothesis)


an alternative hypothesis)

han 0.05?
re not significantly different (cannot reject null hypothesis)
are significantly different (accept an alternative hypothesis)

T-TEST

WHEN TO USE: Use this test when you want to compare values of any numeric variable between two groups (such as tree he

Your Data >>>


Your Data >>>
Your Data >>>
Etc.

Group 1
90.20
99.68
108.29
90.22
103.40
107.16
99.60
85.50
75.59
95.86
75.22
78.81
112.44
100.78
112.98
104.08
91.73
105.44
96.00
94.00
88.00
105.00
103.00
91.00
102.00
91.00
84.00
110.00
91.00
90.00
108.00
101.00
100.00
103.00
74.00
109.00
100.00

Group 2
90.00
94.00
96.00
98.30
94.00
92.00
86.70
105.00
88.00
108.00
103.00
92.00
116.00

w h a t a r e y o u m e a s u r in g (u n its )

Steps to using Excel to do t-test:


Click on Group 1 and type in new name for group; do same for Group 2
Replace existing data with your data under each column name
Click into the vertical-axis label of the graph, and change the label, remembering to give the units, too

average Group 1
average Group 2

96.675
97.154

standard error Group 1


standard error Group 2

1.734
2.386

P value

0.884

97.200
97.100
97.000
96.900
96.800
96.700
96.600
96.500
96.400

n two groups (such as tree heights in a wash versus on a hill slope).

ive the units, too

These values show the variability for each group, and are used to make the "error bars" on the graph below
Is the p value less than 0.05?
If no, then the averages are not significantly different (cannot reject null hypothesis)
If yes, then the averages are significantly different (accept an alternative hypothesis)

7.200

7.100

7.000

6.900

6.800

6.700

6.600

6.500

6.400

Group 1

Group 2

rror bars" on the graph below

PAIRED T-TEST
WHEN TO USE: Use this test when you want to compare numeric variables that come in pairs.

Steps to using Excel to do paired t-test:


Click on Variable 1 and type in a name for your variable; do same for Variable 2.
(These names just need to distinguish between the two variables. For instance, you could
use "North" and "South" if you were comparing numbers of holes in north versus south sides of cacti.)
Replace existing data with your data under each column name. Make sure you put both of the numbers from
Click into the vertical-axis label of the graph, and change the label, remembering to give the units if approp

Your Data for pair 1 >>>


Your Data for pair 2 >>>
Your Data for pair 3 >>>
Etc.

Variable 1
90.20
99.68
108.29
90.22
103.40
107.16
99.60
85.50
75.59
95.86
75.22
78.81
112.44
100.78
112.98
104.08
91.73
105.44
96.00
94.00
88.00
105.00
103.00
91.00
102.00
91.00
84.00
110.00
91.00
90.00
108.00
101.00
100.00
103.00
74.00
109.00
100.00

Variable 2
90.20
99.68
108.29
90.22
103.40
107.16
99.60
85.50
75.59
95.86
75.22
78.81
112.44
100.78
112.98
104.08
91.73
105.44
96.00
94.00
88.00
105.00
103.00
91.00
102.00
91.00
84.00
110.00
91.00
90.00
108.00
101.00
100.00
103.00
74.00
109.00
100.00
90.00
94.00
96.00
98.30
94.00
92.00
86.70
105.00

88.00
108.00
103.00
92.00
116.00

numeric variables that come in pairs.

w h a t a r e y o u m e a s u r in g (u n its )

o same for Variable 2.


riables. For instance, you could
f holes in north versus south sides of cacti.)
ame. Make sure you put both of the numbers from each pair of observations in the same row.
he label, remembering to give the units if appropriate

average Variable 1
average Variable 2

96.675
96.800

standard error Variable 1


standard error Variable 2

1.734
1.413

P value

These values show the variability for each variable, and are used to

#VALUE! Is the p value less than 0.05?


If no, then the averages are not significantly different (cannot reject
If yes, then the averages are significantly different (accept an altern

96.820
96.800
96.780
96.760
96.740
96.720
96.700
96.680
96.660
96.640
96.620
96.600

Variable 1

Variable 2

ariable, and are used to make the "error bars" on the graph below

different (cannot reject null hypothesis)


fferent (accept an alternative hypothesis)

Variable 2

REGRESSION
WHEN TO USE: Use this test when you want to look for a relationship between two numeric variables.
Steps to using Excel to do regression:
Click on Explanatory variable and type in your explanatory variable; do same for Response variable
Replace existing data with your data under each column name
Click into the axis labels of the graph and change the labels, remembering to give the units, too
Calculations:

Your Data >


Your Data >
Your Data >
Etc.

Explanatory
variable
90.20
99.68
108.29
90.22
103.40
107.16
99.60
85.50
75.59
95.86
75.22
78.81
112.44
100.78
112.98
104.08
91.73
105.44
96.00
94.00
88.00
105.00
103.00
91.00
102.00
91.00
84.00
110.00
91.00
90.00
108.00
101.00
100.00
103.00
74.00
109.00
100.00

Response
variable
90.00
94.00
96.00
98.30
94.00
92.00
86.70
105.00
88.00
108.00
103.00
92.00
116.00

xy
8118.07
9369.49
10395.8
8869.01
9719.97
9858.59
8635.44
8978.01
6651.65
10352.6
7748.1
7250.29
13042.6
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

predicted
x2
y2
y
8136.18
8100 39.16693
9935.2
8836 31.80319
11726.7
9216 25.10817
8140.35 9662.89 39.14897
10692.4
8836 28.9054
11483
8464 25.98731
9920.43 7516.89 31.86078
7311.08
11025 42.8166
5713.39
7744 50.52479
9188.67
11664 34.77048
5658.69
10609 50.80666
6210.62
8464 48.02179
12641.8
13456 21.88584
10156.1
12763.4
10832
8415.06
11118
9216
8836
7744
11025
10609
8281
10404
8281
7056
12100
8281
8100
11664
10201
10000
10609
5476
11881
10000

ponse variable

e units, too

squared
residuals
2584.001
3868.443
5025.652
3498.844
4237.307
4357.676
3007.34
3866.775
1404.391
5362.562
2724.145
1934.083
8857.475
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!

(x - avg x)^2
41.9159871
9.002655343
134.90167
41.61734113
45.27866004
109.9050408
8.563489994
124.7727121
444.7064734
0.66827866
460.1339717
319.2484191
248.40245
16.82902557
265.692227
54.78885222
24.41701318
76.85770174
0.455642415
7.155694014
75.25584881
69.30541022
40.00546182
32.20577141
28.35548762
32.20577141
160.655952
177.5552812
32.20577141
44.55579721
128.2553328
18.70551342
11.05553922
40.00546182
514.15621
151.905307
11.05553922

n
37

y
x
3576.9755 1263

(xy)
118990

( x)2
( y)2
12794754 1595169

Y o u r r e s p o n s e v a r ia b le (u n its )

residuals
50.83307
62.19681
70.89183
59.15103
65.0946
66.01269
54.83922
62.1834
37.47521
73.22952
52.19334
43.97821
94.11416

Slope =
y-intercept =
r=
r2 =
regression standard error (s) =
standard error of the slope =
t=
P value

-0.7772
109.271
-0.17333
0.030042
#VALUE!
#VALUE!
#VALUE!
#VALUE!

140.00
120.00
100.00
80.00
60.00
40.00
20.00
0.00
70.00

80.00

90.00

100.00

Your explanatory varia

60.00
40.00
20.00
0.00
70.00

80.00

90.00

100.00

Your explanatory varia

90.00

(x2)
349807

(y2)
123594

100.00

avg(x)
96.67501

110.00

120.00

anatory variable (units)

90.00

100.00

110.00

120.00

anatory variable (units)

SIMPSON'S DIVERSITY INDEX


Steps to using Excel to do Simpson's diversity index:
Type in the number of individuals for each species in the gray boxes
The number in yellow is the Simpson's Diversity Index (D).
Diversity is a measure of the number of species (richness) and
how evenly spread out the individuals are among the species (evenness)
Simpson's Diversity
Index [actually 1-D]
N=
Richness =
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number

of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of
of

species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species
species

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

Area 1

Area 2

64.8

58.1

14
4

73
5

This is calculated for you and is total number of individu


This is calculated for you and is total number of species

1
2
3

8
12
45
2

You type in these


numbers in the gray
boxes which are
the number of
individuals of
each species (no zeroes)

8
6

Percent chance that two individuals pulled random


the community will not be from the same species.
The higher the number, the more diverse the com

number of species 38
number of species 39
number of species 40

ividuals pulled randomly from


om the same species.
more diverse the community.

total number of individuals sampled.


total number of species sampled.

THIS PAGE DOES CALCULATIONS FOR THE CHI-SQUARE

IF TOTAL IS GREATER THAN 3.84 (df=1)


THEN THERE IS SIGNIFICANT DIFFERENCE
Categories

Obs

Exp

(O-E)2

(O-E)2/E

51

55.5

20.25

0.36

60

55.5

20.25

0.36

total

111

111

TOTAL

0.73

Page

You might also like