-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChi-Square-test.R
More file actions
131 lines (67 loc) · 3.16 KB
/
Chi-Square-test.R
File metadata and controls
131 lines (67 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Chi square Test for response : timely_response
com_No <- read.csv("R:/Semester 3 Fall 2016/KDD/Project/com_No.csv")
P <-table(com_No$product, com_No$timely_response)
chisq.test(P) # p-value < 2.2e-16
SP <-table(com_No$sub_product, com_No$timely_response)
chisq.test(SP) # p-value < 2.2e-16 Chi-squared approximation may be incorrect
I <-table(com_No$issue, com_No$timely_response)
chisq.test(I) # p-value < 2.2e-16 Chi-squared approximation may be incorrect
SI <-table(com_No$sub_issue, com_No$timely_response)
chisq.test(SI) # p-value < 2.2e-16
# p-value < 2.2e-16
chisq.test(table(com_No$date_received, com_No$timely_response))
# p-value < 2.2e-16 f
chisq.test(table(com_No$company_public_response, com_No$timely_response))
# # p-value < 2.2e-16
chisq.test(table(com_No$company, com_No$timely_response))
# p-value = 2.557e-10
chisq.test(table(com_No$state, com_No$timely_response))
# p-value = 0.000344
chisq.test(table(com_No$zipcode, com_No$timely_response))
# p-value = 2.112e-13
chisq.test(table(com_No$tags, com_No$timely_response))
# p-value < 2.2e-16
chisq.test(table(com_No$consumer_consent_provided, com_No$timely_response))
# p-value < 2.2e-16
chisq.test(table(com_No$submitted_via, com_No$timely_response))
# p-value < 2.2e-16
chisq.test(table(com_No$date_sent_to_company, com_No$timely_response))
# p-value < 2.2e-16
chisq.test(table(com_No$company_response_to_consumer, com_No$timely_response))
# p-value < 2.2e-16
chisq.test(table(com_No$consumer_disputed, com_No$timely_response))
# p-value = 0.4972
chisq.test(table(com_No$complaint_id, com_No$timely_response))
# Chi square Test for response : consumer_disputed
P <-table(com_No$product, com_No$consumer_disputed)
chisq.test(P) # p-value < 2.2e-16
SP <-table(com_No$sub_product, com_No$consumer_disputed)
chisq.test(SP) # p-value < 2.2e-16 Chi-squared approximation may be incorrect
I <-table(com_No$issue, com_No$consumer_disputed)
chisq.test(I) # p-value < 2.2e-16 Chi-squared approximation may be incorrect
SI <-table(com_No$sub_issue, com_No$consumer_disputed)
chisq.test(SI) # p-value < 2.2e-16
# p-value = 0.0002135
chisq.test(table(com_No$date_received, com_No$consumer_disputed))
# p-value = 2.599e-07
chisq.test(table(com_No$company_public_response, com_No$consumer_disputed))
# p-value = 4.448e-06
chisq.test(table(com_No$company, com_No$consumer_disputed))
# p-value = 0.0001427
chisq.test(table(com_No$state, com_No$consumer_disputed))
# p-value = 0.1322
chisq.test(table(com_No$zipcode, com_No$consumer_disputed))
# p-value = 0.1446
chisq.test(table(com_No$tags, com_No$consumer_disputed))
# p-value = 8.766e-05
chisq.test(table(com_No$consumer_consent_provided, com_No$consumer_disputed))
# p-value = 2.411e-11
chisq.test(table(com_No$submitted_via, com_No$consumer_disputed))
# p-value = 0.000167
chisq.test(table(com_No$date_sent_to_company, com_No$consumer_disputed))
# p-value < 2.2e-16
chisq.test(table(com_No$company_response_to_consumer, com_No$consumer_disputed))
# p-value < 2.2e-16
chisq.test(table(com_No$timely_response, com_No$consumer_disputed))
# p-value = 0.4972
chisq.test(table(com_No$complaint_id, com_No$consumer_disputed))