library(mapproj)  #  map
## Warning: package 'mapproj' was built under R version 3.4.2
## Loading required package: maps
## Warning: package 'maps' was built under R version 3.4.2
library(reshape2) #  melt
## Warning: package 'reshape2' was built under R version 3.4.3
library(nparcomp) #  gao_cs
## Warning: package 'nparcomp' was built under R version 3.4.2
## Loading required package: multcomp
## Warning: package 'multcomp' was built under R version 3.4.3
## Loading required package: mvtnorm
## Warning: package 'mvtnorm' was built under R version 3.4.3
## Loading required package: survival
## Loading required package: TH.data
## Warning: package 'TH.data' was built under R version 3.4.2
## Loading required package: MASS
## 
## Attaching package: 'TH.data'
## The following object is masked from 'package:MASS':
## 
##     geyser
library(car)  # leveneTest and Anova Type III
## Warning: package 'car' was built under R version 3.4.3
library(heplots) #  etasquared
## Warning: package 'heplots' was built under R version 3.4.2
library(MASS) #  lda
library(psy) #  cronbach
library(igraph) # network graphs
## Warning: package 'igraph' was built under R version 3.4.2
## 
## Attaching package: 'igraph'
## The following objects are masked from 'package:stats':
## 
##     decompose, spectrum
## The following object is masked from 'package:base':
## 
##     union
library(lsr) # partial eta squared
library(psych) # KMO
## 
## Attaching package: 'psych'
## The following object is masked from 'package:psy':
## 
##     wkappa
## The following object is masked from 'package:car':
## 
##     logit
library(biotools) # M Box test
## Warning: package 'biotools' was built under R version 3.4.2
## Loading required package: rpanel
## Warning: package 'rpanel' was built under R version 3.4.2
## Loading required package: tcltk
## Package `rpanel', version 1.1-3: type help(rpanel) for summary information
## Loading required package: tkrplot
## Loading required package: lattice
## Loading required package: SpatialEpi
## Warning: package 'SpatialEpi' was built under R version 3.4.2
## Loading required package: sp
## Warning: package 'sp' was built under R version 3.4.3
## 
## Attaching package: 'SpatialEpi'
## The following object is masked from 'package:igraph':
## 
##     normalize
## ---
## biotools version 3.1
## 
## 
## Attaching package: 'biotools'
## The following object is masked from 'package:heplots':
## 
##     boxM
library(vcd) # goodfit
## Warning: package 'vcd' was built under R version 3.4.3
## Loading required package: grid
library(agricolae)
## Warning: package 'agricolae' was built under R version 3.4.2
## 
## Attaching package: 'agricolae'
## The following object is masked from 'package:igraph':
## 
##     similarity
library(lavaan) # SEM4
## Warning: package 'lavaan' was built under R version 3.4.2
## This is lavaan 0.5-23.1097
## lavaan is BETA software! Please report any bugs.
## 
## Attaching package: 'lavaan'
## The following object is masked from 'package:psych':
## 
##     cor2cov
library(semPlot) # SEM graph
## Warning: package 'semPlot' was built under R version 3.4.4
library(Hmisc) # correlation matrix
## Warning: package 'Hmisc' was built under R version 3.4.3
## Loading required package: Formula
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 3.4.3
## 
## Attaching package: 'ggplot2'
## The following objects are masked from 'package:psych':
## 
##     %+%, alpha
## 
## Attaching package: 'Hmisc'
## The following object is masked from 'package:psych':
## 
##     describe
## The following objects are masked from 'package:base':
## 
##     format.pval, units
library(plyr) # count
## 
## Attaching package: 'plyr'
## The following objects are masked from 'package:Hmisc':
## 
##     is.discrete, summarize
## The following object is masked from 'package:maps':
## 
##     ozone
## PRETEST 1
cat("\014")  # cleans screen

rm(list=ls(all=TRUE))  # remove variables in working memory
setwd("C:/Users/Erik Ernesto Vazquez/Downloads/Results")  # sets working directory

Pretest<-read.csv("Main_Study/Main_study__3x3_United_States.csv", skip=2, header=F)  # reads raw data from Qualtrics
NamesandHeaders<-read.csv("Main_Study/Main_study__3x3_United_States.csv")  # assigns headers and names to data frame
names(Pretest)<-names(NamesandHeaders)
Pretest$V6<-as.character(Pretest$V6)
Pretest<-Pretest[which(!duplicated(Pretest$V6)&Pretest$t2.frmwrk_3>0&Pretest$t12_3>0),]  # This procedure displays a freq. table and a bar plot showing grouping' without IPs duplicates
framework.wide=data.frame(Pretest[1],Pretest[34:36],Pretest[596:598],Pretest[603:604])
names(framework.wide)<-c("Subject","Credence","Experience","Search","Age","Gender","Income","Education","RE")
table(framework.wide$Gender)
## 
##   1   2 
## 539 506
women<-subset(framework.wide,framework.wide$Gender==1)
men<-subset(framework.wide,framework.wide$Gender==2)
Pretest<-rbind(women[1:60,],men[1:60,])

table(Pretest$Gender)
## 
##  1  2 
## 60 60
mean(Pretest$Age)-2014
## [1] -31.25
sd(Pretest$Age)
## [1] 8.758429
aggregate(Pretest$Age,list(Pretest$Gender),mean)
##   Group.1        x
## 1       1 1983.067
## 2       2 1982.433
aggregate(Pretest$Age,list(Pretest$Gender),sd)
##   Group.1        x
## 1       1 8.938332
## 2       2 8.638437
women<-subset(Pretest,Pretest$Gender==1)
men<-subset(Pretest,Pretest$Gender==2)
t.test(women$Age,men$Age) ## groups are equivalent in Age
## 
##  Welch Two Sample t-test
## 
## data:  women$Age and men$Age
## t = 0.39466, df = 117.86, p-value = 0.6938
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -2.544578  3.811245
## sample estimates:
## mean of x mean of y 
##  1983.067  1982.433
summary(Pretest[,2:4])
##     Credence       Experience        Search     
##  Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:4.750   1st Qu.:3.000   1st Qu.:3.000  
##  Median :7.000   Median :4.000   Median :3.000  
##  Mean   :6.125   Mean   :4.675   Mean   :4.117  
##  3rd Qu.:8.000   3rd Qu.:6.000   3rd Qu.:6.000  
##  Max.   :9.000   Max.   :9.000   Max.   :9.000
t.test(Pretest$Credence,Pretest$Experience) ## Validation of SEC levels of ease to evaluate quality
## 
##  Welch Two Sample t-test
## 
## data:  Pretest$Credence and Pretest$Experience
## t = 5.0975, df = 237.96, p-value = 7.019e-07
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.8896311 2.0103689
## sample estimates:
## mean of x mean of y 
##     6.125     4.675
t.test(Pretest$Experience,Pretest$Search) ## The chance of error type 2 is very small according to Winter 2013
## 
##  Welch Two Sample t-test
## 
## data:  Pretest$Experience and Pretest$Search
## t = 2.0762, df = 235.43, p-value = 0.03896
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.02853859 1.08812808
## sample estimates:
## mean of x mean of y 
##  4.675000  4.116667
framework.long<-melt(Pretest,id.vars=c("Subject","Age","Gender","Income","Education","RE"),measure.vars=c("Credence", "Experience", "Search" ),variable.name="Framework", value.name="Measurement")
aggregate(framework.long$Measurement,list(framework.long$Framework),sd)
##      Group.1        x
## 1   Credence 2.217435
## 2 Experience 2.189212
## 3     Search 1.971150
## PRETEST 2
cat("\014")  # cleans screen

rm(list=ls(all=TRUE))  # remove variables in working memory
setwd("C:/Users/Erik Ernesto Vazquez/Downloads/IJEC Data recollection")  # sets working directory

MainStudy<-read.csv("Pretest Analysis Tie Strength and Media Richness.csv", header=T)  # reads raw data from Qualtrics
MainStudy<-subset(MainStudy,MainStudy$X3<1991&MainStudy$X1_15>0&MainStudy$X2_15>0&MainStudy$X3_15>0&MainStudy$X4_15>0&MainStudy$X5_15>0)
table(MainStudy$V3)
## 
##  9 10 
## 25 26
MainStudyF<-subset(MainStudy,MainStudy$V3==9)
MainStudyM<-subset(MainStudy,MainStudy$V3==10)
MainStudy<-rbind(MainStudyF[1:25,],MainStudyM[1:25,])
table(MainStudy$V3)
## 
##  9 10 
## 25 25
mean(MainStudy$X3)-2014
## [1] -31.88
sd(MainStudy$X3)
## [1] 8.66294
##Reliability content Vividness
MainStudyMelt1<-melt(MainStudy,id.vars=c("ResponseId","X3","V3","X1_1","X1_2","X1_3",
                                         "X1_4","X1_5","X1_6","X1_7",
                                         "X1_15"),
                     measure.vars=c("X1_1","X1_2","X1_3",
                                    "X1_4","X1_5","X1_6","X1_7",
                                    "X1_15"),
                     variable.name="MediaRichness1", value.name="MRItem1")
MainStudyMelt2<-melt(MainStudy,id.vars=c("ResponseId","X3","V3","X2_1","X2_2","X2_3",
                                         "X2_4","X2_5","X2_6","X2_7",
                                         "X2_15"),
                     measure.vars=c("X2_1","X2_2","X2_3",
                                    "X2_4","X2_5","X2_6","X2_7",
                                    "X2_15"),
                     variable.name="MediaRichness2", value.name="MRItem2")
MainStudyMelt3<-melt(MainStudy,id.vars=c("ResponseId","X3","V3","X3_1","X3_2","X3_3",
                                         "X3_4","X3_5","X3_6","X3_7",
                                         "X3_15"),
                     measure.vars=c("X3_1","X3_2","X3_3",
                                    "X3_4","X3_5","X3_6","X3_7",
                                    "X3_15"),
                     variable.name="MediaRichness3", value.name="MRItem3")
cronbach(cbind(MainStudyMelt1$MRItem1,MainStudyMelt2$MRItem2,MainStudyMelt3$MRItem3)) ## Cronabch 0.81
## $sample.size
## [1] 400
## 
## $number.of.items
## [1] 3
## 
## $alpha
## [1] 0.8172619
## Reliability Tie Strength
MainStudyMelt4<-melt(MainStudy,id.vars=c("ResponseId","X3","V3","X4_1","X4_2","X4_3",
                                         "X4_4","X4_5","X4_6","X4_7",
                                         "X4_15"),
                     measure.vars=c("X4_1","X4_2","X4_3",
                                    "X4_4","X4_5","X4_6","X4_7",
                                    "X4_15"),
                     variable.name="TieStr1", value.name="TieStrItem1")
MainStudyMelt5<-melt(MainStudy,id.vars=c("ResponseId","X3","V3","X5_1","X5_2","X5_3",
                                         "X5_4","X5_5","X5_6","X5_7",
                                         "X5_15"),
                     measure.vars=c("X5_1","X5_2","X5_3",
                                    "X5_4","X5_5","X5_6","X5_7",
                                    "X5_15"),
                     variable.name="TieStr2", value.name="TieStrItem2")
cronbach(cbind(MainStudyMelt4$TieStrItem1,MainStudyMelt5$TieStrItem2)) ## Cronabch 0.89
## $sample.size
## [1] 400
## 
## $number.of.items
## [1] 2
## 
## $alpha
## [1] 0.8946946
validity<-data.frame(cbind(MainStudyMelt1$MRItem1,MainStudyMelt2$MRItem2,MainStudyMelt3$MRItem3,MainStudyMelt4$TieStrItem1,MainStudyMelt5$TieStrItem2))
KMO(validity)
## Kaiser-Meyer-Olkin factor adequacy
## Call: KMO(r = validity)
## Overall MSA =  0.79
## MSA for each item = 
##   X1   X2   X3   X4   X5 
## 0.88 0.82 0.83 0.75 0.73
factanal(validity,2,rotation="varimax")
## 
## Call:
## factanal(x = validity, factors = 2, rotation = "varimax")
## 
## Uniquenesses:
##    X1    X2    X3    X4    X5 
## 0.533 0.295 0.309 0.322 0.005 
## 
## Loadings:
##    Factor1 Factor2
## X1 0.636   0.249  
## X2 0.800   0.254  
## X3 0.694   0.457  
## X4 0.384   0.729  
## X5 0.309   0.948  
## 
##                Factor1 Factor2
## SS loadings      1.769   1.766
## Proportion Var   0.354   0.353
## Cumulative Var   0.354   0.707
## 
## Test of the hypothesis that 2 factors are sufficient.
## The chi square statistic is 0.23 on 1 degree of freedom.
## The p-value is 0.633
summary(prcomp(validity)) ## Two components explain 69% of the variance
## Importance of components%s:
##                           PC1    PC2     PC3     PC4     PC5
## Standard deviation     4.7071 2.2192 1.57373 1.41028 1.16880
## Proportion of Variance 0.6732 0.1496 0.07525 0.06043 0.04151
## Cumulative Proportion  0.6732 0.8228 0.89807 0.95849 1.00000
screeplot(prcomp(validity),type="lines")

biplot(prcomp(validity,scale.=T),cex=0.5,xlabs=rep(".",nrow(validity)))

rcorr(as.matrix(validity))
##      X1   X2   X3   X4   X5
## X1 1.00 0.57 0.56 0.43 0.43
## X2 0.57 1.00 0.67 0.50 0.49
## X3 0.56 0.67 1.00 0.59 0.65
## X4 0.43 0.50 0.59 1.00 0.81
## X5 0.43 0.49 0.65 0.81 1.00
## 
## n= 400 
## 
## 
## P
##    X1 X2 X3 X4 X5
## X1     0  0  0  0
## X2  0     0  0  0
## X3  0  0     0  0
## X4  0  0  0     0
## X5  0  0  0  0
MainStudy$MRFacebook<-(MainStudy$X3_1+MainStudy$X1_1+MainStudy$X2_1)/3-38
MainStudy$MRTwitter<-(MainStudy$X3_2+MainStudy$X1_2+MainStudy$X2_2)/3-38
MainStudy$MRYouTube<-(MainStudy$X3_3+MainStudy$X1_3+MainStudy$X2_3)/3-38
MainStudy$MRInstagram<-(MainStudy$X3_4+MainStudy$X1_4+MainStudy$X2_4)/3-38
MainStudy$MRPinterest<-(MainStudy$X3_5+MainStudy$X1_5+MainStudy$X2_5)/3-38
MainStudy$MRSnapChat<-(MainStudy$X3_6+MainStudy$X1_6+MainStudy$X2_6)/3-38
MainStudy$MRLinkedIn<-(MainStudy$X3_7+MainStudy$X1_7+MainStudy$X2_7)/3-38
MainStudy$MRSecondLife<-(MainStudy$X3_15+MainStudy$X1_15+MainStudy$X2_15)/3-38

MainStudy$TSFacebook<-(MainStudy$X4_1+MainStudy$X5_1)/2-38
MainStudy$TSTwitter<-(MainStudy$X4_2+MainStudy$X5_2)/2-38
MainStudy$TSYouTube<-(MainStudy$X4_3+MainStudy$X5_3)/2-38
MainStudy$TSInstagram<-(MainStudy$X4_4+MainStudy$X5_4)/2-38
MainStudy$TSPinterest<-(MainStudy$X4_5+MainStudy$X5_5)/2-38
MainStudy$TSSnapChat<-(MainStudy$X4_6+MainStudy$X5_6)/2-38
MainStudy$TSLinkedIn<-(MainStudy$X4_7+MainStudy$X5_7)/2-38
MainStudy$TSSecondLife<-(MainStudy$X4_15+MainStudy$X5_15)/2-38

