1. Filter in data from subjects which have completed MR1 and MR2

Repeated_T1<-read.csv("Database.T1.clean.csv")
tmp1<-c("SubID","Session")
tmp1<-Repeated_T1[tmp1]
tmp1<-tmp1[duplicated(tmp1$SubID), ]
Completed_Subs<- c("SubID")
Completed_Subs<-tmp1[Completed_Subs]
Completed.Repeated.df<-merge(Repeated_T1,Completed_Subs, by="SubID" )
Completed.Repeated.df<-Completed.Repeated.df[complete.cases(Completed.Repeated.df),]
rm(Completed_Subs, tmp1, Repeated_T1)
Data<-Completed.Repeated.df
Data<-Data[complete.cases(Data$Nback_dvars_nstd),]

2. Set-Up Repeated Measures Autocorrelation ANOVA Models

2.1 Resting State

## Analysis of Deviance Table (Type II tests)
## 
## Response: Rest_fd_mean
##               Chisq Df Pr(>Chisq)  
## SITE         6.4857  2    0.03905 *
## Session      4.4019  1    0.03590 *
## SITE:Session 0.6567  2    0.72011  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Analysis of Deviance Table (Type II tests)
## 
## Response: Rest_dvars_nstd
##                Chisq Df Pr(>Chisq)   
## SITE         12.3888  2   0.002041 **
## Session       3.6441  1   0.056267 . 
## SITE:Session  0.4806  2   0.786409   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Analysis of Deviance Table (Type II tests)
## 
## Response: Rest_fwhm_avg
##               Chisq Df Pr(>Chisq)  
## SITE         4.4884  2    0.10601  
## Session      5.2007  1    0.02258 *
## SITE:Session 0.0737  2    0.96384  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Analysis of Deviance Table (Type II tests)
## 
## Response: Rest_snr
##               Chisq Df Pr(>Chisq)  
## SITE         2.5220  2     0.2834  
## Session      0.0507  1     0.8218  
## SITE:Session 4.8953  2     0.0865 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Analysis of Deviance Table (Type II tests)
## 
## Response: Rest_tsnr
##                Chisq Df Pr(>Chisq)    
## SITE         17.4274  2  0.0001643 ***
## Session       5.6683  1  0.0172746 *  
## SITE:Session 12.6453  2  0.0017951 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##                 Model df      AIC      BIC    logLik   Test  L.Ratio p-value
## Rest_tsnr.model     1  9 1786.292 1819.101 -884.1457                        
## model.fixed         2  7 1823.796 1849.315 -904.8982 1 vs 2 41.50504  <.0001
## $Models
##                                                                                                                                      
## Model: "lme.formula, Rest_tsnr ~ SITE + Session + SITE * Session, Data, ~1 | SubID, corAR1(form = ~Session | SubID, value = 0), REML"
## Null:  "lme.formula, Rest_tsnr ~ 1, Data, ~1 | SubID"                                                                                
## 
## $Pseudo.R.squared.for.model.vs.null
##                              Pseudo.R.squared
## McFadden                            0.0190113
## Cox and Snell (ML)                  0.1122910
## Nagelkerke (Cragg and Uhler)        0.1125050
## 
## $Likelihood.ratio.test
##  Df.diff LogLik.diff  Chisq    p.value
##       -6     -17.212 34.423 5.5728e-06
## 
## $Number.of.observations
##           
## Model: 289
## Null:  289
## 
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
## 
## $Warnings
## [1] "None"
##  SITE Session lsmean    SE  df lower.CL upper.CL .group
##  PITT       1   28.1 0.733 140     26.1     30.1  a    
##  PITT       2   28.6 0.733 140     26.7     30.6  a    
##  NEU        2   29.9 1.050 140     27.1     32.8  ab   
##  KU         2   31.0 0.764 140     29.0     33.1  abc  
##  KU         1   32.4 0.764 140     30.4     34.5   bc  
##  NEU        1   33.9 1.037 140     31.2     36.7    c  
## 
## Degrees-of-freedom method: containment 
## Confidence level used: 0.95 
## Conf-level adjustment: sidak method for 6 estimates 
## P value adjustment: tukey method for comparing a family of 6 estimates 
## significance level used: alpha = 0.05

2.2 N-Back

## Analysis of Deviance Table (Type II tests)
## 
## Response: Nback_fd_mean
##                Chisq Df Pr(>Chisq)   
## SITE         10.8057  2   0.004504 **
## Session       0.0707  1   0.790351   
## SITE:Session  7.2699  2   0.026386 * 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Analysis of Deviance Table (Type II tests)
## 
## Response: Nback_dvars_nstd
##               Chisq Df Pr(>Chisq)   
## SITE         9.3244  2   0.009446 **
## Session      1.6664  1   0.196744   
## SITE:Session 2.1856  2   0.335277   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Analysis of Deviance Table (Type II tests)
## 
## Response: Nback_fwhm_avg
##               Chisq Df Pr(>Chisq)  
## SITE         1.5777  2    0.45437  
## Session      3.9322  1    0.04737 *
## SITE:Session 0.1605  2    0.92287  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Analysis of Deviance Table (Type II tests)
## 
## Response: Nback_snr
##               Chisq Df Pr(>Chisq)  
## SITE         1.2144  2    0.54487  
## Session      0.1777  1    0.67336  
## SITE:Session 4.6920  2    0.09575 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Analysis of Deviance Table (Type II tests)
## 
## Response: Nback_tsnr
##               Chisq Df Pr(>Chisq)  
## SITE         6.1076  2    0.04718 *
## Session      0.1906  1    0.66241  
## SITE:Session 5.4151  2    0.06670 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##                  Model df      AIC      BIC     logLik   Test  L.Ratio p-value
## Nback_tsnr.model     1  9 1988.142 2020.951  -985.0709                        
## model.fixed          2  7 2021.752 2047.270 -1003.8758 1 vs 2 37.60983  <.0001
## $Models
##                                                                                                                                       
## Model: "lme.formula, Nback_tsnr ~ SITE + Session + SITE * Session, Data, ~1 | SubID, corAR1(form = ~Session | SubID, value = 0), REML"
## Null:  "lme.formula, Nback_tsnr ~ 1, Data, ~1 | SubID"                                                                                
## 
## $Pseudo.R.squared.for.model.vs.null
##                              Pseudo.R.squared
## McFadden                           0.00587958
## Cox and Snell (ML)                 0.03975730
## Nagelkerke (Cragg and Uhler)       0.03979740
## 
## $Likelihood.ratio.test
##  Df.diff LogLik.diff  Chisq  p.value
##       -6     -5.8622 11.724 0.068405
## 
## $Number.of.observations
##           
## Model: 289
## Null:  289
## 
## $Messages
## [1] "Note: For models fit with REML, these statistics are based on refitting with ML"
## 
## $Warnings
## [1] "None"
##  SITE Session lsmean   SE  df lower.CL upper.CL .group
##  PITT       1   30.0 1.04 140     27.3     32.8  a    
##  PITT       2   31.6 1.04 140     28.8     34.4  ab   
##  NEU        2   32.5 1.49 140     28.5     36.5  ab   
##  KU         2   33.0 1.09 140     30.1     35.9  ab   
##  NEU        1   34.0 1.47 140     30.0     37.9  ab   
##  KU         1   34.8 1.09 140     31.9     37.7   b   
## 
## Degrees-of-freedom method: containment 
## Confidence level used: 0.95 
## Conf-level adjustment: sidak method for 6 estimates 
## P value adjustment: tukey method for comparing a family of 6 estimates 
## significance level used: alpha = 0.05
### 2.1 Resting State