### Mixed Effects, hierarchical linear model (e.g., students nested in schools)
### This script shows both the lme4 and nlme package approaches to doing these models
### First, set the working directory where R will find the data
setwd("H:/data/User/Classes/multiv_13/YTs/YTSplit/Week 06 wmv - 2016/Wk06.R")
getwd()
## [1] "H:/data/User/Classes/multiv_13/YTs/YTSplit/Week 06 wmv - 2016/Wk06.R"
### Read the data
class06<- read.csv("Class06_homework_2014.csv")
#The lme4 package (and function lmer) are the more modern way of doing MLM in R
#At bottom, we reference a second package and function (nlme package, lme function), since many
#well-cited papers use this older (but more limited) approach
#Both methods are designed by Doug Bates and team
#install.packages("lme4")
library(lme4)
## Loading required package: Matrix
#This citation function is a cool tool to use with all packages
#Your manuscripts need to CITE the packages, and the "citation" function gives you that citation
citation("lme4")
## 
## To cite lme4 in publications use:
## 
##   Douglas Bates, Martin Maechler, Ben Bolker, Steve Walker (2015).
##   Fitting Linear Mixed-Effects Models Using lme4. Journal of
##   Statistical Software, 67(1), 1-48. doi:10.18637/jss.v067.i01.
## 
## A BibTeX entry for LaTeX users is
## 
##   @Article{,
##     title = {Fitting Linear Mixed-Effects Models Using {lme4}},
##     author = {Douglas Bates and Martin M{\"a}chler and Ben Bolker and Steve Walker},
##     journal = {Journal of Statistical Software},
##     year = {2015},
##     volume = {67},
##     number = {1},
##     pages = {1--48},
##     doi = {10.18637/jss.v067.i01},
##   }
head(class06)
##   ï..const ID BowlingTeamNo GroupGripStrength PercentWinBowl
## 1        1  1             1                65             51
## 2        1  2             1                65             51
## 3        1  3             1                65             46
## 4        1  4             1                65             50
## 5        1  5             1                65             62
## 6        1  6             1                65             45
##   ForearmLengthQuartile WinningOrientation
## 1                     2                 52
## 2                     2                 43
## 3                     1                 42
## 4                     1                 44
## 5                     4                 35
## 6                     1                 49
### 0. Unconditional Model
#As we have done in other modeling types, the null model regresses your DV on an intercept (~1)
# This gives you the FIXED intercept
# The material in parentheses (1|school) gives you the random intercept -- i.e., each school's own intercept
# Also know as unconditional means model
nullmodel = lmer(WinningOrientation ~ 1 +
                   (1|BowlingTeamNo), data=class06, REML=FALSE)
summary(nullmodel)
## Linear mixed model fit by maximum likelihood  ['lmerMod']
## Formula: WinningOrientation ~ 1 + (1 | BowlingTeamNo)
##    Data: class06
## 
##      AIC      BIC   logLik deviance df.resid 
##  16532.7  16550.1  -8263.4  16526.7     2428 
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.23425 -0.78094 -0.02999  0.78812  2.49794 
## 
## Random effects:
##  Groups        Name        Variance Std.Dev.
##  BowlingTeamNo (Intercept) 12.84    3.583   
##  Residual                  48.28    6.948   
## Number of obs: 2431, groups:  BowlingTeamNo, 102
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)   47.550      0.382   124.5
#install.packages("stargazer")
library(stargazer)
## 
## Please cite as:
##  Hlavac, Marek (2018). stargazer: Well-Formatted Regression and Summary Statistics Tables.
##  R package version 5.2.2. https://CRAN.R-project.org/package=stargazer
stargazer(nullmodel, type = "text",
          digits = 3,
          star.cutoffs = c(0.05, 0.01, 0.001),
          digit.separator = "") 
## 
## =================================================
##                          Dependent variable:     
##                     -----------------------------
##                          WinningOrientation      
## -------------------------------------------------
## Constant                      47.550***          
##                                (0.382)           
##                                                  
## -------------------------------------------------
## Observations                    2431             
## Log Likelihood                -8263.358          
## Akaike Inf. Crit.             16532.720          
## Bayesian Inf. Crit.           16550.100          
## =================================================
## Note:               *p<0.05; **p<0.01; ***p<0.001
#install.packages("sjPlot")
library(sjPlot)
tab_model(nullmodel)
| 
 
 | 
WinningOrientation
 | 
| 
Predictors
 | 
Estimates
 | 
CI
 | 
p
 | 
| 
(Intercept)
 | 
47.55
 | 
46.80 â€“ 48.30
 | 
<0.001
 | 
| 
Random Effects
 | 
| 
σ2
 | 
48.28
 | 
| 
τ00 BowlingTeamNo
 | 
12.84
 | 
| 
ICC
 | 
0.21
 | 
| 
N BowlingTeamNo
 | 
102
 | 
| 
Observations
 | 
2431
 | 
| 
Marginal R2 / Conditional R2
 | 
0.000 / 0.210
 | 
#Saving predicted values to the data frame, so we can plot what the null model looks like
pred_0<-(fitted(nullmodel))
pred0<-as.data.frame(pred_0)
class06<-cbind(class06,pred0)
library(ggplot2)
#This plot will show random intercept, with no predictors
qplot(y=pred_0, x=PercentWinBowl, colour = BowlingTeamNo,  
      data = class06)

#This plot will superimpose the fixed intercept and null slope, just to show that this
#first model is a nothing
ggplot(class06) + 
  aes(x=class06$PercentWinBowl, y=class06$pred_0) + #, col=as.factor(hsb_pred2$school)
  geom_point() +
  stat_smooth(method = "lm", se = FALSE)
## Warning: Use of `class06$PercentWinBowl` is discouraged. Use `PercentWinBowl`
## instead.
## Warning: Use of `class06$pred_0` is discouraged. Use `pred_0` instead.
## Warning: Use of `class06$PercentWinBowl` is discouraged. Use `PercentWinBowl`
## instead.
## Warning: Use of `class06$pred_0` is discouraged. Use `pred_0` instead.
## `geom_smooth()` using formula 'y ~ x'

### 1. Conditional model: Fixed effect of Level 2 GroupGripStrength
condmodel1 = lmer(WinningOrientation ~ GroupGripStrength +
                    (1|BowlingTeamNo), data=class06, REML=FALSE)
summary(condmodel1)
## Linear mixed model fit by maximum likelihood  ['lmerMod']
## Formula: WinningOrientation ~ GroupGripStrength + (1 | BowlingTeamNo)
##    Data: class06
## 
##      AIC      BIC   logLik deviance df.resid 
##  16534.7  16557.9  -8263.3  16526.7     2427 
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.23668 -0.77876 -0.02977  0.78740  2.49476 
## 
## Random effects:
##  Groups        Name        Variance Std.Dev.
##  BowlingTeamNo (Intercept) 12.83    3.582   
##  Residual                  48.28    6.948   
## Number of obs: 2431, groups:  BowlingTeamNo, 102
## 
## Fixed effects:
##                    Estimate Std. Error t value
## (Intercept)       47.971132   1.948607   24.62
## GroupGripStrength -0.008428   0.038233   -0.22
## 
## Correlation of Fixed Effects:
##             (Intr)
## GrpGrpStrng -0.981
#lower case anova does nested model tests
anova(nullmodel,condmodel1)
## Data: class06
## Models:
## nullmodel: WinningOrientation ~ 1 + (1 | BowlingTeamNo)
## condmodel1: WinningOrientation ~ GroupGripStrength + (1 | BowlingTeamNo)
##            npar   AIC   BIC  logLik deviance  Chisq Df Pr(>Chisq)
## nullmodel     3 16533 16550 -8263.4    16527                     
## condmodel1    4 16535 16558 -8263.3    16527 0.0486  1     0.8256
#Saving predicted values to the data frame, so we can plot what the conditional model looks like
pred_1<-(fitted(condmodel1))
pred1<-as.data.frame(pred_1)
class06<-cbind(class06,pred1)
#This plot will show the overall fixed intercept and slope; a Level 2 factor cannot
#have random variance
qplot(y=pred_1, x=GroupGripStrength, colour = BowlingTeamNo,  
      data = class06)

#The second plot imposes the best fitting line
ggplot(class06) + 
  aes(x=class06$GroupGripStrength, y=class06$pred_1) + #, col=as.factor(hsb_pred2$school)
  geom_point() +
  stat_smooth(method = "lm", se = FALSE)
## Warning: Use of `class06$GroupGripStrength` is discouraged. Use
## `GroupGripStrength` instead.
## Warning: Use of `class06$pred_1` is discouraged. Use `pred_1` instead.
## Warning: Use of `class06$GroupGripStrength` is discouraged. Use
## `GroupGripStrength` instead.
## Warning: Use of `class06$pred_1` is discouraged. Use `pred_1` instead.
## `geom_smooth()` using formula 'y ~ x'

#Gives you each school's fixed and random! coefficients
coef(condmodel1)
## $BowlingTeamNo
##     (Intercept) GroupGripStrength
## 1      44.36353      -0.008427987
## 2      43.72894      -0.008427987
## 3      43.72935      -0.008427987
## 4      42.35377      -0.008427987
## 5      43.49744      -0.008427987
## 6      43.92238      -0.008427987
## 7      41.57389      -0.008427987
## 8      43.03649      -0.008427987
## 9      43.39790      -0.008427987
## 10     43.23115      -0.008427987
## 11     44.59257      -0.008427987
## 12     46.43803      -0.008427987
## 13     42.95839      -0.008427987
## 14     42.35983      -0.008427987
## 15     44.91674      -0.008427987
## 16     45.34331      -0.008427987
## 17     45.27734      -0.008427987
## 18     45.20489      -0.008427987
## 19     45.37000      -0.008427987
## 20     45.44204      -0.008427987
## 21     42.95880      -0.008427987
## 22     46.95564      -0.008427987
## 23     44.77995      -0.008427987
## 24     42.34485      -0.008427987
## 25     43.69170      -0.008427987
## 26     44.37687      -0.008427987
## 27     47.38139      -0.008427987
## 28     42.97820      -0.008427987
## 29     43.90012      -0.008427987
## 30     46.48862      -0.008427987
## 31     47.77555      -0.008427987
## 32     46.75451      -0.008427987
## 33     45.70350      -0.008427987
## 34     45.49427      -0.008427987
## 35     42.92720      -0.008427987
## 36     47.76303      -0.008427987
## 37     46.97750      -0.008427987
## 38     43.78682      -0.008427987
## 39     44.97339      -0.008427987
## 40     46.37328      -0.008427987
## 41     45.67960      -0.008427987
## 42     48.30331      -0.008427987
## 43     47.97709      -0.008427987
## 44     47.33645      -0.008427987
## 45     46.48093      -0.008427987
## 46     46.97586      -0.008427987
## 47     49.82861      -0.008427987
## 48     48.28104      -0.008427987
## 49     49.83590      -0.008427987
## 50     48.92938      -0.008427987
## 51     47.20695      -0.008427987
## 52     46.87673      -0.008427987
## 53     47.63312      -0.008427987
## 54     47.37288      -0.008427987
## 55     47.06975      -0.008427987
## 56     48.98602      -0.008427987
## 57     50.03908      -0.008427987
## 58     46.42911      -0.008427987
## 59     48.92250      -0.008427987
## 60     48.02203      -0.008427987
## 61     49.15236      -0.008427987
## 62     49.14590      -0.008427987
## 63     51.01240      -0.008427987
## 64     49.80962      -0.008427987
## 65     50.39844      -0.008427987
## 66     48.39032      -0.008427987
## 67     50.06134      -0.008427987
## 68     49.82174      -0.008427987
## 69     50.69347      -0.008427987
## 70     51.83960      -0.008427987
## 71     49.51255      -0.008427987
## 72     50.98244      -0.008427987
## 73     49.55585      -0.008427987
## 74     48.30977      -0.008427987
## 75     50.80922      -0.008427987
## 76     50.11030      -0.008427987
## 77     49.65057      -0.008427987
## 78     52.14232      -0.008427987
## 79     49.88813      -0.008427987
## 80     51.21435      -0.008427987
## 81     51.28638      -0.008427987
## 82     50.83836      -0.008427987
## 83     51.85540      -0.008427987
## 84     50.59311      -0.008427987
## 85     52.23662      -0.008427987
## 86     51.71779      -0.008427987
## 87     51.91769      -0.008427987
## 88     52.15525      -0.008427987
## 89     49.92333      -0.008427987
## 90     49.73554      -0.008427987
## 91     49.33409      -0.008427987
## 92     51.35678      -0.008427987
## 93     52.03426      -0.008427987
## 94     52.50168      -0.008427987
## 95     54.03067      -0.008427987
## 96     51.76715      -0.008427987
## 97     54.64217      -0.008427987
## 98     53.70651      -0.008427987
## 99     53.50333      -0.008427987
## 100    53.57537      -0.008427987
## 101    53.38922      -0.008427987
## 102    55.14457      -0.008427987
## 
## attr(,"class")
## [1] "coef.mer"
library(car)
## Loading required package: carData
## Registered S3 methods overwritten by 'car':
##   method                          from
##   influence.merMod                lme4
##   cooks.distance.influence.merMod lme4
##   dfbeta.influence.merMod         lme4
##   dfbetas.influence.merMod        lme4
#Gives you chi-square for each model term
Anova(condmodel1)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: WinningOrientation
##                    Chisq Df Pr(>Chisq)
## GroupGripStrength 0.0486  1     0.8255
#Three different approaches for confidence intervals
#Method wald is an approximation (same as spss), but fast
#the first and third methods (likelihood and bootstrapping) take a long time
confint(condmodel1) #Profile method; takes a while, less stringent assumptions
## Computing profile confidence intervals ...
##                         2.5 %      97.5 %
## .sig01             3.05971909  4.22333606
## .sigma             6.75326002  7.15269729
## (Intercept)       44.11520888 51.82780845
## GroupGripStrength -0.08408385  0.06724368
confint(condmodel1, method = "Wald")
##                         2.5 %      97.5 %
## .sig01                     NA          NA
## .sigma                     NA          NA
## (Intercept)       44.15193200 51.79033249
## GroupGripStrength -0.08336383  0.06650786
confint(condmodel1, method = "boot",
        nsim = 1000,
        boot.type = "perc", #,"basic","norm" are options
        FUN = NULL, quiet = FALSE)