summary(MainStudy)
##           StartDate            EndDate       Status           IPAddress 
##  9/28/2017 5:29: 3   9/28/2017 2:26: 2   Min.   :0   37.187.147.158: 2  
##  9/28/2017 1:44: 2   9/28/2017 3:43: 2   1st Qu.:0   1.22.132.15   : 1  
##  9/28/2017 3:20: 2   9/28/2017 5:02: 2   Median :0   103.204.47.33 : 1  
##  9/28/2017 4:51: 2   9/28/2017 5:06: 2   Mean   :0   103.25.47.134 : 1  
##  9/28/2017 5:52: 2   9/28/2017 5:36: 2   3rd Qu.:0   103.88.77.3   : 1  
##  9/28/2017 8:30: 2   9/28/2017 1:21: 1   Max.   :0   106.51.152.46 : 1  
##  (Other)       :37   (Other)       :39               (Other)       :43  
##     Progress   Duration..in.seconds.    Finished         RecordedDate
##  Min.   :100   Min.   : 374.0        Min.   :1   9/28/2017 2:26: 2   
##  1st Qu.:100   1st Qu.: 424.2        1st Qu.:1   9/28/2017 3:43: 2   
##  Median :100   Median : 490.0        Median :1   9/28/2017 5:02: 2   
##  Mean   :100   Mean   : 582.4        Mean   :1   9/28/2017 5:06: 2   
##  3rd Qu.:100   3rd Qu.: 634.2        3rd Qu.:1   9/28/2017 5:36: 2   
##  Max.   :100   Max.   :1753.0        Max.   :1   9/28/2017 1:21: 1   
##                                                  (Other)       :39   
##              ResponseId RecipientLastName RecipientFirstName
##  R_10T8rIxyUdDqUvY: 1   Mode:logical      Mode:logical      
##  R_1BoX1ncuNMXu7TD: 1   NA's:50           NA's:50           
##  R_1CazBZ3AMwO2Xwb: 1                                       
##  R_1f2xJMMytF6btHR: 1                                       
##  R_1hALgNb68Qa7d9i: 1                                       
##  R_1i2LOTcQ6vqrYPd: 1                                       
##  (Other)          :44                                       
##  RecipientEmail ExternalReference LocationLatitude LocationLongitude
##  Mode:logical   Mode:logical      Min.   : 8.00    Min.   :-122.68  
##  NA's:50        NA's:50           1st Qu.:13.08    1st Qu.: -71.70  
##                                   Median :15.92    Median :  77.09  
##                                   Mean   :23.26    Mean   :  29.41  
##                                   3rd Qu.:39.12    3rd Qu.:  80.28  
##                                   Max.   :53.75    Max.   : 121.02  
##                                                                     
##  DistributionChannel UserLanguage t0_First.Click   t0_Last.Click   
##  anonymous:50          : 2        Min.   : 0.000   Min.   : 0.000  
##                      EN:48        1st Qu.: 0.000   1st Qu.: 0.000  
##                                   Median : 0.000   Median : 0.000  
##                                   Mean   : 2.289   Mean   : 4.524  
##                                   3rd Qu.: 0.000   3rd Qu.: 0.000  
##                                   Max.   :36.752   Max.   :59.745  
##                                                                    
##  t0_Page.Submit   t0_Click.Count      X0B_Browser        X0B_Version
##  Min.   : 15.97   Min.   :0.00   Chrome     :35   61.0.3163.100:20  
##  1st Qu.: 17.50   1st Qu.:0.00   Firefox    :12   55           : 8  
##  Median : 20.49   Median :0.00   Safari     : 2   60.0.3112.113: 3  
##  Mean   : 43.52   Mean   :0.66   Safari iPad: 1   49.0.2623.112: 2  
##  3rd Qu.: 27.98   3rd Qu.:0.00   Chrome iPad: 0   5.1.7        : 2  
##  Max.   :416.32   Max.   :9.00   Edge       : 0   60.0.3112.90 : 2  
##                                  (Other)    : 0   (Other)      :13  
##       X0B_Operating.System   X0B_Resolution       V1           V2   
##  Windows NT 6.1 :19        1366x768 :19     Min.   :10   Min.   :9  
##  Windows NT 10.0:11        1280x800 : 6     1st Qu.:10   1st Qu.:9  
##  Android 6.0.1  : 3        1280x1024: 5     Median :10   Median :9  
##  Macintosh      : 3        1024x768 : 3     Mean   :10   Mean   :9  
##  Windows NT 5.1 : 3        360x640  : 3     3rd Qu.:10   3rd Qu.:9  
##  Windows NT 6.3 : 3        1440x900 : 2     Max.   :10   Max.   :9  
##  (Other)        : 8        (Other)  :12                             
##        V3                       V4     tV_First.Click   tV_Last.Click   
##  Min.   : 9.0   4,5,6,7,8,9,10   :13   Min.   : 1.250   Min.   : 9.257  
##  1st Qu.: 9.0   4,5,6,7,8,10     : 6   1st Qu.: 2.507   1st Qu.:17.028  
##  Median : 9.5   4,5,6            : 4   Median : 3.454   Median :21.335  
##  Mean   : 9.5   4,5,6,7,8,9,10,11: 3   Mean   : 4.995   Mean   :23.431  
##  3rd Qu.:10.0   4                : 2   3rd Qu.: 4.787   3rd Qu.:27.987  
##  Max.   :10.0   4,5,6,10         : 2   Max.   :52.247   Max.   :69.337  
##                 (Other)          :20                                    
##  tV_Page.Submit  tV_Click.Count       X1_1            X1_2      
##  Min.   :10.17   Min.   : 4.00   Min.   :39.00   Min.   :39.00  
##  1st Qu.:18.41   1st Qu.: 8.00   1st Qu.:44.00   1st Qu.:43.00  
##  Median :23.34   Median :10.00   Median :45.00   Median :45.00  
##  Mean   :25.40   Mean   :11.18   Mean   :44.76   Mean   :44.12  
##  3rd Qu.:30.00   3rd Qu.:11.00   3rd Qu.:46.00   3rd Qu.:45.75  
##  Max.   :75.09   Max.   :32.00   Max.   :47.00   Max.   :47.00  
##                                                                 
##       X1_3            X1_4            X1_5           X1_6      
##  Min.   :40.00   Min.   :39.00   Min.   :39.0   Min.   :39.00  
##  1st Qu.:44.00   1st Qu.:43.00   1st Qu.:43.0   1st Qu.:41.25  
##  Median :45.00   Median :45.00   Median :44.5   Median :43.00  
##  Mean   :45.08   Mean   :44.42   Mean   :44.1   Mean   :43.16  
##  3rd Qu.:47.00   3rd Qu.:46.00   3rd Qu.:46.0   3rd Qu.:44.75  
##  Max.   :47.00   Max.   :47.00   Max.   :47.0   Max.   :47.00  
##                                                                
##       X1_7           X1_15       t1_First.Click   t1_Last.Click    
##  Min.   :39.00   Min.   :39.00   Min.   : 0.836   Min.   :  4.256  
##  1st Qu.:41.00   1st Qu.:41.00   1st Qu.: 4.304   1st Qu.: 21.102  
##  Median :43.00   Median :43.00   Median : 6.212   Median : 39.944  
##  Mean   :43.14   Mean   :42.74   Mean   : 7.830   Mean   : 43.273  
##  3rd Qu.:45.00   3rd Qu.:44.75   3rd Qu.: 8.868   3rd Qu.: 60.008  
##  Max.   :47.00   Max.   :47.00   Max.   :33.204   Max.   :122.232  
##                                                                    
##  t1_Page.Submit   t1_Click.Count       X2_1            X2_2      
##  Min.   : 61.11   Min.   : 8.00   Min.   :41.00   Min.   :39.00  
##  1st Qu.: 62.59   1st Qu.: 9.00   1st Qu.:44.00   1st Qu.:42.25  
##  Median : 65.43   Median :11.50   Median :45.00   Median :44.50  
##  Mean   :103.60   Mean   :13.38   Mean   :44.82   Mean   :43.82  
##  3rd Qu.: 84.50   3rd Qu.:17.00   3rd Qu.:46.00   3rd Qu.:45.00  
##  Max.   :981.92   Max.   :31.00   Max.   :47.00   Max.   :47.00  
##                                                                  
##       X2_3           X2_4            X2_5            X2_6      
##  Min.   :41.0   Min.   :39.00   Min.   :39.00   Min.   :39.00  
##  1st Qu.:45.0   1st Qu.:42.25   1st Qu.:43.00   1st Qu.:40.25  
##  Median :46.0   Median :44.00   Median :44.50   Median :43.00  
##  Mean   :45.5   Mean   :43.80   Mean   :43.88   Mean   :42.30  
##  3rd Qu.:47.0   3rd Qu.:45.00   3rd Qu.:45.75   3rd Qu.:44.00  
##  Max.   :47.0   Max.   :47.00   Max.   :47.00   Max.   :47.00  
##                                                                
##       X2_7           X2_15       Q774_First.Click Q774_Last.Click  
##  Min.   :39.00   Min.   :39.00   Min.   : 0.692   Min.   :  3.404  
##  1st Qu.:41.25   1st Qu.:40.25   1st Qu.: 4.062   1st Qu.: 18.695  
##  Median :43.00   Median :43.00   Median : 7.470   Median : 33.911  
##  Mean   :42.96   Mean   :42.34   Mean   : 9.889   Mean   : 50.221  
##  3rd Qu.:45.00   3rd Qu.:44.00   3rd Qu.:12.105   3rd Qu.: 60.494  
##  Max.   :47.00   Max.   :47.00   Max.   :64.105   Max.   :555.504  
##                                                                    
##  Q774_Page.Submit Q774_Click.Count      X3_1            X3_2      
##  Min.   : 61.16   Min.   : 8.00    Min.   :39.00   Min.   :39.00  
##  1st Qu.: 62.66   1st Qu.: 8.00    1st Qu.:43.00   1st Qu.:40.25  
##  Median : 69.47   Median :11.00    Median :45.00   Median :43.00  
##  Mean   :102.26   Mean   :13.22    Mean   :44.34   Mean   :42.70  
##  3rd Qu.:102.92   3rd Qu.:14.75    3rd Qu.:46.00   3rd Qu.:45.00  
##  Max.   :555.58   Max.   :50.00    Max.   :47.00   Max.   :47.00  
##                                                                   
##       X3_3            X3_4            X3_5            X3_6      
##  Min.   :39.00   Min.   :39.00   Min.   :39.00   Min.   :39.00  
##  1st Qu.:43.00   1st Qu.:41.00   1st Qu.:42.00   1st Qu.:39.00  
##  Median :45.00   Median :43.00   Median :43.00   Median :41.00  
##  Mean   :44.46   Mean   :42.66   Mean   :43.18   Mean   :41.64  
##  3rd Qu.:46.00   3rd Qu.:44.75   3rd Qu.:45.00   3rd Qu.:43.75  
##  Max.   :47.00   Max.   :47.00   Max.   :47.00   Max.   :47.00  
##                                                                 
##       X3_7           X3_15       Q776_First.Click Q776_Last.Click  
##  Min.   :39.00   Min.   :39.00   Min.   : 0.849   Min.   :  3.421  
##  1st Qu.:40.25   1st Qu.:39.00   1st Qu.: 2.640   1st Qu.: 19.424  
##  Median :43.00   Median :39.00   Median : 5.031   Median : 30.837  
##  Mean   :42.46   Mean   :40.98   Mean   : 8.607   Mean   : 38.878  
##  3rd Qu.:44.00   3rd Qu.:42.75   3rd Qu.: 8.897   3rd Qu.: 59.546  
##  Max.   :47.00   Max.   :46.00   Max.   :72.620   Max.   :116.506  
##                                                                    
##  Q776_Page.Submit Q776_Click.Count      X4_1            X4_2      
##  Min.   : 61.13   Min.   : 8.00    Min.   :40.00   Min.   :39.00  
##  1st Qu.: 62.72   1st Qu.: 8.00    1st Qu.:44.25   1st Qu.:43.00  
##  Median : 71.14   Median :10.00    Median :46.00   Median :44.00  
##  Mean   : 96.13   Mean   :13.22    Mean   :45.40   Mean   :43.96  
##  3rd Qu.: 88.52   3rd Qu.:15.75    3rd Qu.:47.00   3rd Qu.:46.00  
##  Max.   :683.66   Max.   :42.00    Max.   :47.00   Max.   :47.00  
##                                                                   
##       X4_3            X4_4            X4_5            X4_6      
##  Min.   :39.00   Min.   :39.00   Min.   :39.00   Min.   :39.00  
##  1st Qu.:41.25   1st Qu.:42.25   1st Qu.:40.00   1st Qu.:39.00  
##  Median :44.00   Median :44.00   Median :42.00   Median :42.00  
##  Mean   :43.46   Mean   :43.66   Mean   :42.32   Mean   :42.12  
##  3rd Qu.:45.75   3rd Qu.:46.00   3rd Qu.:44.00   3rd Qu.:44.75  
##  Max.   :47.00   Max.   :47.00   Max.   :47.00   Max.   :47.00  
##                                                                 
##       X4_7           X4_15      Q778_First.Click Q778_Last.Click  
##  Min.   :39.00   Min.   :39.0   Min.   : 0.885   Min.   :  4.476  
##  1st Qu.:42.25   1st Qu.:39.0   1st Qu.: 4.983   1st Qu.: 27.854  
##  Median :44.00   Median :40.0   Median : 7.396   Median : 44.758  
##  Mean   :43.80   Mean   :41.4   Mean   : 9.577   Mean   : 46.593  
##  3rd Qu.:45.75   3rd Qu.:44.0   3rd Qu.:10.875   3rd Qu.: 60.206  
##  Max.   :47.00   Max.   :47.0   Max.   :65.250   Max.   :121.689  
##                                                                   
##  Q778_Page.Submit Q778_Click.Count      X5_1            X5_2      
##  Min.   : 61.08   Min.   : 8.00    Min.   :40.00   Min.   :39.00  
##  1st Qu.: 61.93   1st Qu.: 9.00    1st Qu.:45.00   1st Qu.:41.25  
##  Median : 62.95   Median :10.50    Median :46.00   Median :44.00  
##  Mean   : 73.21   Mean   :15.24    Mean   :45.36   Mean   :43.46  
##  3rd Qu.: 76.19   3rd Qu.:16.75    3rd Qu.:47.00   3rd Qu.:46.00  
##  Max.   :157.36   Max.   :66.00    Max.   :47.00   Max.   :47.00  
##                                                                   
##       X5_3            X5_4            X5_5            X5_6      
##  Min.   :39.00   Min.   :39.00   Min.   :39.00   Min.   :39.00  
##  1st Qu.:41.00   1st Qu.:41.00   1st Qu.:39.00   1st Qu.:39.00  
##  Median :44.00   Median :43.00   Median :42.00   Median :41.50  
##  Mean   :43.18   Mean   :42.96   Mean   :42.12   Mean   :41.96  
##  3rd Qu.:45.00   3rd Qu.:45.00   3rd Qu.:44.00   3rd Qu.:44.00  
##  Max.   :47.00   Max.   :47.00   Max.   :47.00   Max.   :47.00  
##                                                                 
##       X5_7           X5_15       Q780_First.Click Q780_Last.Click  
##  Min.   :39.00   Min.   :39.00   Min.   : 0.882   Min.   :  5.832  
##  1st Qu.:42.00   1st Qu.:39.00   1st Qu.: 4.543   1st Qu.: 32.826  
##  Median :43.00   Median :40.00   Median : 8.931   Median : 49.100  
##  Mean   :43.34   Mean   :40.94   Mean   : 9.971   Mean   : 52.914  
##  3rd Qu.:45.75   3rd Qu.:42.75   3rd Qu.:12.747   3rd Qu.: 62.276  
##  Max.   :47.00   Max.   :47.00   Max.   :40.273   Max.   :196.035  
##                                                                    
##  Q780_Page.Submit Q780_Click.Count       X3             X4      
##  Min.   : 60.93   Min.   : 8.00    Min.   :1949   Min.   :1.00  
##  1st Qu.: 62.53   1st Qu.: 9.00    1st Qu.:1979   1st Qu.:1.00  
##  Median : 64.97   Median :11.00    Median :1986   Median :3.50  
##  Mean   : 86.12   Mean   :15.42    Mean   :1982   Mean   :3.18  
##  3rd Qu.: 75.39   3rd Qu.:16.50    3rd Qu.:1988   3rd Qu.:5.00  
##  Max.   :505.77   Max.   :70.00    Max.   :1990   Max.   :7.00  
##                                                                 
##  t3_First.Click    t3_Last.Click     t3_Page.Submit    t3_Click.Count 
##  Min.   :  1.404   Min.   :  4.553   Min.   :  5.587   Min.   : 2.00  
##  1st Qu.:  2.312   1st Qu.:  7.345   1st Qu.:  8.748   1st Qu.: 2.00  
##  Median :  3.377   Median :  8.812   Median : 11.464   Median : 2.00  
##  Mean   :  9.071   Mean   : 16.427   Mean   : 18.759   Mean   : 2.94  
##  3rd Qu.:  5.055   3rd Qu.: 16.309   3rd Qu.: 18.027   3rd Qu.: 3.00  
##  Max.   :203.935   Max.   :205.335   Max.   :208.775   Max.   :13.00  
##                                                                       
##        X5              X6              X6_6_TEXT  t4_First.Click  
##  Min.   : 9.00   Min.   :1.00               :38   Min.   : 1.254  
##  1st Qu.:12.00   1st Qu.:2.00   Indian      : 4   1st Qu.: 2.792  
##  Median :12.00   Median :2.00   asian       : 2   Median : 3.466  
##  Mean   :12.06   Mean   :3.22   Asian       : 2   Mean   : 5.989  
##  3rd Qu.:13.00   3rd Qu.:4.75   Asian/Indian: 1   3rd Qu.: 4.179  
##  Max.   :15.00   Max.   :6.00   Mixed       : 1   Max.   :71.134  
##                                 (Other)     : 2                   
##  t4_Last.Click    t4_Page.Submit   t4_Click.Count    mTurkCode    
##  Min.   : 3.004   Min.   : 3.834   Min.   : 2.00   Min.   : 0.00  
##  1st Qu.: 5.530   1st Qu.: 7.016   1st Qu.: 2.00   1st Qu.:21.25  
##  Median : 7.705   Median : 9.520   Median : 2.50   Median :44.00  
##  Mean   :11.190   Mean   :16.241   Mean   : 3.78   Mean   :47.90  
##  3rd Qu.:12.505   3rd Qu.:16.907   3rd Qu.: 4.00   3rd Qu.:78.50  
##  Max.   :75.028   Max.   :85.504   Max.   :16.00   Max.   :99.00  
##                                                                   
##    MRFacebook      MRTwitter       MRYouTube      MRInstagram   
##  Min.   :2.333   Min.   :1.000   Min.   :3.667   Min.   :2.000  
##  1st Qu.:6.000   1st Qu.:4.333   1st Qu.:6.333   1st Qu.:4.333  
##  Median :6.667   Median :6.000   Median :7.333   Median :6.000  
##  Mean   :6.640   Mean   :5.547   Mean   :7.013   Mean   :5.627  
##  3rd Qu.:7.667   3rd Qu.:6.667   3rd Qu.:8.000   3rd Qu.:7.000  
##  Max.   :9.000   Max.   :8.333   Max.   :9.000   Max.   :9.000  
##                                                                 
##   MRPinterest      MRSnapChat      MRLinkedIn     MRSecondLife  
##  Min.   :1.667   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:4.000   1st Qu.:2.417   1st Qu.:3.667   1st Qu.:2.417  
##  Median :6.000   Median :4.333   Median :5.000   Median :3.667  
##  Mean   :5.720   Mean   :4.367   Mean   :4.853   Mean   :4.020  
##  3rd Qu.:7.333   3rd Qu.:5.833   3rd Qu.:6.333   3rd Qu.:5.500  
##  Max.   :8.333   Max.   :8.667   Max.   :8.667   Max.   :8.667  
##                                                                 
##    TSFacebook      TSTwitter       TSYouTube      TSInstagram   
##  Min.   :2.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:6.625   1st Qu.:4.125   1st Qu.:3.125   1st Qu.:3.625  
##  Median :7.750   Median :6.000   Median :5.500   Median :5.500  
##  Mean   :7.380   Mean   :5.710   Mean   :5.320   Mean   :5.310  
##  3rd Qu.:9.000   3rd Qu.:7.500   3rd Qu.:7.500   3rd Qu.:7.000  
##  Max.   :9.000   Max.   :9.000   Max.   :9.000   Max.   :9.000  
##                                                                 
##   TSPinterest     TSSnapChat      TSLinkedIn    TSSecondLife  
##  Min.   :1.00   Min.   :1.000   Min.   :1.00   Min.   :1.000  
##  1st Qu.:2.00   1st Qu.:1.625   1st Qu.:4.50   1st Qu.:1.000  
##  Median :4.00   Median :3.500   Median :5.50   Median :2.250  
##  Mean   :4.22   Mean   :4.040   Mean   :5.57   Mean   :3.170  
##  3rd Qu.:6.00   3rd Qu.:6.500   3rd Qu.:7.50   3rd Qu.:4.875  
##  Max.   :9.00   Max.   :9.000   Max.   :9.00   Max.   :8.500  
## 
t.test(MainStudy$MRYouTube,MainStudy$MRFacebook)
## 
##  Welch Two Sample t-test
## 
## data:  MainStudy$MRYouTube and MainStudy$MRFacebook
## t = 1.2293, df = 96.807, p-value = 0.2219
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.2294196  0.9760863
## sample estimates:
## mean of x mean of y 
##  7.013333  6.640000
t.test(MainStudy$MRYouTube,MainStudy$MRTwitter)
## 
##  Welch Two Sample t-test
## 
## data:  MainStudy$MRYouTube and MainStudy$MRTwitter
## t = 4.5105, df = 93.294, p-value = 1.88e-05
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.8209743 2.1123590
## sample estimates:
## mean of x mean of y 
##  7.013333  5.546667
t.test(MainStudy$MRFacebook,MainStudy$MRTwitter) ## Two levels of Content Vividness
## 
##  Welch Two Sample t-test
## 
## data:  MainStudy$MRFacebook and MainStudy$MRTwitter
## t = 3.2105, df = 96.688, p-value = 0.001799
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.4174128 1.7692539
## sample estimates:
## mean of x mean of y 
##  6.640000  5.546667
mean(MainStudy$MRYouTube)
## [1] 7.013333
sd(MainStudy$MRYouTube)
## [1] 1.431679
mean(MainStudy$MRFacebook)
## [1] 6.64
sd(MainStudy$MRFacebook)
## [1] 1.60051
mean(MainStudy$MRTwitter)
## [1] 5.546667
sd(MainStudy$MRTwitter)
## [1] 1.799168
t.test(MainStudy$TSYouTube,MainStudy$TSFacebook)
## 
##  Welch Two Sample t-test
## 
## data:  MainStudy$TSYouTube and MainStudy$TSFacebook
## t = -4.743, df = 83.499, p-value = 8.585e-06
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -2.923775 -1.196225
## sample estimates:
## mean of x mean of y 
##      5.32      7.38
t.test(MainStudy$TSYouTube,MainStudy$TSTwitter)
## 
##  Welch Two Sample t-test
## 
## data:  MainStudy$TSYouTube and MainStudy$TSTwitter
## t = -0.78715, df = 97.235, p-value = 0.4331
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -1.3733189  0.5933189
## sample estimates:
## mean of x mean of y 
##      5.32      5.71
t.test(MainStudy$TSFacebook,MainStudy$TSTwitter) ## Two levels of Tie Str
## 
##  Welch Two Sample t-test
## 
## data:  MainStudy$TSFacebook and MainStudy$TSTwitter
## t = 4.0882, df = 87.81, p-value = 9.599e-05
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.8581796 2.4818204
## sample estimates:
## mean of x mean of y 
##      7.38      5.71
mean(MainStudy$TSYouTube)
## [1] 5.32
sd(MainStudy$TSYouTube)
## [1] 2.584806
mean(MainStudy$TSFacebook)
## [1] 7.38
sd(MainStudy$TSFacebook)
## [1] 1.658497
mean(MainStudy$TSTwitter)
## [1] 5.71
sd(MainStudy$TSTwitter)
## [1] 2.364901
MainStudyMelt1<-melt(MainStudy,id.vars=c("ResponseId","X3","V3","TSFacebook","TSTwitter","TSYouTube","TSInstagram","TSPinterest","TSSnapChat","TSLinkedIn","TSSecondLife"),measure.vars=c("TSFacebook","TSTwitter","TSYouTube","TSInstagram","TSPinterest","TSSnapChat","TSLinkedIn","TSSecondLife"),variable.name="SMP", value.name="TieStrength")
MainStudyMelt2<-melt(MainStudy,id.vars=c("ResponseId","X3","V3","MRFacebook","MRTwitter","MRYouTube","MRInstagram","MRPinterest","MRSnapChat","MRLinkedIn","MRSecondLife"),measure.vars=c("MRFacebook","MRTwitter","MRYouTube","MRInstagram","MRPinterest","MRSnapChat","MRLinkedIn","MRSecondLife"),variable.name="SMP", value.name="MediaRichness")
MainStudyMelt<-cbind(MainStudyMelt1,MainStudyMelt2)

