You are on page 1of 16

SBE 707 Biostatistics

Yeditepe University
María Cristina Pinos 10/06/2022
Student number: 20213026010
Assignment #1
Chi-Square Test and Fisher’s Exact Test: An Application in Health Sciences

1. Introduction

The importance of health research in society cannot be overstated, as “it can

provide important information about disease trends and risk factors, outcomes of

treatment or public health interventions, functional abilities, patterns of care, and health

care costs and use” (National Institutes of Health, 2009). However, when running medical

research, most of the times researchers have to work with statistical procedures such as

the Chi-square test and the Fisher’s exact test, to be able to reject or not their hypothesis.

The Chi-Square test, also known as the Pearson Chi-square test, divides a variable

into groups and then computes the chi-square statistic. The observed and expected

frequencies in each category are compared in this statistical test to see if all categories

have the same proportion of values or if each category has a user-specified proportion of

values (IBM, 2021). Nevertheless, the Chi-square test can only be applied to sample sizes

bigger than 50.

On the other hand, Fisher's exact test is based on the same ideas as the Chi-square

test. Nonetheless, the difference between both tests is that the Chi-square test uses the

Chi-square distribution to determine the critical value of the data, while the Fisher exact

test uses the hypergeometric distribution (Lewis & Schoenfeld, n.d.).

This study will provide one example for the Chi-square and Fisher’s exact tests,

in order to know the correlation between breast cancer and parabens. The data used was

randomly generated for a determined sample size.

1
2. Methods

2.1. Chi-Square Test Definition

The Chi-square test is defined as the squared sum of the observed values minus

the expected values and divided by the expected value (Rana & Richa, 2015), as is shown

in Equation 1:
𝑘
2
(𝑂1 − 𝐸𝑘 )2
𝑥 =∑ (1)
𝐸𝑗
𝑗=1

Where O is the observed value and E is the expected value, which is the number

of observations that fall in each cell if we distribute them proportionally.

As reported by McHugh, 2013, the expected value is calculated by multiplying

the row and column sums of the respective cell and dividing by the total of the

observations.

𝑀𝑅 × 𝑀𝐶
𝐸= (2)
𝑛

Where “MR represents the row marginal for that cell, MC represents the column

marginal for that cell, and n represents the total sample size” (McHugh, 2013).

For this test, the null hypothesis states that there is no significant difference

between the observed values and the expected values, while the alternative hypothesis

establishes that there is a difference between both values (Dietrichson, 2019). This can be

expressed as:

𝐻0 : 𝑥12 = 𝑥22

𝐻𝑎 : 𝑥12 ≠ 𝑥22

For instance, for a high correlation between the observed and the expected values,

the chi-square must be a low value and higher values indicate a significant difference

between the values mentioned above (Kim, 2017).

2
2.1.1. When to use a Chi-Square Test?

As the Chi-square test is a non-parametric statistic, the data should meet at least

one of the following conditions:

a. All variables are measured at nominal or ordinal level.

b. Each category’s subjects are distinct from one another.

c. The information was gathered from a random sample.

d. Each category has at least five observations.

2.1.2. Types of Chi-Square Test

2.1.2.1. Chi-Square Goodness-of Fit Test

The Chi-square goodness-of-fit test is applied to contrast a randomly selected

sample with a single category variable to the entire population. The most common

application of this test is to compare a random sample to the population from whence it

was derived (Ross, 2017). The null and the alternative hypothesis are presented below:

𝐻0 : 𝑃𝑖 = 𝑝𝑖 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑖 = 1, … , 𝑘

𝐻𝑎 : 𝑃𝑖 ≠ 𝑝𝑖 𝑓𝑜𝑟 𝑠𝑜𝑚𝑒 𝑖 = 1, … , 𝑘

Where P is the proportion of the population and p is the probability.

2.1.2.2. Chi-Square Test for Independence

The Chi-square test for independence “is a statistical hypothesis test used to

determine whether two categorical or nominal variables are likely to be related or not”

(University of Texas, n.d.). This means that if the variables are independent, therefore

