library(tidyr)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(stats)
library(nlme)
## 
## Attaching package: 'nlme'
## The following object is masked from 'package:dplyr':
## 
##     collapse
setwd("C:/Users/Christina/Dropbox/UW Madison/Lupyan Lab")

data <- read.csv("HoutWithMemory.csv")

threeD_Mem1 <- lm(Mem1 ~ Stress_3D + Weird.Mean._3D + Proto.Distance._3D + Vector.Distance._3D, data)
threeD_Mem2 <- lm(Mem2 ~ Stress_3D + Weird.Mean._3D + Proto.Distance._3D + Vector.Distance._3D, data)
threeD_Mem4 <- lm(Mem4 ~ Stress_3D + Weird.Mean._3D + Proto.Distance._3D + Vector.Distance._3D, data)
threeD_Mem8 <- lm(Mem8 ~ Stress_3D + Weird.Mean._3D + Proto.Distance._3D + Vector.Distance._3D, data)
threeD_Mem16 <- lm(Mem16 ~ Stress_3D + Weird.Mean._3D + Proto.Distance._3D + Vector.Distance._3D, data)
threeD_Slope <- lm(Slope ~ Stress_3D + Weird.Mean._3D + Proto.Distance._3D + Vector.Distance._3D, data)

summary(threeD_Mem1)
## 
## Call:
## lm(formula = Mem1 ~ Stress_3D + Weird.Mean._3D + Proto.Distance._3D + 
##     Vector.Distance._3D, data = data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.60852 -0.12959  0.09598  0.11842  0.15330 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)          1.447058   0.422151   3.428 0.000742 ***
## Stress_3D           -0.457332   0.553782  -0.826 0.409908    
## Weird.Mean._3D      -0.279033   0.261889  -1.065 0.287985    
## Proto.Distance._3D  -0.007765   0.095329  -0.081 0.935167    
## Vector.Distance._3D -0.307789   0.309190  -0.995 0.320742    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1716 on 195 degrees of freedom
##   (40 observations deleted due to missingness)
## Multiple R-squared:  0.0143, Adjusted R-squared:  -0.005918 
## F-statistic: 0.7073 on 4 and 195 DF,  p-value: 0.5878
summary(threeD_Mem2)
## 
## Call:
## lm(formula = Mem2 ~ Stress_3D + Weird.Mean._3D + Proto.Distance._3D + 
##     Vector.Distance._3D, data = data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.5752 -0.1275  0.1069  0.1205  0.1644 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)   
## (Intercept)          1.20255    0.41071   2.928  0.00382 **
## Stress_3D           -0.32895    0.53878  -0.611  0.54221   
## Weird.Mean._3D      -0.16334    0.25479  -0.641  0.52223   
## Proto.Distance._3D   0.06966    0.09275   0.751  0.45354   
## Vector.Distance._3D -0.21052    0.30081  -0.700  0.48487   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1669 on 195 degrees of freedom
##   (40 observations deleted due to missingness)
## Multiple R-squared:  0.006253,   Adjusted R-squared:  -0.01413 
## F-statistic: 0.3067 on 4 and 195 DF,  p-value: 0.8732
summary(threeD_Mem4)
## 
## Call:
## lm(formula = Mem4 ~ Stress_3D + Weird.Mean._3D + Proto.Distance._3D + 
##     Vector.Distance._3D, data = data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.5225 -0.1367  0.1084  0.1450  0.2038 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)   
## (Intercept)          1.36565    0.45690   2.989  0.00316 **
## Stress_3D           -0.28008    0.59936  -0.467  0.64081   
## Weird.Mean._3D      -0.37967    0.28345  -1.339  0.18198   
## Proto.Distance._3D  -0.03782    0.10318  -0.367  0.71437   
## Vector.Distance._3D -0.23415    0.33464  -0.700  0.48494   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1857 on 195 degrees of freedom
##   (40 observations deleted due to missingness)
## Multiple R-squared:  0.0193, Adjusted R-squared:  -0.0008186 
## F-statistic: 0.9593 on 4 and 195 DF,  p-value: 0.431
summary(threeD_Mem8)
## 
## Call:
## lm(formula = Mem8 ~ Stress_3D + Weird.Mean._3D + Proto.Distance._3D + 
##     Vector.Distance._3D, data = data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.5939 -0.1363  0.1218  0.1825  0.2184 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)   
## (Intercept)          1.423485   0.528742   2.692  0.00772 **
## Stress_3D           -0.673369   0.693610  -0.971  0.33284   
## Weird.Mean._3D      -0.075725   0.328016  -0.231  0.81767   
## Proto.Distance._3D   0.005474   0.119399   0.046  0.96348   
## Vector.Distance._3D -0.404500   0.387259  -1.045  0.29754   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.2149 on 195 degrees of freedom
##   (40 observations deleted due to missingness)
## Multiple R-squared:  0.008016,   Adjusted R-squared:  -0.01233 
## F-statistic: 0.394 on 4 and 195 DF,  p-value: 0.8128
summary(threeD_Mem16)
## 
## Call:
## lm(formula = Mem16 ~ Stress_3D + Weird.Mean._3D + Proto.Distance._3D + 
##     Vector.Distance._3D, data = data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.56881 -0.13530 -0.00571  0.18441  0.24391 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)  
## (Intercept)          1.12347    0.50077   2.243    0.026 *
## Stress_3D            0.05210    0.65692   0.079    0.937  
## Weird.Mean._3D       0.25928    0.31066   0.835    0.405  
## Proto.Distance._3D  -0.05827    0.11308  -0.515    0.607  
## Vector.Distance._3D -0.55050    0.36677  -1.501    0.135  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.2035 on 195 degrees of freedom
##   (40 observations deleted due to missingness)
## Multiple R-squared:  0.02327,    Adjusted R-squared:  0.003231 
## F-statistic: 1.161 on 4 and 195 DF,  p-value: 0.3292
summary(threeD_Slope)
## 
## Call:
## lm(formula = Slope ~ Stress_3D + Weird.Mean._3D + Proto.Distance._3D + 
##     Vector.Distance._3D, data = data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -15.2175  -3.8401   0.8167   3.4068  12.6957 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)
## (Intercept)           -4.081     14.154  -0.288    0.773
## Stress_3D              6.528     18.567   0.352    0.726
## Weird.Mean._3D        11.661      8.781   1.328    0.186
## Proto.Distance._3D    -1.620      3.196  -0.507    0.613
## Vector.Distance._3D   -6.969     10.367  -0.672    0.502
## 
## Residual standard error: 5.753 on 195 degrees of freedom
##   (40 observations deleted due to missingness)
## Multiple R-squared:  0.01367,    Adjusted R-squared:  -0.00656 
## F-statistic: 0.6758 on 4 and 195 DF,  p-value: 0.6095