hist(MainStudyMelt$TieStrength)

plot(density(MainStudyMelt$TieStrength))

screeplot(prcomp(cbind(MainStudyMelt$SMP,MainStudyMelt$TieStrength),type="lines"))
## Warning: In prcomp.default(cbind(MainStudyMelt$SMP, MainStudyMelt$TieStrength), 
##     type = "lines") :
##  extra argument 'type' will be disregarded

summary(prcomp(cbind(MainStudyMelt$SMP,MainStudyMelt$TieStrength)))
## Importance of components%s:
##                           PC1    PC2
## Standard deviation     2.9096 1.9372
## Proportion of Variance 0.6928 0.3071
## Cumulative Proportion  0.6928 1.0000
## At least two components
mydata<-data.frame(MainStudyMelt$TieStrength)
wss <- (nrow(mydata)-1)*sum(apply(mydata,2,var))
for (i in 2:15) wss[i] <- sum(kmeans(mydata, 
                                     centers=i)$withinss)
plot(1:15, wss, type="b", xlab="Number of Clusters",
     ylab="Within groups sum of squares")

wss<-wss/sum(wss)*100
for (i in 2:15)
  wss[i]<-wss[i]+wss[i-1]
plot(1:15, wss, type="b", xlab="Number of Clusters",
     ylab="% Var explained")
wss
##  [1]  63.92178  79.98327  86.29516  89.96238  92.14484  93.93989  95.10378
##  [8]  95.98143  98.11696  98.59247  98.95988  99.44536  99.67426  99.87121
## [15] 100.00000
## 3 clusters explain more than 80% of the variance
abline(v=3,lty=2)

d <- dist(mydata,method="euclidean") # distance matrix
fit <- hclust(d, method="ward") 
## The "ward" method has been renamed to "ward.D"; note new "ward.D2"
plot(fit) # display dendogram all raw data
groups <- cutree(fit,k=3) # cut tree into 3 clusters
rect.hclust(fit,k=3,border="red") # draw dendogram with red borders around the 4 clusters 

mydata2<-aggregate(MainStudyMelt$TieStrength,list(MainStudyMelt$SMP),mean)
rownames(mydata2)<-c("Facebook","Twitter","YouTube","Instagram","Pinterest",
                     "SnapChat","LinkedIn","SecondLife")
d<-dist(mydata2,method="euclidean") # distance matrix
## Warning in dist(mydata2, method = "euclidean"): NAs introduced by coercion
fit <- hclust(d, method="ward") 
## The "ward" method has been renamed to "ward.D"; note new "ward.D2"
plot(fit,ylab="Tie strength") # display dendogram mean by SMP
groups <- cutree(fit,k=3) # cut tree into 4 clusters
rect.hclust(fit,k=3,border="red") # draw dendogram with red borders around the 4 clusters 

hist(MainStudyMelt$MediaRichness)

plot(density(MainStudyMelt$MediaRichness))

screeplot(prcomp(cbind(MainStudyMelt$SMP,MainStudyMelt$MediaRichness),type="lines"))
## Warning: In prcomp.default(cbind(MainStudyMelt$SMP, MainStudyMelt$MediaRichness), 
##     type = "lines") :
##  extra argument 'type' will be disregarded

summary(prcomp(cbind(MainStudyMelt$SMP,MainStudyMelt$MediaRichness)))
## Importance of components%s:
##                           PC1    PC2
## Standard deviation     2.5873 1.6883
## Proportion of Variance 0.7014 0.2987
## Cumulative Proportion  0.7014 1.0000
## At least two components
mydata<-data.frame(MainStudyMelt$MediaRichness)
wss <- (nrow(mydata)-1)*sum(apply(mydata,2,var))
for (i in 2:15) wss[i] <- sum(kmeans(mydata, 
                                     centers=i)$withinss)
plot(1:15, wss, type="b", xlab="Number of Clusters",
     ylab="Within groups sum of squares")

wss<-wss/sum(wss)*100
for (i in 2:15)
  wss[i]<-wss[i]+wss[i-1]
plot(1:15, wss, type="b", xlab="Number of Clusters",
     ylab="% Var explained")
wss
##  [1]  56.97477  72.13680  80.73386  85.51758  89.35718  91.52489  93.28846
##  [8]  94.54336  95.41749  97.07264  97.71886  98.53486  99.20590  99.66907
## [15] 100.00000
## 3 clusters explain more than 80% of the variance
abline(v=3,lty=2)

d <- dist(mydata,method="euclidean") # distance matrix
fit <- hclust(d, method="ward") 
## The "ward" method has been renamed to "ward.D"; note new "ward.D2"
plot(fit) # display dendogram all raw data
groups <- cutree(fit,k=3) # cut tree into 3 clusters
rect.hclust(fit,k=3,border="red") # draw dendogram with red borders around the 4 clusters 

mydata2<-aggregate(MainStudyMelt$MediaRichness,list(MainStudyMelt$SMP),mean)
rownames(mydata2)<-c("Facebook","Twitter","YouTube","Instagram","Pinterest",
                     "SnapChat","LinkedIn","SecondLife")
d<-dist(mydata2,method="euclidean") # distance matrix
## Warning in dist(mydata2, method = "euclidean"): NAs introduced by coercion
fit <- hclust(d, method="ward") 
## The "ward" method has been renamed to "ward.D"; note new "ward.D2"
plot(fit,ylab="Content vividness") # display dendogram mean by SMP
groups <- cutree(fit,k=3) # cut tree into 4 clusters
rect.hclust(fit,k=3,border="red") # draw dendogram with red borders around the 4 clusters 

## STUDY 1 (SECONDARY DATA)
cat("\014")  # cleans screen

rm(list=ls(all=TRUE))  # remove variables in working memory
setwd("C:/Users/Erik Ernesto Vazquez/Documents")  # sets working directory

X<-read.csv("E-Retailer.csv", skip=0, header=T)  # reads raw data from Qualtrics
X<-subset(X,X$Merchandise.Category=="Apparel/Accessories"|
            X$Merchandise.Category=="Computers/Electronics"|
            X$Merchandise.Category=="Health/Beauty")

X$ProdCat<-ifelse(X$Merchandise.Category=="Computers/Electronics","Search",
                  ifelse(X$Merchandise.Category=="Apparel/Accessories","Experience",
                         "Credence"))
X$ProdCatLvl<-ifelse(X$Merchandise.Category=="Computers/Electronics",3,
                     ifelse(X$Merchandise.Category=="Apparel/Accessories",2,
                            1))
X$WebOnly<-ifelse(X$Merchant.Type=="Web Only",1,0)
X$RetailChain<-ifelse(X$Merchant.Type=="Retail Chain",1,0)
X$ConsumerBM<-ifelse(X$Merchant.Type=="Consumer Brand Manufacturer",1,0)
X$CatalogCallCenter<-ifelse(X$Merchant.Type=="Catallog/Call Center",1,0)

X$ConsistencyLvl<-ifelse(X$Consistency=="Poor",1,
                      ifelse(X$Consistency=="Fair",2,
                             ifelse(X$Consistency=="Good",3,
                             4)))

X$PersonalizationBinary<-ifelse(X$Personalization=="",0,1)

X$ConsistencyLvl<-ifelse(X$Consistency=="Poor",1,
                         ifelse(X$Consistency=="Fair",2,
                                ifelse(X$Consistency=="Good",3,
                                       4)))
X$Mobile.Commerce.PlatformBinary<-ifelse(X$Mobile.Commerce.Platform=="",0,1)

X$X2011.Annual.Visits<-X$X2011.Monthly.Visits*12

