Question 1.
A study comprised of a random sample followed of 883peopleuntil death, some were smokers and others were not – whether each died of a heart attack was recorded. The data are in the file
sle251heartattack.csv.
Format of sle251heartattack.csv data file
Data set:
Smoker
Heart attack Yes No
Yes 221 79
No 155 428
Format of datafile:
Heart attack Smoker count
yes yes 221
yes no 79
no yes 155
no no 428
Heart attack Categorical listing of whether death was by heart attack
Smoker Categorical listing of if person was a smoker
count Number of people in each combination of two variables
Note the format of the data prepared for statistical analysis in software packages, and how it relates to the actual contingency table.
a) What is the null hypothesis being tested?
b) Using a 2 x 2 (two way) contingency table, test this null hypothesis.
To run a chi-square goodness of fit test in R
Statistics
Contingency tables
Enter and analyze two-way table…
Set # of rows (2) and # of columns (2)
Enter the counts for each cell (just copy from worksheet)
Under Statistics tab
Leave Compute Percentages as No percentages
Under Hypothesis Tests, select Chi-square test of independence
and Print expected frequencies
OK
To derive standardized residuals
Go to the R script window
Select andHighlight the following five rows:
.Table <- matrix(c(221,79,155,428), 2, 2, byrow=TRUE)
rownames(.Table) <- c(‘1’, ‘2’)
colnames(.Table) <- c(‘1’, ‘2’)
.Table # Counts
.Test <- chisq.test(.Table, correct=FALSE)
Press Submit
In the script window type
round(.Test$residuals,2)
Press Submit
Complete the tables below.
Smoker
Heart attack Yes No
Yes Obs = 221
Exp =
Std Residual =
Obs = 79
Exp =
Std Residual = No Obs = 155
Exp =
Std Residual =
Obs = 428
Exp =
Std Residual = Note: Expected counts are found under “.Test$expected” andStd residuals are found in the output under “round(.Test$residuals,2)”
Chi-square statistic df P value
c) What are your conclusions (statistical and biological)?
Question 2.
Arrington et al. (2002) examined the frequency with which African, Neotropical and North American fishes have empty stomachs and found that the mean percentage of empty stomachs was
around 16.2%. As part of the investigation they were interested in whether the frequency of empty stomachs was related to dietary items. The data were separated into four major trophic
classifications (detritivores, omnivores, invertivores, and piscivores) and whether the fish species had greater or less than 16.2% of individuals with empty stomachs. The number of fish species
in each category combination was calculated and a subset of that (just the diurnal fish that feed during the day) is provided in the file sle251fishdiet.csv.
Format of sle251fishdiet.csv data file
Data set:
Stomachs empty
Trophic level <16.2% >16.2%
Detritivore 18 4
Omnivore 45 8
Invertebrate 58 15
Piscivore 16 34
Format of datafile:
trophic stomach count
Det <16.2 18
Omn <16.2 45
Inv <16.2 58
Pisc <16.2 16
… …. …
trophic Categorical listing of trophic level (type of diet)
stomach Categorical listing of proportion of empty stomachs
count Number of fish species in each combination of two variables
a) Using a 2×4 contingency table (follow instructions from question 2), test the null hypothesis that the percentage of empty stomachs was independent of trophic classification.
b) What would you conclude from the analysis? Write out the result as would appear in the results section of a report.
Trophic classification was click here and select the correct response.the percentage of empty stomachs (??2= , df = , P = )
c) Complete the following table of standardized residuals.
c) What further conclusions would you draw from the standardized residuals?
d) What is the assumption about minimum expected frequencies for chi-square tests of contingency tables? Was this assumption met for these data?
PLACE THIS ORDER OR A SIMILAR ORDER WITH US TODAY AND GET AN AMAZING DISCOUNT 🙂

+1 862 207 3288 