## Computing bootstrap confidence intervals ...
##                         2.5 %     97.5 %
## .sig01             2.96017455  4.0954240
## .sigma             6.74975811  7.1505102
## (Intercept)       43.95822925 51.8410759
## GroupGripStrength -0.08391973  0.0725048
#This ensures that your model is stored in a lmerMod object, needed for the next step
class(condmodel1) <- "lmerMod"
#Stargazer makes a nicely formated model summary table (albeit incomplete)
stargazer(condmodel1, type = "text",
          digits = 3,
          star.cutoffs = c(0.05, 0.01, 0.001),
          digit.separator = "")
## 
## =================================================
##                          Dependent variable:     
##                     -----------------------------
##                          WinningOrientation      
## -------------------------------------------------
## GroupGripStrength              -0.008            
##                                (0.038)           
##                                                  
## Constant                      47.971***          
##                                (1.949)           
##                                                  
## -------------------------------------------------
## Observations                    2431             
## Log Likelihood                -8263.334          
## Akaike Inf. Crit.             16534.670          
## Bayesian Inf. Crit.           16557.850          
## =================================================
## Note:               *p<0.05; **p<0.01; ***p<0.001
###sjPlot::tab_model is even better, because it formats the table in APA style and adds
# fixed and random effects and p-values 
tab_model(nullmodel,condmodel1)
| 
 
 | 
WinningOrientation
 | 
WinningOrientation
 | 
| 
Predictors
 | 
Estimates
 | 
CI
 | 
p
 | 
Estimates
 | 
CI
 | 
p
 | 
| 
(Intercept)
 | 
47.55
 | 
46.80 â€“ 48.30
 | 
<0.001
 | 
47.97
 | 
44.15 â€“ 51.79
 | 
<0.001
 | 
| 
GroupGripStrength
 | 
       
 | 
       
 | 
       
 | 
-0.01
 | 
-0.08 â€“ 0.07
 | 
0.826
 | 
| 
Random Effects
 | 
| 
σ2
 | 
48.28
 | 
48.28
 | 
| 
τ00
 | 
12.84 BowlingTeamNo
 | 
12.83 BowlingTeamNo
 | 
| 
ICC
 | 
0.21
 | 
0.21
 | 
| 
N
 | 
102 BowlingTeamNo
 | 
102 BowlingTeamNo
 | 
| 
Observations
 | 
2431
 | 
2431
 | 
| 
Marginal R2 / Conditional R2
 | 
0.000 / 0.210
 | 
0.000 / 0.210
 | 
#Exact p-values and df in revised syntax below, but warning VERY time consuming (crashed my computer)
#tab_model(condmodel2, p.val = "kr", show.df = TRUE)
# plot to evaluate normality of residuals
qqnorm(resid(condmodel1))
qqline(resid(condmodel1))  # points fall nicely onto the line - good!

#plots to evaluate linearity and homoscedasticity of residuals
plot(condmodel1, type = c("p", "smooth"))

plot(condmodel1, sqrt(abs(resid(.))) ~ fitted(.),
     type = c("p", "smooth"),col="black")

