-
Notifications
You must be signed in to change notification settings - Fork 0
/
RQ1.R
473 lines (412 loc) · 13.6 KB
/
RQ1.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
############################### RQ_01 ##############################################################
# RQ1: What is the effect of the applied regulatory framework on Smart Home device usage and adoption?
# H1 Strong legislative protection increases adoption of Smart Home devices.
# H2 Strong legislative protection increases the usage of Smart Home devices.
# H3 The lack of appropriate legislative protection influences the perception of Smart Home device in users positively
# Choosing which part of LA01 to use for analysis with corresponding variables
# LA01_01 Legislatory Framework: unwanted access by third parties. *** selected
# LA01_02 Legislatory Framework: unwanted sharing with third parties.
# LA01_03 Legislatory Framework: unwanted processing and analysis by third parties.
####H1_Purchase Behaviour####
#how does the purchase behaviour / adoption of smart home devices change in regards to the participant's feeling legistlative protection
#Rq1 - H1 LA01_01 - R101
# R101 equals the amount of owned devices of the user
#testing for unwanted access to data with amount of different devices owned.
#variance of devices correlates with the Legislative satisfaction lightly
cor.test(singleSourceOfTruthAppended$LA01_01,
singleSourceOfTruthAppended$R101) #*
cor.test(singleSourceOfTruthAppended$LA01_02,
singleSourceOfTruthAppended$R101) #-
cor.test(singleSourceOfTruthAppended$LA01_03,
singleSourceOfTruthAppended$R101) #*
cor.test(singleSourceOfTruthAppended$LA_Mean,
singleSourceOfTruthAppended$R101) #*
mean(subset(singleSourceOfTruthAppended,R101 == 0)$LA_Mean)
mean(subset(singleSourceOfTruthAppended,R101 > 0)$LA_Mean)
# [EXPLANATION] Overall shows that the more the participants feel protected from evil entities by legislation the more different devices they own
wilcox.test(subset(singleSourceOfTruthAppended,R101 == 0)$LA_Mean,subset(singleSourceOfTruthAppended,R101 > 0)$LA_Mean)
# [EXPLANATION] Is there a difference in the amount of devices by region investigated?
kruskal_test(rbind(Participants_UK, Participants_US), LA_Mean ~ R101) #*
kruskal_test(rbind(Participants_DACH, Participants_US), LA_Mean ~ R101) #*
kruskal_test(rbind(Participants_DACH, Participants_UK), LA_Mean ~ R101) #*
#[EXPLANATION] Check if there is a significant difference in amount of devices over regions
kruskal_test(singleSourceOfTruthAppended,
R101 ~ `Current Country of Residence`)
# there is no reason to believe there are different amount of unique devices over different regions
#There is significant difference in the means of the different countries regarding the legislative protection and the amount of devices unique owned
####H1_Pairwise comparison, only used for discussion####
###UK US
kruskal_test(
subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "United Kingdom" |
`Current Country of Residence` == "United States"
),
LA01_01 ~ R101
)#ns
kruskal_test(
subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "United Kingdom" |
`Current Country of Residence` == "United States"
),
LA01_02 ~ R101
)#s
kruskal_test(
subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "United Kingdom" |
`Current Country of Residence` == "United States"
),
LA01_03 ~ R101
)#s
###DACH US
kruskal_test(
subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "DACH" |
`Current Country of Residence` == "United States"
),
LA01_01 ~ R101
)#s
kruskal_test(
subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "DACH" |
`Current Country of Residence` == "United States"
),
LA01_02 ~ R101
)#s
kruskal_test(
subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "DACH" |
`Current Country of Residence` == "United States"
),
LA01_03 ~ R101
)#ns
###UK DACH
kruskal_test(
subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "United Kingdom" |
`Current Country of Residence` == "DACH"
),
LA01_01 ~ R101
) # s
cor.test(singleSourceOfTruthAppended$LA01_01,
singleSourceOfTruthAppended$R101)
kruskal_test(
subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "United Kingdom" |
`Current Country of Residence` == "DACH"
),
LA01_02 ~ R101
) #s
kruskal_test(
subset(
singleSourceOfTruthAppended,
`Current Country of Residence` == "United Kingdom" |
`Current Country of Residence` == "DACH"
),
LA01_03 ~ R101
) #s
####H2 Usage of smart home devices influenced by Legislation (LA)
# creating table usage device ownership
u <-
select(
singleSourceOfTruthAppended,
participant_id,
R232_01,
R232_02,
R232_03,
R233_01,
R233_02 ,
R233_03 ,
R501,
R503,
R505
)
#filtering out devices owned for our analysis on the recurring devices
d1 <-
select(
subset(singleSourceOfTruthAppended, R233_01 == 1),
participant_id,
R232_01,
R501,
LA_Mean
)
d2 <-
select(
subset(singleSourceOfTruthAppended, R233_02 == 1),
participant_id,
R232_02,
R503,
LA_Mean
)
d3 <-
select(
subset(singleSourceOfTruthAppended, R233_03 == 1),
participant_id,
R232_03,
R505,
LA_Mean
)
colnames(d1) <-
c("participant_id", "Device_Owned", "Usage", "LA_Mean")
colnames(d2) <-
c("participant_id", "Device_Owned", "Usage", "LA_Mean")
colnames(d3) <-
c("participant_id", "Device_Owned", "Usage", "LA_Mean")
d <- rbind(d1, d2, d3)
d <-
subset(d, Usage != "Don't know") #filtering out the options of I do not know due to them not holding additional data
d$Usage <-
factor(
d$Usage,
levels = c(
"0 times",
"1-5 times",
"6-10 times",
"11-20 times",
"21-30 times",
"30+ times"
)
)
cor.test(d$LA_Mean, as.numeric(d$Usage))
# [Explanation] we find that the usage of devices correlates positively when the participants felt protected by legislation
####H2_Disabled Features#### -- too little people to use in analysis
disabled_features <-
select(
singleSourceOfTruthAppended,
participant_id,
R507,
R510,
R513,
LA01_01,
LA01_02,
LA01_03,
)
disabled_features$choice <-
ifelse(
disabled_features$R507 == "Yes" |
disabled_features$R510 == "Yes" |
disabled_features$R513 == "Yes",
1,
0
)
disabled_features["LA01_Mean"] = rowMeans(select(disabled_features,LA01_01:LA01_03))
wilcox.test(disabled_features$LA01_Mean, disabled_features$choice) #p-value < 2.2e-16
wilcox.test(disabled_features$LA01_01, disabled_features$choice) #p-value < 2.2e-16
wilcox.test(disabled_features$LA01_02, disabled_features$choice) #p-value < 2.2e-16
wilcox.test(disabled_features$LA01_03, disabled_features$choice) #p-value < 2.2e-16
aggregate(LA01_01 ~ choice, data = disabled_features, mean)
aggregate(LA01_02 ~ choice, data = disabled_features, mean)
aggregate(LA01_03 ~ choice, data = disabled_features, mean)
#plotting results
ggboxplot(
disabled_features,
x = "choice",
y = "LA01_01",
color = "choice",
palette = c("#00AFBB", "#E7B800"),
order = c(0, 1),
ylab = "LA01_01",
xlab = "choice"
)
ggboxplot(
disabled_features,
x = "choice",
y = "LA01_02",
color = "choice",
palette = c("#00AFBB", "#E7B800"),
order = c(0, 1),
ylab = "LA01_01",
xlab = "choice"
)
ggboxplot(
disabled_features,
x = "choice",
y = "LA01_03",
color = "choice",
palette = c("#00AFBB", "#E7B800"),
order = c(0, 1),
ylab = "Agreement to unwanted processing",
xlab = "Disabled features"
)
####H2 Device specific usage in popular smart home devices - how does usage relate to legislative protection?
#Device Usage x LA_Mean
dtInteresting <-
subset(
d,
Device_Owned == "Smart TV" |
Device_Owned == "Smart Lightbulb" |
Device_Owned == "Smart Speaker"
)
dt = group_by(dtInteresting, Device_Owned)
LA_MEAN_USAGE_DEVICE_INTERESTING <-
dplyr::summarize(dt, cor(LA_Mean, as.numeric(Usage)))
LA_MEAN_USAGE_DEVICE_INTERESTING[3] <- "Pearson"
LA_MEAN_USAGE_DEVICE_INTERESTING[4] <-
c(
cor.test(
subset(dtInteresting, Device_Owned == "Smart Lightbulb")$LA_Mean,
as.numeric(subset(
dtInteresting, Device_Owned == "Smart Lightbulb"
)$Usage),
method = "pearson"
)$p.value,
cor.test(
subset(dtInteresting, Device_Owned == "Smart Speaker")$LA_Mean,
as.numeric(subset(
dtInteresting, Device_Owned == "Smart Speaker"
)$Usage),
method = "pearson"
)$p.value,
cor.test(
subset(dtInteresting, Device_Owned == "Smart TV")$LA_Mean,
as.numeric(subset(dtInteresting, Device_Owned == "Smart TV")$Usage),
method = "pearson"
)$p.value
)
colnames(LA_MEAN_USAGE_DEVICE_INTERESTING) <-
c("Device", "Cor", "Method", "P-Value")
#overall correlation over all 3 devices
cor.test(dtInteresting$LA_Mean,
as.numeric(dtInteresting$Usage),
method = "pearson")
#All devices in one table
ddply(dt,
"Device_Owned",
summarise,
corr = cor(LA_Mean, as.numeric(Usage), method = "pearson"))
#individual correlations
cor.test(
subset(dtInteresting, Device_Owned == "Smart TV")$LA_Mean,
as.numeric(subset(dtInteresting, Device_Owned == "Smart TV")$Usage),
method = "pearson"
)
cor.test(
subset(dtInteresting, Device_Owned == "Smart Speaker")$LA_Mean,
as.numeric(subset(
dtInteresting, Device_Owned == "Smart Speaker"
)$Usage),
method = "pearson"
)
cor.test(
subset(dtInteresting, Device_Owned == "Smart Lightbulb")$LA_Mean,
as.numeric(subset(
dtInteresting, Device_Owned == "Smart Lightbulb"
)$Usage),
method = "pearson"
)
####H3_Perception#### How is perception affected by the feeling of legislative protection ?
#E201_01-20 correspond to the perceived risk of a certain device
#11 Smart Lightbuld; 14 Smart Speaker; 16 Smart TV
# over all devices. Different devices and use cases generate noise
v <- rowMeans(select(singleSourceOfTruthAppended, E201_01:E201_20))
cor.test(singleSourceOfTruthAppended$LA01_01, v)
cor.test(singleSourceOfTruthAppended$LA01_02, v)
cor.test(singleSourceOfTruthAppended$LA01_03, v)
cor.test(singleSourceOfTruthAppended$LA_Mean, v)
#even though it generates noise, we find that with a statistically significant value
# device risk assessment goes down when the participants feel protected by legislation
####H3_Perception_popular devices####
#correlation of interesting devices (3)
LA_E201_Latex_Interesting <- subset(select(cor_test(
select(
singleSourceOfTruthAppended,
LA_Mean,
E201_11,
E201_14,
E201_16
)
), var1, var2, cor, p),
var1 == "LA_Mean" & var2 != "LA_Mean")
# [explanation] we find that the smart speaker benefits the most from strong legislation due to a significant drop in risk
#correlation of all devices we have asked
LA_E201_Latex <- subset(select(cor_test(
select(singleSourceOfTruthAppended,
LA_Mean,
E201_01:E201_20)
), var1, var2, cor, p),
var1 == "LA_Mean" & var2 != "LA_Mean")
# we find that the smart home monitoring system receives a huge boost and has 49 people owning it
cor_test(select(singleSourceOfTruthAppended, LA_Mean, E201_10))
#shows large negative impact on device risk when high legislative satisfaction
cor_test(select(
singleSourceOfTruthAppended,
LA_Mean,
E201_11,
E201_14,
E201_16
))
#testing correlation between perceived risk for popular Devices
cor_test(select(
singleSourceOfTruthAppended,
LA01_01,
E201_11,
E201_14,
E201_16
))
#result:
# var1 var2 cor statistic p conf.low conf.high method
# 2 LA01_01 E201_11 -0.092 -1.93 5.46e- 2 -0.185 0.00181 Pearson
# 3 LA01_01 E201_14 -0.17 -3.59 3.64e- 4 -0.260 -0.0774 Pearson
# 4 LA01_01 E201_16 -0.17 -3.58 3.79e- 4 -0.260 -0.0769 Pearson
cor_test(select(
singleSourceOfTruthAppended,
LA01_02,
E201_11,
E201_14,
E201_16
))
#result:
# var1 var2 cor statistic p conf.low conf.high method
#2 LA01_02 E201_11 -0.076 -1.59 1.13e- 1 -0.169 0.0181 Pearson
#3 LA01_02 E201_14 -0.15 -3.14 1.79e- 3 -0.240 -0.0561 Pearson
#4 LA01_02 E201_16 -0.18 -3.85 1.34e- 4 -0.271 -0.0896 Pearson
cor_test(select(
singleSourceOfTruthAppended,
LA01_03,
E201_11,
E201_14,
E201_16
))
#result:
# var1 var2 cor statistic p conf.low conf.high method
#2 LA01_03 E201_11 -0.074 -1.54 1.25e- 1 -0.166 0.0205 Pearson
#3 LA01_03 E201_14 -0.13 -2.69 7.51e- 3 -0.219 -0.0344 Pearson
#4 LA01_03 E201_16 -0.17 -3.54 4.42e- 4 -0.258 -0.0749 Pearson
####H3_Perceived Responsibility####
#Correlation between LA01 and Manufacturer responsibility
#Likert-scale from 0-me to 7-manufacturer
#Keeping the Smart Home device software up-to-date
#Ensuring my privacy
#Protecting my Smart Home ecosystem as a whole #ns
#keeping my device secure #ns
#Fixing a hardware failure
#Fixing a software failure
cor_test(select(singleSourceOfTruthAppended, LA_Mean, A204_01:A204_06))
LA_A204_Latex <- subset(select(cor_test(
select(singleSourceOfTruthAppended,
LA_Mean,
A204_01:A204_06)
), var1, var2, cor, p),
var1 == "LA_Mean" & var2 != "LA_Mean")
# [EXPLANATION] we cannot find a large correlation between manufacturer responsibility and perceived legilsative protection
# perception - how does perceived legislative protection influence perceived surveillance
cor_test(select(singleSourceOfTruthAppended, LA_Mean, muipc_PerceivedSur_avg))
#strong negative correlation for non device users.
cor_test(select(
subset(singleSourceOfTruthAppended, R101 < 1),
LA_Mean,
muipc_PerceivedSur_avg
))
cor_test(select(
subset(singleSourceOfTruthAppended, R101 > 0),
LA_Mean,
muipc_PerceivedSur_avg
))
# higher legislative protection negatively impacts perceived surveillance greatly