## Country Percentages
## 1 United States 25%
## 2 Germany 22%
## 3 Norway 18%
## 4 Austria 14%
## 5 Russia 11%
## 6 France 10%
Midway through the Olympics, of the 120 medals awarded, the following distribution was observed.
## Country Number_of_Medals
## 1 United States 33
## 2 Germany 36
## 3 Norway 18
## 4 Austria 15
## 5 Russia 12
## 6 France 6
We want to test to see if there is a significant difference between the expected and actual awards given at 95% confidence.
Ans.
Number_of_Medals = c(33,36,18,15,12,6)
res <- chisq.test(Number_of_Medals, p =c(0.25,0.22,0.18,0.14,0.11,0.10) )
res
##
## Chi-squared test for given probabilities
##
## data: Number_of_Medals
## X-squared = 7.6929, df = 5, p-value = 0.174
There is not enough evidence of significant difference between the expected and actual awards given at 95% confidence.
## Week Number_of_Cardiac_Deaths
## 1 Monday 40
## 2 Tuesday 17
## 3 Wednesday 16
## 4 Thursday 29
## 5 Friday 15
## 6 Saturday 20
## 7 Sunday 17
We want to determine whether the number of deaths is uniform over the week at 95% confidence.
Ans.
Number_of_Cardiac_Deaths = c(40,17,16,29,15,20,17)
res <- chisq.test(Number_of_Cardiac_Deaths, p =c(1/7,1/7,1/7,1/7,1/7,1/7,1/7) )
res
##
## Chi-squared test for given probabilities
##
## data: Number_of_Cardiac_Deaths
## X-squared = 23.273, df = 6, p-value = 0.0007101
There is enough evidence that the number of deaths is not uniform over the week at 95% confidence.
## Candidate Percentages
## 1 Democrats 48%
## 2 Republicans 38%
## 3 Independent 4%
## 4 Undecided 10%
After the presidential debates, a random sample of 1200 voters showed that 540 favored the Democratic candidate; 480 were in favor of the Republican candidate; 40 were in favor of the Independent candidate, and 140 were undecided. We want to see if the proportion of voters has changed at 95%.
Ans.
Number_of_voters = c(540,480,40,140)
res <- chisq.test(Number_of_voters, p =c(0.48,0.38,0.04,0.10) )
res
##
## Chi-squared test for given probabilities
##
## data: Number_of_voters
## X-squared = 8.1798, df = 3, p-value = 0.04244
There is enough evidence that the proportion of voters has changed at 95% confidence.
4.Last school year, in the school of Business Administration, 30% were Accounting majors, 24% Management majors, 26% Marketing majors, and 20% Economics majors. A sample of 300 students taken from this yearโs students of the school showed the following number of students in each major:
## Majors Number_of_Majors
## 1 Accounting 83
## 2 Management 68
## 3 Marketing 85
## 4 Economics 64
We want to see if there has been a significant change in the number of students in each major at 95% confidence.
Ans.
Number_of_Majors = c(83,68,85,64)
res <- chisq.test(Number_of_Majors, p =c(0.30,0.24,0.26,0.20) )
res
##
## Chi-squared test for given probabilities
##
## data: Number_of_Majors
## X-squared = 1.6615, df = 3, p-value = 0.6455
There is not enough evidence of a significant change in the number of students in each major
5.The personnel department of a large corporation reported sixty resignations during the last year. The following table groups these resignations according to the season in which they occurred:
## Season Number_of_resignations
## 1 Winter 10
## 2 Spring 22
## 3 Summer 19
## 4 Fall 9
Test to see if the number of resignations is uniform over the four seasons at 95% confidence
Number_of_resignations= c(10,22,19,9)
res <- chisq.test(Number_of_resignations, p =c(0.25,0.25,0.25,0.25) )
res
##
## Chi-squared test for given probabilities
##
## data: Number_of_resignations
## X-squared = 8.4, df = 3, p-value = 0.03843
There is enough evidence to infer that the number of resignations is not uniform over the four seasons at 95% confidence.