one of the values will not change when the other one changes. However, if there is a

correlation between the variables, therefore the distribution of one is then determined by

the level of the other.

3
Unlike the goodness-of-fit test, the independence test does not compare a single

observed variable with a theoretical population, but rather two variables within a set of

samples with each other.

2.2. Fisher’s Exact Test Definition

Fisher's exact test, as Chi-square test, is used to examine whether two category

variables have a significant relationship. When one or more categories have less than 5

observations, this test is commonly employed as an alternative to the Chi-square test of

independence. The most common application of this test is to compare a random sample

to the population from whence it was derived (Dietrichson, 2019).

The main idea is to list all conceivable outcomes that are consistent with a given

set of marginal totals and then add up the probabilities of the tables. A 2x2 table is a one-

dimensional random variable with a known distribution that is conditional on the margins,

making the exact test reasonably simple to execute (Le, 2003). The chances of seeing a

table containing cells a, b, c, and d (with a total of n) are described in the Equation 3.

( 𝑎 + 𝑏 ) ! ( 𝑐 + 𝑑 ) ! ( 𝑎 + 𝑐 ) ! ( 𝑏 + 𝑑 )!
Pr(𝑎, 𝑏, 𝑐, 𝑑 ) = (3)
𝑛! 𝑎! 𝑏! 𝑐! 𝑑!

The null hypothesis and the alternative hypothesis for the Fisher’s exact test, are

the same as the Chi-square test, which means:

𝐻0 : 𝜎12 = 𝜎22

𝐻𝑎 : 𝜎12 ≠ 𝜎22

The only necessary condition is that the observations in the sample are

independent of each other. This will be true if the sampling is random, if the sample size

is less than 10% of the population size, and if each observation contributes only to one of

the levels of the qualitative variable (Senn, 2012).

2.2.1. Statistical Analysis

4
The example given in this study analyzes the relation of breast cancer and the use

in parabens in women of 30-50 years old through a hypothetical survey. The null and the

alternative hypothesis were:

H0: There is no association between breast cancer in women and the use of

products containing parabens

Ha: There is an association between breast cancer in women and the use of

products containing parabens

𝛼 = 0.05

The hypothetical data was randomly generated with the program Excel for a

population of 200 women. The data was used and analyzed for the Chi-square test using

the SPPS 28. We decided to use a significance level of 0.05 with a margin error of 5%,

therefore the calculated sample size was of 132 women. As the data obtained is nominal,

frequencies and percentages were used as descriptive statistics.

3. Results

For this test it was assumed a population of 200 women and a sample size of 132

women. Hence, in an Excel sheet we use the function RANDBETWEEN(0;1) to generate

a random number between 0 and 1.The number zero represents a “no” and the number

one represents a “yes”.

Figure 1. Generation of a random number between 0 and 1.

5
Once the data was randomly generated, the variables were entered into the SPSS

program with their characteristics, as shown in Figure 2.

Figure 2. Variables of the study

Since both set of data does not require an order, the two sets of data were

categorized as nominal. It was also established the values labels for zero and one for both

variables.

Image 3. Value labels for zero and one

3.1. Chi-Square Test

As the data obtained is nominal, a frequency test was made in order to determinate

how many times did a “no” or a “yes” was repeated for each variable. For calculate the

frequency and percentages, the Analyze tab was selected, then the Descriptive Statistics

option and then we choose Frequencies.

Image 4. Selection of frequency test from the descriptive statistics option

6
The results for the frequencies and percentages for the variables are presented in

Table 1 and Table 2. According to Table 1, the frequency of the use of products containing

parabens was of 75; this means that from 132 women, the 56.8% use products that contain

this type of preservative. Meanwhile, the 43.2% consume products free of parabens.

Table 1. Frequency and percent for women who use products that contain parabens

On the other hand, Table 2 establish that from 132 women, 53.8% do not suffer

for breast cancer, while the 46.2% of the sample has been diagnosed with this type of

carcinoma.

Table 2. Frequency and percent for women who suffer from breast cancer

The next step consisted in calculate the Chi-square test. For this step the option