table(X$Merchandise.Category)
## 
##          Apparel/Accessories Automotive Parts/Accessories 
##                          139                            0 
##            Books/Music/Video        Computers/Electronics 
##                            0                           48 
##                Flowers/Gifts                    Food/Drug 
##                            0                            0 
##    Hardware/Home Improvement                Health/Beauty 
##                            0                           29 
##  Housewares/Home Furnishings                      Jewelry 
##                            0                            0 
##                Mass Merchant              Office Supplies 
##                            0                            0 
##        Specialty/Non-Apparel               Sporting Goods 
##                            0                            0 
##                 Toys/Hobbies 
##                            0
count(X,c("Merchandise.Category","Merchant.Type"))
##     Merchandise.Category               Merchant.Type freq
## 1    Apparel/Accessories         Catalog/Call Center   17
## 2    Apparel/Accessories Consumer Brand Manufacturer   34
## 3    Apparel/Accessories                Retail Chain   60
## 4    Apparel/Accessories                    Web Only   28
## 5  Computers/Electronics         Catalog/Call Center    7
## 6  Computers/Electronics Consumer Brand Manufacturer   12
## 7  Computers/Electronics                Retail Chain    9
## 8  Computers/Electronics                    Web Only   20
## 9          Health/Beauty         Catalog/Call Center    3
## 10         Health/Beauty Consumer Brand Manufacturer    3
## 11         Health/Beauty                Retail Chain    7
## 12         Health/Beauty                    Web Only   16
count(X,c("Merchandise.Category","Mobile.Commerce.PlatformBinary"))
##    Merchandise.Category Mobile.Commerce.PlatformBinary freq
## 1   Apparel/Accessories                              0   95
## 2   Apparel/Accessories                              1   44
## 3 Computers/Electronics                              0   39
## 4 Computers/Electronics                              1    9
## 5         Health/Beauty                              0   15
## 6         Health/Beauty                              1   14
aggregate(X$X2011.Annual.Visits,list(X$Merchandise.Category),mean)
##                 Group.1         x
## 1   Apparel/Accessories  43070925
## 2 Computers/Electronics 183258367
## 3         Health/Beauty  27888090
aggregate(X$X2011.Annual.Visits,list(X$Merchandise.Category),sd)
##                 Group.1         x
## 1   Apparel/Accessories  59335237
## 2 Computers/Electronics 868808208
## 3         Health/Beauty  64033836
leveneTest(X$X2011.Annual.Visits,X$Merchandise.Category)
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value  Pr(>F)  
## group   2  2.4274 0.09071 .
##       213                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
fit<-(lm(X2011.Annual.Visits~ProdCatLvl+WebOnly+RetailChain+
             ConsumerBM+ConsistencyLvl+PersonalizationBinary+
           Mobile.Commerce.PlatformBinary,data=X,x=T))
vif(fit)
##                     ProdCatLvl                        WebOnly 
##                       1.050945                       2.422315 
##                    RetailChain                     ConsumerBM 
##                       2.483937                       2.192398 
##                 ConsistencyLvl          PersonalizationBinary 
##                       1.043076                       1.057326 
## Mobile.Commerce.PlatformBinary 
##                       1.070315
summary(fit) ## H1a Not supported
## 
## Call:
## lm(formula = X2011.Annual.Visits ~ ProdCatLvl + WebOnly + RetailChain + 
##     ConsumerBM + ConsistencyLvl + PersonalizationBinary + Mobile.Commerce.PlatformBinary, 
##     data = X, x = T)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -283817308  -89400048  -31368030   38690661 5711382692 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                    -203206992  155593642  -1.306   0.1930  
## ProdCatLvl                       85059986   48640424   1.749   0.0818 .
## WebOnly                         -10475055   95503197  -0.110   0.9128  
## RetailChain                      20398481   92472769   0.221   0.8256  
## ConsumerBM                      120294333   99064444   1.214   0.2260  
## ConsistencyLvl                   29087502   23238394   1.252   0.2121  
## PersonalizationBinary           -32131496   57712032  -0.557   0.5783  
## Mobile.Commerce.PlatformBinary   15176372   62667114   0.242   0.8089  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 411800000 on 208 degrees of freedom
## Multiple R-squared:  0.04266,    Adjusted R-squared:  0.01044 
## F-statistic: 1.324 on 7 and 208 DF,  p-value: 0.2402
aggregate(X$X2011.Conversion.Rate,list(X$Merchandise.Category),mean)
##                 Group.1          x
## 1   Apparel/Accessories 0.02956835
## 2 Computers/Electronics 0.02250000
## 3         Health/Beauty 0.05655172
aggregate(X$X2011.Conversion.Rate,list(X$Merchandise.Category),sd)
##                 Group.1          x
## 1   Apparel/Accessories 0.01735689
## 2 Computers/Electronics 0.01344809
## 3         Health/Beauty 0.03819834
leveneTest(X$X2011.Conversion.Rate,X$Merchandise.Category)
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value   Pr(>F)    
## group   2   8.454 0.000293 ***
##       213                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
fit<-(lm(X2011.Conversion.Rate~ProdCatLvl+WebOnly+RetailChain+
           ConsumerBM+ConsistencyLvl+PersonalizationBinary+
           Mobile.Commerce.PlatformBinary,X))
vif(fit)
##                     ProdCatLvl                        WebOnly 
##                       1.050945                       2.422315 
##                    RetailChain                     ConsumerBM 
##                       2.483937                       2.192398 
##                 ConsistencyLvl          PersonalizationBinary 
##                       1.043076                       1.057326 
## Mobile.Commerce.PlatformBinary 
##                       1.070315
summary(fit) ## H1b Approved
## 
## Call:
## lm(formula = X2011.Conversion.Rate ~ ProdCatLvl + WebOnly + RetailChain + 
##     ConsumerBM + ConsistencyLvl + PersonalizationBinary + Mobile.Commerce.PlatformBinary, 
##     data = X)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.045984 -0.009485 -0.003161  0.007115  0.103892 
## 
## Coefficients:
##                                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                     0.089544   0.007047  12.708  < 2e-16 ***
## ProdCatLvl                     -0.015505   0.002203  -7.039 2.77e-11 ***
## WebOnly                        -0.017721   0.004325  -4.097 5.99e-05 ***
## RetailChain                    -0.029782   0.004188  -7.111 1.81e-11 ***
## ConsumerBM                     -0.028788   0.004486  -6.417 9.24e-10 ***
## ConsistencyLvl                 -0.001202   0.001052  -1.142    0.255    
## PersonalizationBinary          -0.003177   0.002614  -1.215    0.226    
## Mobile.Commerce.PlatformBinary  0.004473   0.002838   1.576    0.117    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.01865 on 208 degrees of freedom
## Multiple R-squared:  0.3628, Adjusted R-squared:  0.3413 
## F-statistic: 16.92 on 7 and 208 DF,  p-value: < 2.2e-16
cat("\014")  # cleans screen

rm(list=ls(all=TRUE))  # remove variables in working memory
setwd("C:/Users/Erik Ernesto Vazquez/Documents")  # sets working directory

MainStudy<-read.csv("Main Study 1158 April 2017.csv", skip=2, header=F)  # reads raw data from Qualtrics
names(MainStudy)<-names(read.csv("Main Study 1158 April 2017.csv")) # assigns headers and names to data frame
MainStudy<-subset(MainStudy,MainStudy$X60<5) ## Non-repeated measures
MainStudy1<-subset(MainStudy,MainStudy$X207=="YouTube-Search")
MainStudy2<-subset(MainStudy,MainStudy$X207=="YouTube-Experience")
MainStudy3<-subset(MainStudy,MainStudy$X207=="YouTube-Credence")
MainStudy4<-subset(MainStudy,MainStudy$X207=="Facebook-Search")
MainStudy5<-subset(MainStudy,MainStudy$X207=="Facebook-Experience")
MainStudy6<-subset(MainStudy,MainStudy$X207=="Facebook-Credence")
MainStudy7<-subset(MainStudy,MainStudy$X207=="Twitter-Search")
MainStudy8<-subset(MainStudy,MainStudy$X207=="Twitter-Experience")
MainStudy9<-subset(MainStudy,MainStudy$X207=="Twitter-Credence")

MainStudy1<-MainStudy1[order(MainStudy1$X188),]
MainStudy2<-MainStudy2[order(MainStudy2$X188),]
MainStudy3<-MainStudy3[order(MainStudy3$X188,MainStudy3$X202,MainStudy3$X117),]
MainStudy4<-MainStudy4[order(MainStudy4$X188),]
MainStudy5<-MainStudy5[order(MainStudy5$X188),]
MainStudy6<-MainStudy6[order(MainStudy6$X188),]
MainStudy7<-MainStudy7[order(MainStudy7$X188,MainStudy7$X187),]
MainStudy8<-MainStudy8[order(MainStudy8$X188,MainStudy8$X187),]
MainStudy9<-MainStudy9[order(MainStudy9$X188,MainStudy9$X187),]

MainStudy<-rbind(MainStudy1[1:50,],MainStudy1[120:71,],
                 MainStudy2[1:50,],MainStudy2[123:74,],
                 MainStudy3[1:47,],MainStudy3[48:97,],MainStudy3[7,],MainStudy3[15,],MainStudy3[17,],
                 MainStudy4[1:50,],MainStudy4[122:73,],
                 MainStudy5[1:50,],MainStudy5[110:61,],
                 MainStudy6[1:50,],MainStudy6[119:70,],
                 MainStudy7[1:50,],MainStudy7[58:107,],
                 MainStudy8[1:50,],MainStudy8[52:101,],
                 MainStudy9[1:50,],MainStudy9[72:121,])
write.csv(MainStudy,file="MainStudy.csv")
table(MainStudy$X188,MainStudy$X207)
##    
##     Facebook-Credence Facebook-Experience Facebook-Search Twitter-Credence
##   1                50                  50              50               50
##   2                50                  50              50               50
##    
##     Twitter-Experience Twitter-Search YouTube-Credence YouTube-Experience
##   1                 50             50               50                 50
##   2                 50             50               50                 50
##    
##     YouTube-Search
##   1             50
##   2             50
aggregate(MainStudy$X117,list(MainStudy$X207),mean)
##               Group.1        x
## 1   Facebook-Credence 62.05320
## 2 Facebook-Experience 59.73800
## 3     Facebook-Search 60.32524
## 4    Twitter-Credence 63.94979
## 5  Twitter-Experience 59.04020
## 6      Twitter-Search 62.52855
## 7    YouTube-Credence 59.51666
## 8  YouTube-Experience 61.98686
## 9      YouTube-Search 65.29600
aggregate(scale(MainStudy$X117),list(MainStudy$X207),mean)
##               Group.1          V1
## 1   Facebook-Credence  0.02642300
## 2 Facebook-Experience -0.10971201
## 3     Facebook-Search -0.07518198
## 4    Twitter-Credence  0.13794352
## 5  Twitter-Experience -0.15074302
## 6      Twitter-Search  0.05437384
## 7    YouTube-Credence -0.12272692
## 8  YouTube-Experience  0.02252217
## 9      YouTube-Search  0.21710139
aggregate(MainStudy$X117,list(MainStudy$X207),sd)
##               Group.1        x
## 1   Facebook-Credence 16.85373
## 2 Facebook-Experience 16.71092
## 3     Facebook-Search 18.32444
## 4    Twitter-Credence 17.18115
## 5  Twitter-Experience 17.59770
## 6      Twitter-Search 18.11519
## 7    YouTube-Credence 15.11658
## 8  YouTube-Experience 16.33752
## 9      YouTube-Search 16.18982
summary(aov(X187~X207,MainStudy)) ## Age
##              Df Sum Sq Mean Sq F value Pr(>F)
## X207          8    856  107.00   1.115   0.35
## Residuals   891  85509   95.97
chisq.test(MainStudy$X207,MainStudy$X188) ## Gender
## 
##  Pearson's Chi-squared test
## 
## data:  MainStudy$X207 and MainStudy$X188
## X-squared = 0, df = 8, p-value = 1
summary(aov(X189~X207,MainStudy)) ## Income
##              Df Sum Sq Mean Sq F value Pr(>F)
## X207          8     16   1.995     0.5  0.857
## Residuals   891   3554   3.989
summary(aov(X194~X207,MainStudy)) ## Education
##              Df Sum Sq Mean Sq F value Pr(>F)
## X207          8     27   3.432   0.922  0.498
## Residuals   891   3318   3.724
summary(aov(X202~X207,MainStudy)) ## Location 1
##              Df Sum Sq Mean Sq F value Pr(>F)
## X207          8    146   18.22   0.616  0.765
## Residuals   891  26353   29.58
summary(aov(X203~X207,MainStudy)) ## Location 2
##              Df Sum Sq Mean Sq F value Pr(>F)
## X207          8   1672   209.0   0.352  0.945
## Residuals   891 528906   593.6
summary(aov(X117~X207,MainStudy)) ## StimuliTime
##              Df Sum Sq Mean Sq F value Pr(>F)
## X207          8   3638   454.8   1.581  0.126
## Residuals   891 256376   287.7
summary(aov(X60~X207,MainStudy)) ## BrandFam
##              Df Sum Sq Mean Sq F value Pr(>F)
## X207          8    3.5  0.4344   1.025  0.415
## Residuals   891  377.8  0.4240
summary(aov(X187~X206,MainStudy)) ## Age
##              Df Sum Sq Mean Sq F value Pr(>F)
## X206          2     69   34.61    0.36  0.698
## Residuals   897  86296   96.20
chisq.test(MainStudy$X206,MainStudy$X188) ## Gender
## 
##  Pearson's Chi-squared test
## 
## data:  MainStudy$X206 and MainStudy$X188
## X-squared = 0, df = 2, p-value = 1
summary(aov(X189~X206,MainStudy)) ## Income
##              Df Sum Sq Mean Sq F value Pr(>F)
## X206          2      1   0.343   0.086  0.917
## Residuals   897   3570   3.979
summary(aov(X194~X206,MainStudy)) ## Education
##              Df Sum Sq Mean Sq F value Pr(>F)
## X206          2      5   2.434   0.654   0.52
## Residuals   897   3341   3.724
summary(aov(X202~X206,MainStudy)) ## Location 1
##              Df Sum Sq Mean Sq F value Pr(>F)
## X206          2     49   24.28   0.823  0.439
## Residuals   897  26450   29.49
summary(aov(X203~X206,MainStudy)) ## Location 2
##              Df Sum Sq Mean Sq F value Pr(>F)
## X206          2    131    65.3    0.11  0.895
## Residuals   897 530448   591.4
summary(aov(X117~X206,MainStudy)) ## StimuliTime
##              Df Sum Sq Mean Sq F value Pr(>F)
## X206          2    934   467.0   1.617  0.199
## Residuals   897 259080   288.8
summary(aov(X60~X206,MainStudy)) ## BrandFam
##              Df Sum Sq Mean Sq F value Pr(>F)
## X206          2    1.1  0.5344   1.261  0.284
## Residuals   897  380.2  0.4239
summary(aov(X187~X205,MainStudy)) ## Age
##              Df Sum Sq Mean Sq F value Pr(>F)
## X205          2     58   29.15   0.303  0.739
## Residuals   897  86307   96.22
chisq.test(MainStudy$X205,MainStudy$X188) ## Gender
## 
##  Pearson's Chi-squared test
## 
## data:  MainStudy$X205 and MainStudy$X188
## X-squared = 0, df = 2, p-value = 1
summary(aov(X189~X205,MainStudy)) ## Income
##              Df Sum Sq Mean Sq F value Pr(>F)
## X205          2      8   3.803   0.958  0.384
## Residuals   897   3563   3.972
summary(aov(X194~X205,MainStudy)) ## Education
##              Df Sum Sq Mean Sq F value Pr(>F)
## X205          2     13   6.341   1.707  0.182
## Residuals   897   3333   3.716
summary(aov(X202~X205,MainStudy)) ## Location 1
##              Df Sum Sq Mean Sq F value Pr(>F)
## X205          2     48   23.75   0.806  0.447
## Residuals   897  26451   29.49
summary(aov(X203~X205,MainStudy)) ## Location 2
##              Df Sum Sq Mean Sq F value Pr(>F)
## X205          2    686   343.2   0.581   0.56
## Residuals   897 529892   590.7
summary(aov(X117~X205,MainStudy)) ## StimuliTime
##              Df Sum Sq Mean Sq F value Pr(>F)
## X205          2    391   195.3   0.675   0.51
## Residuals   897 259624   289.4
summary(aov(X60~X205,MainStudy)) ## BrandFam
##              Df Sum Sq Mean Sq F value Pr(>F)
## X205          2    0.1  0.0544   0.128   0.88
## Residuals   897  381.2  0.4249
aov.out<-aov(X60~X207,MainStudy)
TukeyHSD(aov.out)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = X60 ~ X207, data = MainStudy)
## 
## $X207
##                                                 diff        lwr       upr
## Facebook-Experience-Facebook-Credence   4.000000e-02 -0.2463386 0.3263386
## Facebook-Search-Facebook-Credence       1.700000e-01 -0.1163386 0.4563386
## Twitter-Credence-Facebook-Credence     -1.000000e-02 -0.2963386 0.2763386
## Twitter-Experience-Facebook-Credence    1.000000e-01 -0.1863386 0.3863386
## Twitter-Search-Facebook-Credence        7.000000e-02 -0.2163386 0.3563386
## YouTube-Credence-Facebook-Credence      7.000000e-02 -0.2163386 0.3563386
## YouTube-Experience-Facebook-Credence    1.600000e-01 -0.1263386 0.4463386
## YouTube-Search-Facebook-Credence        1.000000e-02 -0.2763386 0.2963386
## Facebook-Search-Facebook-Experience     1.300000e-01 -0.1563386 0.4163386
## Twitter-Credence-Facebook-Experience   -5.000000e-02 -0.3363386 0.2363386
## Twitter-Experience-Facebook-Experience  6.000000e-02 -0.2263386 0.3463386
## Twitter-Search-Facebook-Experience      3.000000e-02 -0.2563386 0.3163386
## YouTube-Credence-Facebook-Experience    3.000000e-02 -0.2563386 0.3163386
## YouTube-Experience-Facebook-Experience  1.200000e-01 -0.1663386 0.4063386
## YouTube-Search-Facebook-Experience     -3.000000e-02 -0.3163386 0.2563386
## Twitter-Credence-Facebook-Search       -1.800000e-01 -0.4663386 0.1063386
## Twitter-Experience-Facebook-Search     -7.000000e-02 -0.3563386 0.2163386
## Twitter-Search-Facebook-Search         -1.000000e-01 -0.3863386 0.1863386
## YouTube-Credence-Facebook-Search       -1.000000e-01 -0.3863386 0.1863386
## YouTube-Experience-Facebook-Search     -1.000000e-02 -0.2963386 0.2763386
## YouTube-Search-Facebook-Search         -1.600000e-01 -0.4463386 0.1263386
## Twitter-Experience-Twitter-Credence     1.100000e-01 -0.1763386 0.3963386
## Twitter-Search-Twitter-Credence         8.000000e-02 -0.2063386 0.3663386
## YouTube-Credence-Twitter-Credence       8.000000e-02 -0.2063386 0.3663386
## YouTube-Experience-Twitter-Credence     1.700000e-01 -0.1163386 0.4563386
## YouTube-Search-Twitter-Credence         2.000000e-02 -0.2663386 0.3063386
## Twitter-Search-Twitter-Experience      -3.000000e-02 -0.3163386 0.2563386
## YouTube-Credence-Twitter-Experience    -3.000000e-02 -0.3163386 0.2563386
## YouTube-Experience-Twitter-Experience   6.000000e-02 -0.2263386 0.3463386
## YouTube-Search-Twitter-Experience      -9.000000e-02 -0.3763386 0.1963386
## YouTube-Credence-Twitter-Search        -2.220446e-16 -0.2863386 0.2863386
## YouTube-Experience-Twitter-Search       9.000000e-02 -0.1963386 0.3763386
## YouTube-Search-Twitter-Search          -6.000000e-02 -0.3463386 0.2263386
## YouTube-Experience-YouTube-Credence     9.000000e-02 -0.1963386 0.3763386
## YouTube-Search-YouTube-Credence        -6.000000e-02 -0.3463386 0.2263386
## YouTube-Search-YouTube-Experience      -1.500000e-01 -0.4363386 0.1363386
##                                            p adj
## Facebook-Experience-Facebook-Credence  0.9999661
## Facebook-Search-Facebook-Credence      0.6511750
## Twitter-Credence-Facebook-Credence     1.0000000
## Twitter-Experience-Facebook-Credence   0.9762166
## Twitter-Search-Facebook-Credence       0.9978162
## YouTube-Credence-Facebook-Credence     0.9978162
## YouTube-Experience-Facebook-Credence   0.7231143
## YouTube-Search-Facebook-Credence       1.0000000
## Facebook-Search-Facebook-Experience    0.8934258
## Twitter-Credence-Facebook-Experience   0.9998145
## Twitter-Experience-Facebook-Experience 0.9992813
## Twitter-Search-Facebook-Experience     0.9999964
## YouTube-Credence-Facebook-Experience   0.9999964
## YouTube-Experience-Facebook-Experience 0.9304868
## YouTube-Search-Facebook-Experience     0.9999964
## Twitter-Credence-Facebook-Search       0.5756534
## Twitter-Experience-Facebook-Search     0.9978162
## Twitter-Search-Facebook-Search         0.9762166
## YouTube-Credence-Facebook-Search       0.9762166
## YouTube-Experience-Facebook-Search     1.0000000
## YouTube-Search-Facebook-Search         0.7231143
## Twitter-Experience-Twitter-Credence    0.9576724
## Twitter-Search-Twitter-Credence        0.9944689
## YouTube-Credence-Twitter-Credence      0.9944689
## YouTube-Experience-Twitter-Credence    0.6511750
## YouTube-Search-Twitter-Credence        0.9999999
## Twitter-Search-Twitter-Experience      0.9999964
## YouTube-Credence-Twitter-Experience    0.9999964
## YouTube-Experience-Twitter-Experience  0.9992813
## YouTube-Search-Twitter-Experience      0.9878511
## YouTube-Credence-Twitter-Search        1.0000000
## YouTube-Experience-Twitter-Search      0.9878511
## YouTube-Search-Twitter-Search          0.9992813
## YouTube-Experience-YouTube-Credence    0.9878511
## YouTube-Search-YouTube-Credence        0.9992813
## YouTube-Search-YouTube-Experience      0.7887943
Demographics<-cbind(MainStudy[187:189],MainStudy[194:195],MainStudy[202:207])
Demographics$Age<-2014-MainStudy$X187
Demographics$Income<-MainStudy$X189
Demographics$Education<-MainStudy$X194
Demographics$Location1<-Demographics$X202
Demographics$Location2<-Demographics$X203

