Creating DVs and condition variables

#trust

m$trust<-(m$ct1+(8-m$ct2)+m$ct3+(8-m$ct4)+m$overall.trust + m$overall.effective)/6
alpha(m[,c(18:23)], check.keys = TRUE)
## Warning in alpha(m[, c(18:23)], check.keys = TRUE): Some items were negatively correlated with total scale and were automatically reversed.
##  This is indicated by a negative sign for the variable name.
## 
## Reliability analysis   
## Call: alpha(x = m[, c(18:23)], check.keys = TRUE)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N  ase mean  sd median_r
##       0.85      0.86    0.85       0.5   6 0.01  3.3 1.1     0.53
## 
##  lower alpha upper     95% confidence boundaries
## 0.83 0.85 0.87 
## 
##  Reliability if an item is dropped:
##                   raw_alpha std.alpha G6(smc) average_r S/N alpha se  var.r
## ct1                    0.83      0.84    0.82      0.50 5.1   0.0120 0.0248
## ct2-                   0.83      0.83    0.82      0.50 5.0   0.0120 0.0281
## ct3-                   0.88      0.88    0.86      0.59 7.2   0.0088 0.0053
## ct4-                   0.82      0.82    0.80      0.48 4.6   0.0129 0.0229
## overall.trust          0.81      0.81    0.79      0.46 4.3   0.0137 0.0203
## overall.effective      0.81      0.81    0.79      0.46 4.3   0.0136 0.0207
##                   med.r
## ct1                0.55
## ct2-               0.56
## ct3-               0.60
## ct4-               0.49
## overall.trust      0.49
## overall.effective  0.50
## 
##  Item statistics 
##                     n raw.r std.r r.cor r.drop mean  sd
## ct1               500  0.76  0.75  0.69   0.63  3.0 1.5
## ct2-              500  0.76  0.76  0.69   0.64  3.4 1.5
## ct3-              500  0.57  0.56  0.41   0.39  3.7 1.5
## ct4-              500  0.80  0.81  0.77   0.71  3.1 1.3
## overall.trust     500  0.85  0.85  0.83   0.77  3.3 1.4
## overall.effective 500  0.84  0.84  0.82   0.76  3.4 1.4
## 
## Non missing response frequency for each item
##                      1    2    3    4    5    6    7 miss
## ct1               0.15 0.27 0.27 0.10 0.14 0.06 0.02    0
## ct2               0.01 0.08 0.15 0.19 0.28 0.20 0.09    0
## ct3               0.03 0.07 0.23 0.15 0.28 0.18 0.05    0
## ct4               0.01 0.05 0.10 0.17 0.36 0.22 0.10    0
## overall.trust     0.10 0.22 0.31 0.15 0.17 0.04 0.02    0
## overall.effective 0.11 0.18 0.26 0.20 0.19 0.05 0.01    0
mean(m$trust)
## [1] 3.424333
#use
m$use<-(m$used_committee + m$purchase + m$use_personally)/3
alpha(m[,c(24:26)], check.keys = TRUE)
## 
## Reliability analysis   
## Call: alpha(x = m[, c(24:26)], check.keys = TRUE)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N    ase mean  sd median_r
##       0.95      0.95    0.93      0.86  18 0.0041    3 1.6     0.85
## 
##  lower alpha upper     95% confidence boundaries
## 0.94 0.95 0.96 
## 
##  Reliability if an item is dropped:
##                raw_alpha std.alpha G6(smc) average_r  S/N alpha se var.r med.r
## used_committee      0.91      0.91    0.83      0.83  9.6   0.0085    NA  0.83
## purchase            0.92      0.92    0.85      0.85 11.0   0.0074    NA  0.85
## use_personally      0.95      0.95    0.90      0.90 18.9   0.0045    NA  0.90
## 
##  Item statistics 
##                  n raw.r std.r r.cor r.drop mean  sd
## used_committee 500  0.96  0.96  0.94   0.92  2.9 1.6
## purchase       500  0.96  0.96  0.93   0.90  2.8 1.6
## use_personally 500  0.94  0.94  0.88   0.86  3.2 1.7
## 
## Non missing response frequency for each item
##                   1    2    3    4    5    6    7 miss
## used_committee 0.23 0.25 0.18 0.10 0.17 0.05 0.01    0
## purchase       0.27 0.25 0.16 0.13 0.12 0.06 0.01    0
## use_personally 0.20 0.21 0.18 0.12 0.19 0.08 0.02    0
mean(m$use)
## [1] 2.976
#conditions
m$sci[m$subjSCI==1 | m$ObjSCI==1]<-"Science"
m$sci[m$subjREG==1 | m$ObjREG==1]<-"Control"