Crosstabs was selected from the Descriptive stadistics.

Image 5. Selection of Chi-Square test

7
Subsequent, we selected our variable of women who suffer from breast cancer to

be in the rows and women who use products with parabens in the columns. We selected

the option Statistics and marked the Chi-square box.

Image 6. Selection of rows and variables for the Chi-square test

Because we also wanted to know the p value for the Fisher’s exact test we selected

in the Exact Tests option, the Exact option instead of the Asynptotic only option.

Image 7. Selection of exact method for Fisher’s exact test

From the steps above we obtained the Table 3, which shows the relation between

women who suffer from breast cancer and use products that contain parabens. Table 3

also displays that within the group of women that do not suffer from breast cancer the

43.7% do not use products containing parabens while the 56.2% use products free of

parabens. In the meantime, from the group of women that suffer of the carcinoma, 57.4%

consume products with this preservative and 42.6% do not use that type of products.

8
Table 3. Relation between women who suffer from breast cancer and use products that

contain parabens

Use products that Chi- Fisher’s


contain parabens square test p
Total
test p value
No Yes
value
Count 31 40 71
Suffers No % within Suffers
43,7% 56,3% 100,0%
from from breast cancer
,904 1,00
breast Count 26 35 61
cancer Yes % within Suffers
42,6% 57,4% 100,0%
from breast cancer
Count 57 75 132
Total % within Suffers
43,2% 56,8% 100,0%
from breast cancer

Chi-square test and Fisher’s exact test

The P value was obtained from Table 4, where we selected the Asymptotic

Significance value for a Pearson Chi-square test. This selection was made taking in

account that there are at least five observations and the sample size is larger enough.

Meanwhile, for the Fisher’s excat test we chose the Exact Significance (2-sided) as we

have a 2x2 table.

Table 4. Chi-Squares tests

9
Both p values obtained determine that there is no distribution difference between

women who consume or not products containing parabens and women who suffer, or not,

from breast cancer. This affirmation is based in the fact that the p value is greater than α.

𝑝 𝑣𝑎𝑙𝑢𝑒 > α

Hence, the null hypothesis can not be rejected for neither the Chi-square nor

Fisher’s exact tests.

4. Discussion and Conclusions

From the results section, the frequency determined the number of women that

declared that use or not paraben-free products. Therefore, we could observe that there are

more women who use products containing parabens than women who prefer products free

of that type of preservative. Meanwhile, the frequency of women who do not suffer from

breast cancer was higher than those who suffer from the carcinoma. It is important to

remind that the frequency only settles “the number of times a particular value for a

variable (data item) has been observed to occur” (Australian Bureau of Statistics, n.d.).

In 2015, Singhal and Rana performed a chi-square test, with hypothetical data, to

determined if there is a relation between lung diseases and smoking for a sample size of

n = 105 persons, with a significance level of 0.05. Their study concluded that there is no

relation between both variables, as the p value obtained was greater (0.0645>0.05) than

the α value. This result does not reject the null hypothesis which establishes that there is

no association between smoking and lung disease.

When comparing Singhal and Rana study with this study both p values are greater

than the α value and, therefore, both null hypotheses can not be rejected. One of the

reasons for this result could be the fact that both studies employed nominal data for the

statistical analysis and, consequently, a Chi-square test or a Fisher’s exact test are the

adequate statistical analysis to find a correlation between the variables (Kim, 2017).

10
At the end of this study, the null hypothesis was not rejected as there is no

correlation between products containing paraben and breast cancer in women of 30-50

years old. The results and analysis of the study were supported by a Chi-square test and

a Fisher’s exact test using the program SPSS when having a sample size of n = 132 with

a significance level of 0.05. It is important to remember that the Chi-square test only

searches for a correlation; it doesn't establish how strong that association is or whether

the relationship is causative. While a properly conducted randomized controlled

experiment allows for causal inferences, uncontrolled trials can muddle the observed

correlations. Techniques that compensate for confounding, such as multivariable logistic

regression, are particularly recommended in such instances (Lewis & Schoenfeld, n.d.).