Demographics$AgeRange<-ifelse(Demographics$Age<21,1,ifelse(Demographics$Age>50,5,ifelse(Demographics$Age>20&Demographics$Age<29,2,ifelse(Demographics$Age>28&Demographics$Age<35,3,4))))
Demographics$IncomeRange<-ifelse(Demographics$Income<3,1,ifelse(Demographics$Income>7,5,ifelse(Demographics$Income>2&Demographics$Income<5,2,ifelse(Demographics$Income>4&Demographics$Income<7,3,4))))
Demographics$EducationRange<-ifelse(Demographics$Education<8,1,ifelse(Demographics$Education>12,5,ifelse(Demographics$Education==8,2,ifelse(Demographics$Education==12,4,3))))
nrow(Demographics)
## [1] 900
ftable(Demographics$AgeRange~Demographics$X207)
##                     Demographics$AgeRange  1  2  3  4  5
## Demographics$X207                                       
## Facebook-Credence                          4 39 21 28  8
## Facebook-Experience                        4 36 26 26  8
## Facebook-Search                            6 37 21 32  4
## Twitter-Credence                           0 43 18 33  6
## Twitter-Experience                         5 46 18 28  3
## Twitter-Search                             0 44 17 31  8
## YouTube-Credence                           4 46 20 26  4
## YouTube-Experience                         6 35 18 35  6
## YouTube-Search                             7 36 20 30  7
aggregate(Demographics$Age,list(Demographics$X207),mean)
##               Group.1     x
## 1   Facebook-Credence 33.05
## 2 Facebook-Experience 33.09
## 3     Facebook-Search 32.20
## 4    Twitter-Credence 33.81
## 5  Twitter-Experience 30.54
## 6      Twitter-Search 33.23
## 7    YouTube-Credence 31.20
## 8  YouTube-Experience 32.66
## 9      YouTube-Search 32.62
aggregate(Demographics$Age,list(Demographics$X207),sd)
##               Group.1         x
## 1   Facebook-Credence 10.517302
## 2 Facebook-Experience 10.157442
## 3     Facebook-Search  9.443078
## 4    Twitter-Credence  9.908363
## 5  Twitter-Experience  8.559265
## 6      Twitter-Search  9.946173
## 7    YouTube-Credence  9.467648
## 8  YouTube-Experience  9.677862
## 9      YouTube-Search 10.349235
ftable(Demographics$IncomeRange~Demographics$X207)
##                     Demographics$IncomeRange  1  2  3  4  5
## Demographics$X207                                          
## Facebook-Credence                            17 26 45 11  1
## Facebook-Experience                          28 28 25 17  2
## Facebook-Search                              22 31 33 12  2
## Twitter-Credence                             19 36 31  9  5
## Twitter-Experience                           18 28 37 11  6
## Twitter-Search                               24 26 27 16  7
## YouTube-Credence                             26 32 28 13  1
## YouTube-Experience                           28 21 33 15  3
## YouTube-Search                               25 24 34 10  7
aggregate(Demographics$Income,list(Demographics$X207),mean)
##               Group.1    x
## 1   Facebook-Credence 4.38
## 2 Facebook-Experience 4.13
## 3     Facebook-Search 4.20
## 4    Twitter-Credence 4.29
## 5  Twitter-Experience 4.53
## 6      Twitter-Search 4.48
## 7    YouTube-Credence 4.15
## 8  YouTube-Experience 4.23
## 9      YouTube-Search 4.34
aggregate(Demographics$Income,list(Demographics$X207),sd)
##               Group.1        x
## 1   Facebook-Credence 1.830052
## 2 Facebook-Experience 2.082418
## 3     Facebook-Search 1.974586
## 4    Twitter-Credence 1.810714
## 5  Twitter-Experience 1.971796
## 6      Twitter-Search 2.171812
## 7    YouTube-Credence 1.929960
## 8  YouTube-Experience 2.073668
## 9      YouTube-Search 2.099639
ftable(Demographics$Income~Demographics$X207)
##                     Demographics$Income  1  2  3  4  5  6  7  8  9
## Demographics$X207                                                 
## Facebook-Credence                       13  4 11 15 31 14 11  1  0
## Facebook-Experience                     11 17 15 13 15 10 17  1  1
## Facebook-Search                         14  8 14 17 18 15 12  2  0
## Twitter-Credence                         4 15 15 21 24  7  9  4  1
## Twitter-Experience                       8 10 12 16 24 13 11  4  2
## Twitter-Search                          11 13  8 18 17 10 16  5  2
## YouTube-Credence                        11 15  6 26 16 12 13  0  1
## YouTube-Experience                      12 16 10 11 22 11 15  3  0
## YouTube-Search                          11 14  9 15 24 10 10  5  2
ftable(Demographics$EducationRange~Demographics$X207)
##                     Demographics$EducationRange  1  2  3  4  5
## Demographics$X207                                             
## Facebook-Credence                                2  8 45 32 13
## Facebook-Experience                              0 14 43 29 14
## Facebook-Search                                  0 10 41 33 16
## Twitter-Credence                                 2 12 43 28 15
## Twitter-Experience                               1 10 35 40 14
## Twitter-Search                                   2  8 43 30 17
## YouTube-Credence                                 3 13 35 37 12
## YouTube-Experience                               5 15 42 25 13
## YouTube-Search                                   5  9 39 31 16
aggregate(Demographics$Education,list(Demographics$X207),mean)
##               Group.1     x
## 1   Facebook-Credence 10.58
## 2 Facebook-Experience 10.61
## 3     Facebook-Search 10.81
## 4    Twitter-Credence 10.49
## 5  Twitter-Experience 10.81
## 6      Twitter-Search 10.67
## 7    YouTube-Credence 10.46
## 8  YouTube-Experience 10.21
## 9      YouTube-Search 10.56
aggregate(Demographics$Education,list(Demographics$X207),sd)
##               Group.1        x
## 1   Facebook-Credence 1.837763
## 2 Facebook-Experience 1.879689
## 3     Facebook-Search 1.709717
## 4    Twitter-Credence 2.081642
## 5  Twitter-Experience 1.846071
## 6      Twitter-Search 1.885913
## 7    YouTube-Credence 2.012185
## 8  YouTube-Experience 2.031544
## 9      YouTube-Search 2.051459
ftable(Demographics$Education~Demographics$X207)
##                     Demographics$Education  1  5  6  7  8  9 10 11 12 13 14 15
## Demographics$X207                                                             
## Facebook-Credence                           0  0  1  1  8 34  2  9 32 11  1  1
## Facebook-Experience                         0  0  0  0 14 27  7  9 29  9  3  2
## Facebook-Search                             0  0  0  0 10 23  9  9 33 15  1  0
## Twitter-Credence                            1  0  0  1 12 29  5  9 28 12  2  1
## Twitter-Experience                          0  0  0  1 10 26  6  3 40 11  1  2
## Twitter-Search                              0  0  0  2  8 32  6  5 30 13  3  1
## YouTube-Credence                            0  1  1  1 13 31  3  1 37 10  0  2
## YouTube-Experience                          0  0  1  4 15 33  4  5 25  9  2  2
## YouTube-Search                              0  1  0  4  9 28  9  2 31 11  3  2
aggregate(Demographics$Location1,list(Demographics$X207),mean)
##               Group.1        x
## 1   Facebook-Credence 36.79035
## 2 Facebook-Experience 37.14975
## 3     Facebook-Search 37.33771
## 4    Twitter-Credence 37.03470
## 5  Twitter-Experience 36.62884
## 6      Twitter-Search 37.80277
## 7    YouTube-Credence 37.34193
## 8  YouTube-Experience 37.81276
## 9      YouTube-Search 37.67040
aggregate(Demographics$Location1,list(Demographics$X207),sd)
##               Group.1        x
## 1   Facebook-Credence 6.154053
## 2 Facebook-Experience 5.607674
## 3     Facebook-Search 5.496958
## 4    Twitter-Credence 4.865277
## 5  Twitter-Experience 5.355676
## 6      Twitter-Search 5.547963
## 7    YouTube-Credence 5.225834
## 8  YouTube-Experience 4.847807
## 9      YouTube-Search 5.719205
aggregate(Demographics$Location2,list(Demographics$X207),mean)
##               Group.1         x
## 1   Facebook-Credence -86.74644
## 2 Facebook-Experience -87.63357
## 3     Facebook-Search -88.75820
## 4    Twitter-Credence -90.68666
## 5  Twitter-Experience -87.78349
## 6      Twitter-Search -90.70321
## 7    YouTube-Credence -88.57208
## 8  YouTube-Experience -90.53339
## 9      YouTube-Search -88.93982
aggregate(Demographics$Location2,list(Demographics$X207),sd)
##               Group.1        x
## 1   Facebook-Credence 24.82919
## 2 Facebook-Experience 25.62070
## 3     Facebook-Search 26.75240
## 4    Twitter-Credence 23.05074
## 5  Twitter-Experience 27.10145
## 6      Twitter-Search 26.45972
## 7    YouTube-Credence 23.55533
## 8  YouTube-Experience 15.74071
## 9      YouTube-Search 24.19343
aggregate(MainStudy$X117,list(MainStudy$X207),mean)
##               Group.1        x
## 1   Facebook-Credence 62.05320
## 2 Facebook-Experience 59.73800
## 3     Facebook-Search 60.32524
## 4    Twitter-Credence 63.94979
## 5  Twitter-Experience 59.04020
## 6      Twitter-Search 62.52855
## 7    YouTube-Credence 59.51666
## 8  YouTube-Experience 61.98686
## 9      YouTube-Search 65.29600
aggregate(MainStudy$X117,list(MainStudy$X207),sd)
##               Group.1        x
## 1   Facebook-Credence 16.85373
## 2 Facebook-Experience 16.71092
## 3     Facebook-Search 18.32444
## 4    Twitter-Credence 17.18115
## 5  Twitter-Experience 17.59770
## 6      Twitter-Search 18.11519
## 7    YouTube-Credence 15.11658
## 8  YouTube-Experience 16.33752
## 9      YouTube-Search 16.18982
aggregate(MainStudy$X60,list(MainStudy$X207),mean)
##               Group.1    x
## 1   Facebook-Credence 1.30
## 2 Facebook-Experience 1.34
## 3     Facebook-Search 1.47
## 4    Twitter-Credence 1.29
## 5  Twitter-Experience 1.40
## 6      Twitter-Search 1.37
## 7    YouTube-Credence 1.37
## 8  YouTube-Experience 1.46
## 9      YouTube-Search 1.31
aggregate(MainStudy$X60,list(MainStudy$X207),sd)
##               Group.1         x
## 1   Facebook-Credence 0.5595814
## 2 Facebook-Experience 0.6699917
## 3     Facebook-Search 0.7971540
## 4    Twitter-Credence 0.6558979
## 5  Twitter-Experience 0.6513389
## 6      Twitter-Search 0.5252224
## 7    YouTube-Credence 0.6912878
## 8  YouTube-Experience 0.6878454
## 9      YouTube-Search 0.5807519
## Location of the sample
map(database="world", ylim=c(36,40), xlim=c(-99,-95), col="white", fill=TRUE, projection="gilbert", orientation= c(90,0,225))
lon<-as.character(Demographics$Location2)
lat<-as.character(Demographics$Location1)
coord<-mapproject(lon, lat, proj="gilbert", orientation=c(90, 0, 225))
points(coord, pch=20, cex=0.8, col="black")

