Creating Variables

#rc is reading comprehension
p$rc1[p$X2C==3]<-1
p$rc1[p$X2C!=3]<-0
p$rc2[p$X2E==5]<-1
p$rc2[p$X2E!=5]<-0
p$rc3[p$X2E.1==5]<-1
p$rc3[p$X2E.1!=5]<-0
p$rc4[p$X2C.1==3]<-1
p$rc4[p$X2C.1!=3]<-0

p$rc<-p$rc1+p$rc2+p$rc3+p$rc4
summary(p$rc)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   0.000   2.000   2.000   2.216   3.000   4.000
#intensity of phone use (composite measure: alpha=.9)
p$freq<-(p$freq_1+p$freq_2+p$freq_3+p$freq_6+p$freq_5+p$freq_7+p$freq_8)
fr<-p[,284:290]
library(psych)
## Warning: package 'psych' was built under R version 3.2.5
alpha(fr)
## 
## Reliability analysis   
## Call: alpha(x = fr)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean sd
##        0.9       0.9     0.9      0.56 8.8 0.022    3  1
## 
##  lower alpha upper     95% confidence boundaries
## 0.85 0.9 0.94 
## 
##  Reliability if an item is dropped:
##        raw_alpha std.alpha G6(smc) average_r S/N alpha se
## freq_1      0.86      0.87    0.86      0.52 6.5    0.029
## freq_2      0.89      0.89    0.90      0.59 8.5    0.023
## freq_3      0.88      0.88    0.88      0.54 7.1    0.027
## freq_5      0.88      0.88    0.89      0.56 7.7    0.025
## freq_6      0.88      0.88    0.88      0.54 7.0    0.027
## freq_7      0.89      0.89    0.89      0.58 8.1    0.024
## freq_8      0.89      0.89    0.89      0.57 8.0    0.024
## 
##  Item statistics 
##         n raw.r std.r r.cor r.drop mean  sd
## freq_1 51  0.89  0.89  0.89   0.84  3.4 1.3
## freq_2 51  0.70  0.71  0.64   0.60  2.7 1.2
## freq_3 51  0.83  0.82  0.79   0.75  3.0 1.3
## freq_5 51  0.76  0.77  0.73   0.68  2.7 1.2
## freq_6 51  0.83  0.83  0.81   0.75  3.1 1.3
## freq_7 51  0.74  0.74  0.69   0.64  2.9 1.3
## freq_8 51  0.76  0.75  0.69   0.65  3.4 1.4
## 
## Non missing response frequency for each item
##           1    2    3    4    5 miss
## freq_1 0.12 0.18 0.12 0.41 0.18    0
## freq_2 0.20 0.18 0.43 0.10 0.10    0
## freq_3 0.20 0.16 0.18 0.35 0.12    0
## freq_5 0.16 0.31 0.25 0.20 0.08    0
## freq_6 0.16 0.14 0.24 0.35 0.12    0
## freq_7 0.20 0.18 0.29 0.22 0.12    0
## freq_8 0.18 0.10 0.20 0.25 0.27    0
p$mindful<-((8-p$m1r)+(8-p$m2)+(8-p$m3)+(8-p$m4)+(8-p$m5r))/5
p$stress<-(p$s1+p$s2+(6-p$s3R)+(6-p$s4R)+p$s5)/5


#attention / digit cancellation task
p[is.na(p)]<-0

p$x71[p$X7_448==1]<-1
p$x72[p$X7_456==1]<-1
p$x73[p$X7_472==1&p$X7_471==1]<-1
p$x74[p$X7_478==1]<-1
p$x75[p$X7_485==1]<-1
p$x76[p$X7_486==1&p$X7_487==1]<-1
p$x77[p$X7_490==1&p$X7_491==1]<-1

p$x7<-p$x71+p$x72+p$x73+p$x74+p$x75+p$x76+p$x77

p[is.na(p)]<-0

p$x31[p$X3_60==1]<-1
p$x32[p$X3_76==1]<-1
p$x33[p$X3_81==1]<-1
p$x34[p$X3_84==1]<-1
p$x35[p$X3_350==1]<-1
p$x36[p$X3_355==1]<-1
p$x37[p$X3_371==1]<-1

p$x3<-p$x31+p$x32+p$x33+p$x34+p$x35+p$x36+p$x37

p[is.na(p)]<-0

p$x61[p$X6_68==1]<-1
p$x62[p$X6_91==1&p$X6_102]<-1
p$x63[p$X6_347==1]<-1
p$x64[p$X6_352==1]<-1
p$x65[p$X6_347==1]<-1
p$x65[p$X6_352==1]<-1
p$x62[p$X6_362==1&p$X6_363]<-1
p$x65[p$X6_365==1]<-1