# There is much additional output you can request from the lmer model object
extractAIC(condmodel1) #model AIC only
## [1]     4.00 16534.67
fixef(condmodel1) #model fixed effects only
##       (Intercept) GroupGripStrength 
##      47.971132244      -0.008427987
formula(condmodel1) #confirmation of what formula the model estimated
## WinningOrientation ~ GroupGripStrength + (1 | BowlingTeamNo)
nobs(condmodel1) #number of Level 1 observations
## [1] 2431
print(condmodel1) #alternative to summary()
## Linear mixed model fit by maximum likelihood  ['lmerMod']
## Formula: WinningOrientation ~ GroupGripStrength + (1 | BowlingTeamNo)
##    Data: class06
##       AIC       BIC    logLik  deviance  df.resid 
## 16534.668 16557.852 -8263.334 16526.668      2427 
## Random effects:
##  Groups        Name        Std.Dev.
##  BowlingTeamNo (Intercept) 3.582   
##  Residual                  6.948   
## Number of obs: 2431, groups:  BowlingTeamNo, 102
## Fixed Effects:
##       (Intercept)  GroupGripStrength  
##         47.971132          -0.008428
ranef(condmodel1) #random effects; shows each school's deviation from fixed intercept and cses
## $BowlingTeamNo
##      (Intercept)
## 1   -3.607605401
## 2   -4.242187329
## 3   -4.241778215
## 4   -5.617361411
## 5   -4.473688238
## 6   -4.048750591
## 7   -6.397245078
## 8   -4.934644484
## 9   -4.573231150
## 10  -4.739980403
## 11  -3.378559178
## 12  -1.533097736
## 13  -5.012739882
## 14  -5.611303211
## 15  -3.054391786
## 16  -2.627817682
## 17  -2.693796680
## 18  -2.766242993
## 19  -2.601130197
## 20  -2.529092998
## 21  -5.012330768
## 22  -1.015493605
## 23  -3.191180640
## 24  -5.626283411
## 25  -4.279433271
## 26  -3.594261659
## 27  -0.589737730
## 28  -4.992928826
## 29  -4.071016333
## 30  -1.482508052
## 31  -0.195578711
## 32  -1.216625001
## 33  -2.267631690
## 34  -2.476866857
## 35  -5.043927624
## 36  -0.208104225
## 37  -0.993636977
## 38  -4.184312102
## 39  -2.997743901
## 40  -1.597849392
## 41  -2.291533890
## 42   0.332174763
## 43   0.005961799
## 44  -0.634678329
## 45  -1.490202709
## 46  -0.995273434
## 47   1.857481441
## 48   0.309909020
## 49   1.864766984
## 50   0.958243805
## 51  -0.764181640
## 52  -1.094407232
## 53  -0.338016650
## 54  -0.598250615
## 55  -0.901379608
## 56   1.014891689
## 57   2.067943950
## 58  -1.542019736
## 59   0.951367377
## 60   0.050902398
## 61   1.181231828
## 62   1.174764514
## 63   3.041264356
## 64   1.838488613
## 65   2.427311713
## 66   0.419192161
## 67   2.090209692
## 68   1.850605013
## 69   2.722336935
## 70   3.868464793
## 71   1.541417820
## 72   3.011303956
## 73   1.584721962
## 74   0.338642077
## 75   2.838087389
## 76   2.139162920
## 77   1.679434016
## 78   4.171184672
## 79   1.916993125
## 80   3.243213979
## 81   3.315251178
## 82   2.867229560
## 83   3.884263221
## 84   2.621975794
## 85   4.265487612
## 86   3.746656139
## 87   3.946560192
## 88   4.184119300
## 89   1.952193496
## 90   1.764405843
## 91   1.362961281
## 92   3.385651919
## 93   4.063128874
## 94   4.530552435
## 95   6.059541141
## 96   3.796018481
## 97   6.671039099
## 98   5.735373749
## 99   5.532196783
## 100  5.604233981
## 101  5.418082785
## 102  7.173441638
## 
## with conditional variances for "BowlingTeamNo"
residuals(condmodel1) #provides each participant's residuals
##            1            2            3            4            5            6 
##   8.18429230  -0.81570770  -1.81570770   0.18429230  -8.81570770   5.18429230 
##            7            8            9           10           11           12 
##   2.18429230  -0.81570770   6.18429230   0.18429230   4.18429230  -0.81570770 
##           13           14           15           16           17           18 
##  -9.81570770 -13.81570770   3.18429230   4.18429230  -9.81570770  -7.81570770 
##           19           20           21           22           23           24 
##   2.18429230   0.18429230   8.18429230  -4.81570770  -2.81570770   4.18429230 
##           25           26           27           28           29           30 
##  -9.24854967  -5.24854967   4.75145033  -3.24854967  -2.24854967   2.75145033 
##           31           32           33           34           35           36 
##   6.75145033   2.75145033   5.75145033   0.75145033  -1.24854967 -11.24854967 
##           37           38           39           40           41           42 
## -15.24854967   0.75145033 -10.24854967   6.75145033  -1.24854967   0.75145033 
##           43           44           45           46           47           48 
##  -2.24854967  -5.24854967  -3.24854967   6.75145033   4.75145033  10.75145033 
##           49           50           51           52           53           54 
##  -4.20681885  -0.20681885   1.79318115   4.79318115  -6.20681885 -10.20681885 
##           55           56           57           58           59           60 
##   7.79318115   5.79318115   2.79318115   8.79318115  -0.20681885   9.79318115 
##           61           62           63           64           65           66 
##  -8.20681885 -12.20681885   8.79318115  -3.20681885  -7.20681885  -8.20681885 
##           67           68           69           70           71           72 
##   6.79318115  -8.20681885   2.79318115 -14.20681885   9.79318115  -3.20681885 
##           73           74           75           76           77           78 
##  -6.79752370  -3.79752370  -3.79752370   4.20247630  -3.79752370   1.20247630 
##           79           80           81           82           83           84 
##   1.20247630   7.20247630 -10.79752370   4.20247630  -4.79752370  -6.79752370 
##           85           86           87           88           89           90 
##   1.20247630  -2.79752370  12.20247630  -5.79752370  -3.79752370   5.20247630 
##           91           92           93           94           95           96 
##  -5.79752370  -9.79752370  11.20247630   2.20247630  -0.79752370  -1.79752370 
##           97           98           99          100          101          102 
##  -7.11818460  -4.11818460  -0.11818460   3.88181540   3.88181540  -3.11818460 
##          103          104          105          106          107          108 
##   5.88181540   7.88181540   2.88181540   1.88181540  -9.11818460  13.88181540 
##          109          110          111          112          113          114 
##  -7.11818460   4.88181540 -12.11818460   1.88181540  -5.11818460  -8.11818460 
##          115          116          117          118          119          120 
##  -1.11818460   1.88181540  -6.11818460   7.88181540 -12.11818460   1.88181540 
##          121          122          123          124          125          126 
##  -2.55155023  -4.55155023  -5.55155023  -3.55155023  -7.55155023  -0.55155023 
##          127          128          129          130          131          132 
##  -1.55155023  12.44844977  10.44844977   8.44844977  -5.55155023  -9.55155023 
##          133          134          135          136          137          138 
##   2.44844977   0.44844977  -6.55155023   2.44844977  -9.55155023   2.44844977 
##          139          140          141          142          143          144 
##  -9.55155023  -3.55155023   4.44844977   6.44844977  10.44844977  -5.55155023 
##          145          146          147          148          149          150 
##   9.78851627   0.78851627  -8.21148373   9.78851627  -3.21148373   4.78851627 
##          151          152          153          154          155          156 
##   4.78851627   3.78851627  -0.21148373  -2.21148373  -6.21148373  -2.21148373 
##          157          158          159          160          161          162 
## -11.21148373  -3.21148373  -7.21148373  -5.21148373   0.78851627   1.78851627 
##          163          164          165          166          167          168 
##   8.78851627  -4.21148373   8.78851627  -8.21148373  -9.21148373  -7.21148373 
##          169          170          171          172          173          174 
##  -2.64880037  -9.64880037   3.35119963   9.35119963  -0.64880037 -10.64880037 
##          175          176          177          178          179          180 
##   6.35119963  -6.64880037  -4.64880037  -5.64880037  11.35119963   8.35119963 
##          181          182          183          184          185          186 
##  -8.64880037   0.35119963  -6.64880037  11.35119963   3.35119963  -2.64880037 
##          187          188          189          190          191          192 
##  -0.64880037  -8.64880037  12.35119963  -1.64880037  -2.64880037 -12.64880037 
##          193          194          195          196          197          198 
##  -4.88379390   2.11620610   6.11620610  -9.88379390  -5.88379390   8.11620610 
##          199          200          201          202          203          204 
##   4.11620610 -10.88379390   4.11620610  -3.88379390   9.11620610  -5.88379390 
##          205          206          207          208          209          210 
##  -0.88379390  -0.88379390   1.11620610  10.11620610 -11.88379390  -2.88379390 
##          211          212          213          214          215          216 
##  -0.88379390   4.11620610   0.11620610  -9.88379390  -1.88379390   4.11620610 
##          217          218          219          220          221          222 
##   2.17339153  -0.82660847   9.17339153  -0.82660847   4.17339153   2.17339153 
##          223          224          225          226          227          228 
## -12.82660847  -1.82660847 -13.82660847 -13.82660847  -3.82660847  14.17339153 
##          229          230          231          232          233          234 
##   2.17339153  -8.82660847   8.17339153   0.17339153  -2.82660847  -4.82660847 
##          235          236          237          238          239          240 
##  -1.82660847  10.17339153   7.17339153 -10.82660847   1.17339153  -1.82660847 
##          241          242          243          244          245          246 
##  -8.19645769  -3.19645769  10.80354231  10.80354231  -1.19645769  -3.19645769 
##          247          248          249          250          251          252 
##   0.80354231   7.80354231   9.80354231   2.80354231  13.80354231  -2.19645769 
##          253          254          255          256          257          258 
##  -3.19645769   8.80354231   6.80354231  -7.19645769  -0.19645769 -12.19645769 
##          259          260          261          262          263          264 
## -11.19645769  -0.19645769 -13.19645769 -12.19645769  -6.19645769  -1.19645769 
##          265          266          267          268          269          270 
##   6.09292866   2.09292866  11.09292866  -2.90707134  -7.90707134   8.09292866 
##          271          272          273          274          275          276 
##  -1.90707134   3.09292866  -7.90707134   7.09292866  -8.90707134  -0.90707134 
##          277          278          279          280          281          282 
##   7.09292866   8.09292866   2.09292866   7.09292866   1.09292866  -1.90707134 
##          283          284          285          286          287          288 
##  -9.90707134  -5.90707134  -0.90707134   4.09292866 -13.90707134  -9.90707134 
##          289          290          291          292          293          294 
##  11.54728685  -9.45271315  -0.45271315  -1.45271315  -8.45271315   2.54728685 
##          295          296          297          298          299          300 
##   4.54728685  -4.45271315  -8.45271315   5.54728685   5.54728685   6.54728685 
##          301          302          303          304          305          306 
##  -7.45271315  -4.45271315  -0.45271315  -6.45271315  -8.45271315  -8.45271315 
##          307          308          309          310          311          312 
##   1.54728685   6.54728685  -2.45271315  -6.45271315   9.54728685   4.54728685 
##          313          314          315          316          317          318 
##  -5.92157372   2.07842628   9.07842628  -5.92157372  -3.92157372   7.07842628 
##          319          320          321          322          323          324 
##  -8.92157372  -7.92157372   4.07842628  -3.92157372  -7.92157372  -5.92157372 
##          325          326          327          328          329          330 
##   0.07842628   4.07842628 -10.92157372   5.07842628 -12.92157372  13.07842628 
##          331          332          333          334          335          336 
##   1.07842628   0.07842628  -5.92157372   9.07842628   0.07842628   4.07842628 
##          337          338          339          340          341          342 
##  10.47937492  -8.52062508  -4.52062508  -3.52062508   5.47937492  -1.52062508 
##          343          344          345          346          347          348 
##   4.47937492  -5.52062508  10.47937492  -2.52062508   2.47937492   3.47937492 
##          349          350          351          352          353          354 
##  -1.52062508   2.47937492  -8.52062508   0.47937492  -3.52062508   5.47937492 
##          355          356          357          358          359          360 
##  -4.52062508  -7.52062508   5.47937492  -6.52062508  -7.52062508   3.47937492 
##          361          362          363          364          365          366 
##  10.21293257  12.21293257 -11.78706743  -3.78706743   4.21293257   4.21293257 
##          367          368          369          370          371          372 
##   8.21293257  -3.78706743  -8.78706743  -9.78706743   0.21293257   0.21293257 
##          373          374          375          376          377          378 
##  -1.78706743   0.21293257   1.21293257  -3.78706743  -0.78706743  -8.78706743 
##          379          380          381          382          383          384 
##  -7.78706743   3.21293257   2.21293257 -11.78706743   4.21293257  12.21293257 
##          385          386          387          388          389          390 
##  -6.83908025   2.16091975   1.16091975   2.16091975  -9.83908025   0.16091975 
##          391          392          393          394          395          396 
##  -2.83908025 -11.83908025  -8.83908025  -2.83908025  -1.83908025   8.16091975 
##          397          398          399          400          401          402 
##  -9.83908025   4.16091975  -3.83908025   5.16091975  -3.83908025   8.16091975 
##          403          404          405          406          407          408 
##   8.16091975   3.16091975  13.16091975  -9.83908025  -1.83908025   8.16091975 
##          409          410          411          412          413          414 
##  -4.80877387  -1.80877387  -1.80877387 -10.80877387   1.19122613   1.19122613 
##          415          416          417          418          419          420 
##  -4.80877387   1.19122613   1.19122613   9.19122613  -2.80877387   8.19122613 
##          421          422          423          424          425          426 
## -14.80877387  -9.80877387   3.19122613   4.19122613  -6.80877387   3.19122613 
##          427          428          429          430          431          432 
##  -4.80877387   8.19122613  10.19122613   7.19122613  -1.80877387  -3.80877387 
##          433          434          435          436          437          438 
##   0.96711742   2.96711742   8.96711742 -10.03288258  -5.03288258   6.96711742 
##          439          440          441          442          443          444 
##  -5.03288258  -3.03288258   0.96711742  -8.03288258   3.96711742   5.96711742 
##          445          446          447          448          449          450 
##   0.96711742  -0.03288258   4.96711742   6.96711742  -1.03288258   6.96711742 
##          451          452          453          454          455          456 
##  -3.03288258  -5.03288258 -11.03288258  -3.03288258  -1.03288258  -5.03288258 
##          457          458          459          460          461          462 
##   4.89508023   0.89508023  -5.10491977 -13.10491977  -5.10491977  -8.10491977 
##          463          464          465          466          467          468 
##   0.89508023  -7.10491977   5.89508023  -3.10491977   5.89508023 -14.10491977 
##          469          470          471          472          473          474 
##   0.89508023  10.89508023 -15.10491977  10.89508023   3.89508023  -8.10491977 
##          475          476          477          478          479          480 
##  -1.10491977   9.89508023   6.89508023  -3.10491977   7.89508023   3.89508023 
##          481          482          483          484          485          486 
##  -8.41098233  -5.41098233  -4.41098233   5.58901767  -5.41098233  10.58901767 
##          487          488          489          490          491          492 
##  -4.41098233   4.58901767  -6.41098233  -9.41098233   0.58901767  -4.41098233 
##          493          494          495          496          497          498 
##  -5.41098233  -1.41098233  -3.41098233  -3.41098233  -6.41098233  12.58901767 
##          499          500          501          502          503          504 
##   4.58901767   3.58901767   4.58901767  -1.41098233   0.58901767   3.58901767 
##          505          506          507          508          509          510 
##   3.46576070   0.46576070  -5.53423930   3.46576070   6.46576070   2.46576070 
##          511          512          513          514          515          516 
##  10.46576070   8.46576070  -3.53423930   6.46576070   9.46576070   2.46576070 
##          517          518          519          520          521          522 
## -11.53423930 -11.53423930  -2.53423930   5.46576070   4.46576070  -5.53423930 
##          523          524          525          526          527          528 
##   8.46576070 -14.53423930  -7.53423930   1.46576070 -12.53423930  -2.53423930 
##          529          530          531          532          533          534 
##   8.62459176  -6.37540824   8.62459176  -5.37540824  -5.37540824   2.62459176 
##          535          536          537          538          539          540 
##  -2.37540824   5.62459176   2.62459176  -2.37540824  -1.37540824  -9.37540824 
##          541          542          543          544          545          546 
##  -3.37540824  -5.37540824  -8.37540824  -4.37540824   6.62459176  -6.37540824 
##          547          548          549          550          551          552 
##  10.62459176   0.62459176   4.62459176  -3.37540824  -0.37540824   1.62459176 
##          553          554          555          556          557          558 
##  -0.96558943  -3.96558943  -8.96558943  -1.96558943  -5.96558943  -5.96558943 
##          559          560          561          562          563          564 
##  -1.96558943   2.03441057  -2.96558943   0.03441057  -0.96558943  -5.96558943 
##          565          566          567          568          569          570 
##   1.03441057   2.03441057   8.03441057  -3.96558943  15.03441057   0.03441057 
##          571          572          573          574          575          576 
##  -3.96558943   8.03441057  -9.96558943  14.03441057  -3.96558943  -9.96558943 
##          577          578          579          580          581          582 
##   3.66227647  -7.33772353   0.66227647  -6.33772353   4.66227647 -12.33772353 
##          583          584          585          586          587          588 
##  13.66227647   8.66227647  10.66227647  -5.33772353  -3.33772353  -1.33772353 
##          589          590          591          592          593          594 
##  -7.33772353  -7.33772353  -6.33772353  -0.33772353   3.66227647  -5.33772353 
##          595          596          597          598          599          600 
##   1.66227647   6.66227647   8.66227647  -5.33772353   2.66227647 -13.33772353 
##          601          602          603          604          605          606 
##  -7.93861527  -5.93861527   4.06138473  -1.93861527   3.06138473  -5.93861527 
##          607          608          609          610          611          612 
##   2.06138473   0.06138473   8.06138473   8.06138473  -1.93861527  -4.93861527 
##          613          614          615          616          617          618 
##   1.06138473  -2.93861527   2.06138473 -11.93861527  12.06138473   5.06138473 
##          619          620          621          622          623          624 
##   0.06138473  -7.93861527   8.06138473  -2.93861527  -1.93861527 -10.93861527 
##          625          626          627          628          629          630 
##  -8.88414329  -1.88414329  -7.88414329  -4.88414329   1.11585671   0.11585671 
##          631          632          633          634          635          636 
##  -8.88414329   7.11585671   2.11585671   2.11585671  -9.88414329   6.11585671 
##          637          638          639          640          641          642 
##  -9.88414329   2.11585671   8.11585671  11.11585671   1.11585671   4.11585671 
##          643          644          645          646          647          648 
##   1.11585671   0.11585671   0.11585671   6.11585671   6.11585671  -8.88414329 
##          649          650          651          652          653          654 
##   6.34206008  -2.65793992  -7.65793992  12.34206008  -9.65793992  -9.65793992 
##          655          656          657          658          659          660 
##   6.34206008  -1.65793992  14.34206008   0.34206008   2.34206008  -3.65793992 
##          661          662          663          664          665          666 
##  -3.65793992 -10.65793992  -5.65793992  -3.65793992  -2.65793992   6.34206008 
##          667          668          669          670          671          672 
##  -7.65793992  -3.65793992  -9.65793992  10.34206008  -7.65793992  12.34206008 
##          673          674          675          676          677          678 
##  -8.59670839  -7.59670839   0.40329161  13.40329161   7.40329161 -12.59670839 
##          679          680          681          682          683          684 
##   3.40329161  -3.59670839   8.40329161   9.40329161  -4.59670839   1.40329161 
##          685          686          687          688          689          690 
##  -9.59670839  -5.59670839 -10.59670839  -5.59670839   7.40329161   8.40329161 
##          691          692          693          694          695          696 
##  -6.59670839  -6.59670839   3.40329161  -2.59670839  -4.59670839  10.40329161 
##          697          698          699          700          701          702 
##   3.05919495 -13.94080505   6.05919495  -2.94080505  -6.94080505   6.05919495 
##          703          704          705          706          707          708 
##  -3.94080505  -9.94080505  -2.94080505  -4.94080505   7.05919495   3.05919495 
##          709          710          711          712          713          714 
##   0.05919495   0.05919495  -7.94080505  -1.94080505   8.05919495  -3.94080505 
##          715          716          717          718          719          720 
##   4.05919495  -3.94080505  -5.94080505   8.05919495   8.05919495  10.05919495 
##          721          722          723          724          725          726 
##  -1.48900198   6.51099802  -9.48900198   0.51099802  -1.48900198   6.51099802 
##          727          728          729          730          731          732 
## -11.48900198   9.51099802   8.51099802  -1.48900198  -7.48900198  -0.48900198 
##          733          734          735          736          737          738 
##   4.51099802   4.51099802 -11.48900198   2.51099802   4.51099802  -2.48900198 
##          739          740          741          742          743          744 
##  -7.48900198  -5.48900198   0.51099802   8.51099802   2.51099802   0.51099802 
##          745          746          747          748          749          750 
##   3.72588800   5.72588800   4.72588800  -0.27411200  -6.27411200 -11.27411200 
##          751          752          753          754          755          756 
##   8.72588800   7.72588800 -10.27411200   5.72588800   0.72588800 -13.27411200 
##          757          758          759          760          761          762 
##   0.72588800   7.72588800  -4.27411200  -5.27411200   7.72588800   5.72588800 
##          763          764          765          766          767          768 
##   5.72588800  -3.27411200   2.72588800  -5.27411200  -2.27411200 -10.27411200 
##          769          770          771          772          773          774 
##  -4.14725342  -2.14725342   7.85274658 -10.14725342  -0.14725342  -5.14725342 
##          775          776          777          778          779          780 
##   7.85274658   5.85274658   9.85274658   5.85274658   1.85274658 -12.14725342 
##          781          782          783          784          785          786 
##  11.85274658  11.85274658  -2.14725342  -5.14725342 -12.14725342   3.85274658 
##          787          788          789          790          791          792 
##   1.85274658 -12.14725342  -1.14725342  -7.14725342  -8.14725342   4.85274658 
##          793          794          795          796          797          798 
##  -3.97173021   9.02826979  -6.97173021  -4.97173021  -3.97173021  -1.97173021 
##          799          800          801          802          803          804 
##  -3.97173021   0.02826979  -0.97173021   5.02826979  -3.97173021   4.02826979 
##          805          806          807          808          809          810 
##   1.02826979  -2.97173021   4.02826979  -5.97173021  -2.97173021  -1.97173021 
##          811          812          813          814          815          816 
##  -8.97173021   3.02826979  -4.97173021   4.02826979   7.02826979  12.02826979 
##          817          818          819          820          821          822 
##  -5.66593703   8.33406297  -5.66593703  -3.66593703  -3.66593703  -0.66593703 
##          823          824          825          826          827          828 
##  -7.66593703  -5.66593703   9.33406297  -5.66593703   6.33406297   2.33406297 
##          829          830          831          832          833          834 
##  -7.66593703  -7.66593703  -7.66593703   6.33406297 -10.66593703  17.33406297 
##          835          836          837          838          839          840 
##   8.33406297  -1.66593703  10.33406297  -6.66593703  -7.66593703   0.33406297 
##          841          842          843          844          845          846 
##  -0.28263277   6.71736723  10.71736723   4.71736723 -15.28263277 -11.28263277 
##          847          848          849          850          851          852 
##  -8.28263277  -5.28263277  -8.28263277  -3.28263277   2.71736723  -2.28263277 
##          853          854          855          856          857          858 
##   8.71736723   8.71736723  10.71736723  -2.28263277 -10.28263277   8.71736723 
##          859          860          861          862          863          864 
##  -1.28263277  10.71736723  -9.28263277  -5.28263277   4.71736723   4.71736723 
##          865          866          867          868          869          870 
##  -4.53081197  -6.53081197 -12.53081197  13.46918803  -1.53081197   8.46918803 
##          871          872          873          874          875          876 
##  10.46918803   7.46918803   1.46918803  -8.53081197   3.46918803  -5.53081197 
##          877          878          879          880          881          882 
##  -2.53081197  -8.53081197   1.46918803  -9.53081197   9.46918803 -10.53081197 
##          883          884          885          886          887          888 
##  -5.53081197   5.46918803  12.46918803  -6.53081197   5.46918803  -0.53081197 
##          889          890          891          892          893          894 
##  -8.28114093   3.71885907  10.71885907   0.71885907  -9.28114093  -5.28114093 
##          895          896          897          898          899          900 
##  -0.28114093  -4.28114093  -3.28114093   9.71885907  -2.28114093   4.71885907 
##          901          902          903          904          905          906 
##  -6.28114093 -10.28114093  -8.28114093   9.71885907  -4.28114093   4.71885907 
##          907          908          909          910          911          912 
##  -6.28114093   0.71885907  13.71885907   1.71885907  -3.28114093  -4.28114093 
##          913          914          915          916          917          918 
##  -3.67840880   4.32159120  -9.67840880  -1.67840880   0.32159120  12.32159120 
##          919          920          921          922          923          924 
##  -4.67840880   5.32159120  10.32159120  -7.67840880  -5.67840880  -3.67840880 
##          925          926          927          928          929          930 
##  -1.67840880  -0.67840880  12.32159120   3.32159120  -3.67840880  -1.67840880 
##          931          932          933          934          935          936 
##   4.32159120  -3.67840880  -7.67840880  -7.67840880   0.32159120  -0.67840880 
##          937          938          939          940          941          942 
##   2.16610830  11.16610830  -2.83389170   4.16610830   0.16610830  -0.83389170 
##          943          944          945          946          947          948 
##   7.16610830   5.16610830   9.16610830 -11.83389170   1.16610830  -8.83389170 
##          949          950          951          952          953          954 
##   9.16610830  -7.83389170   1.16610830  -4.83389170  -4.83389170   1.16610830 
##          955          956          957          958          959          960 
##  -0.83389170  -2.83389170   9.16610830 -10.83389170 -12.83389170   2.16610830 
##          961          962          963          964          965          966 
##   3.64066514  -7.35933486   0.64066514  -8.35933486  -0.35933486  10.64066514 
##          967          968          969          970          971          972 
##  -1.35933486  -3.35933486 -11.35933486  -5.35933486  -5.35933486  -7.35933486 
##          973          974          975          976          977          978 
##  -0.35933486   9.64066514  10.64066514  -1.35933486   6.64066514  -6.35933486 
##          979          980          981          982          983          984 
##  -9.35933486   4.64066514   0.64066514   8.64066514   6.64066514  -3.35933486 
##          985          986          987          988          989          990 
##  -2.82291176  10.17708824  -1.82291176   2.17708824  -0.82291176  -2.82291176 
##          991          992          993          994          995          996 
##  -3.82291176   1.17708824 -11.82291176  -7.82291176 -11.82291176   8.17708824 
##          997          998          999         1000         1001         1002 
##   2.17708824  10.17708824   4.17708824   8.17708824  -3.82291176  -1.82291176 
##         1003         1004         1005         1006         1007         1008 
##   0.17708824   9.17708824   0.17708824   4.17708824  -7.82291176  -1.82291176 
##         1009         1010         1011         1012         1013         1014 
## -14.70739847   3.29260153  -4.70739847   4.29260153  13.29260153   2.29260153 
##         1015         1016         1017         1018         1019         1020 
##   6.29260153  -4.70739847   0.29260153  -0.70739847  -2.70739847  -3.70739847 
##         1021         1022         1023         1024         1025         1026 
##  -6.70739847   6.29260153   0.29260153   8.29260153  -1.70739847   6.29260153 
##         1027         1028         1029         1030         1031         1032 
##   4.29260153  -0.70739847  -5.70739847  -3.70739847   8.29260153 -13.70739847 
##         1033         1034         1035         1036         1037         1038 
##  -8.01619042  -4.01619042   3.98380958   7.98380958   4.98380958  10.98380958 
##         1039         1040         1041         1042         1043         1044 
##   9.98380958  11.98380958   7.98380958  -6.01619042  -8.01619042  -6.01619042 
##         1045         1046         1047         1048         1049         1050 
##   3.98380958   3.98380958 -11.01619042   3.98380958 -13.01619042 -10.01619042 
##         1051         1052         1053         1054         1055         1056 
##   6.98380958  11.98380958  -8.01619042  -8.01619042  -4.01619042  -5.01619042 
##         1057         1058         1059         1060         1061         1062 
##  -2.98367831   3.01632169  -8.98367831   9.01632169  -2.98367831  -0.98367831 
##         1063         1064         1065         1066         1067         1068 
##   5.01632169  -1.98367831  -5.98367831   9.01632169  -6.98367831   7.01632169 
##         1069         1070         1071         1072         1073         1074 
##  -6.98367831   7.01632169   9.01632169  -5.98367831   9.01632169   0.01632169 
##         1075         1076         1077         1078         1079         1080 
##  -5.98367831  -3.98367831 -10.98367831   1.01632169   3.01632169  -2.98367831 
##         1081         1082         1083         1084         1085         1086 
##   3.30226476 -11.69773524   8.30226476  -9.69773524  -5.69773524   6.30226476 
##         1087         1088         1089         1090         1091         1092 
##  -5.69773524  -5.69773524  -1.69773524  -7.69773524   6.30226476  -5.69773524 
##         1093         1094         1095         1096         1097         1098 
##  -3.69773524  -0.69773524   6.30226476   3.30226476 -11.69773524  12.30226476 
##         1099         1100         1101         1102         1103         1104 
##   8.30226476   0.30226476  -0.69773524   9.30226476   4.30226476  -1.69773524 
##         1105         1106         1107         1108         1109         1110 
## -10.54206213  -4.54206213   7.45793787   0.45793787  -6.54206213   2.45793787 
##         1111         1112         1113         1114         1115         1116 
##  -2.54206213   6.45793787  11.45793787   1.45793787   4.45793787  -3.54206213 
##         1117         1118         1119         1120         1121         1122 
##  -3.54206213   6.45793787   2.45793787  -1.54206213 -14.54206213   2.45793787 
##         1123         1124         1125         1126         1127         1128 
##   1.45793787   2.45793787   5.45793787  -3.54206213   5.45793787  -2.54206213 
##         1129         1130         1131         1132         1133         1134 
## -13.86806991  -5.86806991  -7.86806991 -10.86806991   8.13193009   6.13193009 
##         1135         1136         1137         1138         1139         1140 
## -11.86806991   1.13193009  12.13193009  -1.86806991   1.13193009  -0.86806991 
##         1141         1142         1143         1144         1145         1146 
##   8.13193009   2.13193009  -9.86806991  10.13193009   6.13193009  -0.86806991 
##         1147         1148         1149         1150         1151         1152 
##   2.13193009  -0.86806991  -4.86806991  11.13193009  -5.86806991   8.13193009 
##         1153         1154         1155         1156         1157         1158 
##  -5.54091969   9.45908031   2.45908031 -11.54091969  -7.54091969  -1.54091969 
##         1159         1160         1161         1162         1163         1164 
## -11.54091969   3.45908031 -15.54091969  -7.54091969  -4.54091969   8.45908031 
##         1165         1166         1167         1168         1169         1170 
##   0.45908031   4.45908031   7.45908031   6.45908031  -1.54091969   1.45908031 
##         1171         1172         1173         1174         1175         1176 
##  11.45908031   0.45908031   3.45908031   6.45908031   6.45908031   1.45908031 
##         1177         1178         1179         1180         1181         1182 
## -13.51640470   4.48359530  -8.51640470   2.48359530  -5.51640470  -9.51640470 
##         1183         1184         1185         1186         1187         1188 
##  -4.51640470   4.48359530  -5.51640470   0.48359530   6.48359530 -11.51640470 
##         1189         1190         1191         1192         1193         1194 
##   4.48359530   1.48359530  -4.51640470   8.48359530  11.48359530 -12.51640470 
##         1195         1196         1197         1198         1199         1200 
##   8.48359530   6.48359530   5.48359530  11.48359530   6.48359530  -3.51640470 
##         1201         1202         1203         1204         1205         1206 
##   6.13016887   6.13016887   9.13016887   6.13016887 -10.86983113   1.13016887 
##         1207         1208         1209         1210         1211         1212 
##  -0.86983113  -1.86983113   6.13016887  -3.86983113  -7.86983113   2.13016887 
##         1213         1214         1215         1216         1217         1218 
##   4.13016887  -1.86983113 -10.86983113  -8.86983113  -5.86983113   6.13016887 
##         1219         1220         1221         1222         1223         1224 
##   6.13016887  -7.86983113  12.13016887   2.13016887  -9.86983113   0.13016887 
##         1225         1226         1227         1228         1229         1230 
##  -0.42161372   6.57838628  10.57838628  -2.42161372  -4.42161372  -3.42161372 
##         1231         1232         1233         1234         1235         1236 
##  10.57838628  -8.42161372  10.57838628  -6.42161372  -2.42161372  10.57838628 
##         1237         1238         1239         1240         1241         1242 
##   4.57838628  -5.42161372   2.57838628   3.57838628  -5.42161372  -7.42161372 
##         1243         1244         1245         1246         1247         1248 
##   0.57838628  -4.42161372 -11.42161372   1.57838628  -6.42161372   2.57838628 
##         1249         1250         1251         1252         1253         1254 
##  -5.17800431  -6.17800431   6.82199569   2.82199569  -3.17800431  -5.17800431 
##         1255         1256         1257         1258         1259         1260 
##  -9.17800431  10.82199569  -2.17800431  -5.17800431   8.82199569   2.82199569 
##         1261         1262         1263         1264         1265         1266 
##   7.82199569   2.82199569  12.82199569  -7.17800431   0.82199569  -1.17800431 
##         1267         1268         1269         1270         1271         1272 
##  -6.17800431  12.82199569  -3.17800431  -7.17800431  -5.17800431  -4.17800431 
##         1273         1274         1275         1276         1277         1278 
##   9.98952180 -10.01047820  -2.01047820   5.98952180  -3.01047820  -7.01047820 
##         1279         1280         1281         1282         1283         1284 
## -12.01047820  -7.01047820   0.98952180  -4.01047820  -7.01047820   2.98952180 
##         1285         1286         1287         1288         1289         1290 
##  -7.01047820   6.98952180   0.98952180  -6.01047820  -3.01047820   4.98952180 
##         1291         1292         1293         1294         1295         1296 
##   0.98952180   1.98952180   9.98952180  13.98952180  11.98952180  -6.01047820 
##         1297         1298         1299         1300         1301         1302 
##  -3.76634511   1.23365489   3.23365489  10.23365489   9.23365489  -7.76634511 
##         1303         1304         1305         1306         1307         1308 
##  -9.76634511 -11.76634511   7.23365489   6.23365489  -2.76634511  -4.76634511 
##         1309         1310         1311         1312         1313         1314 
##   2.23365489   3.23365489  -7.76634511  -1.76634511   1.23365489   3.23365489 
##         1315         1316         1317         1318         1319         1320 
## -10.76634511   3.23365489  -2.76634511  -6.76634511  10.23365489   6.23365489 
##         1321         1322         1323         1324         1325         1326 
##   4.32581158  -9.67418842  -5.67418842  -3.67418842  -7.67418842  -9.67418842 
##         1327         1328         1329         1330         1331         1332 
##  -1.67418842  14.32581158  -1.67418842  -4.67418842   0.32581158   0.32581158 
##         1333         1334         1335         1336         1337         1338 
##  12.32581158   6.32581158  11.32581158   9.32581158  -1.67418842   9.32581158 
##         1339         1340         1341         1342         1343         1344 
##   1.32581158  -1.67418842  -3.67418842  -4.67418842  -9.67418842   0.32581158 
##         1345         1346         1347         1348         1349         1350 
##   5.40760711  -8.59239289   4.40760711   5.40760711   3.40760711  -0.59239289 
##         1351         1352         1353         1354         1355         1356 
##  -4.59239289  -0.59239289  11.40760711  -2.59239289  -4.59239289 -14.59239289 
##         1357         1358         1359         1360         1361         1362 
##   6.40760711   7.40760711   1.40760711  -4.59239289  -7.59239289   5.40760711 
##         1363         1364         1365         1366         1367         1368 
##   7.40760711  -7.59239289   6.40760711   2.40760711  -7.59239289   4.40760711 
##         1369         1370         1371         1372         1373         1374 
##  10.92486294  10.92486294  -5.07513706  -2.07513706  -3.07513706  -5.07513706 
##         1375         1376         1377         1378         1379         1380 
##  -9.07513706  -9.07513706   1.92486294  -9.07513706  -7.07513706  -8.07513706 
##         1381         1382         1383         1384         1385         1386 
##   0.92486294   9.92486294  -9.07513706  -9.07513706  -5.07513706   0.92486294 
##         1387         1388         1389         1390         1391         1392 
##  -4.07513706  14.92486294  10.92486294  10.92486294  12.92486294  -6.07513706 
##         1393         1394         1395         1396         1397         1398 
##  -0.47581632  -8.47581632  -8.47581632   7.52418368   1.52418368  -1.47581632 
##         1399         1400         1401         1402         1403         1404 
##  -8.47581632  -2.47581632 -10.47581632   7.52418368   1.52418368   0.52418368 
##         1405         1406         1407         1408         1409         1410 
##   6.52418368   1.52418368  -3.47581632   2.52418368   3.52418368  -1.47581632 
##         1411         1412         1413         1414         1415         1416 
##   1.52418368  -4.47581632   7.52418368  -0.47581632  13.52418368  -1.47581632 
##         1417         1418         1419         1420         1421         1422 
##  -5.57535134   2.42464866   0.42464866  -2.57535134   6.42464866  -7.57535134 
##         1423         1424         1425         1426         1427         1428 
##   3.42464866  12.42464866  10.42464866  -7.57535134   8.42464866   7.42464866 
##         1429         1430         1431         1432         1433         1434 
##   0.42464866 -12.57535134   2.42464866 -12.57535134   0.42464866  14.42464866 
##         1435         1436         1437         1438         1439         1440 
##  -1.57535134   4.42464866 -11.57535134  -1.57535134  -3.57535134  -6.57535134 
##         1441         1442         1443         1444         1445         1446 
##  -2.77310467  -7.77310467  -1.77310467 -10.77310467 -12.77310467  -0.77310467 
##         1447         1448         1449         1450         1451         1452 
##   2.22689533   3.22689533   7.22689533   1.22689533  -1.77310467   3.22689533 
##         1453         1454         1455         1456         1457         1458 
##   5.22689533   8.22689533  -1.77310467  -4.77310467  -0.77310467   1.22689533 
##         1459         1460         1461         1462         1463         1464 
## -10.77310467  -0.77310467   6.22689533  14.22689533   6.22689533   3.22689533 
##         1465         1466         1467         1468         1469         1470 
##  -2.69078547   7.30921453   4.30921453  -6.69078547   2.30921453  -5.69078547 
##         1471         1472         1473         1474         1475         1476 
##  -1.69078547   1.30921453  10.30921453  -4.69078547  -3.69078547  -4.69078547 
##         1477         1478         1479         1480         1481         1482 
##  -2.69078547  11.30921453   0.30921453   4.30921453   7.30921453  -3.69078547 
##         1483         1484         1485         1486         1487         1488 
##   6.30921453  -3.69078547  -0.69078547   9.30921453  -7.69078547 -11.69078547 
##         1489         1490         1491         1492         1493         1494 
##  -4.48143343  -8.48143343 -11.48143343  -8.48143343   9.51856657   7.51856657 
##         1495         1496         1497         1498         1499         1500 
##   8.51856657   0.51856657   4.51856657  -9.48143343  -7.48143343  10.51856657 
##         1501         1502         1503         1504         1505         1506 
##   0.51856657   7.51856657   8.51856657   2.51856657   0.51856657   1.51856657 
##         1507         1508         1509         1510         1511         1512 
## -12.48143343   6.51856657   8.51856657  -3.48143343  -2.48143343   2.51856657 
##         1513         1514         1515         1516         1517         1518 
##  -9.25337373   3.74662627  -4.25337373   2.74662627 -11.25337373   7.74662627 
##         1519         1520         1521         1522         1523         1524 
##   4.74662627  -4.25337373  -3.25337373 -10.25337373  -1.25337373  11.74662627 
##         1525         1526         1527         1528         1529         1530 
##  -6.25337373   4.74662627   4.74662627   1.74662627  -6.25337373   1.74662627 
##         1531         1532         1533         1534         1535         1536 
##   5.74662627   3.74662627  -8.25337373   3.74662627   5.74662627   8.74662627 
##         1537         1538         1539         1540         1541         1542 
##   3.96395948  -6.03604052  -1.03604052   0.96395948   8.96395948   4.96395948 
##         1543         1544         1545         1546         1547         1548 
##  -1.03604052   0.96395948 -11.03604052   7.96395948  -2.03604052   9.96395948 
##         1549         1550         1551         1552         1553         1554 
##   7.96395948   9.96395948  -2.03604052  -4.03604052   1.96395948  -6.03604052 
##         1555         1556         1557         1558         1559         1560 
## -12.03604052  -6.03604052   7.96395948  -2.03604052  -2.03604052  -1.03604052 
##         1561         1562         1563         1564         1565         1566 
##  -4.85093325   4.14906675   4.14906675  -1.85093325  -9.85093325  10.14906675 
##         1567         1568         1569         1570         1571         1572 
##  -9.85093325   5.14906675   4.14906675  -3.85093325   0.14906675   2.14906675 
##         1573         1574         1575         1576         1577         1578 
##   5.14906675  11.14906675  -5.85093325   7.14906675  10.14906675  -4.85093325 
##         1579         1580         1581         1582         1583         1584 
##  -3.85093325   4.14906675 -11.85093325  -7.85093325  -0.85093325  -0.85093325 
##         1585         1586         1587         1588         1589         1590 
##  -7.54723474   8.45276526  -7.54723474  10.45276526   4.45276526   2.45276526 
##         1591         1592         1593         1594         1595         1596 
##  -3.54723474  -5.54723474  13.45276526  -0.54723474   8.45276526 -10.54723474 
##         1597         1598         1599         1600         1601         1602 
##  -3.54723474  -0.54723474  -6.54723474  -1.54723474  -5.54723474   3.45276526 
##         1603         1604         1605         1606         1607         1608 
##  10.45276526   2.45276526  -7.54723474   2.45276526   5.45276526  -3.54723474 
##         1609         1610         1611         1612         1613         1614 
##  -5.50147376  -0.50147376  -8.50147376  -4.50147376  -6.50147376  -0.50147376 
##         1615         1616         1617         1618         1619         1620 
##   8.49852624  -0.50147376   1.49852624  11.49852624   6.49852624  14.49852624 
##         1621         1622         1623         1624         1625         1626 
##   9.49852624  -4.50147376  -0.50147376  -8.50147376   3.49852624  -3.50147376 
##         1627         1628         1629         1630         1631         1632 
##   8.49852624  -0.50147376  -1.50147376  -6.50147376  -6.50147376   1.49852624 
##         1633         1634         1635         1636         1637         1638 
##   3.63522231   8.63522231  -5.36477769   8.63522231   4.63522231  -2.36477769 
##         1639         1640         1641         1642         1643         1644 
##   8.63522231   6.63522231   4.63522231  -3.36477769  -7.36477769   6.63522231 
##         1645         1646         1647         1648         1649         1650 
##  -2.36477769   5.63522231  -1.36477769  -6.36477769   6.63522231 -10.36477769 
##         1651         1652         1653         1654         1655         1656 
##  -7.36477769   2.63522231  -7.36477769  -8.36477769  -5.36477769  10.63522231 
##         1657         1658         1659         1660         1661         1662 
##  -0.43505367   6.56494633   6.56494633  -6.43505367   3.56494633   3.56494633 
##         1663         1664         1665         1666         1667         1668 
##   3.56494633  -8.43505367 -11.43505367  -6.43505367   1.56494633   5.56494633 
##         1669         1670         1671         1672         1673         1674 
##   7.56494633  -4.43505367  -6.43505367  -8.43505367   1.56494633  -4.43505367 
##         1675         1676         1677         1678         1679         1680 
##   1.56494633  -0.43505367   9.56494633   0.56494633  12.56494633   7.56494633 
##         1681         1682         1683         1684         1685         1686 
##   8.86670934  -7.13329066   0.86670934   2.86670934   8.86670934  -0.13329066 
##         1687         1688         1689         1690         1691         1692 
##  -5.13329066  -1.13329066   2.86670934   1.86670934   4.86670934  -4.13329066 
##         1693         1694         1695         1696         1697         1698 
##   0.86670934  -7.13329066   8.86670934   8.86670934  -5.13329066   3.86670934 
##         1699         1700         1701         1702         1703         1704 
##   6.86670934  -3.13329066  -6.13329066  -7.13329066  -5.13329066  -3.13329066 
##         1705         1706         1707         1708         1709         1710 
##  -1.56946485   0.43053515   3.43053515   3.43053515  -4.56946485   8.43053515 
##         1711         1712         1713         1714         1715         1716 
##  12.43053515 -11.56946485  -8.56946485 -11.56946485  -6.56946485  -4.56946485 
##         1717         1718         1719         1720         1721         1722 
##  -0.56946485  11.43053515  -0.56946485  -3.56946485   0.43053515  -6.56946485 
##         1723         1724         1725         1726         1727         1728 
##   9.43053515  -2.56946485  11.43053515  -7.56946485  11.43053515   9.43053515 
##         1729         1730         1731         1732         1733         1734 
##   8.83183319   0.83183319   5.83183319   9.83183319   5.83183319   1.83183319 
##         1735         1736         1737         1738         1739         1740 
##  -8.16816681   0.83183319 -10.16816681  -3.16816681   4.83183319  -6.16816681 
##         1741         1742         1743         1744         1745         1746 
##  -3.16816681  -8.16816681  -0.16816681  -3.16816681  10.83183319   5.83183319 
##         1747         1748         1749         1750         1751         1752 
##  -7.16816681   4.83183319 -10.16816681   1.83183319  -5.16816681   8.83183319 
##         1753         1754         1755         1756         1757         1758 
##  -4.90523095  12.09476905  -5.90523095  -2.90523095  -0.90523095  -8.90523095 
##         1759         1760         1761         1762         1763         1764 
##   4.09476905  -6.90523095  -6.90523095  -1.90523095  -9.90523095   2.09476905 
##         1765         1766         1767         1768         1769         1770 
##  12.09476905  -0.90523095   8.09476905  -6.90523095   2.09476905  13.09476905 
##         1771         1772         1773         1774         1775         1776 
##  -4.90523095   2.09476905   5.09476905   9.09476905   2.09476905  -8.90523095 
##         1777         1778         1779         1780         1781         1782 
##  -3.42996023  -0.42996023   9.57003977  -9.42996023 -10.42996023   8.57003977 
##         1783         1784         1785         1786         1787         1788 
##   2.57003977   4.57003977  -1.42996023   1.57003977 -13.42996023  13.57003977 
##         1789         1790         1791         1792         1793         1794 
##  10.57003977  -0.42996023   1.57003977  -2.42996023  -1.42996023  -9.42996023 
##         1795         1796         1797         1798         1799         1800 
##   1.57003977  -2.42996023   7.57003977   7.57003977  -3.42996023  -0.42996023 
##         1801         1802         1803         1804         1805         1806 
##   5.25210827  -6.74789173  -3.74789173   9.25210827  12.25210827   4.25210827 
##         1807         1808         1809         1810         1811         1812 
##  11.25210827  -2.74789173   0.25210827  -0.74789173   5.25210827  -7.74789173 
##         1813         1814         1815         1816         1817         1818 
##  -2.74789173  11.25210827  -6.74789173   3.25210827   3.25210827   0.25210827 
##         1819         1820         1821         1822         1823         1824 
## -10.74789173   3.25210827  -4.74789173 -11.74789173   6.25210827  -8.74789173 
##         1825         1826         1827         1828         1829         1830 
##   8.84668496   8.84668496   8.84668496   4.84668496   8.84668496  -1.15331504 
##         1831         1832         1833         1834         1835         1836 
##   1.84668496  -9.15331504 -12.15331504   3.84668496  -5.15331504  -8.15331504 
##         1837         1838         1839         1840         1841         1842 
##   8.84668496   4.84668496 -11.15331504  -8.15331504  -3.15331504  12.84668496 
##         1843         1844         1845         1846         1847         1848 
##   9.84668496   4.84668496  -7.15331504 -11.15331504 -11.15331504   6.84668496 
##         1849         1850         1851         1852         1853         1854 
##   5.27908242 -11.72091758  -7.72091758  -1.72091758  10.27908242  11.27908242 
##         1855         1856         1857         1858         1859         1860 
##  12.27908242  10.27908242   4.27908242   0.27908242  -2.72091758   3.27908242 
##         1861         1862         1863         1864         1865         1866 
##   0.27908242 -14.72091758   4.27908242  -9.72091758   9.27908242 -11.72091758 
##         1867         1868         1869         1870         1871         1872 
##  -1.72091758  -4.72091758  -9.72091758  10.27908242   8.27908242   2.27908242 
##         1873         1874         1875         1876         1877         1878 
##  10.59226988   0.59226988  -2.40773012  -5.40773012  -3.40773012  -2.40773012 
##         1879         1880         1881         1882         1883         1884 
##   0.59226988 -11.40773012   1.59226988   7.59226988  -3.40773012   0.59226988 
##         1885         1886         1887         1888         1889         1890 
##  -2.40773012  -3.40773012  -1.40773012   9.59226988   1.59226988   7.59226988 
##         1891         1892         1893         1894         1895         1896 
##  -7.40773012  -0.40773012   5.59226988   5.59226988  -6.40773012   5.59226988 
##         1897         1898         1899         1900         1901         1902 
##  -4.65809909   2.34190091  -8.65809909   2.34190091  11.34190091   4.34190091 
##         1903         1904         1905         1906         1907         1908 
##   9.34190091  -5.65809909 -13.65809909  -5.65809909   8.34190091  13.34190091 
##         1909         1910         1911         1912         1913         1914 
##   6.34190091 -10.65809909   6.34190091  -5.65809909  -3.65809909 -11.65809909 
##         1915         1916         1917         1918         1919         1920 
##   7.34190091   9.34190091 -10.65809909   7.34190091  -6.65809909  11.34190091 
##         1921         1922         1923         1924         1925         1926 
##  -7.73013629  -5.73013629   7.26986371   7.26986371  13.26986371  -1.73013629 
##         1927         1928         1929         1930         1931         1932 
##   5.26986371   6.26986371  -4.73013629  -1.73013629  -6.73013629  -8.73013629 
##         1933         1934         1935         1936         1937         1938 
##   6.26986371  -0.73013629   1.26986371  -8.73013629  10.26986371  -4.73013629 
##         1939         1940         1941         1942         1943         1944 
##   6.26986371   2.26986371   6.26986371   4.26986371  -8.73013629  -3.73013629 
##         1945         1946         1947         1948         1949         1950 
##   1.57460955   3.57460955  -8.42539045  -6.42539045   9.57460955  -6.42539045 
##         1951         1952         1953         1954         1955         1956 
##  -0.42539045  -1.42539045   0.57460955   5.57460955  10.57460955   1.57460955 
##         1957         1958         1959         1960         1961         1962 
##   3.57460955  -1.42539045  -6.42539045   3.57460955   5.57460955 -11.42539045 
##         1963         1964         1965         1966         1967         1968 
##   2.57460955   9.57460955  -4.42539045  -4.42539045  -5.42539045   9.57460955 
##         1969         1970         1971         1972         1973         1974 
##  -2.30757632   5.69242368  -8.30757632  -5.30757632  -5.30757632   7.69242368 
##         1975         1976         1977         1978         1979         1980 
##   6.69242368   5.69242368   0.69242368 -11.30757632   8.69242368  -3.30757632 
##         1981         1982         1983         1984         1985         1986 
##   8.69242368  -9.30757632  -8.30757632   1.69242368  10.69242368  12.69242368 
##         1987         1988         1989         1990         1991         1992 
## -12.30757632   8.69242368   2.69242368   2.69242368  -1.30757632  -1.30757632 
##         1993         1994         1995         1996         1997         1998 
##  -2.21384863  -0.21384863  -9.21384863  10.78615137   5.78615137 -10.21384863 
##         1999         2000         2001         2002         2003         2004 
##  -9.21384863  -7.21384863  -7.21384863  11.78615137   5.78615137  -0.21384863 
##         2005         2006         2007         2008         2009         2010 
##   7.78615137  -4.21384863  -4.21384863   7.78615137   2.78615137   8.78615137 
##         2011         2012         2013         2014         2015         2016 
##  -2.21384863   3.78615137   5.78615137  -4.21384863   9.78615137 -10.21384863 
##         2017         2018         2019         2020         2021         2022 
##  -5.74779662   5.25220338  -2.74779662  13.25220338  -2.74779662   1.25220338 
##         2023         2024         2025         2026         2027         2028 
##  -1.74779662  -7.74779662  -6.74779662   8.25220338  -8.74779662  -3.74779662 
##         2029         2030         2031         2032         2033         2034 
##  -4.74779662  -3.74779662   1.25220338 -10.74779662   1.25220338   7.25220338 
##         2035         2036         2037         2038         2039         2040 
##  13.25220338   3.25220338  11.25220338   9.25220338 -10.74779662  11.25220338 
##         2041         2042         2043         2044         2045         2046 
##   0.75417888 -10.24582112   9.75417888   9.75417888   9.75417888  -6.24582112 
##         2047         2048         2049         2050         2051         2052 
##   5.75417888   2.75417888  -6.24582112  -4.24582112 -12.24582112   5.75417888 
##         2053         2054         2055         2056         2057         2058 
##   9.75417888   3.75417888  -0.24582112   3.75417888   4.75417888   3.75417888 
##         2059         2060         2061         2062         2063         2064 
## -10.24582112  -8.24582112  -3.24582112   5.75417888  -2.24582112   1.75417888 
##         2065         2066         2067         2068         2069         2070 
##  11.36885912  -8.63114088  13.36885912   3.36885912 -11.63114088   7.36885912 
##         2071         2072         2073         2074         2075         2076 
##   5.36885912   5.36885912  -8.63114088  13.36885912  -6.63114088  -6.63114088 
##         2077         2078         2079         2080         2081         2082 
##   3.36885912  -4.63114088 -11.63114088   3.36885912  -1.63114088   1.36885912 
##         2083         2084         2085         2086         2087         2088 
##   7.36885912  10.36885912   1.36885912   3.36885912  -8.63114088  -6.63114088 
##         2089         2090         2091         2092         2093         2094 
##   1.11444403  -9.88555597  10.11444403   2.11444403  -1.88555597  -0.88555597 
##         2095         2096         2097         2098         2099         2100 
##   6.11444403  -6.88555597  12.11444403   0.11444403  -0.88555597  -4.88555597 
##         2101         2102         2103         2104         2105         2106 
##  13.11444403  -5.88555597   3.11444403  -6.88555597  -5.88555597   2.11444403 
##         2107         2108         2109         2110         2111         2112 
##   4.11444403  14.11444403  10.11444403  -7.88555597  -7.88555597  -2.88555597 
##         2113         2114         2115         2116         2117         2118 
##  -3.52721036  -1.52721036  -5.52721036   5.47278964  -0.52721036   2.47278964 
##         2119         2120         2121         2122         2123         2124 
##  15.47278964   4.47278964   3.47278964   7.47278964  -1.52721036  -3.52721036 
##         2125         2126         2127         2128         2129         2130 
##  10.47278964  -9.52721036   0.47278964   7.47278964   0.47278964  -4.52721036 
##         2131         2132         2133         2134         2135         2136 
##  -7.52721036  -6.52721036  -4.52721036  -7.52721036  10.47278964  -4.52721036 
##         2137         2138         2139         2140         2141         2142 
##   0.61000937  -3.38999063  -9.38999063  -3.38999063   0.61000937   5.61000937 
##         2143         2144         2145         2146         2147         2148 
##  -5.38999063  -5.38999063  -5.38999063   6.61000937  -2.38999063   7.61000937 
##         2149         2150         2151         2152         2153         2154 
##  -6.38999063   4.61000937  -6.38999063  -1.38999063   7.61000937  10.61000937 
##         2155         2156         2157         2158         2159         2160 
##  -5.38999063   2.61000937  -3.38999063  14.61000937  -7.38999063  10.61000937 
##         2161         2162         2163         2164         2165         2166 
##  -1.78627438   2.21372562   0.21372562  14.21372562  -1.78627438  -1.78627438 
##         2167         2168         2169         2170         2171         2172 
##   0.21372562   6.21372562  -0.78627438   3.21372562  -5.78627438   7.21372562 
##         2173         2174         2175         2176         2177         2178 
##  -5.78627438  -5.78627438  -7.78627438   2.21372562  -5.78627438  -8.78627438 
##         2179         2180         2181         2182         2183         2184 
##  -0.78627438  15.21372562  -1.78627438  -5.78627438  12.21372562  -3.78627438 
##         2185         2186         2187         2188         2189         2190 
##  -9.96909677   0.03090323  -6.96909677  -2.96909677   9.03090323  -5.96909677 
##         2191         2192         2193         2194         2195         2196 
##   8.03090323  15.03090323  -5.96909677   1.03090323   0.03090323   7.03090323 
##         2197         2198         2199         2200         2201         2202 
##  12.03090323   1.03090323   7.03090323  -8.96909677 -12.96909677   3.03090323 
##         2203         2204         2205         2206         2207         2208 
##  -1.96909677   4.03090323  -2.96909677  -2.96909677   7.03090323   0.03090323 
##         2209         2210         2211         2212         2213         2214 
##  -0.61286178   2.38713822  -6.61286178   1.38713822  -7.61286178  -8.61286178 
##         2215         2216         2217         2218         2219         2220 
##  -9.61286178   3.38713822  -9.61286178  -0.61286178  -0.61286178  15.38713822 
##         2221         2222         2223         2224         2225         2226 
##   3.38713822  -6.61286178   9.38713822  -1.61286178  13.38713822   3.38713822 
##         2227         2228         2229         2230         2231         2232 
##   2.38713822  11.38713822 -13.61286178   7.38713822  -5.61286178  13.38713822 
##         2233         2234         2235         2236         2237         2238 
##   4.83543479   7.83543479   8.83543479   2.83543479   4.83543479 -10.16456521 
##         2239         2240         2241         2242         2243         2244 
##  -0.16456521   1.83543479  11.83543479   1.83543479   3.83543479  -0.16456521 
##         2245         2246         2247         2248         2249         2250 
##  -8.16456521   1.83543479  -2.16456521  -6.16456521   8.83543479   2.83543479 
##         2251         2252         2253         2254         2255         2256 
##  -8.16456521  13.83543479 -12.16456521  -1.16456521   1.83543479 -12.16456521 
##         2257         2258         2259         2260         2261         2262 
##   2.49186180  -1.50813820  -6.50813820  -7.50813820   2.49186180  -2.50813820 
##         2263         2264         2265         2266         2267         2268 
##   5.49186180  -3.50813820  10.49186180   6.49186180   7.49186180  -5.50813820 
##         2269         2270         2271         2272         2273         2274 
##   8.49186180  -0.50813820   3.49186180   4.49186180  -1.50813820 -11.50813820 
##         2275         2276         2277         2278         2279         2280 
##   2.49186180   1.49186180  -3.50813820   9.49186180   4.49186180  -2.50813820 
##         2281         2282         2283         2284         2285         2286 
##  -9.40474729   0.59525271   8.59525271   6.59525271  -7.40474729  -3.40474729 
##         2287         2288         2289         2290         2291         2292 
##  -1.40474729  -0.40474729  -3.40474729  -4.40474729  -9.40474729  11.59525271 
##         2293         2294         2295         2296         2297         2298 
##  14.59525271   3.59525271   0.59525271   8.59525271  -0.40474729   6.59525271 
##         2299         2300         2301         2302         2303         2304 
##  -4.40474729  -1.40474729  -5.40474729  -0.40474729   4.59525271  -0.40474729 
##         2305         2306         2307         2308         2309         2310 
##   5.79608397  10.79608397 -12.20391603  -5.20391603 -11.20391603   0.79608397 
##         2311         2312         2313         2314         2315         2316 
##  -5.20391603   4.79608397 -13.20391603  -4.20391603   8.79608397   4.79608397 
##         2317         2318         2319         2320         2321         2322 
##   5.79608397   5.79608397  12.79608397  -3.20391603  10.79608397   0.79608397 
##         2323         2324         2325         2326         2327         2328 
##   3.79608397  -5.20391603  -3.20391603  -1.20391603   8.79608397   4.79608397 
##         2329         2330         2331         2332         2333         2334 
##   7.81602919   6.81602919   3.81602919   0.81602919  -0.18397081  11.81602919 
##         2335         2336         2337         2338         2339         2340 
##  -8.18397081   7.81602919  -0.18397081  -8.18397081   4.81602919  -8.18397081 
##         2341         2342         2343         2344         2345         2346 
##   7.81602919   1.81602919  -8.18397081   4.81602919 -14.18397081   1.81602919 
##         2347         2348         2349         2350         2351         2352 
##  -8.18397081   7.81602919   8.81602919  -4.18397081   7.81602919  -3.18397081 
##         2353         2354         2355         2356         2357         2358 
##  -0.13249761  -8.13249761  12.86750239  -8.13249761  -9.13249761   7.86750239 
##         2359         2360         2361         2362         2363         2364 
##  -1.13249761   1.86750239   5.86750239   6.86750239 -11.13249761  -0.13249761 
##         2365         2366         2367         2368         2369         2370 
##   5.86750239  -2.13249761   1.86750239   9.86750239   5.86750239   7.86750239 
##         2371         2372         2373         2374         2375         2376 
##  -6.13249761  -0.13249761   9.86750239  -2.13249761  -6.13249761  -1.13249761 
##         2377         2378         2379         2380         2381         2382 
##  -5.20453481   2.79546519  -7.20453481  -9.20453481  -1.20453481   0.79546519 
##         2383         2384         2385         2386         2387         2388 
##  -1.20453481   0.79546519   6.79546519 -11.20453481   7.79546519   7.79546519 
##         2389         2390         2391         2392         2393         2394 
##   8.79546519   0.79546519   4.79546519   4.79546519  -8.20453481   8.79546519 
##         2395         2396         2397         2398         2399         2400 
##   5.79546519   8.79546519  -6.20453481 -10.20453481   8.79546519   2.79546519 
##         2401         2402         2403         2404         2405         2406 
##  -0.90039179  -8.90039179  -2.90039179  -2.90039179  13.09960821  -7.90039179 
##         2407         2408         2409         2410         2411         2412 
##  11.09960821  -2.90039179  -8.90039179 -11.90039179   2.09960821  -2.90039179 
##         2413         2414         2415         2416         2417         2418 
##   5.09960821   1.09960821   4.09960821  -6.90039179   3.09960821  14.09960821 
##         2419         2420         2421         2422         2423         2424 
##  -0.90039179   7.09960821   4.09960821  11.09960821   3.09960821  -0.90039179 
##         2425         2426         2427         2428         2429         2430 
##  11.28525344  -5.71474656  -0.71474656  13.28525344  -0.71474656   3.28525344 
##         2431 
##   6.28525344
VarCorr(condmodel1) #shows random variances, square rooted as sds
##  Groups        Name        Std.Dev.
##  BowlingTeamNo (Intercept) 3.5816  
##  Residual                  6.9482
vcov(condmodel1) #shows covariance of fixed effects (not sure this is interesting)
## 2 x 2 Matrix of class "dpoMatrix"
##                   (Intercept) GroupGripStrength
## (Intercept)        3.79707065      -0.073056883
## GroupGripStrength -0.07305688       0.001461783
df.residual(condmodel1) #shows df of residual
## [1] 2427
head(class06)
##   ï..const ID BowlingTeamNo GroupGripStrength PercentWinBowl
## 1        1  1             1                65             51
## 2        1  2             1                65             51
## 3        1  3             1                65             46
## 4        1  4             1                65             50
## 5        1  5             1                65             62
## 6        1  6             1                65             45
##   ForearmLengthQuartile WinningOrientation   pred_0   pred_1
## 1                     2                 52 43.83257 43.81571
## 2                     2                 43 43.83257 43.81571
## 3                     1                 42 43.83257 43.81571
## 4                     1                 44 43.83257 43.81571
## 5                     4                 35 43.83257 43.81571
## 6                     1                 49 43.83257 43.81571
### 2. Conditional model: Fixed effect of Level 1 PercentWinBowl
condmodel2 = lmer(WinningOrientation ~ GroupGripStrength + PercentWinBowl +
                    (1|BowlingTeamNo), data=class06, REML=FALSE)