cronbach(cbind(MainStudy$X126,MainStudy$X127,MainStudy$X128,MainStudy$X134,MainStudy$X135)) ## Quality Alpha 0.82 Good
## $sample.size
## [1] 900
## 
## $number.of.items
## [1] 5
## 
## $alpha
## [1] 0.9084386
MainStudy$Quality<-(MainStudy$X126+MainStudy$X127+MainStudy$X128+MainStudy$X134+MainStudy$X135)/5
2014-mean(MainStudy$X187)
## [1] 32.48889
sd(MainStudy$X187)
## [1] 9.801415
aggregate(2014-MainStudy$X187,list(MainStudy$X207),mean)
##               Group.1     x
## 1   Facebook-Credence 33.05
## 2 Facebook-Experience 33.09
## 3     Facebook-Search 32.20
## 4    Twitter-Credence 33.81
## 5  Twitter-Experience 30.54
## 6      Twitter-Search 33.23
## 7    YouTube-Credence 31.20
## 8  YouTube-Experience 32.66
## 9      YouTube-Search 32.62
aggregate(MainStudy$X187,list(MainStudy$X207),sd)
##               Group.1         x
## 1   Facebook-Credence 10.517302
## 2 Facebook-Experience 10.157442
## 3     Facebook-Search  9.443078
## 4    Twitter-Credence  9.908363
## 5  Twitter-Experience  8.559265
## 6      Twitter-Search  9.946173
## 7    YouTube-Credence  9.467648
## 8  YouTube-Experience  9.677862
## 9      YouTube-Search 10.349235
aggregate(MainStudy$Quality,list(MainStudy$X207),mean)
##               Group.1     x
## 1   Facebook-Credence 5.402
## 2 Facebook-Experience 5.792
## 3     Facebook-Search 5.336
## 4    Twitter-Credence 5.254
## 5  Twitter-Experience 5.732
## 6      Twitter-Search 6.126
## 7    YouTube-Credence 5.514
## 8  YouTube-Experience 5.970
## 9      YouTube-Search 6.276
aggregate(MainStudy$Quality,list(MainStudy$X207),sd)
##               Group.1         x
## 1   Facebook-Credence 1.2363174
## 2 Facebook-Experience 1.0909805
## 3     Facebook-Search 1.6572778
## 4    Twitter-Credence 1.4269711
## 5  Twitter-Experience 1.2398175
## 6      Twitter-Search 1.2819351
## 7    YouTube-Credence 1.2408062
## 8  YouTube-Experience 1.0852082
## 9      YouTube-Search 0.9972812
## Brand Familiarity
aggregate(MainStudy$X60,list(MainStudy$X207),mean)
##               Group.1    x
## 1   Facebook-Credence 1.30
## 2 Facebook-Experience 1.34
## 3     Facebook-Search 1.47
## 4    Twitter-Credence 1.29
## 5  Twitter-Experience 1.40
## 6      Twitter-Search 1.37
## 7    YouTube-Credence 1.37
## 8  YouTube-Experience 1.46
## 9      YouTube-Search 1.31
aggregate(MainStudy$X60,list(MainStudy$X207),sd)
##               Group.1         x
## 1   Facebook-Credence 0.5595814
## 2 Facebook-Experience 0.6699917
## 3     Facebook-Search 0.7971540
## 4    Twitter-Credence 0.6558979
## 5  Twitter-Experience 0.6513389
## 6      Twitter-Search 0.5252224
## 7    YouTube-Credence 0.6912878
## 8  YouTube-Experience 0.6878454
## 9      YouTube-Search 0.5807519
mean(MainStudy$X60)
## [1] 1.367778
sd(MainStudy$X60)
## [1] 0.6512293
## Effects of content richness and product cat on quality
aggregate(MainStudy$Quality,list(MainStudy$X207),mean)
##               Group.1     x
## 1   Facebook-Credence 5.402
## 2 Facebook-Experience 5.792
## 3     Facebook-Search 5.336
## 4    Twitter-Credence 5.254
## 5  Twitter-Experience 5.732
## 6      Twitter-Search 6.126
## 7    YouTube-Credence 5.514
## 8  YouTube-Experience 5.970
## 9      YouTube-Search 6.276
aggregate(MainStudy$Quality,list(MainStudy$X207),sd)
##               Group.1         x
## 1   Facebook-Credence 1.2363174
## 2 Facebook-Experience 1.0909805
## 3     Facebook-Search 1.6572778
## 4    Twitter-Credence 1.4269711
## 5  Twitter-Experience 1.2398175
## 6      Twitter-Search 1.2819351
## 7    YouTube-Credence 1.2408062
## 8  YouTube-Experience 1.0852082
## 9      YouTube-Search 0.9972812
aov.out<-aov(Quality~X207,MainStudy)
TukeyHSD(aov.out)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = Quality ~ X207, data = MainStudy)
## 
## $X207
##                                          diff         lwr         upr
## Facebook-Experience-Facebook-Credence   0.390 -0.16611075  0.94611075
## Facebook-Search-Facebook-Credence      -0.066 -0.62211075  0.49011075
## Twitter-Credence-Facebook-Credence     -0.148 -0.70411075  0.40811075
## Twitter-Experience-Facebook-Credence    0.330 -0.22611075  0.88611075
## Twitter-Search-Facebook-Credence        0.724  0.16788925  1.28011075
## YouTube-Credence-Facebook-Credence      0.112 -0.44411075  0.66811075
## YouTube-Experience-Facebook-Credence    0.568  0.01188925  1.12411075
## YouTube-Search-Facebook-Credence        0.874  0.31788925  1.43011075
## Facebook-Search-Facebook-Experience    -0.456 -1.01211075  0.10011075
## Twitter-Credence-Facebook-Experience   -0.538 -1.09411075  0.01811075
## Twitter-Experience-Facebook-Experience -0.060 -0.61611075  0.49611075
## Twitter-Search-Facebook-Experience      0.334 -0.22211075  0.89011075
## YouTube-Credence-Facebook-Experience   -0.278 -0.83411075  0.27811075
## YouTube-Experience-Facebook-Experience  0.178 -0.37811075  0.73411075
## YouTube-Search-Facebook-Experience      0.484 -0.07211075  1.04011075
## Twitter-Credence-Facebook-Search       -0.082 -0.63811075  0.47411075
## Twitter-Experience-Facebook-Search      0.396 -0.16011075  0.95211075
## Twitter-Search-Facebook-Search          0.790  0.23388925  1.34611075
## YouTube-Credence-Facebook-Search        0.178 -0.37811075  0.73411075
## YouTube-Experience-Facebook-Search      0.634  0.07788925  1.19011075
## YouTube-Search-Facebook-Search          0.940  0.38388925  1.49611075
## Twitter-Experience-Twitter-Credence     0.478 -0.07811075  1.03411075
## Twitter-Search-Twitter-Credence         0.872  0.31588925  1.42811075
## YouTube-Credence-Twitter-Credence       0.260 -0.29611075  0.81611075
## YouTube-Experience-Twitter-Credence     0.716  0.15988925  1.27211075
## YouTube-Search-Twitter-Credence         1.022  0.46588925  1.57811075
## Twitter-Search-Twitter-Experience       0.394 -0.16211075  0.95011075
## YouTube-Credence-Twitter-Experience    -0.218 -0.77411075  0.33811075
## YouTube-Experience-Twitter-Experience   0.238 -0.31811075  0.79411075
## YouTube-Search-Twitter-Experience       0.544 -0.01211075  1.10011075
## YouTube-Credence-Twitter-Search        -0.612 -1.16811075 -0.05588925
## YouTube-Experience-Twitter-Search      -0.156 -0.71211075  0.40011075
## YouTube-Search-Twitter-Search           0.150 -0.40611075  0.70611075
## YouTube-Experience-YouTube-Credence     0.456 -0.10011075  1.01211075
## YouTube-Search-YouTube-Credence         0.762  0.20588925  1.31811075
## YouTube-Search-YouTube-Experience       0.306 -0.25011075  0.86211075
##                                            p adj
## Facebook-Experience-Facebook-Credence  0.4192655
## Facebook-Search-Facebook-Credence      0.9999904
## Twitter-Credence-Facebook-Credence     0.9960400
## Twitter-Experience-Facebook-Credence   0.6518033
## Twitter-Search-Facebook-Credence       0.0018343
## YouTube-Credence-Facebook-Credence     0.9994629
## YouTube-Experience-Facebook-Credence   0.0409829
## YouTube-Search-Facebook-Credence       0.0000426
## Facebook-Search-Facebook-Experience    0.2099053
## Twitter-Credence-Facebook-Experience   0.0669387
## Twitter-Experience-Facebook-Experience 0.9999954
## Twitter-Search-Facebook-Experience     0.6364544
## YouTube-Credence-Facebook-Experience   0.8290689
## YouTube-Experience-Facebook-Experience 0.9863260
## YouTube-Search-Facebook-Experience     0.1469837
## Twitter-Credence-Facebook-Search       0.9999487
## Twitter-Experience-Facebook-Search     0.3972076
## Twitter-Search-Facebook-Search         0.0003822
## YouTube-Credence-Facebook-Search       0.9863260
## YouTube-Experience-Facebook-Search     0.0122796
## YouTube-Search-Facebook-Search         0.0000065
## Twitter-Experience-Twitter-Credence    0.1591300
## Twitter-Search-Twitter-Credence        0.0000450
## YouTube-Credence-Twitter-Credence      0.8762935
## YouTube-Experience-Twitter-Credence    0.0021969
## YouTube-Search-Twitter-Credence        0.0000005
## Twitter-Search-Twitter-Experience      0.4045090
## YouTube-Credence-Twitter-Experience    0.9523703
## YouTube-Experience-Twitter-Experience  0.9220249
## YouTube-Search-Twitter-Experience      0.0608634
## YouTube-Credence-Twitter-Search        0.0186954
## YouTube-Experience-Twitter-Search      0.9943145
## YouTube-Search-Twitter-Search          0.9956550
## YouTube-Experience-YouTube-Credence    0.2099053
## YouTube-Search-YouTube-Credence        0.0007565
## YouTube-Search-YouTube-Experience      0.7398261
summary(aov(Quality~X205+X206,MainStudy))
##              Df Sum Sq Mean Sq F value   Pr(>F)    
## X205          2   25.2  12.620   7.751  0.00046 ***
## X206          2   47.5  23.729  14.574 5.91e-07 ***
## Residuals   895 1457.2   1.628                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
aggregate(MainStudy$Quality,list(MainStudy$X205),mean)
##    Group.1     x
## 1 Facebook 5.510
## 2  Twitter 5.704
## 3  YouTube 5.920
aggregate(MainStudy$Quality,list(MainStudy$X205),sd)
##    Group.1        x
## 1 Facebook 1.360221
## 2  Twitter 1.361923
## 3  YouTube 1.152110
aggregate(MainStudy$Quality,list(MainStudy$X206),mean)
##      Group.1        x
## 1   Credence 5.390000
## 2 Experience 5.831333
## 3     Search 5.912667
aggregate(MainStudy$Quality,list(MainStudy$X206),sd)
##      Group.1        x
## 1   Credence 1.304392
## 2 Experience 1.141591
## 3     Search 1.397647
aov.out<-aov(Quality~X205+X206,MainStudy)
TukeyHSD(aov.out)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = Quality ~ X205 + X206, data = MainStudy)
## 
## $X205
##                   diff        lwr       upr     p adj
## Twitter-Facebook 0.194 -0.0505869 0.4385869 0.1504328
## YouTube-Facebook 0.410  0.1654131 0.6545869 0.0002637
## YouTube-Twitter  0.216 -0.0285869 0.4605869 0.0960073
## 
## $X206
##                           diff        lwr       upr     p adj
## Experience-Credence 0.44133333  0.1967464 0.6859202 0.0000744
## Search-Credence     0.52266667  0.2780798 0.7672536 0.0000019
## Search-Experience   0.08133333 -0.1632536 0.3259202 0.7150230
MainStudy$TieStr<-ifelse(MainStudy$X205=="Facebook","Strong","Weak")
MainStudy$TieStrLvl<-ifelse(MainStudy$X205=="Facebook",3,
                            ifelse(MainStudy$X205=="Twitter",2,1))
MainStudy$MR<-ifelse(MainStudy$X205=="Twitter","Poor","Rich")
MainStudy$MRLvl<-ifelse(MainStudy$X205=="Twitter",1,
                        ifelse(MainStudy$X205=="Facebook",2,3))
MainStudy$Pure<-ifelse(MainStudy$X205=="YouTube","Mix","Pure")

