In: Math
Using the data set (link below), please calculate a one-way chi-square tests for President Obama approval rating for the first years in office. Specifically run chi-square on the "Approving" column.
This is the information provided.
Approving |
49 |
51 |
51 |
53 |
52 |
51 |
51 |
50 |
51 |
49 |
50 |
50 |
52 |
51 |
49 |
48 |
48 |
48 |
50 |
50 |
50 |
47 |
49 |
52 |
52 |
51 |
49 |
51 |
51 |
51 |
49 |
49 |
49 |
49 |
49 |
48 |
49 |
49 |
50 |
50 |
50 |
53 |
53 |
54 |
52 |
53 |
51 |
54 |
53 |
54 |
52 |
52 |
52 |
50 |
50 |
53 |
55 |
55 |
53 |
51 |
51 |
51 |
52 |
55 |
54 |
54 |
51 |
50 |
50 |
51 |
53 |
54 |
52 |
53 |
52 |
56 |
56 |
56 |
54 |
53 |
53 |
51 |
50 |
51 |
52 |
53 |
54 |
54 |
53 |
52 |
51 |
51 |
52 |
50 |
51 |
51 |
53 |
53 |
52 |
52 |
51 |
51 |
52 |
53 |
53 |
52 |
51 |
51 |
51 |
51 |
52 |
53 |
55 |
55 |
54 |
52 |
51 |
50 |
50 |
50 |
50 |
51 |
51 |
52 |
54 |
53 |
53 |
51 |
51 |
52 |
53 |
54 |
55 |
54 |
53 |
53 |
54 |
55 |
55 |
58 |
58 |
56 |
56 |
55 |
56 |
55 |
56 |
54 |
52 |
53 |
54 |
56 |
56 |
55 |
56 |
55 |
57 |
59 |
61 |
60 |
60 |
58 |
58 |
59 |
60 |
59 |
58 |
58 |
58 |
57 |
56 |
58 |
59 |
60 |
62 |
61 |
63 |
60 |
59 |
57 |
59 |
59 |
61 |
60 |
60 |
57 |
57 |
58 |
61 |
61 |
62 |
61 |
62 |
63 |
61 |
60 |
59 |
61 |
62 |
62 |
62 |
62 |
63 |
63 |
64 |
62 |
63 |
62 |
64 |
64 |
65 |
64 |
64 |
62 |
64 |
64 |
65 |
63 |
64 |
63 |
65 |
63 |
64 |
64 |
65 |
66 |
66 |
66 |
66 |
67 |
66 |
67 |
67 |
68 |
67 |
65 |
63 |
63 |
63 |
65 |
65 |
66 |
65 |
65 |
64 |
63 |
63 |
62 |
61 |
62 |
62 |
63 |
62 |
63 |
62 |
60 |
59 |
60 |
61 |
61 |
62 |
63 |
62 |
61 |
60 |
59 |
60 |
60 |
62 |
62 |
62 |
63 |
63 |
65 |
65 |
64 |
62 |
62 |
61 |
62 |
61 |
61 |
61 |
62 |
63 |
62 |
62 |
62 |
62 |
62 |
62 |
62 |
61 |
62 |
63 |
64 |
67 |
67 |
65 |
61 |
59 |
62 |
63 |
63 |
62 |
62 |
62 |
64 |
66 |
66 |
64 |
63 |
63 |
66 |
64 |
65 |
63 |
65 |
65 |
66 |
66 |
67 |
67 |
66 |
64 |
64 |
65 |
67 |
I used R software to solve this question.
R codes:
> x=scan('clipboard')
Read 328 items
> x
[1] 49 51 51 53 52 51 51 50 51 49 50 50 52 51 49 48 48 48 50 50 50
47 49 52 52
[26] 51 49 51 51 51 49 49 49 49 49 48 49 49 50 50 50 53 53 54 52 53
51 54 53 54
[51] 52 52 52 50 50 53 55 55 53 51 51 51 52 55 54 54 51 50 50 51 53
54 52 53 52
[76] 56 56 56 54 53 53 51 50 51 52 53 54 54 53 52 51 51 52 50 51 51
53 53 52 52
[101] 51 51 52 53 53 52 51 51 51 51 52 53 55 55 54 52 51 50 50 50
50 51 51 52 54
[126] 53 53 51 51 52 53 54 55 54 53 53 54 55 55 58 58 56 56 55 56
55 56 54 52 53
[151] 54 56 56 55 56 55 57 59 61 60 60 58 58 59 60 59 58 58 58 57
56 58 59 60 62
[176] 61 63 60 59 57 59 59 61 60 60 57 57 58 61 61 62 61 62 63 61
60 59 61 62 62
[201] 62 62 63 63 64 62 63 62 64 64 65 64 64 62 64 64 65 63 64 63
65 63 64 64 65
[226] 66 66 66 66 67 66 67 67 68 67 65 63 63 63 65 65 66 65 65 64
63 63 62 61 62
[251] 62 63 62 63 62 60 59 60 61 61 62 63 62 61 60 59 60 60 62 62
62 63 63 65 65
[276] 64 62 62 61 62 61 61 61 62 63 62 62 62 62 62 62 62 61 62 63
64 67 67 65 61
[301] 59 62 63 63 62 62 62 64 66 66 64 63 63 66 64 65 63 65 65 66
66 67 67 66 64
[326] 64 65 67
> chisq.test(x)
Chi-squared test for given probabilities
data: x
X-squared = 183.33, df = 327, p-value = 1
Hypothesis:
H0: There is no significant difference between observed and expected values.
H1: There is significant difference between observed and expected values.
Here p value is much greater than alpha=0.05, we accept null hypothesis and conclude that, There is no significant difference between observed and expected values.