m$SO[m$subjSCI==1 | m$subjREG==1]<-"Subjective"
m$SO[m$ObjSCI==1 | m$ObjREG==1]<-"Objective"

table(m$sci, m$SO)
##          
##           Objective Subjective
##   Control       127        118
##   Science       128        127

ANOVAs, regressions

#excluding people with no hiring experience
table(m$hiring_experience)
## 
##   1   2   3 
## 227 236  37
m<-subset(m, hiring_experience!=3)

mod <- lm(use ~ sci*SO + hiring_experience_2, data=m, contrasts=list(sci=contr.sum, SO=contr.sum))
Anova(mod, type="III")
## Anova Table (Type III tests)
## 
## Response: use
##                      Sum Sq  Df F value    Pr(>F)    
## (Intercept)           44.22   1 18.1264 2.509e-05 ***
## sci                    2.07   1  0.8479   0.35763    
## SO                     0.48   1  0.1953   0.65874    
## hiring_experience_2    8.86   1  3.6296   0.05739 .  
## sci:SO                 0.02   1  0.0089   0.92483    
## Residuals           1117.43 458                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(lm(use~sci+SO , m))
## 
## Call:
## lm(formula = use ~ sci + SO, data = m)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.0656 -1.0656 -0.2006  1.3316  4.0689 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)    2.9311     0.1252  23.418   <2e-16 ***
## sciScience     0.1345     0.1454   0.925    0.356    
## SOSubjective  -0.0638     0.1455  -0.439    0.661    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.565 on 460 degrees of freedom
## Multiple R-squared:  0.002267,   Adjusted R-squared:  -0.002071 
## F-statistic: 0.5227 on 2 and 460 DF,  p-value: 0.5933
mod <- lm(trust ~ sci*SO + hiring_experience_2, data=m, contrasts=list(sci=contr.sum, SO=contr.sum))
Anova(mod, type="III")
## Anova Table (Type III tests)
## 
## Response: trust
##                     Sum Sq  Df F value    Pr(>F)    
## (Intercept)          33.17   1 40.6267 4.501e-10 ***
## sci                   1.32   1  1.6228   0.20335    
## SO                    0.88   1  1.0763   0.30007    
## hiring_experience_2   2.31   1  2.8338   0.09298 .  
## sci:SO                0.05   1  0.0636   0.80106    
## Residuals           373.93 458                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(lm(trust~sci+SO, m))
## 
## Call:
## lm(formula = trust ~ sci + SO, data = m)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.5160 -0.5458  0.0112  0.5708  3.5910 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   3.40897    0.07235  47.119   <2e-16 ***
## sciScience    0.10707    0.08407   1.273    0.203    
## SOSubjective -0.08687    0.08410  -1.033    0.302    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9045 on 460 degrees of freedom
## Multiple R-squared:  0.005798,   Adjusted R-squared:  0.001476 
## F-statistic: 1.341 on 2 and 460 DF,  p-value: 0.2625

APPLICANTS: Creating DVs and condition variables