MainStudyX<-subset(MainStudy,MainStudy$X206=="Search")
aggregate(MainStudyX$Quality,list(MainStudyX$MR),mean)
##   Group.1     x
## 1    Poor 6.126
## 2    Rich 5.806
aggregate(MainStudyX$Quality,list(MainStudyX$MR),sd)
##   Group.1        x
## 1    Poor 1.281935
## 2    Rich 1.443323
## Cohen d 0.23442944671866184 and effect size r 0.11641770326988482
## above small effect size
## using https://www.uccs.edu/lbecker/
aggregate(MainStudyX$Quality,list(MainStudyX$TieStr),mean)
##   Group.1     x
## 1  Strong 5.336
## 2    Weak 6.201
aggregate(MainStudyX$Quality,list(MainStudyX$TieStr),sd)
##   Group.1        x
## 1  Strong 1.657278
## 2    Weak 1.148037
## Cohen d 0.6067703798001213 and effect size r 0.29031841991493496
## above medium effect size
## Cohen suggests that d values of 0.2, 0.5, and 0.8 
## represent small, medium, and large effect sizes respectively
## Hence, above small effect from vividness vs above medium effect from tie str
## H1b approved
t.test(Quality~TieStr,MainStudyX) ## H1a approved
## 
##  Welch Two Sample t-test
## 
## data:  Quality by TieStr
## t = -4.6873, df = 147.97, p-value = 6.229e-06
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -1.2296777 -0.5003223
## sample estimates:
## mean in group Strong   mean in group Weak 
##                5.336                6.201
summary(lm(Quality~TieStrLvl,MainStudyX))
## 
## Call:
## lm(formula = Quality ~ TieStrLvl, data = MainStudyX)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.4427 -0.7977  0.0173  1.0173  3.0873 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  6.85267    0.20560  33.329  < 2e-16 ***
## TieStrLvl   -0.47000    0.09518  -4.938 1.32e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.346 on 298 degrees of freedom
## Multiple R-squared:  0.07564,    Adjusted R-squared:  0.07254 
## F-statistic: 24.39 on 1 and 298 DF,  p-value: 1.316e-06
t.test(Quality~MR,MainStudyX)
## 
##  Welch Two Sample t-test
## 
## data:  Quality by MR
## t = 1.9529, df = 220.25, p-value = 0.0521
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.002930428  0.642930428
## sample estimates:
## mean in group Poor mean in group Rich 
##              6.126              5.806
summary(lm(Quality~MRLvl,MainStudyX))
## 
## Call:
## lm(formula = Quality ~ MRLvl, data = MainStudyX)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.9127 -0.8377  0.0123  1.0123  3.1623 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   5.7627     0.2137  26.973   <2e-16 ***
## MRLvl         0.0750     0.0989   0.758    0.449    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.399 on 298 degrees of freedom
## Multiple R-squared:  0.001926,   Adjusted R-squared:  -0.001423 
## F-statistic: 0.5751 on 1 and 298 DF,  p-value: 0.4488
MainStudyX<-subset(MainStudy,MainStudy$X206=="Experience")
aggregate(MainStudyX$Quality,list(MainStudyX$MR),mean)
##   Group.1     x
## 1    Poor 5.732
## 2    Rich 5.881
aggregate(MainStudyX$Quality,list(MainStudyX$MR),sd)
##   Group.1        x
## 1    Poor 1.239818
## 2    Rich 1.089022
## Cohen d 0.12769328761125776 and effect size r 0.06371690827553132
## below small effect-size
aggregate(MainStudyX$Quality,list(MainStudyX$TieStr),mean)
##   Group.1     x
## 1  Strong 5.792
## 2    Weak 5.851
aggregate(MainStudyX$Quality,list(MainStudyX$TieStr),sd)
##   Group.1        x
## 1  Strong 1.090980
## 2    Weak 1.168256
## Cohen d 0.052199519508090444 and effect size r 0.02609087474810489
## below small effect-size
## Cohen suggests that d values of 0.2, 0.5, and 0.8 
## represent small, medium, and large effect sizes respectively
## Hence, small effect from vividness vs small effect from tie str
## the effect of content vividness is only 2.4x greater than vividness
## in this context the effect are considered similar
## it should be +5x the difference to be considered different 
## according to the Cohen's d comparisons
## H3b approved
12/5
## [1] 2.4
t.test(Quality~TieStr,MainStudyX) ## H3a rejected
## 
##  Welch Two Sample t-test
## 
## data:  Quality by TieStr
## t = -0.43115, df = 210.62, p-value = 0.6668
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.3287609  0.2107609
## sample estimates:
## mean in group Strong   mean in group Weak 
##                5.792                5.851
summary(lm(Quality~TieStrLvl,MainStudyX))
## 
## Call:
## lm(formula = Quality ~ TieStrLvl, data = MainStudyX)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.8313 -0.7423 -0.1313  0.7909  3.2577 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  6.00933    0.17432  34.473   <2e-16 ***
## TieStrLvl   -0.08900    0.08069  -1.103    0.271    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.141 on 298 degrees of freedom
## Multiple R-squared:  0.004066,   Adjusted R-squared:  0.0007235 
## F-statistic: 1.216 on 1 and 298 DF,  p-value: 0.2709
t.test(Quality~MR,MainStudyX)
## 
##  Welch Two Sample t-test
## 
## data:  Quality by MR
## t = -1.0209, df = 177.01, p-value = 0.3087
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.4370254  0.1390254
## sample estimates:
## mean in group Poor mean in group Rich 
##              5.732              5.881
summary(lm(Quality~MRLvl,MainStudyX))
## 
## Call:
## lm(formula = Quality ~ MRLvl, data = MainStudyX)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.8313 -0.7123 -0.1123  0.8497  3.1687 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  5.59333    0.17404  32.139   <2e-16 ***
## MRLvl        0.11900    0.08056   1.477    0.141    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.139 on 298 degrees of freedom
## Multiple R-squared:  0.007268,   Adjusted R-squared:  0.003937 
## F-statistic: 2.182 on 1 and 298 DF,  p-value: 0.1407
MainStudyX<-subset(MainStudy,MainStudy$X206=="Credence")
aggregate(MainStudyX$Quality,list(MainStudyX$MR),mean)
##   Group.1     x
## 1    Poor 5.254
## 2    Rich 5.458
aggregate(MainStudyX$Quality,list(MainStudyX$MR),sd)
##   Group.1        x
## 1    Poor 1.426971
## 2    Rich 1.236723
## Cohen d 0.15278155887796593 and effect size r 0.07616885908703643
## below small effect size
aggregate(MainStudyX$Quality,list(MainStudyX$TieStr),mean)
##   Group.1     x
## 1  Strong 5.402
## 2    Weak 5.384
aggregate(MainStudyX$Quality,list(MainStudyX$TieStr),sd)
##   Group.1        x
## 1  Strong 1.236317
## 2    Weak 1.340121
## Cohen d 0.013961452515901696 and effect size r 0.00698055617689004
## below small effect size
## Cohen suggests that d values of 0.2, 0.5, and 0.8 
## represent small, medium, and large effect sizes respectively
## Hence, both vividness and tie strength have below small effect size but 
## the effect of vividness is +11x greater than tie strength
15/1.3
## [1] 11.53846
## H3a accepted
t.test(Quality~MR,MainStudyX)
## 
##  Welch Two Sample t-test
## 
## data:  Quality by MR
## t = -1.2189, df = 175.04, p-value = 0.2245
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.5343062  0.1263062
## sample estimates:
## mean in group Poor mean in group Rich 
##              5.254              5.458
summary(lm(Quality~MRLvl,MainStudyX))
## 
## Call:
## lm(formula = Quality ~ MRLvl, data = MainStudyX)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.3900 -0.5200 -0.1900  0.7575  3.7400 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  5.13000    0.19892  25.789   <2e-16 ***
## MRLvl        0.13000    0.09208   1.412    0.159    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.302 on 298 degrees of freedom
## Multiple R-squared:  0.006644,   Adjusted R-squared:  0.003311 
## F-statistic: 1.993 on 1 and 298 DF,  p-value: 0.1591
t.test(Quality~TieStr,MainStudyX) ## H4b rejected but with trends
## 
##  Welch Two Sample t-test
## 
## data:  Quality by TieStr
## t = 0.11555, df = 212.93, p-value = 0.9081
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.2890496  0.3250496
## sample estimates:
## mean in group Strong   mean in group Weak 
##                5.402                5.384
summary(lm(Quality~TieStrLvl,MainStudyX))
## 
## Call:
## lm(formula = Quality ~ TieStrLvl, data = MainStudyX)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -4.390 -0.446 -0.134  0.768  3.610 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  5.50200    0.19946  27.584   <2e-16 ***
## TieStrLvl   -0.05600    0.09233  -0.607    0.545    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.306 on 298 degrees of freedom
## Multiple R-squared:  0.001233,   Adjusted R-squared:  -0.002119 
## F-statistic: 0.3678 on 1 and 298 DF,  p-value: 0.5446
### ALTERNATIVE STUDY WITH VARIABLE PURCH INT
cronbach(cbind(MainStudy$X142,MainStudy$X143,MainStudy$X144)) ## PurchInt Alpha 0.95 Good
## $sample.size
## [1] 900
## 
## $number.of.items
## [1] 3
## 
## $alpha
## [1] 0.9463625
MainStudy$PurchInt<-(MainStudy$X142+MainStudy$X143+MainStudy$X144)/3

## Effects of content richness and product cat on quality
aggregate(MainStudy$PurchInt,list(MainStudy$X207),mean)
##               Group.1        x
## 1   Facebook-Credence 2.663333
## 2 Facebook-Experience 2.856667
## 3     Facebook-Search 3.063333
## 4    Twitter-Credence 2.563333
## 5  Twitter-Experience 2.956667
## 6      Twitter-Search 3.476667
## 7    YouTube-Credence 3.300000
## 8  YouTube-Experience 3.433333
## 9      YouTube-Search 3.693333
aggregate(MainStudy$PurchInt,list(MainStudy$X207),sd)
##               Group.1        x
## 1   Facebook-Credence 1.811235
## 2 Facebook-Experience 1.803635
## 3     Facebook-Search 1.847554
## 4    Twitter-Credence 1.872295
## 5  Twitter-Experience 2.000368
## 6      Twitter-Search 2.081534
## 7    YouTube-Credence 1.867977
## 8  YouTube-Experience 2.179643
## 9      YouTube-Search 2.011013
aov.out<-aov(PurchInt~X207,MainStudy)
TukeyHSD(aov.out)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = PurchInt ~ X207, data = MainStudy)
## 
## $X207
##                                               diff         lwr       upr
## Facebook-Experience-Facebook-Credence   0.19333333 -0.66225748 1.0489242
## Facebook-Search-Facebook-Credence       0.40000000 -0.45559082 1.2555908
## Twitter-Credence-Facebook-Credence     -0.10000000 -0.95559082 0.7555908
## Twitter-Experience-Facebook-Credence    0.29333333 -0.56225748 1.1489242
## Twitter-Search-Facebook-Credence        0.81333333 -0.04225748 1.6689242
## YouTube-Credence-Facebook-Credence      0.63666667 -0.21892415 1.4922575
## YouTube-Experience-Facebook-Credence    0.77000000 -0.08559082 1.6255908
## YouTube-Search-Facebook-Credence        1.03000000  0.17440918 1.8855908
## Facebook-Search-Facebook-Experience     0.20666667 -0.64892415 1.0622575
## Twitter-Credence-Facebook-Experience   -0.29333333 -1.14892415 0.5622575
## Twitter-Experience-Facebook-Experience  0.10000000 -0.75559082 0.9555908
## Twitter-Search-Facebook-Experience      0.62000000 -0.23559082 1.4755908
## YouTube-Credence-Facebook-Experience    0.44333333 -0.41225748 1.2989242
## YouTube-Experience-Facebook-Experience  0.57666667 -0.27892415 1.4322575
## YouTube-Search-Facebook-Experience      0.83666667 -0.01892415 1.6922575
## Twitter-Credence-Facebook-Search       -0.50000000 -1.35559082 0.3555908
## Twitter-Experience-Facebook-Search     -0.10666667 -0.96225748 0.7489242
## Twitter-Search-Facebook-Search          0.41333333 -0.44225748 1.2689242
## YouTube-Credence-Facebook-Search        0.23666667 -0.61892415 1.0922575
## YouTube-Experience-Facebook-Search      0.37000000 -0.48559082 1.2255908
## YouTube-Search-Facebook-Search          0.63000000 -0.22559082 1.4855908
## Twitter-Experience-Twitter-Credence     0.39333333 -0.46225748 1.2489242
## Twitter-Search-Twitter-Credence         0.91333333  0.05774252 1.7689242
## YouTube-Credence-Twitter-Credence       0.73666667 -0.11892415 1.5922575
## YouTube-Experience-Twitter-Credence     0.87000000  0.01440918 1.7255908
## YouTube-Search-Twitter-Credence         1.13000000  0.27440918 1.9855908
## Twitter-Search-Twitter-Experience       0.52000000 -0.33559082 1.3755908
## YouTube-Credence-Twitter-Experience     0.34333333 -0.51225748 1.1989242
## YouTube-Experience-Twitter-Experience   0.47666667 -0.37892415 1.3322575
## YouTube-Search-Twitter-Experience       0.73666667 -0.11892415 1.5922575
## YouTube-Credence-Twitter-Search        -0.17666667 -1.03225748 0.6789242
## YouTube-Experience-Twitter-Search      -0.04333333 -0.89892415 0.8122575
## YouTube-Search-Twitter-Search           0.21666667 -0.63892415 1.0722575
## YouTube-Experience-YouTube-Credence     0.13333333 -0.72225748 0.9889242
## YouTube-Search-YouTube-Credence         0.39333333 -0.46225748 1.2489242
## YouTube-Search-YouTube-Experience       0.26000000 -0.59559082 1.1155908
##                                            p adj
## Facebook-Experience-Facebook-Credence  0.9987561
## Facebook-Search-Facebook-Credence      0.8763194
## Twitter-Credence-Facebook-Credence     0.9999915
## Twitter-Experience-Facebook-Credence   0.9788078
## Twitter-Search-Facebook-Credence       0.0774089
## YouTube-Credence-Facebook-Credence     0.3347652
## YouTube-Experience-Facebook-Credence   0.1171999
## YouTube-Search-Facebook-Credence       0.0060055
## Facebook-Search-Facebook-Experience    0.9979945
## Twitter-Credence-Facebook-Experience   0.9788078
## Twitter-Experience-Facebook-Experience 0.9999915
## Twitter-Search-Facebook-Experience     0.3721506
## YouTube-Credence-Facebook-Experience   0.7987520
## YouTube-Experience-Facebook-Experience 0.4768534
## YouTube-Search-Facebook-Experience     0.0610479
## Twitter-Credence-Facebook-Search       0.6708217
## Twitter-Experience-Facebook-Search     0.9999859
## Twitter-Search-Facebook-Search         0.8546627
## YouTube-Credence-Facebook-Search       0.9948338
## YouTube-Experience-Facebook-Search     0.9175141
## YouTube-Search-Facebook-Search         0.3494894
## Twitter-Experience-Twitter-Credence    0.8863786
## Twitter-Search-Twitter-Credence        0.0261790
## YouTube-Credence-Twitter-Credence      0.1574417
## YouTube-Experience-Twitter-Credence    0.0427705
## YouTube-Search-Twitter-Credence        0.0014440
## Twitter-Search-Twitter-Experience      0.6210320
## YouTube-Credence-Twitter-Experience    0.9455162
## YouTube-Experience-Twitter-Experience  0.7263958
## YouTube-Search-Twitter-Experience      0.1574417
## YouTube-Credence-Twitter-Search        0.9993547
## YouTube-Experience-Twitter-Search      1.0000000
## YouTube-Search-Twitter-Search          0.9971996
## YouTube-Experience-YouTube-Credence    0.9999217
## YouTube-Search-YouTube-Credence        0.8863786
## YouTube-Search-YouTube-Experience      0.9902684
summary(aov(PurchInt~X205+X206,MainStudy))
##              Df Sum Sq Mean Sq F value   Pr(>F)    
## X205          2     62  31.187   8.253 0.000281 ***
## X206          2     49  24.470   6.476 0.001614 ** 
## Residuals   895   3382   3.779                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
aggregate(MainStudy$PurchInt,list(MainStudy$X205),mean)
##    Group.1        x
## 1 Facebook 2.861111
## 2  Twitter 2.998889
## 3  YouTube 3.475556
aggregate(MainStudy$PurchInt,list(MainStudy$X205),sd)
##    Group.1        x
## 1 Facebook 1.822168
## 2  Twitter 2.015086
## 3  YouTube 2.023403
aggregate(MainStudy$PurchInt,list(MainStudy$X206),mean)
##      Group.1        x
## 1   Credence 2.842222
## 2 Experience 3.082222
## 3     Search 3.411111
aggregate(MainStudy$PurchInt,list(MainStudy$X206),sd)
##      Group.1        x
## 1   Credence 1.873239
## 2 Experience 2.009615
## 3     Search 1.993082
aov.out<-aov(PurchInt~X205+X206,MainStudy)
TukeyHSD(aov.out)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = PurchInt ~ X205 + X206, data = MainStudy)
## 
## $X205
##                       diff        lwr       upr     p adj
## Twitter-Facebook 0.1377778 -0.2348388 0.5103944 0.6606165
## YouTube-Facebook 0.6144444  0.2418278 0.9870610 0.0003416
## YouTube-Twitter  0.4766667  0.1040501 0.8492833 0.0077287
## 
## $X206
##                          diff         lwr       upr     p adj
## Experience-Credence 0.2400000 -0.13261660 0.6126166 0.2856785
## Search-Credence     0.5688889  0.19627229 0.9415055 0.0010376
## Search-Experience   0.3288889 -0.04372771 0.7015055 0.0962469
MainStudy$TieStr<-ifelse(MainStudy$X205=="Facebook","Strong","Weak")
MainStudy$TieStrLvl<-ifelse(MainStudy$X205=="Facebook",3,
                            ifelse(MainStudy$X205=="Twitter",2,1))
MainStudy$MR<-ifelse(MainStudy$X205=="Twitter","Poor","Rich")
MainStudy$MRLvl<-ifelse(MainStudy$X205=="Twitter",1,
                        ifelse(MainStudy$X205=="Facebook",2,3))
MainStudy$Pure<-ifelse(MainStudy$X205=="YouTube","Mix","Pure")

