-
Notifications
You must be signed in to change notification settings - Fork 0
/
RQ2.R
987 lines (841 loc) · 30.2 KB
/
RQ2.R
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
# RQ 2 ---------------------------------
# RQ2: How does the cultural context impact Smart Home device adoption and use?
# H1: The purchasing trends of buying a Smart Home device differs internationally.
# H2: The cultural background of participants affects the usage of Smart Home devices.
# H3: The perception towards Smart Home devices differs internationally.
## H1 ----
# -- not used in paper as we decided purchasing is not part of our initial investigation
attach(singleSourceOfTruthAppended)
# 1 R216_01 Education about Device D1: Online reviews
# 2 R216_02 Education about Device D1: Online forums
# 3 R216_03 Education about Device D1: Print media (e.g., Newspapers, Magazines, etc.)
# 4 R216_04 Education about Device D1: Friends and Family
# 5 R216_05 Education about Device D1: Online news sites
singleSourceOfTruthAppended$`Current Country of Residence` <-
as.factor(singleSourceOfTruthAppended$`Current Country of Residence`)
## testing dependencies between current country of residence and consulting online reviews for their smart devices
chisq.test(R216_01, `Current Country of Residence`)
chisq.test(R216_02, `Current Country of Residence`)
chisq.test(R216_03, `Current Country of Residence`)
chisq.test(R216_04, `Current Country of Residence`)
chisq.test(R216_05, `Current Country of Residence`)
# 1 HP02_01 Market tools: Low prices
# 2 HP02_02 Market tools: Bundled offers (e.g., including other devices with purchase of one or more devices)
# 3 HP02_03 Market tools: Trials (e.g., 30-day free use of a service)
# 4 HP02_04 Market tools: Periodic sales
# 5 HP02_05 Market tools: Discounts (e.g., coupons)
# testing for dependencies in country of residence in purchase was influenced by:
kruskal_test(singleSourceOfTruthAppended,
formula = HP02_01 ~ `Current Country of Residence`)#n.s
kruskal_test(singleSourceOfTruthAppended,
formula = HP02_02 ~ `Current Country of Residence`)#s p = 0.0127
kruskal_test(singleSourceOfTruthAppended,
formula = HP02_03 ~ `Current Country of Residence`)#s P = 0.0103
kruskal_test(singleSourceOfTruthAppended,
formula = HP02_04 ~ `Current Country of Residence`)#s p = 0.0000000901
kruskal_test(singleSourceOfTruthAppended,
formula = HP02_05 ~ `Current Country of Residence`)#n.s
#How does legislation affect the adoption of different devices over different regions
cor.test(Participants_DACH$LA_Mean,
Participants_DACH$R101) #*
cor.test(Participants_UK$LA_Mean,
Participants_UK$R101)
cor.test(Participants_US$LA_Mean,
Participants_US$R101)
kruskal_test(singleSourceOfTruthAppended,
formula = R101 ~ `Current Country of Residence`)#n.s
## H2 ----
#- usage affected by region?
# Adding all device owners to the same data frame and stacking them for analysis
u <-
select(
singleSourceOfTruthAppended,
participant_id,
`Current Country of Residence`,
R232_01,
R232_02,
R232_03,
R233_01,
R233_02 ,
R233_03 ,
R501,
R503,
R505
)
d1 <-
select(subset(u, R233_01 == 1),
participant_id,
`Current Country of Residence`,
R232_01,
R501)
d2 <-
select(subset(u, R233_02 == 1),
participant_id,
`Current Country of Residence`,
R232_02,
R503)
d3 <-
select(subset(u, R233_03 == 1),
participant_id,
`Current Country of Residence`,
R232_03,
R505)
colnames(d1) <-
c("participant_id",
"Current Country of Residence",
"Device",
"Usage")
colnames(d2) <-
c("participant_id",
"Current Country of Residence",
"Device",
"Usage")
colnames(d3) <-
c("participant_id",
"Current Country of Residence",
"Device",
"Usage")
d <- rbind(d1, d2, d3)
d <- subset(d, Usage != "Don't know")
d$Usage <-
factor(
d$Usage,
levels = c(
"0 times",
"1-5 times",
"6-10 times",
"11-20 times",
"21-30 times",
"30+ times"
)
)
#testing for connection between current region of residence and the amount of usaage over ALL smart home devices
Usage_CCR_LATEX <-
dunnTest(
x = as.numeric(d$Usage),
g = as.factor(d$`Current Country of Residence`),
method = "bonferroni"
)$res
Usage_CCR_LATEX <- Usage_CCR_LATEX[-c(3)]
view(Usage_CCR_LATEX)
aggregate(as.numeric(d$Usage),
list(d$`Current Country of Residence`),
mean)
# we find that there is no significant connection between the region of residence
# and the amount of usage of smart home devices overall
# we investigate for specific high favourability devices
Usage_CCR_LATEX_SMART_TV <-
dunnTest(
x = as.numeric(subset(d, Device == "Smart TV")$Usage),
g = as.factor(subset(d, Device == "Smart TV")$`Current Country of Residence`),
method = "bonferroni"
)$res
Usage_CCR_LATEX_SMART_TV <- Usage_CCR_LATEX_SMART_TV[-c(3)]
view(Usage_CCR_LATEX_SMART_TV)
aggregate(as.numeric(subset(d, Device == "Smart TV")$Usage), list(as.factor(
subset(d, Device == "Smart TV")$`Current Country of Residence`
)), mean)
# we find that there is a significant difference in usage between DE-UK and DE - US
#---
#we investigate the same for the smart speaker
Usage_CCR_LATEX_SMART_SPEAKER <-
dunnTest(
x = as.numeric(subset(d, Device == "Smart Speaker")$Usage),
g = as.factor(
subset(d, Device == "Smart Speaker")$`Current Country of Residence`
),
method = "bonferroni"
)$res
Usage_CCR_LATEX_SMART_SPEAKER <-
Usage_CCR_LATEX_SMART_SPEAKER[-c(3)]
aggregate(as.numeric(subset(d, Device == "Smart Speaker")$Usage), list(as.factor(
subset(d, Device == "Smart Speaker")$`Current Country of Residence`
)), mean)
#we find that there is no significant difference between the participants from different regions in smart speaker usage
#---
#we investigate the smart lightbulb
Usage_CCR_LATEX_SMART_LIGHTBULB <-
dunnTest(
x = as.numeric(subset(d, Device == "Smart Lightbulb")$Usage),
g = as.factor(
subset(d, Device == "Smart Lightbulb")$`Current Country of Residence`
),
method = "bonferroni"
)$res
Usage_CCR_LATEX_SMART_LIGHTBULB <-
Usage_CCR_LATEX_SMART_LIGHTBULB[-c(3)]
aggregate(as.numeric(subset(d, Device == "Smart Lightbulb")$Usage), list(as.factor(
subset(d, Device == "Smart Lightbulb")$`Current Country of Residence`
)), mean)
#we find that there is no sgnificant difference in smart lightbulb use across different regions
# we investigate all other devices
Usage_CCR_LATEX_OTHER <-
dunnTest(
x = as.numeric(
subset(
d,
Device != "Smart Lightbulb" &&
Device != "Smart Speaker" && Device != "Smart TV"
)$Usage
),
g = as.factor(
subset(
d,
Device != "Smart Lightbulb" &&
Device != "Smart Speaker" &&
Device != "Smart TV"
)$`Current Country of Residence`
),
method = "bonferroni"
)$res
Usage_CCR_LATEX_OTHER <- Usage_CCR_LATEX_OTHER[-c(3)]
# we find that the other devices do not have a significant change in use because of the region of residence
#---
# we investigate further into smart TV users
smartTVUsers <- subset(d, Device == "Smart TV")
epsilonSquared(x = as.numeric(smartTVUsers$Usage),
g = smartTVUsers$`Current Country of Residence`)
# we determine the effect size
sTV_UK <- subset(smartTVUsers,
`Current Country of Residence` == "United Kingdom")##
sTV_US <- subset(smartTVUsers,
`Current Country of Residence` == "United States")
sTV_DACH <- subset(smartTVUsers,
`Current Country of Residence` == "DACH")
summary(sTV_US)
summary(sTV_UK)
summary(sTV_DACH)
#disabled features and residence -- are not using this due to small sample size
disabled_features_country <-
select(
singleSourceOfTruthAppended,
participant_id,
R507,
R510,
R513,
`Current Country of Residence`
)
disabled_features_country$choice <-
ifelse(
disabled_features_country$R507 == "Yes" |
disabled_features_country$R510 == "Yes" |
disabled_features_country$R513 == "Yes",
1,
0
)
test <-
merge(disabled_features_country,
rbind(sTV_DACH, sTV_UK, sTV_US),
by = "participant_id")
chisq.test(test$`Current Country of Residence.y`,
test$choice)
DISABLED_FEATURES_COUNTRY_LATEX_CHI <-
chisq.test(
disabled_features_country$`Current Country of Residence`,
disabled_features_country$choice
)
DISABLED_FEATURES_COUNTRY_LATEX_CHI <-
data.frame(
cbind(
DISABLED_FEATURES_COUNTRY_LATEX_CHI$p.value,
DISABLED_FEATURES_COUNTRY_LATEX_CHI$method
)
)
names(DISABLED_FEATURES_COUNTRY_LATEX_CHI) <- c("p", "X^2")
#ns no effect on usage by region could be measured
#---
## H3 ----
#The perception towards Smart Home devices differs internationally.
# 1 A204_01 Manufacturer responsibilitiy: Keeping the Smart Home device software up-to-date
# 2 A204_02 Manufacturer responsibilitiy: Ensuring my privacy
# 3 A204_03 Manufacturer responsibilitiy: Protecting my Smart Home ecosystem as a whole
# 4 A204_04 Manufacturer responsibilitiy: Keeping the Smart Home device secure
# 5 A204_05 Manufacturer responsibilitiy: Fixing a hardware failure
# 6 A204_06 Manufacturer responsibilitiy: Fixing a software failure
##
p <- c(
kruskal_test(
singleSourceOfTruthAppended,
formula = A204_01 ~ `Current Country of Residence`
)[5],
kruskal_test(
singleSourceOfTruthAppended,
formula = A204_02 ~ `Current Country of Residence`
)[5],
kruskal_test(
singleSourceOfTruthAppended,
formula = A204_03 ~ `Current Country of Residence`
)[5],
kruskal_test(
singleSourceOfTruthAppended,
formula = A204_04 ~ `Current Country of Residence`
)[5],
#p-adj: 0.01362 #dach - us / us - uk / dach - uk correct p values for pairwise testing
kruskal_test(
singleSourceOfTruthAppended,
formula = A204_05 ~ `Current Country of Residence`
)[5],
kruskal_test(
singleSourceOfTruthAppended,
formula = A204_06 ~ `Current Country of Residence`
)[5]
)
p.adjust(p, method = "bonferroni", n = length(p))
#1.00000 1.00000 0.26160 0.01362 0.38100 1.00000
#pairwise testing for A204_04
#starting pairwise testing per country
# we investigate how the regions perception change in regard to manufacturer
# responsibility of keeping the smart home device secure as a whole
dunn_A204_04 <-
dunnTest(singleSourceOfTruthAppended$A204_04,
`Current Country of Residence`,
method = "bonferroni")
eps1 <-
epsilonSquared(
x = as.numeric(
subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "DACH" |
`Current Country of Residence` == "United Kingdom"
)$A204_04
),
g = subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "DACH" |
`Current Country of Residence` == "United Kingdom"
)$`Current Country of Residence`
)
eps2 <-
epsilonSquared(
x = as.numeric(
subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "DACH" |
`Current Country of Residence` == "United States"
)$A204_04
),
g = subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "DACH" |
`Current Country of Residence` == "United States"
)$`Current Country of Residence`
)
epsilonSquared <- c(eps1, eps2, "NA")
dunn_A204_04_LATEX <- cbind(dunn_A204_04$res, epsilonSquared)
dunn_A204_04_LATEX <- dunn_A204_04_LATEX[-c(3)]
countryPerception = select(singleSourceOfTruthAppended,
`Current Country of Residence`,
A204_04)
aggregate(countryPerception[, 2],
list(countryPerception$`Current Country of Residence`),
mean)
#check on non-users
countryPerception_N = select(subset(singleSourceOfTruthAppended, R101 < 1),
`Current Country of Residence`,
A204_04)
aggregate(
countryPerception_N[, 2],
list(countryPerception_N$`Current Country of Residence`),
mean
)
#check users
countryPerception_U = select(subset(singleSourceOfTruthAppended, R101 > 0),
`Current Country of Residence`,
A204_04)
aggregate(
countryPerception_U[, 2],
list(countryPerception_U$`Current Country of Residence`),
mean
)
# We find that germany sees smart home device security to lie more in their individual hands
# whereas the english speaking regions see it more in the manufacturers hands
#---
library(plyr)
mu <-
ddply(countryPerception,
"`Current Country of Residence`",
summarise,
grp.mean = mean(A204_04))
p <-
ggplot(
countryPerception,
aes(
x = countryPerception$A204_04,
color = countryPerception$`Current Country of Residence`
)
) +
geom_density() + geom_vline(
data = mu,
aes(xintercept = grp.mean, color = `Current Country of Residence`),
linetype = "dashed"
) + scale_color_brewer(palette = "Dark2") + labs(title = "Manufacturer responsibility - keeping smart home device secure",
x =
"Likert Scale from myself vs. Manufacturer", y = "density") + theme(legend.title = element_blank())
# barplot, show the whole scale, germans want to take more responsibility or no trust in responsibility. Protected by GDPR , different regions call to different conclusions, test for a206 global change, in all three regions there is a desire to place responsibility on the manufacturer
# english speaking countries nudged into Manufacturer domain
# No real trends add mean and
p
a <-
ggplot(
countryPerception,
aes(x = A204_04, color = `Current Country of Residence`, fill = `Current Country of Residence`)
) +
geom_histogram(aes(y = ..density..), alpha = 0.5,
position = "identity") +
geom_density(alpha = .2)
a
# Group.1 A204_04
# 1 DACH 3.940741
# 2 United Kingdom 4.535484
# 3 United States 4.675862
# we are investigating the benefits of smart home device perceived benefits and if they change by country
# 1 A307_01 Perceived benefits: Saving money
# 2 A307_02 Perceived benefits: Saving energy
# 3 A307_03 Perceived benefits: Increasing convenience
# 4 A307_04 Perceived benefits: Enhancing leisure activities
# 5 A307_05 Perceived benefits: Providing peace of mind
# 6 A307_06 Perceived benefits: Providing comfort
# 7 A307_07 Perceived benefits: Increasing safety
# 8 A307_08 Perceived benefits: Providing care
# 9 A307_09 Perceived benefits: Improving quality of life
# 10 A307_10 Perceived benefits: Increasing property value
p <- c(
kruskal_test(
singleSourceOfTruthAppended,
formula = A307_01 ~ `Current Country of Residence`
)[5],
# 0.272
kruskal_test(
singleSourceOfTruthAppended,
formula = A307_02 ~ `Current Country of Residence`
)[5],
kruskal_test(
singleSourceOfTruthAppended,
formula = A307_03 ~ `Current Country of Residence`
)[5],
#0.508 # not stat sig
kruskal_test(
singleSourceOfTruthAppended,
formula = A307_04 ~ `Current Country of Residence`
)[5],
#0.0268
kruskal_test(
singleSourceOfTruthAppended,
formula = A307_05 ~ `Current Country of Residence`
)[5],
#0.125
kruskal_test(
singleSourceOfTruthAppended,
formula = A307_06 ~ `Current Country of Residence`
)[5],
#0.00141 -- adding pairwise testing -- p.adjust(p, method = "bonferroni", n = length(p))
kruskal_test(
singleSourceOfTruthAppended,
formula = A307_07 ~ `Current Country of Residence`
)[5],
#0.0867
kruskal_test(
singleSourceOfTruthAppended,
formula = A307_08 ~ `Current Country of Residence`
)[5],
#0.00615
kruskal_test(
singleSourceOfTruthAppended,
formula = A307_09 ~ `Current Country of Residence`
)[5],
kruskal_test(
singleSourceOfTruthAppended,
formula = A307_10 ~ `Current Country of Residence`
)[5]
) #0.000274
p <- unlist(p, use.names = FALSE)
p.adjust(p, method = "bonferroni", n = length(p))
# 1 2 3 4 5 6 7 8 9 10
#0.272000 1.000000 0.508000 0.026800 0.125000 0.001410 0.086700 0.006150 1.000000 0.000274
# 1 A307_01 Perceived benefits: Saving money
# 2 A307_02 Perceived benefits: Saving energy
# 3 A307_03 Perceived benefits: Increasing convenience
# 4 A307_04 Perceived benefits: Enhancing leisure activities
# 5 A307_05 Perceived benefits: Providing peace of mind
# 6 A307_06 Perceived benefits: Providing comfort
# 7 A307_07 Perceived benefits: Increasing safety
# 8 A307_08 Perceived benefits: Providing care
# 9 A307_09 Perceived benefits: Improving quality of life
# 10 A307_10 Perceived benefits: Increasing property value-------------------------------------------------------------------------------#testing for smart home device preference country ~ enhancing leisure activities
dunnTest(A307_04, `Current Country of Residence`, method = "bonferroni")
increaseLeisure = select(singleSourceOfTruthAppended,
`Current Country of Residence`,
A307_04)
aggregate(increaseLeisure[, 2],
list(increaseLeisure$`Current Country of Residence`),
mean)
# we find that perceived benefits include enhancing leisure activities is significantly different in the different regions
# with germany / UK / US in rank for enhancing leisure activities
#---
# 1 A307_01 Perceived benefits: Saving money
# 2 A307_02 Perceived benefits: Saving energy
# 3 A307_03 Perceived benefits: Increasing convenience
# 4 A307_04 Perceived benefits: Enhancing leisure activities
# 5 A307_05 Perceived benefits: Providing peace of mind
# 6 A307_06 Perceived benefits: Providing comfort
# 7 A307_07 Perceived benefits: Increasing safety
# 8 A307_08 Perceived benefits: Providing care
# 9 A307_09 Perceived benefits: Improving quality of life
# 10 A307_10 Perceived benefits: Increasing property value
#testing for smart home device preference country ~ providing comfort-------------------------------------------------------------------------------
dunnTest(A307_06, `Current Country of Residence`, method = "bonferroni")
test = subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "DACH" |
`Current Country of Residence` == "United Kingdom"
)
providingComfort = select(singleSourceOfTruthAppended,
`Current Country of Residence`,
A307_06)
aggregate(providingComfort[, 2],
list(providingComfort$`Current Country of Residence`),
mean)
# we find that providing comfort is significantly different across regions
# rank: UK / US / DACH
#---
# 1 A307_01 Perceived benefits: Saving money
# 2 A307_02 Perceived benefits: Saving energy
# 3 A307_03 Perceived benefits: Increasing convenience
# 4 A307_04 Perceived benefits: Enhancing leisure activities
# 5 A307_05 Perceived benefits: Providing peace of mind
# 6 A307_06 Perceived benefits: Providing comfort
# 7 A307_07 Perceived benefits: Increasing safety
# 8 A307_08 Perceived benefits: Providing care
# 9 A307_09 Perceived benefits: Improving quality of life
# 10 A307_10 Perceived benefits: Increasing property value
# Pairwise testing by country ~ increasing safety -----------------------------------------------------------------------------
#testing for smart home device preference
dunnTest(A307_07, `Current Country of Residence`, method = "bonferroni")
increasingSafety = select(singleSourceOfTruthAppended,
`Current Country of Residence`,
A307_07)
aggregate(increasingSafety[, 2],
list(increasingSafety$`Current Country of Residence`),
mean)
# we find that increasing safety is important to US
# rank: DACH / UK / US
#---
# 1 A307_01 Perceived benefits: Saving money
# 2 A307_02 Perceived benefits: Saving energy
# 3 A307_03 Perceived benefits: Increasing convenience
# 4 A307_04 Perceived benefits: Enhancing leisure activities
# 5 A307_05 Perceived benefits: Providing peace of mind
# 6 A307_06 Perceived benefits: Providing comfort
# 7 A307_07 Perceived benefits: Increasing safety
# 8 A307_08 Perceived benefits: Providing care
# 9 A307_09 Perceived benefits: Improving quality of life
# 10 A307_10 Perceived benefits: Increasing property value
# Pairwise testing by country ---------------------------------------------------------------
#testing for smart home device preference country ~ providing care
dunnTest(A307_08, `Current Country of Residence`, method = "bonferroni")
providingCare = select(singleSourceOfTruthAppended,
`Current Country of Residence`,
A307_08)
aggregate(providingCare[, 2],
list(providingCare$`Current Country of Residence`),
mean)
# providing care is different for DACH - US/UK
# rank DACH / US-UK (close)
# Pairwise testing by country ------------------------------------------------------------------------------------
#starting pairwise testing per country
# Country and adding to the property value
dunnTest(A307_10, as.factor(`Current Country of Residence`), method = "bonferroni")
epsilonSquared(x = as.numeric(A307_10), g = `Current Country of Residence`)
countryIncreaseProperty = select(singleSourceOfTruthAppended,
`Current Country of Residence`,
A307_10)
aggregate(
countryIncreaseProperty[, 2],
list(countryIncreaseProperty$`Current Country of Residence`),
mean
)
# significant use to increase property value
# rank : DACH/ UK / US
# Testing Device Risk-------------------------------------------------------------------------------
# testing for country by perceived device risk
# 1 E201_01 Device risk: Smart Coffee Maker
# 2 E201_02 Device risk: Smart Dishwasher
# 3 E201_03 Device risk: Smart Door Lock
# 4 E201_04 Device risk: Smart Doorbell
# 5 E201_05 Device risk: Smart Electricity Meter
# 6 E201_06 Device risk: Smart Electrical Outlet
# 7 E201_07 Device risk: Smart Fridge
# 8 E201_08 Device risk: Smart Gardening Equipment
# 9 E201_09 Device risk: Smart Heating/Cooling System
# 10 E201_10 Device risk: Smart Home Monitoring System
# 11 E201_11 Device risk: Smart Lightbulb
# 12 E201_12 Device risk: Smart Oven
# 13 E201_13 Device risk: Smart Robot
# 14 E201_14 Device risk: Smart Speaker
# 15 E201_15 Device risk: Smart Stove
# 16 E201_16 Device risk: Smart TV
# 17 E201_17 Device risk: Smart Thermostat
# 18 E201_18 Device risk: Smart Toy
# 19 E201_19 Device risk: Smart Vacuum Cleaner
# 20 E201_20 Device risk: Smart Washing Machine
p <- c((
kruskal_test(
singleSourceOfTruthAppended,
formula = E201_11 ~ `Current Country of Residence`
)[5]
),
# smart lights
kruskal_test(
singleSourceOfTruthAppended,
formula = E201_14 ~ `Current Country of Residence`
)[5],
# smart speaker
kruskal_test(
singleSourceOfTruthAppended,
formula = E201_16 ~ `Current Country of Residence`
)[5]
)# smart TV - significantly different for countries p = 0.0000555
# --- plot means by country to find out which is different and higher / lower
p.adjust(p, "bonferroni") #1.0000000 0.2760000 0.0001665
E201_SMART_TV_RISK_CCR <-
cbind(
dunnTest(
singleSourceOfTruthAppended$E201_16,
singleSourceOfTruthAppended$`Current Country of Residence`,
method = "bonferroni"
)$res,
c(
epsilonSquared(
x = subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "DACH" |
`Current Country of Residence` == "United Kingdom"
)$E201_16,
g = subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "DACH" |
`Current Country of Residence` == "United Kingdom"
)$`Current Country of Residence`
),
epsilonSquared(
x = subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "DACH" |
`Current Country of Residence` == "United States"
)$E201_16,
g = subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "DACH" |
`Current Country of Residence` == "United States"
)$`Current Country of Residence`
),
"NA"
)
)
names(E201_SMART_TV_RISK_CCR)[5] = "Epsilon^2"
E201_SMART_TV_RISK_CCR <- E201_SMART_TV_RISK_CCR[-c(3)]
avg_smart_tv_risk = select(singleSourceOfTruthAppended,
E201_16,
`Current Country of Residence`)
aggregate(avg_smart_tv_risk[, 1],
list(avg_smart_tv_risk$`Current Country of Residence`),
mean)
# we find that the smart tv posed risk is significant by region
# rank UK / US / - DACH
perceived_benefits <-
select(
singleSourceOfTruthAppended,
`Current Country of Residence`,
A307_04,
A307_07,
A307_08,
A307_10
)
A307_LATEX <-
cbind(
c(
"A307_04",
"A307_04",
"A307_04",
"A307_07",
"A307_07",
"A307_07",
"A307_08",
"A307_08",
"A307_08",
"A307_10",
"A307_10",
"A307_10"
),
rbind(
data.frame(
dunnTest(
singleSourceOfTruthAppended$A307_04,
singleSourceOfTruthAppended$`Current Country of Residence`,
method = "bonferroni"
)$res
),
data.frame(
dunnTest(
singleSourceOfTruthAppended$A307_07,
singleSourceOfTruthAppended$`Current Country of Residence`,
method = "bonferroni"
)$res
),
data.frame(
dunnTest(
singleSourceOfTruthAppended$A307_08,
singleSourceOfTruthAppended$`Current Country of Residence`,
method = "bonferroni"
)$res
),
data.frame(
dunnTest(
singleSourceOfTruthAppended$A307_10,
singleSourceOfTruthAppended$`Current Country of Residence`,
method = "bonferroni"
)$res
)
)
)
names(A307_LATEX)[1] <- "Code"
A307_LATEX <- A307_LATEX[-c(4)]
#smart lights actually smart home device (benefiting from smart capabilities)
CCR_Device_Smart_Benefit <-
select(singleSourceOfTruthAppended,
`Current Country of Residence`,
A302_01:A302_19)
kruskal.test(
CCR_Device_Smart_Benefit$`Current Country of Residence`,
CCR_Device_Smart_Benefit$A302_11
)
kruskal.test(
CCR_Device_Smart_Benefit$`Current Country of Residence`,
CCR_Device_Smart_Benefit$A302_14
)
kruskal.test(
CCR_Device_Smart_Benefit$`Current Country of Residence`,
CCR_Device_Smart_Benefit$A302_16
)
table(CCR_Device_Smart_Benefit$A302_11) #light
table(CCR_Device_Smart_Benefit$A302_14) #speaker
table(CCR_Device_Smart_Benefit$A302_16) #TV
# ANOVA I - sebis_avg----
# country as exploratory variable
country_anova = select(singleSourceOfTruthAppended,
`Current Country of Residence`,
sebis_avg,
R101,
E201_11)
# explanatory var = country
# responsible var = sebis_avg
# country ˜ sebis_avg
# null hypothesis = all regions are equal
# alternative hypothesis = there is a reationship between continents and sebis
means <-
round(tapply(
as.numeric(country_anova$sebis_avg),
country_anova$`Current Country of Residence`,
mean
),
digits = 2)
plotmeans(
country_anova$sebis_avg ~ country_anova$`Current Country of Residence`,
digits = 2,
ccol = 'red',
mean.labels = T,
main = 'Plot of sebis score means by region'
)
boxplot(
country_anova$sebis_avg ~ country_anova$`Current Country of Residence`,
main = "Plot of sebis score means by region",
xlab = "'region'",
ylab = "Sebis Score",
col = rainbow(7)
)
# F statistics = Variation among sample means / Variation within groups
aov_content <-
aov(country_anova$sebis_avg ~ country_anova$`Current Country of Residence`)
summary(aov_content)
# summary:
# Not significant in this test.
# ANOVA II - R101 ----
# ANOVA analysis II | Amount of owned devices
# R101
# CCR
means <-
round(tapply(
as.numeric(country_anova$R101),
country_anova$`Current Country of Residence`,
mean
),
digits = 2)
plotmeans(
country_anova$R101 ~ country_anova$`Current Country of Residence`,
digits = 2,
ccol = 'red',
mean.labels = T,
main = 'Plot of sebis score means by region'
)
boxplot(
country_anova$R101 ~ country_anova$`Current Country of Residence`,
main = "Plot of sebis score means by region",
xlab = "'region'",
ylab = "Sebis Score",
col = rainbow(7)
)
# F statistics = Variation among sample means / Variation within groups
aov_content = aov(country_anova$R101 ~ singleSourceOfTruthAppended$`Current Country of Residence`)
summary(aov_content)
# summary:
# Not significant in this test.
# ANOVA II - E201 device risk ----
calc_anova <- function(data, column_to_use) {
data <- data[data[[column_to_use]] >= 0, ]
means <-
round(tapply(as.numeric(data[[column_to_use]]),
data$`Current Country of Residence`,
mean),
digits = 2)
plotmeans(
data[[column_to_use]] ~ data$`Current Country of Residence`,
digits = 2,
ccol = 'red',
mean.labels = T,
main = 'Plot of sebis score means by region'
)
boxplot(
data[[column_to_use]] ~ data$`Current Country of Residence`,
main = sprintf("Plot of %s means by region", names(column_to_use)),
xlab = "'region'",
ylab = "Sebis Score",
col = rainbow(7)
)
# F statistics = Variation among sample means / Variation within groups
aov_content = aov(data[[column_to_use]] ~ data$`Current Country of Residence`)
return(summary(aov_content))
}
calc_anova(country_anova, "E201_11")
# Testing Device Risk-------------------------------------------------------------------------------
# testing for country by perceived device risk
# 1 E201_01 Device risk: Smart Coffee Maker
# 2 E201_02 Device risk: Smart Dishwasher
# 3 E201_03 Device risk: Smart Door Lock
# 4 E201_04 Device risk: Smart Doorbell
# 5 E201_05 Device risk: Smart Electricity Meter
# 6 E201_06 Device risk: Smart Electrical Outlet
# 7 E201_07 Device risk: Smart Fridge
# 8 E201_08 Device risk: Smart Gardening Equipment
# 9 E201_09 Device risk: Smart Heating/Cooling System
# 10 E201_10 Device risk: Smart Home Monitoring System
# 11 E201_11 Device risk: Smart Lightbulb
# 12 E201_12 Device risk: Smart Oven
# 13 E201_13 Device risk: Smart Robot
# 14 E201_14 Device risk: Smart Speaker
# 15 E201_15 Device risk: Smart Stove
# 16 E201_16 Device risk: Smart TV
# 17 E201_17 Device risk: Smart Thermostat
# 18 E201_18 Device risk: Smart Toy
# 19 E201_19 Device risk: Smart Vacuum Cleaner
# 20 E201_20 Device risk: Smart Washing Machine
detach(singleSourceOfTruthAppended)