#trust
a$trust<-(a$ct1+(8-a$ct2)+a$ct3+(8-a$ct4)+a$overall.trust + a$overall.effective)/6
alpha(a[,c(18:23)], check.keys = TRUE)
## Warning in alpha(a[, c(18:23)], check.keys = TRUE): Some items were negatively correlated with total scale and were automatically reversed.
##  This is indicated by a negative sign for the variable name.
## 
## Reliability analysis   
## Call: alpha(x = a[, c(18:23)], check.keys = TRUE)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean  sd median_r
##       0.84      0.85    0.84      0.48 5.6 0.011  3.3 1.1     0.51
## 
##  lower alpha upper     95% confidence boundaries
## 0.82 0.84 0.86 
## 
##  Reliability if an item is dropped:
##                   raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r
## ct1                    0.82      0.82    0.81      0.48 4.6   0.0133 0.032
## ct2-                   0.82      0.82    0.82      0.48 4.7   0.0130 0.038
## ct3-                   0.87      0.88    0.86      0.59 7.1   0.0088 0.007
## ct4-                   0.81      0.81    0.80      0.46 4.3   0.0137 0.032
## overall.trust          0.79      0.79    0.77      0.43 3.8   0.0152 0.023
## overall.effective      0.79      0.80    0.78      0.44 4.0   0.0149 0.025
##                   med.r
## ct1                0.53
## ct2-               0.56
## ct3-               0.58
## ct4-               0.49
## overall.trust      0.49
## overall.effective  0.49
## 
##  Item statistics 
##                     n raw.r std.r r.cor r.drop mean  sd
## ct1               502  0.76  0.76  0.69   0.63  3.1 1.5
## ct2-              502  0.75  0.75  0.67   0.62  3.3 1.4
## ct3-              502  0.54  0.52  0.36   0.34  3.6 1.5
## ct4-              502  0.78  0.79  0.74   0.68  3.0 1.2
## overall.trust     502  0.86  0.86  0.86   0.78  3.2 1.4
## overall.effective 502  0.84  0.84  0.83   0.74  3.5 1.5
## 
## Non missing response frequency for each item
##                      1    2    3    4    5    6    7 miss
## ct1               0.13 0.27 0.27 0.14 0.13 0.05 0.01    0
## ct2               0.01 0.07 0.14 0.14 0.30 0.26 0.07    0
## ct3               0.04 0.08 0.18 0.14 0.29 0.21 0.05    0
## ct4               0.00 0.03 0.11 0.12 0.37 0.27 0.09    0
## overall.trust     0.09 0.24 0.31 0.15 0.17 0.05 0.00    0
## overall.effective 0.10 0.18 0.25 0.18 0.21 0.07 0.01    0
#use
a$dv<-(a$like + a$apply + a$happy)/3
alpha(a[,c(24:26)], check.keys = TRUE)
## Warning in alpha(a[, c(24:26)], check.keys = TRUE): Some items were negatively correlated with total scale and were automatically reversed.
##  This is indicated by a negative sign for the variable name.
## 
## Reliability analysis   
## Call: alpha(x = a[, c(24:26)], check.keys = TRUE)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean  sd median_r
##       0.82      0.82    0.75      0.61 4.6 0.014  3.2 1.3     0.61
## 
##  lower alpha upper     95% confidence boundaries
## 0.79 0.82 0.85 
## 
##  Reliability if an item is dropped:
##        raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## like        0.76      0.76    0.61      0.61 3.1    0.022    NA  0.61
## apply-      0.76      0.76    0.62      0.62 3.2    0.021    NA  0.62
## happy       0.74      0.74    0.59      0.59 2.9    0.023    NA  0.59
## 
##  Item statistics 
##          n raw.r std.r r.cor r.drop mean  sd
## like   502  0.85  0.86  0.74   0.67  2.6 1.5
## apply- 502  0.86  0.85  0.74   0.67  3.2 1.6
## happy  502  0.86  0.86  0.76   0.69  3.9 1.5
## 
## Non missing response frequency for each item
##          1    2    3    4    5    6    7 miss
## like  0.30 0.26 0.20 0.12 0.07 0.05 0.00    0
## apply 0.03 0.09 0.10 0.20 0.20 0.24 0.14    0
## happy 0.09 0.11 0.16 0.27 0.22 0.12 0.02    0
#conditions
a$sci[a$subjSCI==1 | a$ObjSCI==1]<-"Science"
a$sci[a$subjREG==1 | a$ObjREG==1]<-"Control"

a$SO[a$subjSCI==1 | a$subjREG==1]<-"Subjective"
a$SO[a$ObjSCI==1 | a$ObjREG==1]<-"Objective"

table(a$sci, a$SO)
##          
##           Objective Subjective
##   Control       122        147
##   Science       126        107

APPLICANTS - ANOVAs, regressions

#excluding non-students
table(a$student)
## 
##   1   2 
## 491  11
a<-subset(a, student==1)