summary(condmodel2)
## Linear mixed model fit by maximum likelihood  ['lmerMod']
## Formula: WinningOrientation ~ GroupGripStrength + PercentWinBowl + (1 |  
##     BowlingTeamNo)
##    Data: class06
## 
##      AIC      BIC   logLik deviance df.resid 
##  16278.8  16307.8  -8134.4  16268.8     2426 
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.11822 -0.85455 -0.00689  0.80870  2.17507 
## 
## Random effects:
##  Groups        Name        Variance Std.Dev.
##  BowlingTeamNo (Intercept) 12.55    3.543   
##  Residual                  43.28    6.579   
## Number of obs: 2431, groups:  BowlingTeamNo, 102
## 
## Fixed effects:
##                   Estimate Std. Error t value
## (Intercept)       36.39438    2.04084  17.833
## GroupGripStrength -0.11419    0.03814  -2.993
## PercentWinBowl     0.33729    0.02044  16.502
## 
## Correlation of Fixed Effects:
##             (Intr) GrpGrS
## GrpGrpStrng -0.850       
## PercntWnBwl -0.344 -0.168
#lower case anova does nested model tests
anova(nullmodel,condmodel1,condmodel2)
## Data: class06
## Models:
## nullmodel: WinningOrientation ~ 1 + (1 | BowlingTeamNo)
## condmodel1: WinningOrientation ~ GroupGripStrength + (1 | BowlingTeamNo)
## condmodel2: WinningOrientation ~ GroupGripStrength + PercentWinBowl + (1 | 
## condmodel2:     BowlingTeamNo)
##            npar   AIC   BIC  logLik deviance    Chisq Df Pr(>Chisq)    
## nullmodel     3 16533 16550 -8263.4    16527                           
## condmodel1    4 16535 16558 -8263.3    16527   0.0486  1     0.8256    
## condmodel2    5 16279 16308 -8134.4    16269 257.8588  1     <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Saving predicted values to the data frame, so we can plot what the conditional model looks like
pred_2<-(fitted(condmodel2))
pred2<-as.data.frame(pred_2)
class06<-cbind(class06,pred2)
#This plot will show the overall fixed intercept and slope; 
qplot(y=pred_2, x=PercentWinBowl, colour = BowlingTeamNo,  
      data = class06)