11
5. References
Australian Bureau of Statistics. (n.d.). Statistical Language - Describing Frequencies. Retrieved
June 5, 2022, from Australian Bureau of Statistics:
https://www.abs.gov.au/websitedbs/D3310114.nsf/Home/Statistical+Language+-
+describing+frequencies
Cancer. (2021, December 20). Retrieved June 09, 2022, from For a healthy Belgium:
https://www.healthybelgium.be/en/health-status/non-communicable-
diseases/cancer#read-more
Dietrichson, A. (2019). Métodos Cuantitativos. Universidad Nacional San Martín. Retrieved from
https://bookdown.org/dietrichson/metodos-cuantitativos/
IBM. (2021, June). Prueba de Chi cuadrado. Retrieved 20 May, 2022, from IBM:
https://www.ibm.com/docs/es/spss-statistics/SaaS?topic=tests-chi-square-test
Kim, H.-Y. (2017). Statistical notes for clinical researchers: Chi-squared test and Fisher's exact
test. Restorative Dentistry and Endodontics, 2(42), 152-155.
doi:10.5395/rde.2017.42.2.152
Le, C. T. (2003). Comparison of Population Proportions. Hoboken: John Wiley and Sons.
Lewis, J., & Schoenfeld, D. (n.d.). Educational Research Column: Choosing Wisely: Chi-Square
vs. Fisher’s Exact. Retrieved June 7, 2022, from Clerkship Directors in Emergency
Medicine: https://www.saem.org/about-saem/academies-interest-groups-
affiliates2/cdem/for-students/cdem-voice/educational-research-column/educational-
research-column-choosing-wisely-chi-square-vs.-fisher-s-exact
McHugh, M. (2013). The Chi-square test of independence. Biochemica Medica, 2(23), 143-149.
doi:10.11613/BM.2013.018
National Institutes of Health. (2009). 3 The Value, Importance, and Oversight of Health. In
Beyond the HIPAA Privacy Rule. Washington (DC): National Academies Press.
Rana, R., & Richa, S. (2015). Chi-square Test and its Application in Hypothesis Testing. Journal
of the Practice of Cardiovascular Science, 1(1), 69-71. doi:10.4103/2395-5414.157577
Ross, S. (2017). Chi-Squared Goodness-of-Fit Tests. In S. Ross, Introductory Statistics (pp. 585-
620). Elsevier. doi:10.1016/B978-0-12-804317-2.00013-8
Senn, S. (2012). Tea for three: Of infusions and inferences and milk in first. Significance(9), 30-
33. doi:10.1111/j.1740-9713.2012.00620.x
Sharkey, A., Siddiquin, N., Downey, K., Ye, X., Guevera, J., & Carvalho, J. (2019). Comparison
of Intermittent Intravenous Boluses of Phenylephrine and Norepinephrine to Prevent and
Treat Spinal-Induced Hypotension in Cesarean Deliveries: Randomized Controlled Trial.
Anasthesia & Analgesia, 129, 1312-1318. doi:10.1213/ANE.0000000000003704
University of Texas. (n.d.). Chi-Square Test of Independence. Retrieved June 1, 2022, from
University of Texas at Austin:
http://sites.utexas.edu/sos/guided/inferential/categorical/chi2/#:~:text=This%20test%20i
s%20used%20to,fact%20related%20to%20one%20another.