mod <- lm(dv ~ sci*SO, data=a, contrasts=list(sci=contr.sum, SO=contr.sum))
Anova(mod, type="III")
## Anova Table (Type III tests)
## 
## Response: dv
##             Sum Sq  Df    F value Pr(>F)    
## (Intercept) 6762.8   1 14688.6648 <2e-16 ***
## sci            0.0   1     0.0981 0.7543    
## SO             0.1   1     0.1327 0.7158    
## sci:SO         0.6   1     1.2960 0.2555    
## Residuals    224.2 487                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(lm(dv~sci+SO , a))
## 
## Call:
## lm(formula = dv ~ sci + SO, data = a)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.73912 -0.40578 -0.07017  0.27982  2.59422 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   3.72018    0.05360  69.406   <2e-16 ***
## sciScience    0.01893    0.06176   0.307    0.759    
## SOSubjective  0.01665    0.06154   0.271    0.787    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.6787 on 488 degrees of freedom
## Multiple R-squared:  0.000313,   Adjusted R-squared:  -0.003784 
## F-statistic: 0.0764 on 2 and 488 DF,  p-value: 0.9265
mod <- lm(trust ~ sci*SO, data=a, contrasts=list(sci=contr.sum, SO=contr.sum))
Anova(mod, type="III")
## Anova Table (Type III tests)
## 
## Response: trust
##             Sum Sq  Df   F value Pr(>F)    
## (Intercept) 5623.6   1 7015.9341 <2e-16 ***
## sci            0.0   1    0.0229 0.8798    
## SO             0.0   1    0.0164 0.8980    
## sci:SO         0.4   1    0.5572 0.4557    
## Residuals    390.4 487                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(lm(trust~sci+SO, a))
## 
## Call:
## lm(formula = trust ~ sci + SO, data = a)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.41785 -0.57184 -0.06644  0.58755  2.42816 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   3.412452   0.070670  48.287   <2e-16 ***
## sciScience   -0.012676   0.081425  -0.156    0.876    
## SOSubjective  0.005396   0.081144   0.066    0.947    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8949 on 488 degrees of freedom
## Multiple R-squared:  6.333e-05,  Adjusted R-squared:  -0.004035 
## F-statistic: 0.01545 on 2 and 488 DF,  p-value: 0.9847

Comparing managers and applicants

#overall trust
t.test(a$trust, m$trust)
## 
##  Welch Two Sample t-test
## 
## data:  a$trust and m$trust
## t = -0.19015, df = 947.06, p-value = 0.8492
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.1254096  0.1032541
## sample estimates:
## mean of x mean of y 
##  3.409369  3.420446
#just the science / subjective conditions 
a2<-subset(a, sci=="Science" & SO=="Subjective")
m2<-subset(m, sci=="Science" & SO=="Subjective")

t.test(a2$trust, m2$trust)
## 
##  Welch Two Sample t-test
## 
## data:  a2$trust and m2$trust
## t = -0.02661, df = 210.78, p-value = 0.9788
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.2453579  0.2388220
## sample estimates:
## mean of x mean of y 
##  3.441176  3.444444
#main effects of science
summary(lm(trust ~ sci, m))
## 
## Call:
## lm(formula = trust ~ sci, data = m)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.4735 -0.5333 -0.0333  0.5265  3.6333 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  3.36667    0.05965  56.444   <2e-16 ***
## sciScience   0.10687    0.08408   1.271    0.204    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9046 on 461 degrees of freedom
## Multiple R-squared:  0.003492,   Adjusted R-squared:  0.00133 
## F-statistic: 1.615 on 1 and 461 DF,  p-value: 0.2044
summary(lm(trust ~ sci, a))
## 
## Call:
## lm(formula = trust ~ sci, data = a)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.41541 -0.56889 -0.06889  0.58459  2.43111 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  3.41541    0.05481  62.310   <2e-16 ***
## sciScience  -0.01319    0.08097  -0.163    0.871    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.894 on 489 degrees of freedom
## Multiple R-squared:  5.427e-05,  Adjusted R-squared:  -0.001991 
## F-statistic: 0.02654 on 1 and 489 DF,  p-value: 0.8707
#just the subjective conditions
a3<-subset(a, SO=="Subjective")
m3<-subset(m, SO=="Subjective")

summary(lm(trust ~ sci, m3))
## 
## Call:
## lm(formula = trust ~ sci, data = m3)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.44444 -0.61111  0.05556  0.52679  2.55556 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  3.30655    0.08064  41.006   <2e-16 ***
## sciScience   0.13790    0.11353   1.215    0.226    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8534 on 224 degrees of freedom
## Multiple R-squared:  0.006543,   Adjusted R-squared:  0.002108 
## F-statistic: 1.475 on 1 and 224 DF,  p-value: 0.2258
summary(lm(trust ~ sci, a3))
## 
## Call:
## lm(formula = trust ~ sci, data = a3)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.44118 -0.60784 -0.05936  0.60731  2.39216 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  3.39269    0.07533  45.039   <2e-16 ***
## sciScience   0.04848    0.11746   0.413     0.68    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9102 on 246 degrees of freedom
## Multiple R-squared:  0.0006921,  Adjusted R-squared:  -0.00337 
## F-statistic: 0.1704 on 1 and 246 DF,  p-value: 0.6801