You are on page 1of 3

Chi-square Test – Workshop 10

Download the Excel spreadsheet from Moodle and import the data ready for analysis.
Single Sample
1. Using the Piglets worksheet: contains piglet sex data from two litters each from 10 sows.
a) Perform a Chi-square of single sample to determine if the proportion of female and male pigs
observed is significantly different from p0=0.5
i. Check assumptions

ii. P-value

iii. Statement

Two or More Samples


2. Using the CocaineAddiction worksheet: contains data from a drug trial to prevent relapse of cocaine use
(Treatment: 3 levels and Relapse: 2 levels).
a) Perform a Chi-square (or Fisher’s exact if required due to small sample size or categories with
counts < 5) to determine rate of successful rehabilitation for cocaine addicts based on treatment
modality.
i. Check assumptions

ii. P-value

iii. Statement
3. Using the WinePreference worksheet: contains results of wine tasting undertaken by 20 participants
who each tasted two wines (PreferredWine: 2 levels) from five years (Wine Year: 5 levels - A=2014,
B=2015, C=2016, D=2017, E=2018).
a) Perform a Chi-square (or Fisher’s exact) to determine if in a particular year one wine brand was
more preferred than another.
i. Check assumptions

ii. P-value

iii. Statement

b) Create a bar chart to present the data and ensure you write a suitable figure caption

4. Using the Racehorse worksheet: contains data from thoroughbreds sold at auction (Price Category: 5
levels – A=$0-3,000; B=$3,001-10,000; C=$10,001-20,000; D=$20,001-50,000; and E=>$50,000) and
examination of subsequent prize money earnings being profitable (earning prize money greater than
combined $AUD40,000 cost of training and purchase price; Earnings Profitability: 2 levels – 0=No and
1=Yes).
NOTE: because Earnings Profitability is categorised using numbers (a preferred coding method by
some and essential for some stats software – but not R) you will need to convert the data in this
variable for it to be analysed:
 Data > Manage variables in active data set > Convert numeric variables to factors > in popup select
the variable and leave Supply level names checked > OK > in popup complete Numeric value level
name (e.g. for 0 put No) > OK – You can now analyse the data!
a) Perform a Chi-square (or Fisher’s exact) to determine rate of successful prize money earning
based on purchase price category.
i. Check assumptions

ii. P-value
iii. Statement

c) Create a bar chart to present the data and ensure you write a suitable figure caption

Test Instructions
 Check assumptions for Two or more samples
Statistics > Contingency tables > Two-way table > in popup Data tab select row variable (independent) and
column variable (dependent); Statistics tab check Row percentages and uncheck Chi-square test of
independence
 One sample
Statistics > Summaries > Frequency distributions… > in popup select variable and check Chi-square > OK
> in popup if required amend hypothesised probabilities > OK
• Two or more samples
Statistics > Contingency tables > Two-way table > in popup Data tab select row variable (independent) and
column variable (dependent); Statistics tab check Row percentages and if required due to small sample
size or categories with counts < 5 check Fisher’s exact test.
o You can also check Components of chi-square statistic and Print expected frequencies.
These will help you check the assumptions and interpret the test result.
• Bar graph
Graphs > Bar graph > in popup Data tab select variable (independent) and plot by groups (dependent);
Options tab Axis Scaling – check Percentages, Style of Groups – check Side-by-side (parallel) > OK

You might also like