#The second plot imposes the best fitting line
ggplot(class06) + 
  aes(x=class06$PercentWinBowl, y=class06$pred_2) + #, col=as.factor(hsb_pred2$school)
  geom_point() +
  stat_smooth(method = "lm", se = FALSE)
## Warning: Use of `class06$PercentWinBowl` is discouraged. Use `PercentWinBowl`
## instead.
## Warning: Use of `class06$pred_2` is discouraged. Use `pred_2` instead.
## Warning: Use of `class06$PercentWinBowl` is discouraged. Use `PercentWinBowl`
## instead.
## Warning: Use of `class06$pred_2` is discouraged. Use `pred_2` instead.
## `geom_smooth()` using formula 'y ~ x'

#Gives you each school's fixed and random! coefficients
coef(condmodel2)
## $BowlingTeamNo
##     (Intercept) GroupGripStrength PercentWinBowl
## 1      33.30907        -0.1141861      0.3372947
## 2      32.21007        -0.1141861      0.3372947
## 3      32.00927        -0.1141861      0.3372947
## 4      30.34880        -0.1141861      0.3372947
## 5      31.65271        -0.1141861      0.3372947
## 6      32.24810        -0.1141861      0.3372947
## 7      29.68188        -0.1141861      0.3372947
## 8      31.00859        -0.1141861      0.3372947
## 9      31.88875        -0.1141861      0.3372947
## 10     32.52095        -0.1141861      0.3372947
## 11     33.24026        -0.1141861      0.3372947
## 12     34.91523        -0.1141861      0.3372947
## 13     30.98308        -0.1141861      0.3372947
## 14     30.68238        -0.1141861      0.3372947
## 15     33.48213        -0.1141861      0.3372947
## 16     33.61841        -0.1141861      0.3372947
## 17     34.38295        -0.1141861      0.3372947
## 18     33.29434        -0.1141861      0.3372947
## 19     33.68652        -0.1141861      0.3372947
## 20     33.80854        -0.1141861      0.3372947
## 21     30.57338        -0.1141861      0.3372947
## 22     35.50234        -0.1141861      0.3372947
## 23     33.65743        -0.1141861      0.3372947
## 24     30.92926        -0.1141861      0.3372947
## 25     32.43196        -0.1141861      0.3372947
## 26     33.34927        -0.1141861      0.3372947
## 27     34.88512        -0.1141861      0.3372947
## 28     31.68446        -0.1141861      0.3372947
## 29     32.62862        -0.1141861      0.3372947
## 30     35.60601        -0.1141861      0.3372947
## 31     36.52333        -0.1141861      0.3372947
## 32     35.40551        -0.1141861      0.3372947
## 33     33.19628        -0.1141861      0.3372947
## 34     33.96647        -0.1141861      0.3372947
## 35     31.71059        -0.1141861      0.3372947
## 36     35.73746        -0.1141861      0.3372947
## 37     34.80651        -0.1141861      0.3372947
## 38     32.54602        -0.1141861      0.3372947
## 39     33.36368        -0.1141861      0.3372947
## 40     34.51212        -0.1141861      0.3372947
## 41     34.45371        -0.1141861      0.3372947
## 42     36.43140        -0.1141861      0.3372947
## 43     36.75114        -0.1141861      0.3372947
## 44     35.79780        -0.1141861      0.3372947
## 45     35.54722        -0.1141861      0.3372947
## 46     35.41309        -0.1141861      0.3372947
## 47     38.14528        -0.1141861      0.3372947
## 48     37.26659        -0.1141861      0.3372947
## 49     38.24512        -0.1141861      0.3372947
## 50     37.71346        -0.1141861      0.3372947
## 51     35.49539        -0.1141861      0.3372947
## 52     35.15341        -0.1141861      0.3372947
## 53     36.26256        -0.1141861      0.3372947
## 54     35.94064        -0.1141861      0.3372947
## 55     35.87149        -0.1141861      0.3372947
## 56     36.84543        -0.1141861      0.3372947
## 57     37.60830        -0.1141861      0.3372947
## 58     35.27451        -0.1141861      0.3372947
## 59     37.46197        -0.1141861      0.3372947
## 60     36.23168        -0.1141861      0.3372947
## 61     37.32335        -0.1141861      0.3372947
## 62     38.21049        -0.1141861      0.3372947
## 63     39.59123        -0.1141861      0.3372947
## 64     38.44317        -0.1141861      0.3372947
## 65     38.92718        -0.1141861      0.3372947
## 66     37.31417        -0.1141861      0.3372947
## 67     37.60872        -0.1141861      0.3372947
## 68     37.52515        -0.1141861      0.3372947
## 69     38.92944        -0.1141861      0.3372947
## 70     39.66755        -0.1141861      0.3372947
## 71     38.32666        -0.1141861      0.3372947
## 72     38.64726        -0.1141861      0.3372947
## 73     38.22946        -0.1141861      0.3372947
## 74     36.94512        -0.1141861      0.3372947
## 75     39.12210        -0.1141861      0.3372947
## 76     38.05818        -0.1141861      0.3372947
## 77     38.39686        -0.1141861      0.3372947
## 78     40.85912        -0.1141861      0.3372947
## 79     38.39076        -0.1141861      0.3372947
## 80     40.13435        -0.1141861      0.3372947
## 81     39.87543        -0.1141861      0.3372947
## 82     39.21426        -0.1141861      0.3372947
## 83     40.05129        -0.1141861      0.3372947
## 84     38.91580        -0.1141861      0.3372947
## 85     40.18282        -0.1141861      0.3372947
## 86     40.57904        -0.1141861      0.3372947
## 87     40.00027        -0.1141861      0.3372947
## 88     39.69925        -0.1141861      0.3372947
## 89     38.71819        -0.1141861      0.3372947
## 90     37.69079        -0.1141861      0.3372947
## 91     37.84513        -0.1141861      0.3372947
## 92     40.19851        -0.1141861      0.3372947
## 93     40.68838        -0.1141861      0.3372947
## 94     41.36698        -0.1141861      0.3372947
## 95     41.98640        -0.1141861      0.3372947
## 96     40.29931        -0.1141861      0.3372947
## 97     43.25310        -0.1141861      0.3372947
## 98     43.16997        -0.1141861      0.3372947
## 99     41.39829        -0.1141861      0.3372947
## 100    41.64319        -0.1141861      0.3372947
## 101    41.69271        -0.1141861      0.3372947
## 102    43.20921        -0.1141861      0.3372947
## 
## attr(,"class")
## [1] "coef.mer"
library(car)
#Gives you chi-square for each model term
Anova(condmodel2)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: WinningOrientation
##                     Chisq Df Pr(>Chisq)    
## GroupGripStrength   8.961  1   0.002758 ** 
## PercentWinBowl    272.330  1  < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#This ensures that your model is stored in a lmerMod object, needed for the next step
class(condmodel2) <- "lmerMod"
#Stargazer makes a nicely formated model summary table (albeit incomplete)
stargazer(condmodel2, type = "text",
          digits = 3,
          star.cutoffs = c(0.05, 0.01, 0.001),
          digit.separator = "")