## Monthly Expenses on Category
aggregate(MainStudy$X181,list(MainStudy$X206),mean)
##      Group.1        x
## 1   Credence 23.25663
## 2 Experience 70.60667
## 3     Search 69.70667
aggregate(MainStudy$X181,list(MainStudy$X206),sd)
##      Group.1         x
## 1   Credence  30.98185
## 2 Experience  71.13555
## 3     Search 157.61978
aggregate(MainStudy$X181,list(MainStudy$X207),mean)
##               Group.1       x
## 1   Facebook-Credence 19.8200
## 2 Facebook-Experience 69.0800
## 3     Facebook-Search 53.0000
## 4    Twitter-Credence 22.1599
## 5  Twitter-Experience 72.2000
## 6      Twitter-Search 75.8600
## 7    YouTube-Credence 27.7900
## 8  YouTube-Experience 70.5400
## 9      YouTube-Search 80.2600
aggregate(MainStudy$X181,list(MainStudy$X207),sd)
##               Group.1         x
## 1   Facebook-Credence  29.13687
## 2 Facebook-Experience  65.17648
## 3     Facebook-Search 108.92023
## 4    Twitter-Credence  29.85062
## 5  Twitter-Experience  73.43767
## 6      Twitter-Search 105.03496
## 7    YouTube-Credence  33.54246
## 8  YouTube-Experience  75.08022
## 9      YouTube-Search 227.38787
MainStudyX<-subset(MainStudy,MainStudy$X207=="Facebook-Search"|MainStudy$X207=="YouTube-Search")
t.test(X181~X207,MainStudyX)
## 
##  Welch Two Sample t-test
## 
## data:  X181 by X207
## t = -1.0812, df = 142.16, p-value = 0.2814
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -77.10059  22.58059
## sample estimates:
## mean in group Facebook-Search  mean in group YouTube-Search 
##                         53.00                         80.26
MainStudyX<-subset(MainStudy,MainStudy$X207=="Facebook-Credence"|MainStudy$X207=="YouTube-Credence")
t.test(X181~X207,MainStudyX) ## there is a difference in prices for credence groups
## 
##  Welch Two Sample t-test
## 
## data:  X181 by X207
## t = -1.7938, df = 194.2, p-value = 0.0744
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -16.7327927   0.7927927
## sample estimates:
## mean in group Facebook-Credence  mean in group YouTube-Credence 
##                           19.82                           27.79
MainStudyX<-subset(MainStudy,MainStudy$X206=="Search")
aggregate(MainStudyX$PurchInt,list(MainStudyX$MR),mean)
##   Group.1        x
## 1    Poor 3.476667
## 2    Rich 3.378333
aggregate(MainStudyX$PurchInt,list(MainStudyX$MR),sd)
##   Group.1        x
## 1    Poor 2.081534
## 2    Rich 1.951871
## Cohen d 0.0496 and effect-size r 0.0247
## below small effect size
## from https://www.uccs.edu/lbecker/
aggregate(MainStudyX$PurchInt,list(MainStudyX$TieStr),mean)
##   Group.1        x
## 1  Strong 3.063333
## 2    Weak 3.585000
aggregate(MainStudyX$PurchInt,list(MainStudyX$TieStr),sd)
##   Group.1        x
## 1  Strong 1.847554
## 2    Weak 2.044316
## Cohen d 0.2677 and effect-size r 0.1326
## above small effect size
## Cohen suggests that d values of 0.2, 0.5, and 0.8 
## represent small, medium, and large effect sizes respectively
## Hence, 0.0496 is below small effect from vividness vs 0.2677 above small effect from tie str
## H1b approved
t.test(PurchInt~TieStr,MainStudyX) ## H1a approved WITH PRUCH INT
## 
##  Welch Two Sample t-test
## 
## data:  PurchInt by TieStr
## t = -2.2238, df = 216.88, p-value = 0.02719
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.98402736 -0.05930598
## sample estimates:
## mean in group Strong   mean in group Weak 
##             3.063333             3.585000
summary(lm(PurchInt~TieStrLvl,MainStudyX))
## 
## Call:
## lm(formula = PurchInt ~ TieStrLvl, data = MainStudyX)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.7261 -1.7444 -0.4111  1.5889  5.2739 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   4.0411     0.3024   13.36   <2e-16 ***
## TieStrLvl    -0.3150     0.1400   -2.25   0.0252 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.98 on 298 degrees of freedom
## Multiple R-squared:  0.01671,    Adjusted R-squared:  0.01341 
## F-statistic: 5.064 on 1 and 298 DF,  p-value: 0.02516
t.test(PurchInt~MR,MainStudyX)
## 
##  Welch Two Sample t-test
## 
## data:  PurchInt by MR
## t = 0.39372, df = 187.19, p-value = 0.6942
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.3943601  0.5910267
## sample estimates:
## mean in group Poor mean in group Rich 
##           3.476667           3.378333
summary(lm(PurchInt~MRLvl,MainStudyX))
## 
## Call:
## lm(formula = PurchInt ~ MRLvl, data = MainStudyX)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.5194 -1.6361 -0.4111  1.5889  5.4806 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   3.1944     0.3047  10.485   <2e-16 ***
## MRLvl         0.1083     0.1410   0.768    0.443    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.994 on 298 degrees of freedom
## Multiple R-squared:  0.001976,   Adjusted R-squared:  -0.001373 
## F-statistic: 0.5901 on 1 and 298 DF,  p-value: 0.443
##controlling for monthly expenses on the category
summary(lm(PurchInt~TieStrLvl*X181,MainStudyX))
## 
## Call:
## lm(formula = PurchInt ~ TieStrLvl * X181, data = MainStudyX)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.7596 -1.7596 -0.4181  1.5803  5.2996 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     4.076e+00  3.235e-01  12.598   <2e-16 ***
## TieStrLvl      -3.163e-01  1.520e-01  -2.081   0.0383 *  
## X181           -3.170e-04  1.597e-03  -0.199   0.8428    
## TieStrLvl:X181 -7.797e-05  9.675e-04  -0.081   0.9358    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.985 on 296 degrees of freedom
## Multiple R-squared:  0.01789,    Adjusted R-squared:  0.007934 
## F-statistic: 1.797 on 3 and 296 DF,  p-value: 0.1478
summary(lm(PurchInt~MRLvl*X181,MainStudyX))
## 
## Call:
## lm(formula = PurchInt ~ MRLvl * X181, data = MainStudyX)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.5247 -1.6651 -0.4354  1.5672  5.4932 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  3.2989019  0.3626698   9.096   <2e-16 ***
## MRLvl        0.0752515  0.1608478   0.468    0.640    
## X181        -0.0014377  0.0026388  -0.545    0.586    
## MRLvl:X181   0.0004395  0.0009969   0.441    0.660    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2 on 296 degrees of freedom
## Multiple R-squared:  0.003272,   Adjusted R-squared:  -0.00683 
## F-statistic: 0.3239 on 3 and 296 DF,  p-value: 0.8081
MainStudyX<-subset(MainStudy,MainStudy$X206=="Experience")
aggregate(MainStudyX$PurchInt,list(MainStudyX$MR),mean)
##   Group.1        x
## 1    Poor 2.956667
## 2    Rich 3.145000
aggregate(MainStudyX$PurchInt,list(MainStudyX$MR),sd)
##   Group.1        x
## 1    Poor 2.000368
## 2    Rich 2.016287
## Cohen d 0.0937 and effect size r 0.0468
## below small effect size
aggregate(MainStudyX$PurchInt,list(MainStudyX$TieStr),mean)
##   Group.1        x
## 1  Strong 2.856667
## 2    Weak 3.195000
aggregate(MainStudyX$PurchInt,list(MainStudyX$TieStr),sd)
##   Group.1        x
## 1  Strong 1.803635
## 2    Weak 2.100298
## Cohen d 0.1728 and effect size r 0.0860
## below small effect size
## Cohen suggests that d values of 0.2, 0.5, and 0.8 
## represent small, medium, and large effect sizes respectively
## Hence, small effect from vividness vs small effect from tie str
0.1728/0.0937
## [1] 1.844184
## H3b approved
t.test(PurchInt~TieStr,MainStudyX) ## H3a rejected
## 
##  Welch Two Sample t-test
## 
## data:  PurchInt by TieStr
## t = -1.4481, df = 226.87, p-value = 0.149
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.7987135  0.1220468
## sample estimates:
## mean in group Strong   mean in group Weak 
##             2.856667             3.195000
summary(lm(PurchInt~TieStrLvl,MainStudyX))
## 
## Call:
## lm(formula = PurchInt ~ TieStrLvl, data = MainStudyX)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.3706 -1.7489 -0.7039  1.5394  6.2061 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   3.6589     0.3054   11.98   <2e-16 ***
## TieStrLvl    -0.2883     0.1414   -2.04   0.0423 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.999 on 298 degrees of freedom
## Multiple R-squared:  0.01377,    Adjusted R-squared:  0.01046 
## F-statistic: 4.161 on 1 and 298 DF,  p-value: 0.04226
t.test(PurchInt~MR,MainStudyX)
## 
##  Welch Two Sample t-test
## 
## data:  PurchInt by MR
## t = -0.76669, df = 199.52, p-value = 0.4442
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.6727282  0.2960615
## sample estimates:
## mean in group Poor mean in group Rich 
##           2.956667           3.145000
summary(lm(PurchInt~MRLvl,MainStudyX))
## 
## Call:
## lm(formula = PurchInt ~ MRLvl, data = MainStudyX)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.3206 -1.7489 -0.6539  1.4894  6.1561 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   2.6056     0.3060   8.514  8.4e-16 ***
## MRLvl         0.2383     0.1417   1.682   0.0936 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.003 on 298 degrees of freedom
## Multiple R-squared:  0.009408,   Adjusted R-squared:  0.006084 
## F-statistic:  2.83 on 1 and 298 DF,  p-value: 0.09355
##controlling for monthly expenses on the category
summary(lm(PurchInt~TieStrLvl*X181,MainStudyX))
## 
## Call:
## lm(formula = PurchInt ~ TieStrLvl * X181, data = MainStudyX)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.4881 -1.5550 -0.6043  1.2739  6.0880 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     3.138493   0.417602   7.516 6.78e-13 ***
## TieStrLvl      -0.226502   0.196701  -1.152   0.2505    
## X181            0.007267   0.004135   1.758   0.0798 .  
## TieStrLvl:X181 -0.000827   0.001998  -0.414   0.6792    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.964 on 296 degrees of freedom
## Multiple R-squared:  0.05486,    Adjusted R-squared:  0.04528 
## F-statistic: 5.727 on 3 and 296 DF,  p-value: 0.0008038
summary(lm(PurchInt~MRLvl*X181,MainStudyX))
## 
## Call:
## lm(formula = PurchInt ~ MRLvl * X181, data = MainStudyX)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.6790 -1.4697 -0.5501  1.3714  5.9229 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  1.864775   0.420568   4.434 1.31e-05 ***
## MRLvl        0.404109   0.193027   2.094   0.0372 *  
## X181         0.010289   0.004110   2.503   0.0128 *  
## MRLvl:X181  -0.002256   0.001879  -1.200   0.2309    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.963 on 296 degrees of freedom
## Multiple R-squared:  0.05532,    Adjusted R-squared:  0.04575 
## F-statistic: 5.778 on 3 and 296 DF,  p-value: 0.0007503
MainStudyX<-subset(MainStudy,MainStudy$X206=="Credence")
aggregate(MainStudyX$PurchInt,list(MainStudyX$MR),mean)
##   Group.1        x
## 1    Poor 2.563333
## 2    Rich 2.981667
aggregate(MainStudyX$PurchInt,list(MainStudyX$MR),sd)
##   Group.1        x
## 1    Poor 1.872295
## 2    Rich 1.862737
## Cohen d 0.22 and effect size r 0.11
aggregate(MainStudyX$PurchInt,list(MainStudyX$TieStr),mean)
##   Group.1        x
## 1  Strong 2.663333
## 2    Weak 2.931667
aggregate(MainStudyX$PurchInt,list(MainStudyX$TieStr),sd)
##   Group.1        x
## 1  Strong 1.811235
## 2    Weak 1.901628
## Cohen d 0.14 and effect size r 0.07
## Cohen suggests that d values of 0.2, 0.5, and 0.8 
## represent small, medium, and large effect sizes respectively
## Hence, small effect from vividness vs below small effect from tie str
## they have almos the same effect
22/14
## [1] 1.571429
## H4a rejected
t.test(PurchInt~MR,MainStudyX)
## 
##  Welch Two Sample t-test
## 
## data:  PurchInt by MR
## t = -1.8274, df = 197.21, p-value = 0.06915
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.86977641  0.03310974
## sample estimates:
## mean in group Poor mean in group Rich 
##           2.563333           2.981667
summary(lm(PurchInt~MRLvl,MainStudyX))
## 
## Call:
## lm(formula = PurchInt ~ MRLvl, data = MainStudyX)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.2106 -1.4739 -0.5089  1.1928  5.8594 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   2.1056     0.2829   7.443 1.06e-12 ***
## MRLvl         0.3683     0.1310   2.813  0.00524 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.852 on 298 degrees of freedom
## Multiple R-squared:  0.02586,    Adjusted R-squared:  0.02259 
## F-statistic: 7.911 on 1 and 298 DF,  p-value: 0.005239
t.test(PurchInt~TieStr,MainStudyX) ## H4b rejected
## 
##  Welch Two Sample t-test
## 
## data:  PurchInt by TieStr
## t = -1.1895, df = 206.93, p-value = 0.2356
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.7130645  0.1763978
## sample estimates:
## mean in group Strong   mean in group Weak 
##             2.663333             2.931667
summary(lm(PurchInt~TieStrLvl,MainStudyX))
## 
## Call:
## lm(formula = PurchInt ~ TieStrLvl, data = MainStudyX)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.1606 -1.5239 -0.5239  1.4761  5.8094 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   3.4789     0.2838  12.257   <2e-16 ***
## TieStrLvl    -0.3183     0.1314  -2.423    0.016 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.858 on 298 degrees of freedom
## Multiple R-squared:  0.01932,    Adjusted R-squared:  0.01603 
## F-statistic:  5.87 on 1 and 298 DF,  p-value: 0.016
MainStudy$WOM<-(MainStudy$X151+MainStudy$X152+MainStudy$X153)/3
##controlling for monthly expenses on the category
summary(lm(PurchInt~TieStrLvl*X181,MainStudyX))
## 
## Call:
## lm(formula = PurchInt ~ TieStrLvl * X181, data = MainStudyX)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.3214 -1.5072 -0.5072  1.2053  5.1975 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     3.175548   0.353719   8.978   <2e-16 ***
## TieStrLvl      -0.334196   0.160558  -2.081   0.0383 *  
## X181            0.008489   0.008518   0.997   0.3198    
## TieStrLvl:X181  0.003138   0.004107   0.764   0.4455    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.808 on 296 degrees of freedom
## Multiple R-squared:  0.07769,    Adjusted R-squared:  0.06834 
## F-statistic: 8.311 on 3 and 296 DF,  p-value: 2.524e-05
summary(lm(PurchInt~MRLvl*X181,MainStudyX))
## 
## Call:
## lm(formula = PurchInt ~ MRLvl * X181, data = MainStudyX)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.2238 -1.4753 -0.4898  1.2471  5.5247 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 1.973124   0.345669   5.708 2.77e-08 ***
## MRLvl       0.265581   0.162291   1.636    0.103    
## X181        0.009331   0.009086   1.027    0.305    
## MRLvl:X181  0.002499   0.004047   0.617    0.537    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.801 on 296 degrees of freedom
## Multiple R-squared:  0.08456,    Adjusted R-squared:  0.07528 
## F-statistic: 9.113 on 3 and 296 DF,  p-value: 8.685e-06
## Full model
summary(lm(PurchInt~X181+MRLvl+TieStrLvl,MainStudy))
## 
## Call:
## lm(formula = PurchInt ~ X181 + MRLvl + TieStrLvl, data = MainStudy)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.1739 -1.7257 -0.5936  1.4685  6.0656 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  3.2853341  0.3285095  10.001  < 2e-16 ***
## X181         0.0013906  0.0006284   2.213  0.02716 *  
## MRLvl        0.1160454  0.0920065   1.261  0.20754    
## TieStrLvl   -0.2406961  0.0921079  -2.613  0.00912 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.952 on 896 degrees of freedom
## Multiple R-squared:  0.02319,    Adjusted R-squared:  0.01992 
## F-statistic: 7.091 on 3 and 896 DF,  p-value: 0.0001034
summary(lm(PurchInt~X181+TieStrLvl,MainStudy))
## 
## Call:
## lm(formula = PurchInt ~ X181 + TieStrLvl, data = MainStudy)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.0926 -1.7275 -0.5596  1.5265  6.1242 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  3.6342713  0.1772044  20.509  < 2e-16 ***
## X181         0.0013786  0.0006286   2.193 0.028545 *  
## TieStrLvl   -0.2987922  0.0797897  -3.745 0.000192 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.952 on 897 degrees of freedom
## Multiple R-squared:  0.02146,    Adjusted R-squared:  0.01928 
## F-statistic: 9.835 on 2 and 897 DF,  p-value: 5.954e-05
summary(lm(PurchInt~X181+MRLvl,MainStudy))
## 
## Call:
## lm(formula = PurchInt ~ X181 + MRLvl, data = MainStudy)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.2109 -1.7439 -0.6012  1.4644  5.8212 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 2.5590589  0.1757131  14.564   <2e-16 ***
## X181        0.0014715  0.0006297   2.337   0.0197 *  
## MRLvl       0.2362805  0.0799341   2.956   0.0032 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.958 on 897 degrees of freedom
## Multiple R-squared:  0.01575,    Adjusted R-squared:  0.01355 
## F-statistic: 7.176 on 2 and 897 DF,  p-value: 0.0008094