p$x6<-p$x61+p$x62+p$x63+p$x64+p$x65

p[is.na(p)]<-0

p$x3.21[p$X3_57==1&p$X3_58==1]<-1
p$x3.22[p$X3_63==1]<-1
p$x3.23[p$X3_76==1]<-1
p$x3.24[p$X3_81==1]<-1
p$x3.25[p$X3_84==1]<-1

p$x3.2<-p$x3.25+p$x3.24+p$x3.23+p$x3.22+p$x3.21


p$attn<-p$x3+p$x6+p$x7+p$x3.2

Checking correlations

First, reading comprehension and intensity of checking phone

cor.test(p$rc, p$freq)
## 
##  Pearson's product-moment correlation
## 
## data:  p$rc and p$freq
## t = 1.0456, df = 49, p-value = 0.3009
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.1332753  0.4067577
## sample estimates:
##       cor 
## 0.1477345

Then reading comp and frequency of checking phone (single item)

cor.test(p$rc, p$check)
## 
##  Pearson's product-moment correlation
## 
## data:  p$rc and p$check
## t = 0.14946, df = 49, p-value = 0.8818
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.2557412  0.2951940
## sample estimates:
##        cor 
## 0.02134694

Then both measures of phone use and mindfulness while reading the passages

cor.test(p$check, p$mindful)
## 
##  Pearson's product-moment correlation
## 
## data:  p$check and p$mindful
## t = -2.2336, df = 49, p-value = 0.03011
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.53477209 -0.03100207
## sample estimates:
##        cor 
## -0.3039886
cor.test(p$freq, p$mindful)
## 
##  Pearson's product-moment correlation
## 
## data:  p$freq and p$mindful
## t = 0.29973, df = 49, p-value = 0.7657
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.2355815  0.3146536
## sample estimates:
##        cor 
## 0.04277952

Then both measures of phone use and attention task

cor.test(p$freq, p$attn)
## 
##  Pearson's product-moment correlation
## 
## data:  p$freq and p$attn
## t = -0.96225, df = 1, p-value = 0.5122
## alternative hypothesis: true correlation is not equal to 0
## sample estimates:
##        cor 
## -0.6933752
cor.test(p$check, p$attn)
## 
##  Pearson's product-moment correlation
## 
## data:  p$check and p$attn
## t = -1.1547, df = 1, p-value = 0.4544
## alternative hypothesis: true correlation is not equal to 0
## sample estimates:
##        cor 
## -0.7559289

And finally measures of phone use and stress

cor.test(p$stress, p$freq)
## 
##  Pearson's product-moment correlation
## 
## data:  p$stress and p$freq
## t = 1.8346, df = 49, p-value = 0.07264
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.02372122  0.49455116
## sample estimates:
##       cor 
## 0.2535198
cor.test(p$stress, p$check)
## 
##  Pearson's product-moment correlation
## 
## data:  p$stress and p$check
## t = 1.5648, df = 49, p-value = 0.1241
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.06110247  0.46573822
## sample estimates:
##       cor 
## 0.2181547

We also asked “was your phone out of sight during the survey” so we can look at that as a non manipulated variable… people whose phone was out of sight reported lower stress and lower mindfulness but not better reading comprehension or attention

p[is.na(p)]<-0
out<-subset(p, manipcheck==1)
not<-subset(p, manipcheck==2)
t.test(out$stress, not$stress)
## 
##  Welch Two Sample t-test
## 
## data:  out$stress and not$stress
## t = -2.3455, df = 42.933, p-value = 0.02369
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -1.04450926 -0.07871655
## sample estimates:
## mean of x mean of y 
##  2.548387  3.110000
t.test(out$mindful, not$mindful)
## 
##  Welch Two Sample t-test
## 
## data:  out$mindful and not$mindful
## t = 1.5324, df = 46.503, p-value = 0.1322
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.153055  1.130474
## sample estimates:
## mean of x mean of y 
##   5.23871   4.75000
t.test(out$rc, not$rc)
## 
##  Welch Two Sample t-test
## 
## data:  out$rc and not$rc
## t = -0.16308, df = 32.105, p-value = 0.8715
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.7614614  0.6485582
## sample estimates:
## mean of x mean of y 
##  2.193548  2.250000
t.test(out$attn, not$attn)
## 
##  Welch Two Sample t-test
## 
## data:  out$attn and not$attn
## t = -0.67296, df = 32.053, p-value = 0.5058
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -4.130568  2.078955
## sample estimates:
## mean of x mean of y 
## 0.7741935 1.8000000