## 
## =================================================
##                          Dependent variable:     
##                     -----------------------------
##                          WinningOrientation      
## -------------------------------------------------
## GroupGripStrength             -0.114**           
##                                (0.038)           
##                                                  
## PercentWinBowl                0.337***           
##                                (0.020)           
##                                                  
## Constant                      36.394***          
##                                (2.041)           
##                                                  
## -------------------------------------------------
## Observations                    2431             
## Log Likelihood                -8134.405          
## Akaike Inf. Crit.             16278.810          
## Bayesian Inf. Crit.           16307.790          
## =================================================
## Note:               *p<0.05; **p<0.01; ***p<0.001
###sjPlot::tab_model is even better, because it formats the table in APA style and adds
# fixed and random effects and p-values 
tab_model(nullmodel,condmodel1,condmodel2)
| 
 
 | 
WinningOrientation
 | 
WinningOrientation
 | 
WinningOrientation
 | 
| 
Predictors
 | 
Estimates
 | 
CI
 | 
p
 | 
Estimates
 | 
CI
 | 
p
 | 
Estimates
 | 
CI
 | 
p
 | 
| 
(Intercept)
 | 
47.55
 | 
46.80 â€“ 48.30
 | 
<0.001
 | 
47.97
 | 
44.15 â€“ 51.79
 | 