12
Assignment # 2
Coverage of Skin Cancer Risk Factors and UV Behaviors in Popular U.S
Magazines from 2000 to 2012
Jennifer E McWhirter, Laurie Hoffman-Goetz
Abstract Mass media is an influential source of skin cancer and tanning
information for the public, but we know little about its content or
emphasis. The objective of this research was to describe the volume and
nature of skin cancer and tanning messages in 20 popular U.S. men’s and
women’s magazines (2000–2012). We used a directed content analysis
to determine frequency information about risk factors and ultraviolet
(UV) behaviors in 608 articles and 930 images. Chisquare and Fisher’s
exact tests determined coverage differences based on content type (text
vs. image) and target audience (women vs. men). UV exposure was the
most common risk factor mentioned (37.7 %) and sunscreen use the most
common behavior encouraged (60.0 %); information about other risk
factors and protective behaviors was uncommon. Both articles (25.2 %)
and images (36.9 %) promoted the tanned look as attractive. In most
cases, images infrequently contained helpful information on skin cancer
risk factors and prevention, except for high-SPF sunscreens. Women’s
magazines published more articles on skin cancer and tanning than men’s
magazines (456 vs. 159, χ2 =143.43, P<.01), and the nature of the
messages differed between them. Magazine skin cancer and tanning
content may contribute to inaccurate public understanding of risks and
prevention. These findings are relevant to cancer educators, who may
wish to counter potentially harmful messages and enhance positive ones
through cancer education efforts.
Keywords Skin cancer. Melanoma. Tanning. Mass media. Beauty.
Visual health communication. Sunscreen. Skin cancer prevention.
For this study, McWhirter and Hoffman-Goetz (2015) “conveyed information

about skin cancer risk factors and UV behaviors”. Therefore, they used a sample size of

n = 608 magazines, of the U.S, that presented articles and images that covered the risk

factors and UV behaviors about skin cancer and tanning. As consequence, they ended up

with two subsamples, one for articles (n = 61) and another one for images (n = 91). It is

important to remind that the researchers of this paper excluded advertisements, as they

would not represent information about the matter. For the statistical analysis, the

researchers used a Chi-square and Fisher’s exact tests to “compare the presence of

variables by content type (text vs. image) and target audience (women vs. men)”

13
(McWhirter and Hoffman-Goetz, 2015). The study also employed a significance level of

0.05.

This paper decided to used Chi-square test because researchers wanted to know if

there is a relation between the fact that during their lifetime, men tend to accumulate more

UV exposure in comparison with women. However, indoor tanning systems are mostly

used by the female population. Ergo, the study compares two categorical data, magazine’s

articles directed to women and men about the risk factors of UV exposure, to understand

and interpret if there exists a relation between them (University of Southhampton, 2014).

On the other hand, if we analyse the sample size of the study, it is large enough to carry

out a Chi-square test and, also, each category had at least five observations.

The factors that could influence in McWhirter and Hoffman-Goetz to select a

Fisher’s exact test could have been the fact that some categories had a frequency lower

than 5. Ergo, for categories such as Sunburns and Medication/immune suppression, the

Chi-square test would give a wrong p value, as it is sensitive to the size of the sample.

This test could also be used as if each category is analysed one by one, the crosstab would

be a 2x2 and, thus, SPSS program will be able to analyse the Fisher’s exact test. Some

programs, as SPSS, can only perform a Fisher’s exact test if the data is a 2x2.

A p value lower than the significance level (α) means that it is statistically

significant and the null hypothesis, who state that there is no relation between two

variables, should be rejected (McHugh, 2015). The study concluded that the following

risk factors and UV behaviours are statistically significant (p value <0.05) when

comparing them for men and women:

• Risk factors

o UV exposure (image)

o Sunburns (image)

14
o Medication/immune suppression (text and image)

• UV behaviours

o Promotes tanned look (text)

o Promotes self-tanners (text)

o Promotes solar UV avoidance (image)

o Promotes clothes (image)

o Promotes sunscreen (image)

o SPF level (30+) (text and image)

15
References

McHugh, M. (2013). The Chi-square test of independence. Biochemica Medica, 2(23),


143-149. doi:10.11613/BM.2013.018
McWhirter, J, & Hoffman-Goetz, L. (2015). Coverage of Skin Cancer Risk Factors and
UV Behaviors in Popular U.S. Magazines from 2000 to 2012. Journal of Cancer
Education, 2(31), 382-388. doi: 10.1007/s13187-015-0808-1
University of Southamptom. (2014). Chi Square. Retrieved June 9, 2022, from:
https://www.southampton.ac.uk/passs/full_time_education/bivariate_analysis/chi
_square.page#:~:text=A%20chi%2Dsquare%20test%20is,the%20variables%20y
ou%20are%20studying.

16

You might also like