<0.001
 | 
36.39
 | 
32.39 â€“ 40.39
 | 
<0.001
 | 
| 
GroupGripStrength
 | 
       
 | 
       
 | 
       
 | 
-0.01
 | 
-0.08 â€“ 0.07
 | 
0.826
 | 
-0.11
 | 
-0.19 â€“ -0.04
 | 
0.003
 | 
| 
PercentWinBowl
 | 
       
 | 
       
 | 
       
 | 
       
 | 
       
 | 
       
 | 
0.34
 | 
0.30 â€“ 0.38
 | 
<0.001
 | 
| 
Random Effects
 | 
| 
σ2
 | 
48.28
 | 
48.28
 | 
43.28
 | 
| 
τ00
 | 
12.84 BowlingTeamNo
 | 
12.83 BowlingTeamNo
 | 
12.55 BowlingTeamNo
 | 
| 
ICC
 | 
0.21
 | 
0.21
 | 
0.22
 | 
| 
N
 | 
102 BowlingTeamNo
 | 
102 BowlingTeamNo
 | 
102 BowlingTeamNo
 | 
| 
Observations
 | 
2431
 | 
2431
 | 
2431
 | 
| 
Marginal R2 / Conditional R2
 | 
0.000 / 0.210
 | 
0.000 / 0.210
 | 
0.083 / 0.289
 | 
#Exact p-values and df in revised syntax below, but warning VERY time consuming (crashed my computer)
#tab_model(condmodel2, p.val = "kr", show.df = TRUE)
### 3. Conditional model: Random effect of Level 1 PercentWinBowl
#Double line creates a "variance components" (no correlated random effects) solution like SPSS
condmodel3 = lmer(WinningOrientation ~ GroupGripStrength + PercentWinBowl +
                    (1 + PercentWinBowl||BowlingTeamNo), data=class06, REML=FALSE)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
## Model failed to converge with max|grad| = 0.205288 (tol = 0.002, component 1)
summary(condmodel3)
## Linear mixed model fit by maximum likelihood  ['lmerMod']
## Formula: WinningOrientation ~ GroupGripStrength + PercentWinBowl + ((1 |  
##     BowlingTeamNo) + (0 + PercentWinBowl | BowlingTeamNo))
##    Data: class06
## 
##      AIC      BIC   logLik deviance df.resid 
##  16280.6  16315.3  -8134.3  16268.6     2425 
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.11992 -0.85186 -0.00686  0.81319  2.17117 
## 
## Random effects:
##  Groups          Name           Variance  Std.Dev.
##  BowlingTeamNo   (Intercept)    1.140e+01 3.37573 
##  BowlingTeamNo.1 PercentWinBowl 5.179e-04 0.02276 
##  Residual                       4.324e+01 6.57549 
## Number of obs: 2431, groups:  BowlingTeamNo, 102
## 
## Fixed effects:
##                   Estimate Std. Error t value
## (Intercept)       36.30849    2.04284  17.774
## GroupGripStrength -0.11255    0.03832  -2.937
## PercentWinBowl     0.33739    0.02056  16.411
## 
## Correlation of Fixed Effects:
##             (Intr) GrpGrS
## GrpGrpStrng -0.852       
## PercntWnBwl -0.340 -0.168
## convergence code: 0
## Model failed to converge with max|grad| = 0.205288 (tol = 0.002, component 1)
#lower case anova does nested model tests
anova(nullmodel,condmodel1,condmodel2,condmodel3)
## Data: class06
## Models:
## nullmodel: WinningOrientation ~ 1 + (1 | BowlingTeamNo)
## condmodel1: WinningOrientation ~ GroupGripStrength + (1 | BowlingTeamNo)
## condmodel2: WinningOrientation ~ GroupGripStrength + PercentWinBowl + (1 | 
## condmodel2:     BowlingTeamNo)
## condmodel3: WinningOrientation ~ GroupGripStrength + PercentWinBowl + ((1 | 
## condmodel3:     BowlingTeamNo) + (0 + PercentWinBowl | BowlingTeamNo))
##            npar   AIC   BIC  logLik deviance    Chisq Df Pr(>Chisq)    
## nullmodel     3 16533 16550 -8263.4    16527                           
## condmodel1    4 16535 16558 -8263.3    16527   0.0486  1     0.8256    
## condmodel2    5 16279 16308 -8134.4    16269 257.8588  1     <2e-16 ***
## condmodel3    6 16281 16315 -8134.3    16269   0.2370  1     0.6264    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Saving predicted values to the data frame, so we can plot what the conditional model looks like
pred_3<-(fitted(condmodel3))
pred3<-as.data.frame(pred_3)
class06<-cbind(class06,pred3)
#This plot will show the overall fixed intercept and slope; 
qplot(y=pred_3, x=PercentWinBowl, colour = BowlingTeamNo,  
      data = class06)

#The second plot imposes the best fitting line
ggplot(class06) + 
  aes(x=class06$PercentWinBowl, y=class06$pred_3) + #, col=as.factor(hsb_pred2$school)
  geom_point() +
  stat_smooth(method = "lm", se = FALSE)
## Warning: Use of `class06$PercentWinBowl` is discouraged. Use `PercentWinBowl`
## instead.
## Warning: Use of `class06$pred_3` is discouraged. Use `pred_3` instead.
## Warning: Use of `class06$PercentWinBowl` is discouraged. Use `PercentWinBowl`
## instead.
## Warning: Use of `class06$pred_3` is discouraged. Use `pred_3` instead.
## `geom_smooth()` using formula 'y ~ x'

#Gives you each school's fixed and random! coefficients
coef(condmodel3)
## $BowlingTeamNo
##     (Intercept) GroupGripStrength PercentWinBowl
## 1      33.68778        -0.1125499      0.3275568
## 2      32.45829        -0.1125499      0.3308502
## 3      32.38390        -0.1125499      0.3283138
## 4      31.01419        -0.1125499      0.3229822
## 5      31.94857        -0.1125499      0.3299413
## 6      32.63025        -0.1125499      0.3275950
## 7      30.25606        -0.1125499      0.3238819
## 8      31.43791        -0.1125499      0.3271424
## 9      32.39586        -0.1125499      0.3253085
## 10     32.64605        -0.1125499      0.3333769
## 11     33.38061        -0.1125499      0.3329848
## 12     34.93591        -0.1125499      0.3350786
## 13     31.53952        -0.1125499      0.3248026
## 14     31.25249        -0.1125499      0.3239621
## 15     33.66187        -0.1125499      0.3319977
## 16     33.78451        -0.1125499      0.3323513
## 17     34.60124        -0.1125499      0.3306051
## 18     33.53272        -0.1125499      0.3308676
## 19     33.95347        -0.1125499      0.3298851
## 20     33.81380        -0.1125499      0.3362752
## 21     31.35713        -0.1125499      0.3208101
## 22     35.54434        -0.1125499      0.3346468
## 23     33.87791        -0.1125499      0.3308381
## 24     31.26467        -0.1125499      0.3289678
## 25     32.87050        -0.1125499      0.3257683
## 26     33.54567        -0.1125499      0.3314900
## 27     34.99595        -0.1125499      0.3334187
## 28     31.84297        -0.1125499      0.3330473
## 29     32.80961        -0.1125499      0.3321650
## 30     35.59356        -0.1125499      0.3354940
## 31     36.45956        -0.1125499      0.3373582
## 32     35.40110        -0.1125499      0.3355918
## 33     33.27875        -0.1125499      0.3343504
## 34     34.35650        -0.1125499      0.3273556
## 35     31.90644        -0.1125499      0.3320476
## 36     35.74842        -0.1125499      0.3352453
## 37     34.75424        -0.1125499      0.3369756
## 38     32.91125        -0.1125499      0.3280480
## 39     33.63637        -0.1125499      0.3297219
## 40     34.54268        -0.1125499      0.3350054
## 41     34.44298        -0.1125499      0.3365081
## 42     36.39785        -0.1125499      0.3360069
## 43     36.58117        -0.1125499      0.3402080
## 44     35.75193        -0.1125499      0.3369900
## 45     35.68114        -0.1125499      0.3322929
## 46     35.59798        -0.1125499      0.3312932
## 47     38.06283        -0.1125499      0.3373179
## 48     37.09020        -0.1125499      0.3393444
## 49     38.04771        -0.1125499      0.3401815
## 50     37.38672        -0.1125499      0.3427717
## 51     35.52092        -0.1125499      0.3352722
## 52     35.23340        -0.1125499      0.3338776
## 53     36.17353        -0.1125499      0.3373552
## 54     35.88408        -0.1125499      0.3370431
## 55     35.90732        -0.1125499      0.3348914
## 56     36.70562        -0.1125499      0.3389928
## 57     37.34134        -0.1125499      0.3408442
## 58     35.25812        -0.1125499      0.3362688
## 59     37.39514        -0.1125499      0.3365381
## 60     36.11819        -0.1125499      0.3379427
## 61     37.25858        -0.1125499      0.3367763
## 62     38.03323        -0.1125499      0.3388662
## 63     39.23069        -0.1125499      0.3420431
## 64     38.15589        -0.1125499      0.3406348
## 65     38.60054        -0.1125499      0.3427188
## 66     37.04282        -0.1125499      0.3407610
## 67     37.30629        -0.1125499      0.3411771
## 68     37.41226        -0.1125499      0.3380884
## 69     38.77557        -0.1125499      0.3386540
## 70     39.27105        -0.1125499      0.3435019
## 71     38.10336        -0.1125499      0.3403384
## 72     38.09233        -0.1125499      0.3471556
## 73     37.90741        -0.1125499      0.3426678
## 74     36.78472        -0.1125499      0.3390559
## 75     38.73058        -0.1125499      0.3439780
## 76     37.77176        -0.1125499      0.3418158
## 77     37.89458        -0.1125499      0.3458429
## 78     40.21023        -0.1125499      0.3493307
## 79     38.22952        -0.1125499      0.3382782
## 80     39.55839        -0.1125499      0.3464901
## 81     39.52430        -0.1125499      0.3415989
## 82     38.87854        -0.1125499      0.3423873
## 83     39.57045        -0.1125499      0.3442026
## 84     38.49250        -0.1125499      0.3447974
## 85     39.55080        -0.1125499      0.3477731
## 86     40.13245        -0.1125499      0.3442535
## 87     39.45158        -0.1125499      0.3484043
## 88     39.46385        -0.1125499      0.3406438
## 89     38.46537        -0.1125499      0.3408213
## 90     37.54961        -0.1125499      0.3386087
## 91     37.48486        -0.1125499      0.3423702
## 92     39.73536        -0.1125499      0.3455699
## 93     40.04880        -0.1125499      0.3491116
## 94     40.88657        -0.1125499      0.3462033
## 95     41.28184        -0.1125499      0.3484560
## 96     39.74820        -0.1125499      0.3477616
## 97     42.25971        -0.1125499      0.3562596
## 98     42.40134        -0.1125499      0.3507223
## 99     40.97936        -0.1125499      0.3438286
## 100    41.15355        -0.1125499      0.3454873
## 101    41.03635        -0.1125499      0.3481243
## 102    42.40961        -0.1125499      0.3517951
## 
## attr(,"class")
## [1] "coef.mer"
#Gives you chi-square for each model term
Anova(condmodel3)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: WinningOrientation
##                      Chisq Df Pr(>Chisq)    
## GroupGripStrength   8.6244  1   0.003317 ** 
## PercentWinBowl    269.3114  1  < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#This ensures that your model is stored in a lmerMod object, needed for the next step
class(condmodel3) <- "lmerMod"
#Stargazer makes a nicely formated model summary table (albeit incomplete)
stargazer(condmodel3, type = "text",
          digits = 3,
          star.cutoffs = c(0.05, 0.01, 0.001),
          digit.separator = "")
## 
## =================================================
##                          Dependent variable:     
##                     -----------------------------
##                          WinningOrientation      
## -------------------------------------------------
## GroupGripStrength             -0.113**           
##                                (0.038)           
##                                                  
## PercentWinBowl                0.337***           
##                                (0.021)           
##                                                  
## Constant                      36.308***          
##                                (2.043)           
##                                                  
## -------------------------------------------------
## Observations                    2431             
## Log Likelihood                -8134.286          
## Akaike Inf. Crit.             16280.570          
## Bayesian Inf. Crit.           16315.350          
## =================================================
## Note:               *p<0.05; **p<0.01; ***p<0.001
###sjPlot::tab_model is even better, because it formats the table in APA style and adds
# fixed and random effects and p-values 
tab_model(nullmodel,condmodel1,condmodel2,condmodel3)
| 
 
 | 
WinningOrientation
 | 
WinningOrientation
 | 
WinningOrientation
 | 
WinningOrientation
 | 
| 
Predictors
 | 
Estimates
 | 
CI
 | 
p
 | 
Estimates
 | 
CI
 | 
p
 | 
Estimates
 | 
CI
 | 
p
 | 
Estimates
 | 
CI
 | 
p
 | 
| 
(Intercept)
 | 
47.55
 | 
46.80 â€“ 48.30
 | 
<0.001
 | 
47.97
 | 
44.15 â€“ 51.79
 | 
<0.001
 | 
36.39
 | 
32.39 â€“ 40.39
 | 
<0.001
 | 
36.31
 | 
32.30 â€“ 40.31
 | 
<0.001
 | 
| 
GroupGripStrength
 | 
       
 | 
       
 | 
       
 | 
-0.01
 | 
-0.08 â€“ 0.07
 | 
0.826
 | 
-0.11
 | 
-0.19 â€“ -0.04
 | 
0.003
 | 
-0.11
 | 
-0.19 â€“ -0.04
 | 
0.003
 | 
| 
PercentWinBowl
 | 
       
 | 
       
 | 
       
 | 
       
 | 
       
 | 
       
 | 
0.34
 | 
0.30 â€“ 0.38
 | 
<0.001
 | 
0.34
 | 
0.30 â€“ 0.38
 | 
<0.001
 | 
| 
Random Effects
 | 
| 
σ2
 | 
48.28
 | 
48.28
 | 
43.28
 | 
43.24
 | 
| 
τ00
 | 
12.84 BowlingTeamNo
 | 
12.83 BowlingTeamNo
 | 
12.55 BowlingTeamNo
 | 
11.40 BowlingTeamNo
 | 
       
 | 
 
 | 
 
 | 
 
 | 
0.00 BowlingTeamNo.1
 | 
| 
ICC
 | 
0.21
 | 
0.21
 | 
0.22
 | 
0.21
 | 
| 
N
 | 
102 BowlingTeamNo
 | 
102 BowlingTeamNo
 | 
102 BowlingTeamNo
 | 
102 BowlingTeamNo
 | 
| 
Observations
 | 
2431
 | 
2431
 | 
2431
 | 
2431
 | 
| 
Marginal R2 / Conditional R2
 | 
0.000 / 0.210
 | 
0.000 / 0.210
 | 
0.083 / 0.289
 | 
0.085 / 0.276
 | 
#Exact p-values and df in revised syntax below, but warning VERY time consuming (crashed my computer)
#tab_model(condmodel2, p.val = "kr", show.df = TRUE)
library(lattice)
# This is an alternative to the qplot above; shows each school in a truly unique color
with(class06, xyplot(pred_3 ~ PercentWinBowl, group=BowlingTeamNo))

### 4. Repeating the above model series in lme
###### Trying lme
# nlme::lme is an older function, generally superseded by lme4:lmer
# It offers less control over random covariance, etc
# It does include df, t, p-values though
library(nlme)
## 
## Attaching package: 'nlme'
## The following object is masked from 'package:lme4':
## 
##     lmList
nullmodel2 <- lme(WinningOrientation~1, 
                  data=class06,
                  random=~1|BowlingTeamNo,
                  na.action=na.omit, 
                  method="ML",
                  control=list(maxIter=100,msMaxIter=100,tolerance=1e-5,
                               opt="optim",optimMethod="BFGS"))
summary(nullmodel2)
## Linear mixed-effects model fit by maximum likelihood
##  Data: class06 
##        AIC     BIC    logLik
##   16532.72 16550.1 -8263.358
## 
## Random effects:
##  Formula: ~1 | BowlingTeamNo
##         (Intercept) Residual
## StdDev:    3.582684 6.948192
## 
## Fixed effects: WinningOrientation ~ 1 
##                Value Std.Error   DF  t-value p-value
## (Intercept) 47.54993 0.3820665 2329 124.4546       0
## 
## Standardized Within-Group Residuals:
##         Min          Q1         Med          Q3         Max 
## -2.23424567 -0.78093979 -0.02999008  0.78812321  2.49793568 
## 
## Number of Observations: 2431
## Number of Groups: 102
condmodel1b <- lme(WinningOrientation~GroupGripStrength, 
                  data=class06,
                  random=~1|BowlingTeamNo,
                  na.action=na.omit, 
                  method="ML",
                  control=list(maxIter=100,msMaxIter=100,tolerance=1e-5,
                               opt="optim",optimMethod="BFGS"))
summary(condmodel1b)
## Linear mixed-effects model fit by maximum likelihood
##  Data: class06 
##        AIC      BIC    logLik
##   16534.67 16557.85 -8263.334
## 
## Random effects:
##  Formula: ~1 | BowlingTeamNo
##         (Intercept) Residual
## StdDev:    3.581624 6.948197
## 
## Fixed effects: WinningOrientation ~ GroupGripStrength 
##                      Value Std.Error   DF   t-value p-value
## (Intercept)       47.97113  1.949410 2329 24.608031  0.0000
## GroupGripStrength -0.00843  0.038249  100 -0.220345  0.8261
##  Correlation: 
##                   (Intr)
## GroupGripStrength -0.981
## 
## Standardized Within-Group Residuals:
##         Min          Q1         Med          Q3         Max 
## -2.23668369 -0.77876057 -0.02976581  0.78739686  2.49475687 
## 
## Number of Observations: 2431
## Number of Groups: 102
condmodel2b <- lme(WinningOrientation~GroupGripStrength + PercentWinBowl, 
                   data=class06,
                   random=~1|BowlingTeamNo,
                   na.action=na.omit, 
                   method="ML",
                   control=list(maxIter=100,msMaxIter=100,tolerance=1e-5,
                                opt="optim",optimMethod="BFGS"))
summary(condmodel2b)
## Linear mixed-effects model fit by maximum likelihood
##  Data: class06 
##        AIC      BIC    logLik
##   16278.81 16307.79 -8134.405
## 
## Random effects:
##  Formula: ~1 | BowlingTeamNo
##         (Intercept) Residual
## StdDev:    3.542689 6.578827
## 
## Fixed effects: WinningOrientation ~ GroupGripStrength + PercentWinBowl 
##                      Value Std.Error   DF   t-value p-value
## (Intercept)       36.39438 2.0420959 2328 17.822071  0.0000
## GroupGripStrength -0.11419 0.0381684  100 -2.991637  0.0035
## PercentWinBowl     0.33729 0.0204517 2328 16.492253  0.0000
##  Correlation: 
##                   (Intr) GrpGrS
## GroupGripStrength -0.850       
## PercentWinBowl    -0.344 -0.168
## 
## Standardized Within-Group Residuals:
##          Min           Q1          Med           Q3          Max 
## -2.118222355 -0.854554256 -0.006894971  0.808704013  2.175067336 
## 
## Number of Observations: 2431
## Number of Groups: 102
condmodel3b <- lme(WinningOrientation~GroupGripStrength + PercentWinBowl, 
                   data=class06,
                   random=~1 + PercentWinBowl|BowlingTeamNo,
                   na.action=na.omit, 
                   method="ML",
                   control=list(maxIter=100,msMaxIter=100,tolerance=1e-5,
                                opt="optim",optimMethod="BFGS"))
summary(condmodel3b)
## Linear mixed-effects model fit by maximum likelihood
##  Data: class06 
##        AIC      BIC    logLik
##   16282.62 16323.19 -8134.311
## 
## Random effects:
##  Formula: ~1 + PercentWinBowl | BowlingTeamNo
##  Structure: General positive-definite, Log-Cholesky parametrization
##                StdDev     Corr  
## (Intercept)    3.73448604 (Intr)
## PercentWinBowl 0.05155614 -0.401
## Residual       6.56726968       
## 
## Fixed effects: WinningOrientation ~ GroupGripStrength + PercentWinBowl 
##                      Value Std.Error   DF   t-value p-value
## (Intercept)       36.21924 2.0552976 2328 17.622383  0.0000
## GroupGripStrength -0.11088 0.0385389  100 -2.877128  0.0049
## PercentWinBowl     0.33757 0.0210720 2328 16.019600  0.0000
##  Correlation: 
##                   (Intr) GrpGrS
## GroupGripStrength -0.851       
## PercentWinBowl    -0.345 -0.165
## 
## Standardized Within-Group Residuals:
##          Min           Q1          Med           Q3          Max 
## -2.123416658 -0.849702508 -0.007557133  0.811058706  2.159672462 
## 
## Number of Observations: 2431
## Number of Groups: 102
anova(nullmodel2,condmodel1b,condmodel2b,condmodel3b)
##             Model df      AIC      BIC    logLik   Test   L.Ratio p-value
## nullmodel2      1  3 16532.72 16550.10 -8263.358                         
## condmodel1b     2  4 16534.67 16557.85 -8263.334 1 vs 2   0.04858  0.8256
## condmodel2b     3  5 16278.81 16307.79 -8134.405 2 vs 3 257.85879  <.0001
## condmodel3b     4  7 16282.62 16323.19 -8134.311 3 vs 4   0.18699  0.9107