This script is part of the Online Appendix to my PhD thesis.

Please cite as: Le Foll, Elen. 2022. Textbook English: A Corpus-Based Analysis of the Language of EFL textbooks used in Secondary Schools in France, Germany and Spain. PhD thesis. Osnabrück University.

For more information, see: https://elenlefoll.github.io/TextbookEnglish/

Please note that the plot dimensions in this notebook have been optimised for the print version of the thesis.

Built with R 4.0.3

# Colours used in Register Studies paper and included in Open Access plots published on Zenodo:
colours <- suf_palette(name = "london", n = 6, type = "continuous") # Very nice, similar to OrRd palette
scales::show_col(colours)

colours <- colours[6:1] 

# Colour scheme used in PhD thesis:
colours = c("#F9B921", "#A18A33",  "#722672", "#BD241E", "#15274D", "#D54E1E") 
scales::show_col(colours)

Import data

Textbook data for additive MDAs using Biber’s 1988 model of general English as a baseline

# Textbook Corpus

TxBcounts <- read.delim(here("data", "TxB900MDA_counts.tsv"), header = TRUE)

glimpse(TxBcounts)
## Rows: 1,950
## Columns: 101
## $ Filename  <chr> "._Access_1_Informative_0001.txt", "Access_1_Informative_000…
## $ Level     <chr> "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", …
## $ Tokens    <int> 89, 664, 718, 731, 768, 768, 773, 775, 765, 779, 827, 1042, …
## $ AWL       <dbl> 1.5169, 4.2560, 4.0543, 4.2585, 3.9375, 3.9779, 4.0763, 3.90…
## $ TTR       <dbl> 0.191011, 0.535000, 0.362500, 0.397500, 0.387500, 0.360000, …
## $ X.        <dbl> 0.0000, 0.0000, 0.1393, 0.0000, 0.0000, 0.0000, 0.0000, 0.12…
## $ X..1      <dbl> 0.0000, 0.3012, 0.5571, 0.5472, 0.1302, 0.0000, 0.0000, 0.12…
## $ X..       <dbl> 0.0000, 0.4518, 0.1393, 0.1368, 0.2604, 0.2604, 0.0000, 0.25…
## $ X..2      <dbl> 0.0000, 5.2711, 2.5070, 1.5048, 0.5208, 1.5625, 1.5524, 1.03…
## $ X.LRB.    <dbl> 0.0000, 0.3012, 0.9749, 0.9576, 1.1719, 0.1302, 0.7762, 1.80…
## $ X.RRB.    <dbl> 0.0000, 0.3012, 4.0390, 6.7031, 5.9896, 4.6875, 5.1746, 5.16…
## $ .         <dbl> 0.0000, 8.1325, 13.3705, 13.4063, 13.0208, 12.1094, 13.0660,…
## $ X..3      <dbl> 0.0000, 1.8072, 4.4568, 3.1464, 2.7344, 1.5625, 3.6223, 2.83…
## $ AMP       <dbl> 0.0000, 0.9036, 0.0000, 0.0000, 0.0000, 0.0000, 0.1294, 0.00…
## $ ANDC      <dbl> 0.0000, 0.1506, 0.2786, 0.0000, 0.1302, 0.2604, 0.1294, 0.12…
## $ CAUS      <dbl> 0.0000, 0.1506, 0.0000, 0.0000, 0.0000, 0.0000, 0.1294, 0.00…
## $ CC        <dbl> 0.0000, 1.6566, 2.3677, 1.9152, 2.6042, 2.3438, 2.1992, 1.93…
## $ CD        <dbl> 4.4944, 0.9036, 0.9749, 1.6416, 0.9115, 1.3021, 1.0349, 1.29…
## $ CONC      <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ COND      <dbl> 0.0000, 0.0000, 0.1393, 0.1368, 0.1302, 0.0000, 0.0000, 0.00…
## $ CONJ      <dbl> 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.00…
## $ DEMO      <dbl> 0.0000, 0.0000, 0.5571, 0.5472, 1.0417, 0.3906, 0.3881, 0.64…
## $ DEMP      <dbl> 0.0000, 0.0000, 0.8357, 0.6840, 0.0000, 0.1302, 0.2587, 0.00…
## $ DPAR      <dbl> 0.0000, 0.0000, 0.4178, 0.1368, 0.2604, 0.1302, 0.5175, 0.00…
## $ DT        <dbl> 0.0000, 9.7892, 10.4457, 11.2175, 11.7188, 12.2396, 11.3842,…
## $ DWNT      <dbl> 0.0000, 0.3012, 0.1393, 0.0000, 0.0000, 0.0000, 0.0000, 0.00…
## $ EMPH      <dbl> 0.0000, 0.1506, 0.5571, 0.5472, 0.2604, 0.2604, 0.0000, 0.25…
## $ EX        <dbl> 0.0000, 0.1506, 0.0000, 0.4104, 0.0000, 0.0000, 0.0000, 0.00…
## $ FPP1      <dbl> 0.0000, 0.4518, 1.3928, 0.6840, 0.2604, 0.2604, 0.1294, 0.12…
## $ FW        <dbl> 4.4944, 0.4518, 0.0000, 0.1368, 1.3021, 0.0000, 0.5175, 0.25…
## $ GER       <dbl> 0.0000, 1.5060, 0.1393, 0.0000, 0.1302, 0.0000, 0.0000, 0.38…
## $ HDG       <dbl> 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.12…
## $ IN        <dbl> 0.0000, 0.9036, 1.6713, 2.0520, 1.4323, 1.9531, 1.6818, 1.54…
## $ INPR      <dbl> 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.00…
## $ JJ        <dbl> 0.0000, 5.1205, 5.1532, 3.1464, 3.1250, 1.9531, 2.5873, 5.03…
## $ LS        <dbl> 0.0000, 0.0000, 2.3677, 4.1040, 3.3854, 3.5156, 3.6223, 2.70…
## $ NEMD      <dbl> 0.0000, 0.1506, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.00…
## $ NN        <dbl> 91.0112, 38.1024, 32.4513, 28.4542, 30.0781, 32.5521, 26.261…
## $ NNP       <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ NOMZ      <dbl> 0.0000, 0.4518, 0.8357, 2.3256, 0.2604, 1.3021, 3.6223, 0.77…
## $ OSUB      <dbl> 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.00…
## $ PDT       <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ PHC       <dbl> 0.0000, 1.0542, 1.2535, 1.2312, 1.3021, 0.9115, 1.0349, 1.16…
## $ PIN       <dbl> 0.0000, 9.9398, 10.1671, 8.0711, 8.0729, 11.4583, 7.6326, 12…
## $ PIT       <dbl> 0.0000, 1.5060, 0.5571, 0.4104, 0.7812, 0.5208, 0.9056, 1.03…
## $ PLACE     <dbl> 0.0000, 1.6566, 0.1393, 0.1368, 0.2604, 0.0000, 0.1294, 0.12…
## $ POMD      <dbl> 0.0000, 0.7530, 0.1393, 0.9576, 1.1719, 1.4323, 1.4230, 0.77…
## $ POS       <dbl> 0.0000, 0.9036, 1.2535, 0.8208, 0.3906, 1.3021, 0.7762, 0.77…
## $ PRED      <dbl> 0.0000, 0.9036, 0.2786, 0.1368, 0.7812, 0.1302, 0.2587, 0.12…
## $ PRMD      <dbl> 0.0000, 0.0000, 0.0000, 0.1368, 0.0000, 0.2604, 0.0000, 0.00…
## $ PRP       <dbl> 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.00…
## $ PRPS      <dbl> 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.00…
## $ QUAN      <dbl> 0.0000, 0.9036, 0.2786, 0.2736, 0.5208, 0.2604, 0.0000, 0.38…
## $ QUPR      <dbl> 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.2604, 0.0000, 0.12…
## $ RB        <dbl> 0.0000, 1.8072, 1.3928, 1.9152, 1.6927, 0.9115, 2.8461, 2.19…
## $ RP        <dbl> 0.0000, 0.1506, 0.2786, 0.6840, 0.2604, 0.0000, 0.0000, 0.25…
## $ SPP2      <dbl> 0.0000, 0.6024, 3.8997, 6.8399, 5.4688, 6.7708, 6.7270, 4.51…
## $ SYM       <dbl> 0.0000, 1.5060, 0.0000, 0.0000, 0.5208, 0.0000, 0.1294, 0.25…
## $ SYNE      <dbl> 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.00…
## $ THAC      <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ THVC      <dbl> 0.0000, 0.1506, 0.0000, 0.0000, 0.0000, 0.1302, 0.0000, 0.00…
## $ TIME      <dbl> 0.0000, 0.3012, 0.4178, 0.5472, 0.1302, 0.2604, 0.1294, 0.12…
## $ TO        <dbl> 0.0000, 1.0542, 0.1393, 0.0000, 0.5208, 0.2604, 1.0349, 0.64…
## $ TOBJ      <dbl> 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.00…
## $ TPP3      <dbl> 0.0000, 2.4096, 1.6713, 2.0520, 0.9115, 1.1719, 1.2937, 1.29…
## $ TSUB      <dbl> 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1302, 0.0000, 0.00…
## $ UH        <dbl> 0.0000, 0.0000, 0.0000, 0.1368, 0.0000, 0.1302, 0.0000, 0.00…
## $ VB        <dbl> 0.0000, 3.0120, 11.6992, 12.1751, 11.5885, 10.8073, 13.0660,…
## $ VBD       <dbl> 0.0000, 3.1627, 0.2786, 0.0000, 0.0000, 0.0000, 0.0000, 0.64…
## $ VBG       <dbl> 0.0000, 0.3012, 0.1393, 0.1368, 0.5208, 0.0000, 0.6468, 0.00…
## $ VBN       <dbl> 0.0000, 0.3012, 0.0000, 0.0000, 0.1302, 0.0000, 0.0000, 0.38…
## $ VPRT      <dbl> 0.0000, 6.3253, 4.1783, 4.6512, 5.3385, 3.5156, 4.9159, 3.48…
## $ WDT       <dbl> 0.0000, 0.0000, 0.2786, 0.1368, 0.5208, 0.3906, 1.0349, 0.25…
## $ WP        <dbl> 0.0000, 0.3012, 1.2535, 1.2312, 1.4323, 1.5625, 1.6818, 1.80…
## $ WPS       <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ XX0       <dbl> 0.0000, 0.6024, 0.8357, 0.0000, 1.0417, 0.1302, 0.5175, 0.12…
## $ X.BEMA.   <dbl> 0.0000, 2.8614, 1.3928, 1.3680, 1.3021, 1.1719, 1.2937, 1.16…
## $ X.BYPA.   <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.CONT.   <dbl> 0.0000, 0.6024, 1.3928, 0.6840, 1.9531, 0.5208, 1.0349, 0.12…
## $ X.PASS.   <dbl> 0.0000, 0.3012, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.00…
## $ X.PASTP.  <dbl> 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.00…
## $ X.PEAS.   <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.PIRE.   <dbl> 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1294, 0.00…
## $ X.PRESP.  <dbl> 0.0000, 0.1506, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.00…
## $ X.PRIV.   <dbl> 0.0000, 1.2048, 1.6713, 2.3256, 2.0833, 2.3438, 2.1992, 2.58…
## $ X.PROD.   <dbl> 0.0000, 0.3012, 0.0000, 0.0000, 0.2604, 0.1302, 0.5175, 0.77…
## $ X.PUBV.   <dbl> 0.0000, 0.1506, 2.2284, 3.1464, 1.9531, 1.4323, 1.9405, 1.67…
## $ X.SERE.   <dbl> 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1294, 0.00…
## $ X.SMP.    <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.SPAU.   <dbl> 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.00…
## $ X.SPIN.   <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.STPR.   <dbl> 0.0000, 0.4518, 0.1393, 0.0000, 0.0000, 0.2604, 0.2587, 0.00…
## $ X.SUAV.   <dbl> 0.0000, 0.0000, 0.2786, 0.8208, 0.1302, 0.2604, 1.0349, 0.25…
## $ X.THATD.  <dbl> 0.0000, 0.0000, 0.0000, 0.1368, 0.1302, 0.2604, 0.0000, 0.00…
## $ X.WHCL.   <dbl> 0.0000, 0.1506, 0.2786, 0.2736, 0.5208, 0.1302, 0.6468, 0.38…
## $ X.WHOBJ.  <dbl> 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.00…
## $ X.WHQU.   <dbl> 0.0000, 0.0000, 0.0000, 0.2736, 0.3906, 0.3906, 0.0000, 0.00…
## $ X.WHSUB.  <dbl> 0.0000, 0.0000, 0.1393, 0.0000, 0.0000, 0.0000, 0.0000, 0.00…
## $ X.WZPAST. <dbl> 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.00…
## $ X.WZPRES. <dbl> 0.0000, 0.1506, 0.0000, 0.1368, 0.1302, 0.0000, 0.2587, 0.00…
## $ X...1     <dbl> 0.0000, 0.6024, 0.0000, 0.2736, 0.2604, 0.2604, 0.0000, 0.25…
nrow(TxBcounts)
## [1] 1950
TxBcounts <- TxBcounts %>% filter(Filename!="._Access_1_Informative_0001.txt")
TxBcounts$Register <- as.factor(stringr::str_extract(TxBcounts$Filename, "Spoken|Narrative|Other|Personal|Informative|Instructional|Poetry")) # Add a variable for Textbook Register
summary(TxBcounts$Register)
##   Informative Instructional     Narrative      Personal        Poetry 
##           363           647           285            88            37 
##        Spoken 
##           529
TxBcounts$Register <-car::recode(TxBcounts$Register, "'Narrative' = 'Fiction'; 'Spoken' = 'Conversation'")

colnames(TxBcounts)
##   [1] "Filename"  "Level"     "Tokens"    "AWL"       "TTR"       "X."       
##   [7] "X..1"      "X.."       "X..2"      "X.LRB."    "X.RRB."    "."        
##  [13] "X..3"      "AMP"       "ANDC"      "CAUS"      "CC"        "CD"       
##  [19] "CONC"      "COND"      "CONJ"      "DEMO"      "DEMP"      "DPAR"     
##  [25] "DT"        "DWNT"      "EMPH"      "EX"        "FPP1"      "FW"       
##  [31] "GER"       "HDG"       "IN"        "INPR"      "JJ"        "LS"       
##  [37] "NEMD"      "NN"        "NNP"       "NOMZ"      "OSUB"      "PDT"      
##  [43] "PHC"       "PIN"       "PIT"       "PLACE"     "POMD"      "POS"      
##  [49] "PRED"      "PRMD"      "PRP"       "PRPS"      "QUAN"      "QUPR"     
##  [55] "RB"        "RP"        "SPP2"      "SYM"       "SYNE"      "THAC"     
##  [61] "THVC"      "TIME"      "TO"        "TOBJ"      "TPP3"      "TSUB"     
##  [67] "UH"        "VB"        "VBD"       "VBG"       "VBN"       "VPRT"     
##  [73] "WDT"       "WP"        "WPS"       "XX0"       "X.BEMA."   "X.BYPA."  
##  [79] "X.CONT."   "X.PASS."   "X.PASTP."  "X.PEAS."   "X.PIRE."   "X.PRESP." 
##  [85] "X.PRIV."   "X.PROD."   "X.PUBV."   "X.SERE."   "X.SMP."    "X.SPAU."  
##  [91] "X.SPIN."   "X.STPR."   "X.SUAV."   "X.THATD."  "X.WHCL."   "X.WHOBJ." 
##  [97] "X.WHQU."   "X.WHSUB."  "X.WZPAST." "X.WZPRES." "X...1"     "Register"
MAT_features <- read.csv(here("metadata", "MAT_features_TxB.csv"), header = F)
MAT_features <- MAT_features$V3 # Feature names without any spaces or hythens
MAT_features
##   [1] "Filename"                     "Level"                       
##   [3] "Tokens"                       "AWL"                         
##   [5] "TTR"                          "Hashtag"                     
##   [7] "Dollar"                       "Quotation"                   
##   [9] "Comma"                        "LeftBracket"                 
##  [11] "RightBracket"                 "Full_stop"                   
##  [13] "Colon"                        "Amplifiers"                  
##  [15] "Ind_clause_coord"             "because"                     
##  [17] "Coord_conj"                   "Card_numb"                   
##  [19] "although_though"              "if_unless"                   
##  [21] "Conjuncts"                    "Demonstratives"              
##  [23] "Dem_pronouns"                 "Discourse_particles"         
##  [25] "Determiners"                  "Downtoners"                  
##  [27] "Emphatics"                    "Existential_there"           
##  [29] "FPP1"                         "Foreign_words"               
##  [31] "Gerunds"                      "Hedges"                      
##  [33] "Prep_subord_conj"             "Ind_pronouns"                
##  [35] "Attr_Adj"                     "List_markers"                
##  [37] "Necessity_modals"             "Nouns"                       
##  [39] "Proper_nouns"                 "Nominalizations"             
##  [41] "Adv_sub"                      "Pre_determiners"             
##  [43] "Phrasal_coord"                "Prepositions"                
##  [45] "it"                           "Place_adv"                   
##  [47] "Poss_modals"                  "Poss_S"                      
##  [49] "Pred_adj"                     "Pred_modals"                 
##  [51] "Personal_pronouns"            "Poss_pronouns"               
##  [53] "Quantifiers"                  "Quantifying_pronouns"        
##  [55] "Adverbs"                      "Particles"                   
##  [57] "SPP2"                         "Symbols"                     
##  [59] "Syn_negation"                 "That_adj_comp"               
##  [61] "That_verb_comp"               "Time_adv"                    
##  [63] "To_infinitives"               "That_rel_clause_obj"         
##  [65] "TPP3"                         "That_rel_clause_subj"        
##  [67] "Interjection"                 "Verb_base_form"              
##  [69] "Past_tense"                   "Verb_ing_form"               
##  [71] "Verb_past_par"                "Present_tense"               
##  [73] "WH_determiner"                "WH_pronoun"                  
##  [75] "Poss_WH_pronoun"              "Analytic_negation"           
##  [77] "BE_main_verb"                 "By_passives"                 
##  [79] "Contractions"                 "Agentless_passives"          
##  [81] "Past_participial_clauses"     "Perfect_aspect"              
##  [83] "Pied_piping_relative_clauses" "Present_part_clauses"        
##  [85] "Private_verbs"                "Pro_verb_DO"                 
##  [87] "Public_verbs"                 "Sentence_relatives"          
##  [89] "seem_appear"                  "Split_auxiliaries"           
##  [91] "Split_infinitives"            "Stranded_prepositions"       
##  [93] "Suasive_verbs"                "That_deletion"               
##  [95] "WH_clauses"                   "WH_rel_clauses_obj"          
##  [97] "Direct_WH_questions"          "WH_rel_clauses_subj"         
##  [99] "Past_part_WHIZ_del_rel"       "Present_part_WHIZ_del_rel"   
## [101] "Quotation2"                   "Register"
colnames(TxBcounts) <- MAT_features
colnames(TxBcounts)
##   [1] "Filename"                     "Level"                       
##   [3] "Tokens"                       "AWL"                         
##   [5] "TTR"                          "Hashtag"                     
##   [7] "Dollar"                       "Quotation"                   
##   [9] "Comma"                        "LeftBracket"                 
##  [11] "RightBracket"                 "Full_stop"                   
##  [13] "Colon"                        "Amplifiers"                  
##  [15] "Ind_clause_coord"             "because"                     
##  [17] "Coord_conj"                   "Card_numb"                   
##  [19] "although_though"              "if_unless"                   
##  [21] "Conjuncts"                    "Demonstratives"              
##  [23] "Dem_pronouns"                 "Discourse_particles"         
##  [25] "Determiners"                  "Downtoners"                  
##  [27] "Emphatics"                    "Existential_there"           
##  [29] "FPP1"                         "Foreign_words"               
##  [31] "Gerunds"                      "Hedges"                      
##  [33] "Prep_subord_conj"             "Ind_pronouns"                
##  [35] "Attr_Adj"                     "List_markers"                
##  [37] "Necessity_modals"             "Nouns"                       
##  [39] "Proper_nouns"                 "Nominalizations"             
##  [41] "Adv_sub"                      "Pre_determiners"             
##  [43] "Phrasal_coord"                "Prepositions"                
##  [45] "it"                           "Place_adv"                   
##  [47] "Poss_modals"                  "Poss_S"                      
##  [49] "Pred_adj"                     "Pred_modals"                 
##  [51] "Personal_pronouns"            "Poss_pronouns"               
##  [53] "Quantifiers"                  "Quantifying_pronouns"        
##  [55] "Adverbs"                      "Particles"                   
##  [57] "SPP2"                         "Symbols"                     
##  [59] "Syn_negation"                 "That_adj_comp"               
##  [61] "That_verb_comp"               "Time_adv"                    
##  [63] "To_infinitives"               "That_rel_clause_obj"         
##  [65] "TPP3"                         "That_rel_clause_subj"        
##  [67] "Interjection"                 "Verb_base_form"              
##  [69] "Past_tense"                   "Verb_ing_form"               
##  [71] "Verb_past_par"                "Present_tense"               
##  [73] "WH_determiner"                "WH_pronoun"                  
##  [75] "Poss_WH_pronoun"              "Analytic_negation"           
##  [77] "BE_main_verb"                 "By_passives"                 
##  [79] "Contractions"                 "Agentless_passives"          
##  [81] "Past_participial_clauses"     "Perfect_aspect"              
##  [83] "Pied_piping_relative_clauses" "Present_part_clauses"        
##  [85] "Private_verbs"                "Pro_verb_DO"                 
##  [87] "Public_verbs"                 "Sentence_relatives"          
##  [89] "seem_appear"                  "Split_auxiliaries"           
##  [91] "Split_infinitives"            "Stranded_prepositions"       
##  [93] "Suasive_verbs"                "That_deletion"               
##  [95] "WH_clauses"                   "WH_rel_clauses_obj"          
##  [97] "Direct_WH_questions"          "WH_rel_clauses_subj"         
##  [99] "Past_part_WHIZ_del_rel"       "Present_part_WHIZ_del_rel"   
## [101] "Quotation2"                   "Register"
TxBcounts %>% 
  group_by(Register) %>% 
  summarise(totaltexts = n(), totalwords = sum(Tokens), meannouncount = mean(Nouns), sdnouncount = sd(Nouns), TTRmean = mean(TTR))
## # A tibble: 6 × 6
##   Register      totaltexts totalwords meannouncount sdnouncount TTRmean
##   <fct>              <int>      <int>         <dbl>       <dbl>   <dbl>
## 1 Conversation         529     407591          24.4        4.34   0.459
## 2 Fiction              285     205072          22.2        3.82   0.498
## 3 Informative          363     265224          27.9        4.80   0.542
## 4 Instructional        647     499324          26.6        2.87   0.443
## 5 Personal              88      58534          22.5        4.10   0.511
## 6 Poetry                37      22358          23.4        4.74   0.465
### Z-scores ###

TxBzscores <- read.delim(here("data", "TxB900MDA_zscores.tsv"), header = TRUE)
glimpse(TxBzscores)
## Rows: 1,951
## Columns: 71
## $ Filename  <chr> "._Access_1_Informative_0001.txt", "Access_1_Informative_000…
## $ Level     <chr> "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", …
## $ AMP       <dbl> -1.0385, 2.4369, -1.0385, -1.0385, -1.0385, -1.0385, -0.5408…
## $ ANDC      <dbl> -0.9375, -0.6238, -0.3571, -0.9375, -0.6663, -0.3950, -0.667…
## $ AWL       <dbl> -7.4579, -0.6099, -1.1142, -0.6036, -1.4062, -1.3053, -1.059…
## $ CAUS      <dbl> -0.6471, 0.2388, -0.6471, -0.6471, -0.6471, -0.6471, 0.1141,…
## $ CONC      <dbl> -0.625, -0.625, -0.625, -0.625, -0.625, -0.625, -0.625, -0.6…
## $ COND      <dbl> -1.1364, -1.1364, -0.5032, -0.5145, -0.5445, -1.1364, -1.136…
## $ CONJ      <dbl> -0.7500, -0.7500, -0.7500, -0.7500, -0.7500, -0.7500, -0.750…
## $ DEMO      <dbl> -2.3571, -2.3571, -1.0307, -1.0543, 0.1231, -1.4271, -1.4331…
## $ DEMP      <dbl> -0.9583, -0.9583, 0.7827, 0.4667, -0.9583, -0.6871, -0.4194,…
## $ DPAR      <dbl> -0.5217, -0.5217, 1.2948, 0.0730, 0.6104, 0.0443, 1.7283, -0…
## $ DWNT      <dbl> -1.2500, 0.6325, -0.3794, -1.2500, -1.2500, -1.2500, -1.2500…
## $ EMPH      <dbl> -1.5000, -1.1414, -0.1736, -0.1971, -0.8800, -0.8800, -1.500…
## $ EX        <dbl> -1.2222, -0.3856, -1.2222, 1.0578, -1.2222, -1.2222, -1.2222…
## $ FPP1      <dbl> -1.0421, -0.8690, -0.5085, -0.7801, -0.9424, -0.9424, -0.992…
## $ GER       <dbl> -1.8421, 2.1211, -1.4755, -1.8421, -1.4995, -1.8421, -1.8421…
## $ HDG       <dbl> -0.4615, -0.4615, -0.4615, -0.4615, -0.4615, -0.4615, -0.461…
## $ INPR      <dbl> -0.7000, -0.7000, -0.7000, -0.7000, -0.7000, -0.7000, -0.700…
## $ JJ        <dbl> -3.2287, -0.5051, -0.4877, -1.5551, -1.5665, -2.1898, -1.852…
## $ NEMD      <dbl> -1.0000, -0.2829, -1.0000, -1.0000, -1.0000, -1.0000, -1.000…
## $ NN        <dbl> 20.4947, 5.6327, 4.0453, 2.9225, 3.3787, 4.0736, 2.3065, 2.9…
## $ NOMZ      <dbl> -1.3819, -1.0682, -0.8016, 0.2331, -1.2011, -0.4777, 1.1335,…
## $ OSUB      <dbl> -0.9091, -0.9091, -0.9091, -0.9091, -0.9091, -0.9091, -0.909…
## $ PHC       <dbl> -1.2593, 2.6452, 3.3833, 3.3007, 3.5633, 2.1167, 2.5737, 3.0…
## $ PIN       <dbl> -4.3504, -0.4371, -0.3476, -1.1728, -1.1721, 0.1607, -1.3454…
## $ PIT       <dbl> -1.4507, 0.6704, -0.6661, -0.8727, -0.3504, -0.7172, -0.1752…
## $ PLACE     <dbl> -0.9118, 3.9606, -0.5021, -0.5094, -0.1459, -0.9118, -0.5312…
## $ POMD      <dbl> -1.6571, 0.4943, -1.2591, 1.0789, 1.6911, 2.4351, 2.4086, 0.…
## $ PRED      <dbl> -1.8077, 1.6677, -0.7362, -1.2815, 1.1969, -1.3069, -0.8127,…
## $ PRMD      <dbl> -1.3333, -1.3333, -1.3333, -1.0076, -1.3333, -0.7133, -1.333…
## $ RB        <dbl> -3.7273, -2.7005, -2.9359, -2.6391, -2.7655, -3.2094, -2.110…
## $ SPP2      <dbl> -0.7174, -0.2809, 2.1085, 4.2391, 3.2455, 4.1890, 4.1572, 2.…
## $ SYNE      <dbl> -1.0625, -1.0625, -1.0625, -1.0625, -1.0625, -1.0625, -1.062…
## $ THAC      <dbl> -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, …
## $ THVC      <dbl> -1.1379, -0.6186, -1.1379, -1.1379, -1.1379, -0.6890, -1.137…
## $ TIME      <dbl> -1.4857, -0.6251, -0.2920, 0.0777, -1.1137, -0.7417, -1.1160…
## $ TO        <dbl> -2.6607, -0.7782, -2.4120, -2.6607, -1.7307, -2.1957, -0.812…
## $ TOBJ      <dbl> -0.7273, -0.7273, -0.7273, -0.7273, -0.7273, -0.7273, -0.727…
## $ TPP3      <dbl> -1.3289, -0.2580, -0.5861, -0.4169, -0.9238, -0.8080, -0.753…
## $ TSUB      <dbl> -0.5000, -0.5000, -0.5000, -0.5000, -0.5000, 1.1275, -0.5000…
## $ TTR       <dbl> -6.1536, 0.4615, -2.8558, -2.1827, -2.3750, -2.9038, -1.7500…
## $ VBD       <dbl> -1.3191, -0.2787, -1.2274, -1.3191, -1.3191, -1.3191, -1.319…
## $ VPRT      <dbl> -2.2653, -0.4212, -1.0471, -0.9093, -0.7089, -1.2403, -0.832…
## $ XX0       <dbl> -1.3934, -0.4059, -0.0234, -1.3934, 0.3143, -1.1800, -0.5451…
## $ X.BEMA.   <dbl> -2.9789, 0.0331, -1.5128, -1.5389, -1.6083, -1.7454, -1.6172…
## $ X.BYPA.   <dbl> -0.6154, -0.6154, -0.6154, -0.6154, -0.6154, -0.6154, -0.615…
## $ X.CONT.   <dbl> -0.7258, -0.4019, 0.0230, -0.3581, 0.3242, -0.4458, -0.1694,…
## $ X.PASS.   <dbl> -1.4545, -0.9982, -1.4545, -1.4545, -1.4545, -1.4545, -1.454…
## $ X.PASTP.  <dbl> -0.250, -0.250, -0.250, -0.250, -0.250, -0.250, -0.250, -0.2…
## $ X.PEAS.   <dbl> -1.6538, -1.6538, -1.6538, -1.6538, -1.6538, -1.6538, -1.653…
## $ X.PIRE.   <dbl> -0.6364, -0.6364, -0.6364, -0.6364, -0.6364, -0.6364, 0.5400…
## $ X.PRESP.  <dbl> -0.5882, 0.2976, -0.5882, -0.5882, -0.5882, -0.5882, -0.5882…
## $ X.PRIV.   <dbl> -1.7308, -0.5723, -0.1238, 0.5054, 0.2724, 0.5229, 0.3838, 0…
## $ X.PROD.   <dbl> -0.8571, 0.0034, -0.8571, -0.8571, -0.1131, -0.4851, 0.6214,…
## $ X.PUBV.   <dbl> -1.4259, -1.1470, 2.7007, 4.4007, 2.1909, 1.2265, 2.1676, 1.…
## $ X.SERE.   <dbl> -0.2500, -0.2500, -0.2500, -0.2500, -0.2500, -0.2500, 2.9850…
## $ X.SMP.    <dbl> -0.8, -0.8, -0.8, -0.8, -0.8, -0.8, -0.8, -0.8, -0.8, -0.8, …
## $ X.SPAU.   <dbl> -2.2000, -2.2000, -2.2000, -2.2000, -2.2000, -2.2000, -2.200…
## $ X.SPIN.   <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ X.STPR.   <dbl> -0.7407, 0.9326, -0.2248, -0.7407, -0.7407, 0.2237, 0.2174, …
## $ X.SUAV.   <dbl> -0.9355, -0.9355, -0.0368, 1.7123, -0.5155, -0.0955, 2.4029,…
## $ X.THATD.  <dbl> -0.7561, -0.7561, -0.7561, -0.4224, -0.4385, -0.1210, -0.756…
## $ X.WHCL.   <dbl> -0.600, 0.906, 2.186, 2.136, 4.608, 0.702, 5.868, 3.271, 5.9…
## $ X.WHOBJ.  <dbl> -0.8235, -0.8235, -0.8235, -0.8235, -0.8235, -0.8235, -0.823…
## $ X.WHQU.   <dbl> -0.3333, -0.3333, -0.3333, 4.2267, 6.1767, 6.1767, -0.3333, …
## $ X.WHSUB.  <dbl> -1.0500, -1.0500, -0.3535, -1.0500, -1.0500, -1.0500, -1.050…
## $ X.WZPAST. <dbl> -0.8065, -0.8065, -0.8065, -0.8065, -0.8065, -0.8065, -0.806…
## $ X.WZPRES. <dbl> -0.8889, -0.0522, -0.8889, -0.1289, -0.1656, -0.8889, 0.5483…
## $ Underused <chr> "AWL DEMO JJ PIN RB TO TTR VPRT [BEMA] [SPAU]", "DEMO RB [SP…
## $ Overused  <chr> "NN", "AMP GER NN PHC PLACE", "NN PHC SPP2 [PUBV] [WHCL]", "…
TxBzscores <- TxBzscores %>% filter(Filename!="CORPUS" & Filename!="._Access_1_Informative_0001.txt") # Remove this row with mean values for the corpus
nrow(TxBzscores)
## [1] 1949
colnames(TxBzscores)
##  [1] "Filename"  "Level"     "AMP"       "ANDC"      "AWL"       "CAUS"     
##  [7] "CONC"      "COND"      "CONJ"      "DEMO"      "DEMP"      "DPAR"     
## [13] "DWNT"      "EMPH"      "EX"        "FPP1"      "GER"       "HDG"      
## [19] "INPR"      "JJ"        "NEMD"      "NN"        "NOMZ"      "OSUB"     
## [25] "PHC"       "PIN"       "PIT"       "PLACE"     "POMD"      "PRED"     
## [31] "PRMD"      "RB"        "SPP2"      "SYNE"      "THAC"      "THVC"     
## [37] "TIME"      "TO"        "TOBJ"      "TPP3"      "TSUB"      "TTR"      
## [43] "VBD"       "VPRT"      "XX0"       "X.BEMA."   "X.BYPA."   "X.CONT."  
## [49] "X.PASS."   "X.PASTP."  "X.PEAS."   "X.PIRE."   "X.PRESP."  "X.PRIV."  
## [55] "X.PROD."   "X.PUBV."   "X.SERE."   "X.SMP."    "X.SPAU."   "X.SPIN."  
## [61] "X.STPR."   "X.SUAV."   "X.THATD."  "X.WHCL."   "X.WHOBJ."  "X.WHQU."  
## [67] "X.WHSUB."  "X.WZPAST." "X.WZPRES." "Underused" "Overused"
MAT_features <- read.csv(here("metadata", "MAT_features_zscores.csv"), header = F)
MAT_features <- MAT_features$V3 # Feature names without any spaces or hythens
colnames(TxBzscores) <- MAT_features
colnames(TxBzscores)
##  [1] "Filename"                     "Level"                       
##  [3] "Amplifiers"                   "Ind_clause_coord"            
##  [5] "AWL"                          "because"                     
##  [7] "Coord_conj"                   "if_unless"                   
##  [9] "although_though"              "Demonstratives"              
## [11] "Dem_pronouns"                 "Discourse_particles"         
## [13] "Downtoners"                   "Emphatics"                   
## [15] "Existential_there"            "FPP1"                        
## [17] "Gerunds"                      "Hedges"                      
## [19] "Ind_pronouns"                 "Attr_Adj"                    
## [21] "Necessity_modals"             "Nouns"                       
## [23] "Nominalizations"              "Adv_sub"                     
## [25] "Phrasal_coord"                "Prepositions"                
## [27] "it"                           "Place_adv"                   
## [29] "Poss_modals"                  "Pred_adj"                    
## [31] "Pred_modals"                  "Adverbs"                     
## [33] "SPP2"                         "Syn_negation"                
## [35] "That_adj_comp"                "That_verb_comp"              
## [37] "Time_adv"                     "To_infinitives"              
## [39] "That_rel_clause_obj"          "TPP3"                        
## [41] "That_rel_clause_subj"         "TTR"                         
## [43] "Past_tense"                   "Present_tense"               
## [45] "Analytic_negation"            "BE_main_verb"                
## [47] "By_passives"                  "Contractions"                
## [49] "Agentless_passives"           "Past_participial_clauses"    
## [51] "Perfect_aspect"               "Pied_piping_relative_clauses"
## [53] "Present_part_clauses"         "Private_verbs"               
## [55] "Pro_verb_DO"                  "Public_verbs"                
## [57] "Sentence_relatives"           "seem_appear"                 
## [59] "Split_auxiliaries"            "Split_infinitives"           
## [61] "Stranded_prepositions"        "Suasive_verbs"               
## [63] "That_deletion"                "WH_clauses"                  
## [65] "WH_rel_clauses_obj"           "Direct_WH_questions"         
## [67] "WH_rel_clauses_subj"          "Past_part_WHIZ_del_rel"      
## [69] "Present_part_WHIZ_del_rel"    "Underused"                   
## [71] "Overused"
TxBzscores$Register <- as.factor(stringr::str_extract(TxBzscores$Filename, "Spoken|Narrative|Other|Personal|Informative|Instructional|Poetry")) # Add a variable for Textbook Register
TxBzscores$Register <-car::recode(TxBzscores$Register, "'Narrative' = 'Fiction'; 'Spoken' = 'Conversation'")
summary(TxBzscores$Register)
##  Conversation       Fiction   Informative Instructional      Personal 
##           529           285           363           647            88 
##        Poetry 
##            37
# Textbook Series variable
TxBzscores$Filename <- stringr::str_replace(TxBzscores$Filename, "English_In_Mind", "EIM") 
TxBzscores$Filename <- stringr::str_replace(TxBzscores$Filename, "English_in_Mind", "EIM") # This is necessary because of inconsistencies in the use of capital letters for this series
TxBzscores$Filename <- stringr::str_replace(TxBzscores$Filename, "New_GreenLine", "NGL") # Otherwise the regex for GreenLine will override New_GreenLine
TxBzscores$Filename <- stringr::str_replace(TxBzscores$Filename, "Piece_of_cake", "POC") # Otherwise the regex for GreenLine will override New_GreenLine

TxBzscores$Series <- as.factor(stringr::str_extract(TxBzscores$Filename, "Access|Achievers|EIM|GreenLine|HT|NB|NM|POC|JTT|NGL|Solutions"))
summary(TxBzscores$Series)
##    Access Achievers       EIM GreenLine        HT       JTT        NB       NGL 
##       282       238       174       206       114       130        45       300 
##        NM       POC Solutions 
##        58        92       310
TxBzscores$Series <-car::recode(TxBzscores$Series, "c('NB', 'JTT') = 'JTT'; c('NM', 'HT') = 'HT'")

# Textbook country variable
TxBzscores$Country <- TxBzscores$Series
TxBzscores$Country <- car::recode(TxBzscores$Series, "c('Access', 'GreenLine', 'NGL') = 'Germany'; c('Achievers', 'EIM', 'Solutions') = 'Spain'; c('HT', 'NB', 'NM', 'POC', 'JTT') = 'France'")
summary(TxBzscores$Country)
##  France Germany   Spain 
##     439     788     722
TxBzscores$Level <- as.factor(TxBzscores$Level)
TxBdimensions <- read.delim(here("data", "TxB900MDA_dims.tsv"), header = TRUE)

filter(TxBdimensions, Filename=="CORPUS") # This row reports the mean values for each dimension
##   Filename Level  Dim1    Dim2   Dim3    Dim4   Dim5    Dim6
## 1   CORPUS  <NA> 3.051 -1.6558 1.5119 -1.6541 -1.953 -1.6102
##              TextType
## 1 Involved persuasion
TxBdimensions <- TxBdimensions %>% filter(Filename!="CORPUS") # Remove the row with mean values
glimpse(TxBdimensions)
## Rows: 1,949
## Columns: 9
## $ Filename <chr> "Access_1_Informative_0001.txt", "Access_1_Instructional_0001…
## $ Level    <chr> "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "…
## $ Dim1     <dbl> -7.3851, -4.9261, -2.4381, -0.1935, -1.6453, 4.4156, -6.7901,…
## $ Dim2     <dbl> -4.1024, -2.4173, -0.6398, -3.3565, -4.2051, -3.2099, -3.4863…
## $ Dim3     <dbl> -0.9315, 5.1347, 4.7311, 4.5138, 4.6284, 5.5911, 4.4546, 2.16…
## $ Dim4     <dbl> -6.6663, -7.4853, -5.6705, -7.3240, -7.3409, -4.0795, -7.2812…
## $ Dim5     <dbl> -3.4638, -3.9201, -3.9201, -3.9201, -3.9201, -3.9201, -3.9201…
## $ Dim6     <dbl> -2.9757, -2.1686, -2.1922, -1.0148, -2.1161, -2.5710, -1.9589…
## $ TextType <chr> "General narrative exposition", "General narrative exposition…
# Register variable
TxBdimensions$Register <- as.factor(stringr::str_extract(TxBdimensions$Filename, "Spoken|Narrative|Other|Personal|Informative|Instructional|Poetry")) # Add a variable for Textbook Register
summary(TxBdimensions$Register)
##   Informative Instructional     Narrative      Personal        Poetry 
##           363           647           285            88            37 
##        Spoken 
##           529
TxBdimensions$Register <-car::recode(TxBdimensions$Register, "'Narrative' = 'Fiction'; 'Spoken' = 'Conversation'")

# Show me the Textbook Series variable for ease of plotting
TxBdimensions$Filename <- stringr::str_replace(TxBdimensions$Filename, "English_In_Mind", "EIM") 
TxBdimensions$Filename <- stringr::str_replace(TxBdimensions$Filename, "English_in_Mind", "EIM") # This is necessary because of inconsistencies in the use of capital letters for this series
TxBdimensions$Filename <- stringr::str_replace(TxBdimensions$Filename, "New_GreenLine", "NGL") # Otherwise the regex for GreenLine will override New_GreenLine
TxBdimensions$Filename <- stringr::str_replace(TxBdimensions$Filename, "Piece_of_cake", "POC") # Otherwise the regex for GreenLine will override New_GreenLine
TxBdimensions$Series <- as.factor(stringr::str_extract(TxBdimensions$Filename, "Access|Achievers|EIM|GreenLine|HT|NB|NM|POC|JTT|NGL|Solutions"))

summary(TxBdimensions$Series)
##    Access Achievers       EIM GreenLine        HT       JTT        NB       NGL 
##       282       238       174       206       114       130        45       300 
##        NM       POC Solutions 
##        58        92       310
# Match the level E French textbooks to their corresponding series
TxBdimensions$Series <-car::recode(TxBdimensions$Series, "c('NB', 'JTT') = 'JTT'; c('NM', 'HT') = 'HT'")

# Textbook country variable
TxBdimensions$Country <- TxBdimensions$Series
TxBdimensions$Country <- car::recode(TxBdimensions$Series, "c('Access', 'GreenLine', 'NGL') = 'Germany'; c('Achievers', 'EIM', 'Solutions') = 'Spain'; c('HT', 'NB', 'NM', 'POC', 'JTT') = 'France'")
summary(TxBdimensions$Country)
##  France Germany   Spain 
##     439     788     722
TxBdimensions$Level <- as.factor(TxBdimensions$Level)

Additive MDA: Intra-textbook analysis I

Dim1

Rainplots for all textbook registers on Dimension 1

ggplot(TxBdimensions,aes(x=Register,y=Dim1, fill = Register, colour = Register))+ # Or leave out "colour = Register" to keep the dots in black
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .25)+
  # note that here we need to set the x-variable to a numeric variable and bump it to get the boxplots to line up with the rainclouds.
  geom_boxplot(position = position_nudge(x = .25), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Dimension 1 (Biber 1988)') + xlab('Textbook Registers') +
  theme_cowplot() +
  guides(fill = "none", colour = "none") +
  scale_colour_manual(values = colours)+
  scale_fill_manual(values = colours)+
  #ggtitle("Dimension 1: Involved vs. Informational Discourse")
  scale_y_continuous(sec.axis = dup_axis(name=NULL), breaks = seq(from = -30, to = 40, by = 10)) 

#ggsave(here("plots", "TxB_Reg_Dim1.svg"), width = 10, height = 6)
#ggsave(here("plots", "TxB_Reg_Dim1.png"), width = 10, height = 6, dpi = 300)

Modelling Dim1 results: Linear regression with mixed effects

Checks

Predictors

Check the relationships among the predictor variables and the grouping variable.

# Plot 1
ggplot(TxBdimensions, aes(x = Level)) +
  geom_bar() +
  facet_grid(rows = vars(Series), cols = vars(Register))

# Plot 2 (more detailed)
fig_obs <- ggplot(TxBdimensions, aes(x = Level, y = Dim1)) +
  geom_point(
    shape = "circle filled",
    fill = "grey",
    position = position_jitter(width = 0.2, height = 0)
  ) +
  facet_grid(rows = vars(Series), cols = vars(Register))
fig_obs

Basic observations: * There are relatively few ‘Personal’ and ‘Poetry’ texts. * Some series (‘POC’ and ‘Solutions’) have almost no fiction. * Some series (e.g. ‘POC’ and ‘Solutions’ again) have no level ‘E’ textbooks

Outcome

Check the distribution of the outcome variable. Note that the y axis varies in scale so as to ‘zoom in’ on the shape of the distribution for those registers that contain much fewer texts.

fig_outcome <- ggplot(TxBdimensions, aes(x = Dim1)) +
  geom_histogram(bins = 20) +
  facet_grid(rows = vars(Register), cols = vars(Level), scales = "free_y")
fig_outcome

Aside from the fact that some combinations of Register and Level contain very few texts, Dim1 looks approximately normally distributed in each.

Models and model comparisons

Data for Poetry is too sparse so I am excluding it from these models. Thus, the following models are for just four of the registers. Following Gries and others, I am following this method: 1. Fit baseline model with only random effect structure. 2. Fit all plausible models. 3. Check for (significant) differences between models.

TxBdim_nopoetry <- TxBdimensions %>% filter(Register != "Poetry") %>% droplevels(.)
summary(TxBdim_nopoetry$Register) # Check
##  Conversation       Fiction   Informative Instructional      Personal 
##           529           285           363           647            88
md0 <- lmer(Dim1 ~ 1 + (1|Series), TxBdim_nopoetry, REML = FALSE)
md_register <- update(md0, .~. + Register)
md_level <- update(md0, . ~ . + Level)
md_both <- update(md_register, .~. + Level)
md_interaction <- update(md_both, . ~ . + Level:Register)

anova(md0, md_register, md_both, md_interaction)
## Data: TxBdim_nopoetry
## Models:
## md0: Dim1 ~ 1 + (1 | Series)
## md_register: Dim1 ~ (1 | Series) + Register
## md_both: Dim1 ~ (1 | Series) + Register + Level
## md_interaction: Dim1 ~ (1 | Series) + Register + Level + Register:Level
##                npar   AIC   BIC  logLik deviance    Chisq Df
## md0               3 14620 14637 -7307.2    14614            
## md_register       7 12689 12728 -6337.7    12675 1939.016  4
## md_both          11 12633 12694 -6305.4    12611   64.466  4
## md_interaction   27 12622 12772 -6284.1    12568   42.627 16
##                           Pr(>Chisq)    
## md0                                     
## md_register    < 0.00000000000000022 ***
## md_both           0.0000000000003333 ***
## md_interaction             0.0003179 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(md0, md_level)
## Data: TxBdim_nopoetry
## Models:
## md0: Dim1 ~ 1 + (1 | Series)
## md_level: Dim1 ~ (1 | Series) + Level
##          npar   AIC   BIC  logLik deviance  Chisq Df      Pr(>Chisq)    
## md0         3 14620 14637 -7307.2    14614                              
## md_level    7 14576 14615 -7281.1    14562 52.261  4 0.0000000001216 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
md_final <- lmer(Dim1 ~ (Register|Series) + Register + Level + Level:Register, TxBdim_nopoetry, REML = FALSE) # boundary (singular) fit: see ?isSingular
## boundary (singular) fit: see ?isSingular
tab_model(md_final)
  Dim 1
Predictors Estimates CI p
(Intercept) 16.41 14.35 – 18.47 <0.001
Register [Fiction] -6.53 -9.06 – -4.00 <0.001
Register [Informative] -20.02 -23.23 – -16.80 <0.001
Register [Instructional] -21.21 -23.70 – -18.73 <0.001
Register [Personal] -5.87 -9.69 – -2.05 0.003
Level [B] 0.30 -1.38 – 1.98 0.723
Level [C] -0.41 -2.08 – 1.26 0.631
Level [D] -2.23 -3.92 – -0.54 0.010
Level [E] -1.68 -3.61 – 0.25 0.088
Register [Fiction] *
Level [B]
-3.92 -7.02 – -0.83 0.013
Register [Informative] *
Level [B]
-0.86 -4.02 – 2.29 0.592
Register [Instructional]
* Level [B]
0.59 -1.72 – 2.90 0.618
Register [Personal] *
Level [B]
-2.09 -6.68 – 2.49 0.371
Register [Fiction] *
Level [C]
-4.33 -7.44 – -1.21 0.006
Register [Informative] *
Level [C]
-0.45 -3.47 – 2.57 0.771
Register [Instructional]
* Level [C]
1.36 -0.92 – 3.65 0.242
Register [Personal] *
Level [C]
-0.81 -5.47 – 3.84 0.732
Register [Fiction] *
Level [D]
-6.54 -9.57 – -3.52 <0.001
Register [Informative] *
Level [D]
-1.10 -4.11 – 1.91 0.472
Register [Instructional]
* Level [D]
2.25 -0.05 – 4.55 0.055
Register [Personal] *
Level [D]
0.06 -4.82 – 4.94 0.982
Register [Fiction] *
Level [E]
-5.90 -9.03 – -2.76 <0.001
Register [Informative] *
Level [E]
-3.28 -6.51 – -0.06 0.046
Register [Instructional]
* Level [E]
-0.07 -2.62 – 2.48 0.957
Register [Personal] *
Level [E]
0.25 -4.67 – 5.17 0.919
Random Effects
σ2 38.31
τ00 Series 6.07
τ11 Series.RegisterFiction 1.03
τ11 Series.RegisterInformative 9.07
τ11 Series.RegisterInstructional 7.19
τ11 Series.RegisterPersonal 3.20
ρ01 -0.27
0.19
-0.67
0.29
ICC 0.17
N Series 9
Observations 1912
Marginal R2 / Conditional R2 0.645 / 0.706

Singularity

The model fit is singular.

The summary of the random effects can tell us more. It shows the variance-covariance matrix for the random effect estimates.

VarCorr(md_final)
##  Groups   Name                  Std.Dev. Corr                       
##  Series   (Intercept)           2.4638                              
##           RegisterFiction       1.0125   -0.274                     
##           RegisterInformative   3.0117    0.194 -0.688              
##           RegisterInstructional 2.6812   -0.675  0.458  0.041       
##           RegisterPersonal      1.7891    0.288 -0.995  0.754 -0.435
##  Residual                       6.1896
md_final_ranefs <- tidy(md_final, effects = "ran_vals")

head(md_final_ranefs)
## # A tibble: 6 × 6
##   effect   group  level     term        estimate std.error
##   <chr>    <chr>  <chr>     <chr>          <dbl>     <dbl>
## 1 ran_vals Series Access    (Intercept)   -0.842     0.461
## 2 ran_vals Series Achievers (Intercept)   -1.03      0.742
## 3 ran_vals Series EIM       (Intercept)    4.88      0.748
## 4 ran_vals Series GreenLine (Intercept)    1.25      0.588
## 5 ran_vals Series HT        (Intercept)   -2.04      0.646
## 6 ran_vals Series JTT       (Intercept)   -0.746     0.674

To look at the association between intercepts and slopes, we need the values in the term column as separate columns.

md_final_ranefs %>%
  pivot_wider(
    id_cols = c(group, level),
    names_from = term,
    values_from = estimate
  ) ->
  md_final_ranefs

head(md_final_ranefs)
## # A tibble: 6 × 7
##   group  level  `(Intercept)` RegisterFiction RegisterInformat… RegisterInstruc…
##   <chr>  <chr>          <dbl>           <dbl>             <dbl>            <dbl>
## 1 Series Access        -0.842           1.00            -0.0521            3.01 
## 2 Series Achie…        -1.03           -1.19             4.53              1.52 
## 3 Series EIM            4.88           -0.800            0.781            -5.42 
## 4 Series Green…         1.25            0.447            1.91              2.30 
## 5 Series HT            -2.04            1.34            -4.95              0.515
## 6 Series JTT           -0.746           0.593           -4.01             -0.374
## # … with 1 more variable: RegisterPersonal <dbl>

Now we can plot a matrix of correlations among the estimated random effects.

md_final_ranefs %>%
  select(`(Intercept)`, starts_with("Register")) %>%
  ggpairs(
    lower = list(continuous = wrap("smooth_lm", shape = "circle filled", fill = "grey", se = FALSE)),
    diag = "blank",
    upper = list(continuous = wrap("cor", stars = FALSE))
  )

The scatterplots show close linear relationships among some of the estimates. In particular, the estimates for the random effect of the ‘Personal’ register are closely correlated with ‘Fiction’ and ‘Informative,’ as was also the case in the estimated covariance matrix. Zoom in on this correlation to understand what each plot in the matrix represents.

fig_ranef_cor <- ggplot(md_final_ranefs, 
                        aes(x = RegisterFiction, y = RegisterPersonal, label = level)) +
  geom_point(shape = "bullet") +
  geom_text(hjust = "inward")

fig_ranef_cor

In general, the higher the estimated Dim1 for Personal Communication texts in a given textbook series, the lower the estimated Dim1 for Fiction in that same series. Hence, in a certain sense, some of these random slopes for Register are providing ‘redundant’ information. If the random effect for one register is almost perfectly correlated with another, then there is no need for them both. Indeed, this redundancy can make it difficult to estimate both reliably.

Final Dim1 model

TxBdim_nopoetry <- TxBdimensions %>% filter(Register != "Poetry") %>% droplevels(.)
summary(TxBdim_nopoetry$Register) # Check
##  Conversation       Fiction   Informative Instructional      Personal 
##           529           285           363           647            88
md_final <- lmer(Dim1 ~ (1|Series) + Register + Level + Level:Register, TxBdim_nopoetry, REML = FALSE) # no warnings

tab_model(md_final, wrap.labels = 100) 
  Dim 1
Predictors Estimates CI p
(Intercept) 16.34 14.41 – 18.26 <0.001
Register [Fiction] -6.96 -9.44 – -4.47 <0.001
Register [Informative] -18.95 -21.54 – -16.36 <0.001
Register [Instructional] -21.42 -23.23 – -19.62 <0.001
Register [Personal] -5.29 -9.03 – -1.56 0.006
Level [B] 0.62 -1.12 – 2.36 0.485
Level [C] -0.28 -2.01 – 1.45 0.753
Level [D] -2.19 -3.94 – -0.44 0.014
Level [E] -1.27 -3.25 – 0.71 0.208
Register [Fiction] * Level [B] -4.09 -7.30 – -0.88 0.013
Register [Informative] * Level [B] -1.80 -5.07 – 1.46 0.279
Register [Instructional] * Level [B] 0.21 -2.19 – 2.60 0.866
Register [Personal] * Level [B] -2.82 -7.56 – 1.91 0.243
Register [Fiction] * Level [C] -4.09 -7.31 – -0.86 0.013
Register [Informative] * Level [C] -0.61 -3.74 – 2.52 0.703
Register [Instructional] * Level [C] 1.20 -1.17 – 3.57 0.321
Register [Personal] * Level [C] -1.53 -6.34 – 3.29 0.534
Register [Fiction] * Level [D] -6.06 -9.19 – -2.93 <0.001
Register [Informative] * Level [D] -1.37 -4.48 – 1.73 0.386
Register [Instructional] * Level [D] 2.21 -0.17 – 4.60 0.069
Register [Personal] * Level [D] -0.46 -5.49 – 4.56 0.856
Register [Fiction] * Level [E] -5.64 -8.87 – -2.40 0.001
Register [Informative] * Level [E] -4.45 -7.71 – -1.18 0.008
Register [Instructional] * Level [E] -0.24 -2.83 – 2.35 0.857
Register [Personal] * Level [E] -0.53 -5.58 – 4.52 0.836
Random Effects
σ2 41.29
τ00 Series 4.60
ICC 0.10
N Series 9
Observations 1912
Marginal R2 / Conditional R2 0.647 / 0.682

Checks

The basic checks look okay: * No warnings about problems with the fitting. * The variance of the random effects is not zero. * None of the standard errors are really huge (although those for the interactions involving the ‘Personal’ register are larger because data is sparse for this register).

# check distribution of residuals
plot(md_final)

# We can access the estimated deviation between each series average Dim1 1 and the overall average:
ranef(md_final)
## $Series
##           (Intercept)
## Access     0.04163842
## Achievers  0.82686763
## EIM        2.80050868
## GreenLine  2.41507553
## HT        -2.81224079
## JTT       -1.79858728
## NGL        2.35060266
## POC       -2.68886659
## Solutions -1.13499826
## 
## with conditional variances for "Series"

Visualising fitted vs. observed values

TxBdim_nopoetry[, "predicted"] <- predict(md_final)

p <- ggplot(TxBdim_nopoetry, aes(x = Level, y = Dim1)) +
  geom_point(shape = "circle filled", fill = "grey", position = position_jitter(width = 0.2, height = 0)) +
  facet_grid(rows = vars(Series), cols = vars(Register)) +
  geom_point(aes(y = predicted), shape = "triangle filled", fill = "red")+
  labs(y = "Dimension 1 (Biber 1988)", x = "Textbook Level")

top_label <- ggplot() +
  annotate("text", x = 0, y = 0, label = "Textbook Register") +
  theme_void()
right_label <- ggplot() +
  annotate("text", x = 0, y = 0, label = "Textbook Series", angle = -90) +
  theme_void()
blank_panel <- ggplot() +
  theme_void()

jpeg(here("plots", "TxB_Dim1_Pred_Obs_1Series_RS.jpeg"), height = 30, width = 20, units = "cm", res = 300)

gridExtra::grid.arrange(
  top_label, blank_panel, p, right_label,
  nrow = 2, ncol = 2,
  widths = c(30, 1), heights = c(1, 30)
)

#dev.off()

# Save plot using Rstudio export function (dimensions: 600 to 900 work well)

Comparing groups

Register_results <- emmeans(md_final, "Register")
## NOTE: Results may be misleading due to involvement in interactions
summary(Register_results)
##  Register      emmean    SE   df lower.CL upper.CL
##  Conversation   15.71 0.818 12.7    13.94    17.48
##  Fiction         4.78 0.868 16.4     2.94     6.62
##  Informative    -4.89 0.850 15.0    -6.70    -3.07
##  Instructional  -5.04 0.806 11.9    -6.79    -3.28
##  Personal        9.35 1.038 35.3     7.24    11.45
## 
## Results are averaged over the levels of: Level 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95
Level_results <- emmeans(md_final, "Level")
## NOTE: Results may be misleading due to involvement in interactions
summary(Level_results)
##  Level emmean    SE   df lower.CL upper.CL
##  A       5.81 0.920 21.2    3.898     7.72
##  B       4.73 0.863 16.1    2.898     6.56
##  C       4.53 0.863 16.0    2.699     6.36
##  D       2.48 0.869 16.6    0.644     4.32
##  E       2.37 0.877 17.1    0.519     4.22
## 
## Results are averaged over the levels of: Register 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95
comparisons <- pairs(Register_results, adjust = "tukey")
comparisons
##  contrast                     estimate    SE   df t.ratio p.value
##  Conversation - Fiction          10.93 0.505 1936  21.645 <.0001 
##  Conversation - Informative      20.60 0.478 1933  43.096 <.0001 
##  Conversation - Instructional    20.75 0.394 1933  52.684 <.0001 
##  Conversation - Personal          6.36 0.763 1930   8.342 <.0001 
##  Fiction - Informative            9.67 0.564 1936  17.148 <.0001 
##  Fiction - Instructional          9.82 0.487 1936  20.151 <.0001 
##  Fiction - Personal              -4.57 0.812 1930  -5.621 <.0001 
##  Informative - Instructional      0.15 0.452 1929   0.332 0.9974 
##  Informative - Personal         -14.23 0.795 1928 -17.893 <.0001 
##  Instructional - Personal       -14.38 0.748 1928 -19.233 <.0001 
## 
## Results are averaged over the levels of: Level 
## Degrees-of-freedom method: kenward-roger 
## P value adjustment: tukey method for comparing a family of 5 estimates
confint(comparisons)
##  contrast                     estimate    SE   df lower.CL upper.CL
##  Conversation - Fiction          10.93 0.505 1936     9.55    12.31
##  Conversation - Informative      20.60 0.478 1933    19.29    21.90
##  Conversation - Instructional    20.75 0.394 1933    19.67    21.82
##  Conversation - Personal          6.36 0.763 1930     4.28     8.45
##  Fiction - Informative            9.67 0.564 1936     8.13    11.21
##  Fiction - Instructional          9.82 0.487 1936     8.49    11.15
##  Fiction - Personal              -4.57 0.812 1930    -6.78    -2.35
##  Informative - Instructional      0.15 0.452 1929    -1.08     1.38
##  Informative - Personal         -14.23 0.795 1928   -16.40   -12.06
##  Instructional - Personal       -14.38 0.748 1928   -16.42   -12.34
## 
## Results are averaged over the levels of: Level 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95 
## Conf-level adjustment: tukey method for comparing a family of 5 estimates

Visualising effects

visreg(md_final, xvar = "Series", by="Register", type = "conditional", re.form=~(1|Series), line=list(col="darkred"), xlab = "Textbook Series", ylab = "Dimension 1 (Biber 1988)", layout=c(2,3))

Textual Analysis of individual features on Dim1

Dim1 <- TxBzscores %>%
  dplyr::select(Register, Private_verbs, That_deletion, Contractions, Present_tense, SPP2, Pro_verb_DO, Analytic_negation, Dem_pronouns, Emphatics, FPP1, it, BE_main_verb, because, Discourse_particles, Ind_pronouns, Hedges, Amplifiers, Sentence_relatives, Direct_WH_questions, Poss_modals, Ind_clause_coord, WH_clauses, Stranded_prepositions, Nouns, AWL, Prepositions, TTR, Attr_Adj) %>% 
  group_by(Register) %>% 
  summarise_all(mean) %>% 
  mutate_if(is.numeric, round, digits = 2) %>% 
  t()

head(Dim1)
##               [,1]           [,2]      [,3]          [,4]            [,5]      
## Register      "Conversation" "Fiction" "Informative" "Instructional" "Personal"
## Private_verbs " 0.19"        " 0.23"   "-0.39"       " 0.58"         " 0.06"   
## That_deletion " 0.3"         " 0.0"    "-0.3"        "-0.2"          " 0.1"    
## Contractions  " 1.56"        " 0.47"   "-0.19"       "-0.46"         " 1.13"   
## Present_tense " 0.26"        "-0.66"   "-0.66"       "-0.81"         "-0.15"   
## SPP2          "1.52"         "0.35"    "0.05"        "2.55"          "0.94"    
##               [,6]    
## Register      "Poetry"
## Private_verbs " 0.00" 
## That_deletion " 0.1"  
## Contractions  " 1.23" 
## Present_tense " 0.10" 
## SPP2          "1.19"

Dim2

Rainplots

# Rainplots for all textbook registers on Dimension 2 

TxBdimensions %>% 
  group_by(Register) %>% 
  summarise(mean = mean(Dim2), sd = sd(Dim2)) %>% 
  mutate_if(is.numeric, round, digits = 2)
## # A tibble: 6 × 3
##   Register       mean    sd
##   <fct>         <dbl> <dbl>
## 1 Conversation  -3.17  2.05
## 2 Fiction        2.53  2.83
## 3 Informative   -1.51  2.78
## 4 Instructional -2.25  1.63
## 5 Personal      -2.31  2.22
## 6 Poetry        -1.57  4.21
ggplot(TxBdimensions,aes(x=Register,y=Dim2, fill = Register, colour = Register))+ # Or leave out "colour = Register" to keep the dots in black
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .25)+
  geom_boxplot(position = position_nudge(x = .25), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Dimension 2 (Biber 1988)')+xlab('Textbook Registers') +
  theme_cowplot()+ 
  guides(fill = "none", colour = "none") +
  scale_colour_manual(values = colours)+
  scale_fill_manual(values = colours)+
  #ggtitle("Dimension 2: Narrative vs. Non-narrative Concerns") +
  scale_y_continuous(sec.axis = dup_axis(name=NULL), breaks = seq(from = -10, to = 20, by = 5)) 

#ggsave(here("plots", "TxB_Reg_Dim2.svg"), width = 10, height = 6)

# Consider filtering out the outlier in Poetry: Solutions_Elementary_Poetry_0001.txt 
# Very high score due to repetition of "Ain't got no..." which is tagged as past tense verb (0.90) + synthetic negation (0.40), both of which score positively on factor 2.

# Removing clear outliner

TxBdimensions2 <- TxBdimensions %>% filter(Filename!="Solutions_Elementary_Poetry_0001.txt")

ggplot(TxBdimensions2,aes(x=Register,y=Dim2, fill = Register, colour = Register))+ # Or leave out "colour = Register" to keep the dots in black
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .25)+
# note that here we need to set the x-variable to a numeric variable and bump it to get the boxplots to line up with the rainclouds. 
  geom_boxplot(aes(x = as.numeric(Register)+0.25, y = Dim2), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Dimension 2 (Biber 1988)')+xlab('Textbook Registers')+
  theme_cowplot()+ 
  guides(fill = "none", colour = "none") +
  scale_y_continuous(breaks = scales::pretty_breaks(n = 5)) +
  scale_colour_manual(values = colours)+
  scale_fill_manual(values = colours)+
  #ggtitle("Dimension 2: Narrative vs. Non-narrative Concerns")
  scale_y_continuous(sec.axis = dup_axis(name=NULL), breaks = seq(from = -10, to = 15, by = 5)) 
## Scale for 'y' is already present. Adding another scale for 'y', which will
## replace the existing scale.

#ggsave(here("plots", "TxB_Reg_Dim2.svg"), width = 10, height = 6)

LME model, plots and checks

md_final2 <- lmer(Dim2 ~ (1|Series) + Register + Level + Level:Register, TxBdim_nopoetry, REML = FALSE) # no warnings

tab_model(md_final2, wrap.labels = 100) 
  Dim 2
Predictors Estimates CI p
(Intercept) -4.09 -4.52 – -3.65 <0.001
Register [Fiction] 3.95 3.14 – 4.76 <0.001
Register [Informative] 0.71 -0.13 – 1.56 0.097
Register [Instructional] 1.36 0.77 – 1.95 <0.001
Register [Personal] 0.57 -0.64 – 1.79 0.357
Level [B] 0.27 -0.30 – 0.83 0.357
Level [C] 0.90 0.33 – 1.46 0.002
Level [D] 1.74 1.17 – 2.31 <0.001
Level [E] 1.78 1.14 – 2.41 <0.001
Register [Fiction] * Level [B] 2.79 1.74 – 3.84 <0.001
Register [Informative] * Level [B] 0.69 -0.37 – 1.76 0.203
Register [Instructional] * Level [B] -0.19 -0.97 – 0.59 0.629
Register [Personal] * Level [B] -0.21 -1.75 – 1.34 0.790
Register [Fiction] * Level [C] 2.71 1.66 – 3.77 <0.001
Register [Informative] * Level [C] 0.77 -0.25 – 1.79 0.140
Register [Instructional] * Level [C] -0.46 -1.23 – 0.32 0.246
Register [Personal] * Level [C] 0.65 -0.92 – 2.22 0.415
Register [Fiction] * Level [D] 1.25 0.23 – 2.27 0.016
Register [Informative] * Level [D] 0.69 -0.32 – 1.70 0.183
Register [Instructional] * Level [D] -1.05 -1.83 – -0.28 0.008
Register [Personal] * Level [D] 0.26 -1.37 – 1.90 0.753
Register [Fiction] * Level [E] 0.97 -0.09 – 2.02 0.072
Register [Informative] * Level [E] 0.84 -0.22 – 1.91 0.120
Register [Instructional] * Level [E] -0.68 -1.53 – 0.16 0.113
Register [Personal] * Level [E] 0.67 -0.97 – 2.32 0.423
Random Effects
σ2 4.40
τ00 Series 0.01
ICC 0.00
N Series 9
Observations 1912
Marginal R2 / Conditional R2 0.472 / 0.474
# check distribution of residuals
library(predictmeans)
## Loading required package: nlme
## 
## Attaching package: 'nlme'
## The following object is masked from 'package:dplyr':
## 
##     collapse
## The following object is masked from 'package:lme4':
## 
##     lmList
## Loading required package: parallel
residplot(md_final2)

# We can access the estimated deviation between each series average Dim2 and the overall average:
ranef(md_final2)
## $Series
##            (Intercept)
## Access    -0.010235255
## Achievers -0.020008877
## EIM        0.060406291
## GreenLine -0.009780533
## HT        -0.009027618
## JTT        0.007276723
## NGL       -0.063482158
## POC       -0.077522890
## Solutions  0.122374316
## 
## with conditional variances for "Series"
TxBdim_nopoetry[, "predicted"] <- predict(md_final2)

p <- ggplot(TxBdim_nopoetry, aes(x = Level, y = Dim2)) +
  geom_point(shape = "circle filled", fill = "grey", position = position_jitter(width = 0.2, height = 0)) +
  facet_grid(rows = vars(Series), cols = vars(Register)) +
  geom_point(aes(y = predicted), shape = "triangle filled", fill = "red")+
  labs(y = "Dimension 2 (Biber 1988)", x = "Textbook Level")

top_label <- ggplot() +
  annotate("text", x = 0, y = 0, label = "Textbook Register") +
  theme_void()
right_label <- ggplot() +
  annotate("text", x = 0, y = 0, label = "Textbook Series", angle = -90) +
  theme_void()
blank_panel <- ggplot() +
  theme_void()

grid.arrange(
  top_label, blank_panel, p, right_label,
  nrow = 2, ncol = 2,
  widths = c(30, 1), heights = c(1, 30)
)

# Save plot using Rstudio export function (dimensions: 600 to 900 work well)

Register_results2 <- emmeans(md_final2, "Register")
## NOTE: Results may be misleading due to involvement in interactions
summary(Register_results2)
##  Register      emmean     SE     df lower.CL upper.CL
##  Conversation   -3.15 0.1045   67.8    -3.36    -2.94
##  Fiction         2.34 0.1393  157.5     2.07     2.62
##  Informative    -1.84 0.1288  164.0    -2.09    -1.58
##  Instructional  -2.26 0.0941   51.5    -2.45    -2.08
##  Personal       -2.30 0.2329 1072.3    -2.76    -1.84
## 
## Results are averaged over the levels of: Level 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95
comparisons2 <- pairs(Register_results2, adjust = "tukey")
comparisons2
##  contrast                     estimate    SE   df t.ratio p.value
##  Conversation - Fiction        -5.4934 0.163 1475 -33.685 <.0001 
##  Conversation - Informative    -1.3126 0.155 1717  -8.464 <.0001 
##  Conversation - Instructional  -0.8846 0.128 1687  -6.923 <.0001 
##  Conversation - Personal       -0.8477 0.248 1930  -3.414 0.0059 
##  Fiction - Informative          4.1808 0.182 1283  22.960 <.0001 
##  Fiction - Instructional        4.6088 0.157 1483  29.269 <.0001 
##  Fiction - Personal             4.6457 0.264 1917  17.582 <.0001 
##  Informative - Instructional    0.4280 0.147 1935   2.905 0.0304 
##  Informative - Personal         0.4650 0.259 1938   1.793 0.3779 
##  Instructional - Personal       0.0369 0.244 1935   0.151 0.9999 
## 
## Results are averaged over the levels of: Level 
## Degrees-of-freedom method: kenward-roger 
## P value adjustment: tukey method for comparing a family of 5 estimates
# Visualising effects
visreg(md_final2, xvar = "Level", by="Register", type = "conditional", line=list(col="darkred"), xlab = "Textbook Level", ylab = "Dimension 2 (Biber 1988)")

# Group differences
emmeans(md_final2, ~ Level*Register)
##  Level Register      emmean    SE   df lower.CL upper.CL
##  A     Conversation  -4.085 0.223  870   -4.524  -3.6468
##  B     Conversation  -3.819 0.198  680   -4.207  -3.4313
##  C     Conversation  -3.188 0.198  633   -3.575  -2.7997
##  D     Conversation  -2.342 0.202  626   -2.738  -1.9454
##  E     Conversation  -2.310 0.250  982   -2.800  -1.8206
##  A     Fiction       -0.136 0.357 1547   -0.836   0.5633
##  B     Fiction        2.921 0.291 1172    2.350   3.4914
##  C     Fiction        3.476 0.295 1341    2.898   4.0545
##  D     Fiction        2.858 0.259 1154    2.349   3.3656
##  E     Fiction        2.605 0.254 1116    2.107   3.1019
##  A     Informative   -3.371 0.377 1722   -4.109  -2.6322
##  B     Informative   -2.413 0.279 1335   -2.960  -1.8656
##  C     Informative   -1.705 0.232  927   -2.160  -1.2493
##  D     Informative   -0.940 0.217  893   -1.366  -0.5143
##  E     Informative   -0.753 0.233  954   -1.209  -0.2961
##  A     Instructional -2.724 0.212  899   -3.141  -2.3066
##  B     Instructional -2.650 0.187  649   -3.017  -2.2833
##  C     Instructional -2.284 0.181  589   -2.638  -1.9293
##  D     Instructional -2.033 0.180  580   -2.386  -1.6795
##  E     Instructional -1.631 0.200  660   -2.024  -1.2380
##  A     Personal      -3.513 0.587 1918   -4.665  -2.3611
##  B     Personal      -3.457 0.453 1841   -4.345  -2.5694
##  C     Personal      -1.963 0.474 1888   -2.893  -1.0338
##  D     Personal      -1.506 0.530 1906   -2.545  -0.4675
##  E     Personal      -1.066 0.514 1890   -2.075  -0.0575
## 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95

Dim3

# Rainplots for all textbook registers on Dimension 3

TxBdimensions %>% group_by(Register) %>% summarise(mean = mean(Dim3), sd = sd(Dim3))
## # A tibble: 6 × 3
##   Register        mean    sd
##   <fct>          <dbl> <dbl>
## 1 Conversation  -0.445  2.37
## 2 Fiction       -0.649  2.74
## 3 Informative    3.12   3.07
## 4 Instructional  3.52   2.82
## 5 Personal      -0.829  2.96
## 6 Poetry         0.919  3.77
ggplot(TxBdimensions,aes(x=Register,y=Dim3, fill = Register, colour = Register))+ 
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .25)+
  geom_boxplot(position = position_nudge(x = .25), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Dimension 3 (Biber 1988)')+xlab('Textbook Registers')+ 
  theme_cowplot()+ 
  guides(fill = "none", colour = "none") +
  scale_colour_manual(values = colours)+
  scale_fill_manual(values = colours)+
  #ggtitle("Dimension 3: Explicit vs. Situation-Dependent Reference") +
  scale_y_continuous(sec.axis = dup_axis(name=NULL), breaks = seq(from = -10, to = 20, by = 5)) 

#ggsave(here("plots", "TxB_Reg_Dim3.svg"), width = 10, height = 6)


Dim3 <- TxBzscores %>%
  select(Register, WH_rel_clauses_obj, Pied_piping_relative_clauses, WH_rel_clauses_subj, Phrasal_coord, Nominalizations, Time_adv, Place_adv, Adverbs) %>%
  group_by(Register) %>% 
  summarise_all(mean) %>% 
  mutate_if(is.numeric, round, digits = 2) %>% 
  t()

Dim3
##                              [,1]           [,2]      [,3]         
## Register                     "Conversation" "Fiction" "Informative"
## WH_rel_clauses_obj           "-0.75"        "-0.76"   "-0.63"      
## Pied_piping_relative_clauses "-0.59"        "-0.59"   "-0.45"      
## WH_rel_clauses_subj          "-0.63"        "-0.59"   "-0.11"      
## Phrasal_coord                "0.60"         "1.39"    "2.40"       
## Nominalizations              "-0.91"        "-0.95"   "-0.30"      
## Time_adv                     " 0.19"        " 0.34"   "-0.10"      
## Place_adv                    "-0.11"        " 0.77"   " 0.24"      
## Adverbs                      "-1.33"        "-1.38"   "-1.89"      
##                              [,4]            [,5]       [,6]    
## Register                     "Instructional" "Personal" "Poetry"
## WH_rel_clauses_obj           "-0.58"         "-0.80"    "-0.80" 
## Pied_piping_relative_clauses "-0.26"         "-0.64"    "-0.57" 
## WH_rel_clauses_subj          "-0.71"         "-0.63"    "-0.62" 
## Phrasal_coord                "2.31"          "1.06"     "2.81"  
## Nominalizations              " 0.35"         "-0.85"    "-1.11" 
## Time_adv                     "-0.35"         " 0.88"    " 0.15" 
## Place_adv                    " 0.39"         " 0.10"    " 0.62" 
## Adverbs                      "-2.18"         "-1.36"    "-1.42"
md_final3 <- lmer(Dim3 ~ (1|Series) + Register + Level + Level:Register, TxBdim_nopoetry, REML = FALSE) # no warnings

tab_model(md_final3, wrap.labels = 100) 
  Dim 3
Predictors Estimates CI p
(Intercept) -0.18 -1.13 – 0.77 0.715
Register [Fiction] -0.15 -1.10 – 0.81 0.764
Register [Informative] 3.03 2.04 – 4.03 <0.001
Register [Instructional] 5.16 4.46 – 5.85 <0.001
Register [Personal] -0.04 -1.47 – 1.39 0.957
Level [B] -0.29 -0.96 – 0.37 0.389
Level [C] -0.24 -0.91 – 0.42 0.471
Level [D] 0.52 -0.15 – 1.19 0.128
Level [E] -0.08 -0.84 – 0.67 0.829
Register [Fiction] * Level [B] 0.35 -0.89 – 1.58 0.582
Register [Informative] * Level [B] 0.48 -0.77 – 1.74 0.450
Register [Instructional] * Level [B] -0.89 -1.81 – 0.03 0.058
Register [Personal] * Level [B] 0.18 -1.64 – 2.00 0.844
Register [Fiction] * Level [C] -0.15 -1.39 – 1.09 0.809
Register [Informative] * Level [C] 1.08 -0.12 – 2.28 0.077
Register [Instructional] * Level [C] -1.52 -2.43 – -0.61 0.001
Register [Personal] * Level [C] -0.56 -2.41 – 1.28 0.550
Register [Fiction] * Level [D] -0.05 -1.25 – 1.15 0.934
Register [Informative] * Level [D] -0.14 -1.33 – 1.06 0.821
Register [Instructional] * Level [D] -2.13 -3.04 – -1.21 <0.001
Register [Personal] * Level [D] -2.10 -4.03 – -0.17 0.033
Register [Fiction] * Level [E] -0.52 -1.76 – 0.72 0.411
Register [Informative] * Level [E] 1.07 -0.18 – 2.32 0.094
Register [Instructional] * Level [E] -1.08 -2.07 – -0.08 0.033
Register [Personal] * Level [E] 0.18 -1.75 – 2.12 0.852
Random Effects
σ2 6.08
τ00 Series 1.51
ICC 0.20
N Series 9
Observations 1912
Marginal R2 / Conditional R2 0.353 / 0.482
# check distribution of residuals
residplot(md_final3)

# We can access the estimated deviation between each series average Dim3 and the overall average:
ranef(md_final3)
## $Series
##           (Intercept)
## Access     -0.6912930
## Achievers  -0.6174253
## EIM        -1.1919483
## GreenLine  -0.8109561
## HT          1.9421314
## JTT         1.6915190
## NGL        -0.2658934
## POC         1.3291986
## Solutions  -1.3853329
## 
## with conditional variances for "Series"
TxBdim_nopoetry[, "predicted"] <- predict(md_final3)

p <- ggplot(TxBdim_nopoetry, aes(x = Level, y = Dim3)) +
  geom_point(shape = "circle filled", fill = "grey", position = position_jitter(width = 0.2, height = 0)) +
  facet_grid(rows = vars(Series), cols = vars(Register)) +
  geom_point(aes(y = predicted), shape = "triangle filled", fill = "red")+
  labs(y = "Dimension 3 (Biber 1988)", x = "Textbook Level")

top_label <- ggplot() +
  annotate("text", x = 0, y = 0, label = "Textbook Register") +
  theme_void()
right_label <- ggplot() +
  annotate("text", x = 0, y = 0, label = "Textbook Series", angle = -90) +
  theme_void()
blank_panel <- ggplot() +
  theme_void()

grid.arrange(
  top_label, blank_panel, p, right_label,
  nrow = 2, ncol = 2,
  widths = c(30, 1), heights = c(1, 30)
)

# Save plot using Rstudio export function (dimensions: 600 to 900 work well)

Register_results3 <- emmeans(md_final3, "Register")
## NOTE: Results may be misleading due to involvement in interactions
summary(Register_results3)
##  Register      emmean    SE   df lower.CL upper.CL
##  Conversation  -0.197 0.450 11.3    -1.19    0.792
##  Fiction       -0.419 0.464 12.8    -1.42    0.585
##  Informative    3.334 0.459 12.2     2.34    4.332
##  Instructional  3.837 0.447 10.9     2.85    4.822
##  Personal      -0.696 0.513 19.8    -1.77    0.375
## 
## Results are averaged over the levels of: Level 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95
comparisons3 <- pairs(Register_results3, adjust = "tukey")
comparisons3
##  contrast                     estimate    SE   df t.ratio p.value
##  Conversation - Fiction          0.222 0.194 1932   1.145 0.7824 
##  Conversation - Informative     -3.531 0.183 1930 -19.250 <.0001 
##  Conversation - Instructional   -4.034 0.151 1930 -26.689 <.0001 
##  Conversation - Personal         0.499 0.293 1929   1.703 0.4321 
##  Fiction - Informative          -3.753 0.216 1932 -17.343 <.0001 
##  Fiction - Instructional        -4.256 0.187 1932 -22.759 <.0001 
##  Fiction - Personal              0.277 0.312 1929   0.888 0.9015 
##  Informative - Instructional    -0.503 0.173 1928  -2.898 0.0311 
##  Informative - Personal          4.030 0.305 1928  13.202 <.0001 
##  Instructional - Personal        4.533 0.287 1928  15.795 <.0001 
## 
## Results are averaged over the levels of: Level 
## Degrees-of-freedom method: kenward-roger 
## P value adjustment: tukey method for comparing a family of 5 estimates
# Visualise effects
# Levels

visreg::visreg(md_final3, xvar = "Level", by="Register", type = "conditional", line=list(col="darkred"), xlab = "Textbook Level", ylab = "Dimension 3 (Biber 1988)")

# Textbook Series (random effect)
v <- visreg::visreg(md_final3, "Register", by="Series", re.form=~(1|Series), plot=FALSE)
plot(v, ylab="Dimension 3 (Biber 1988)", line=list(col="darkred"))

visreg(md_final3, xvar = "Series", by="Register", type = "conditional", re.form=~(1|Series), line=list(col="darkred"), xlab = "Textbook Series", ylab = "Dimension 3 (Biber 1988)", layout=c(1,5))

# Textual analysis
Dim3zscores <- TxBzscores %>%
  select(Series, WH_rel_clauses_obj, WH_rel_clauses_subj, Pied_piping_relative_clauses, Phrasal_coord, Nominalizations, Place_adv, Time_adv, Adverbs) %>% 
  group_by(Series) %>% 
  summarise_all(mean) %>% 
  mutate_if(is.numeric, round, digits = 2) %>% 
  t()

Dim3zscores
##                              [,1]     [,2]        [,3]    [,4]        [,5]   
## Series                       "Access" "Achievers" "EIM"   "GreenLine" "HT"   
## WH_rel_clauses_obj           "-0.75"  "-0.63"     "-0.62" "-0.72"     "-0.65"
## WH_rel_clauses_subj          "-0.67"  "-0.72"     "-0.66" "-0.61"     "-0.40"
## Pied_piping_relative_clauses "-0.51"  "-0.47"     "-0.51" "-0.46"     "-0.33"
## Phrasal_coord                "1.57"   "2.12"      "1.25"  "1.27"      "2.40" 
## Nominalizations              "-0.76"  " 0.10"     "-0.49" "-0.70"     " 0.01"
## Place_adv                    " 0.35"  " 0.53"     "-0.20" " 0.08"     "-0.18"
## Time_adv                     " 0.16"  " 0.14"     " 0.32" " 0.12"     "-0.25"
## Adverbs                      "-1.57"  "-1.85"     "-1.63" "-1.64"     "-1.93"
##                              [,6]    [,7]    [,8]    [,9]       
## Series                       "JTT"   "NGL"   "POC"   "Solutions"
## WH_rel_clauses_obj           "-0.74" "-0.72" "-0.73" "-0.56"    
## WH_rel_clauses_subj          "-0.44" "-0.40" "-0.51" "-0.53"    
## Pied_piping_relative_clauses "-0.39" "-0.50" "-0.50" "-0.42"    
## Phrasal_coord                "2.38"  "1.39"  "1.94"  "1.37"     
## Nominalizations              "-0.25" "-0.56" "-0.24" "-0.31"    
## Place_adv                    "-0.08" " 0.23" "-0.44" " 1.10"    
## Time_adv                     "-0.41" "-0.01" "-0.36" " 0.03"    
## Adverbs                      "-2.08" "-1.49" "-1.96" "-1.74"

Dim4

ggplot(TxBdimensions,aes(x=Register,y=Dim4, fill = Register, colour = Register))+ 
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .25)+
  geom_boxplot(aes(x = as.numeric(Register)+0.25, y = Dim4), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Dimension 4 (Biber 1988)')+xlab('Textbook Registers')+ theme_cowplot()+ 
  guides(fill = "none", colour = "none") +
  scale_colour_manual(values = colours)+
  scale_fill_manual(values = colours)+
  #ggtitle("Dimension 4: Overt Expression of Persuasion") +
  scale_y_continuous(sec.axis = dup_axis(name=NULL), breaks = seq(from = -10, to = 25, by = 5))

#ggsave(here("plots", "TxB_Reg_Dim4.svg"), width = 10, height = 6)

TxBdimensions %>% filter(Dim4>20) # Outlier
##                     Filename Level    Dim1    Dim2    Dim3    Dim4   Dim5
## 1 JTT_5_Informative_0007.txt     B 21.3275 -0.9109 -1.5774 25.5345 1.0514
##      Dim6                  TextType    Register Series Country
## 1 -1.1141 Informational interaction Informative    JTT  France
TxBdimensions %>% group_by(Register) %>% summarise(mean = mean(Dim4))
## # A tibble: 6 × 2
##   Register        mean
##   <fct>          <dbl>
## 1 Conversation  -1.33 
## 2 Fiction       -1.69 
## 3 Informative   -1.72 
## 4 Instructional -2.10 
## 5 Personal      -0.366
## 6 Poetry        -0.340
TxBdimensions2 <- TxBdimensions %>% filter(Filename!="JTT_5_Informative_0007.txt") # Remove outlier for testing

ggplot(TxBdimensions2,aes(x=Register,y=Dim4, fill = Register, colour = Register))+ 
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .25)+
  geom_boxplot(aes(x = as.numeric(Register)+0.25, y = Dim4), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Dimension 4 (Biber 1988)')+xlab('Textbook Registers')+ theme_cowplot()+ 
  guides(fill = "none", colour = "none") +
  scale_colour_manual(values = colours)+
  scale_fill_manual(values = colours)+
  #ggtitle("Dimension 4: Overt Expression of Persuasion") +
  scale_y_continuous(sec.axis = dup_axis(name=NULL), breaks = seq(from = -10, to = 25, by = 5))

#ggsave(here("plots", "TxB_Reg_Dim4.svg"), width = 10, height = 6)
TxBdim2_nopoetry <- TxBdimensions2 %>% filter(Register != "Poetry") %>% droplevels(.)
summary(TxBdim_nopoetry$Register) # Check
##  Conversation       Fiction   Informative Instructional      Personal 
##           529           285           363           647            88
md_final4 <- lmer(Dim4 ~ (1|Series) + Register + Level + Level:Register, TxBdim2_nopoetry, REML = FALSE) # no warnings

tab_model(md_final4, wrap.labels = 100) 
  Dim 4
Predictors Estimates CI p
(Intercept) -5.74 -6.56 – -4.91 <0.001
Register [Fiction] 1.01 -0.23 – 2.24 0.110
Register [Informative] 0.98 -0.30 – 2.27 0.134
Register [Instructional] 1.75 0.85 – 2.64 <0.001
Register [Personal] 0.49 -1.37 – 2.34 0.608
Level [B] 3.83 2.97 – 4.70 <0.001
Level [C] 5.96 5.11 – 6.82 <0.001
Level [D] 5.69 4.82 – 6.56 <0.001
Level [E] 6.38 5.39 – 7.36 <0.001
Register [Fiction] * Level [B] -1.59 -3.19 – 0.00 0.050
Register [Informative] * Level [B] -2.43 -4.06 – -0.80 0.003
Register [Instructional] * Level [B] -2.49 -3.67 – -1.30 <0.001
Register [Personal] * Level [B] -0.11 -2.46 – 2.24 0.928
Register [Fiction] * Level [C] -1.82 -3.42 – -0.22 0.026
Register [Informative] * Level [C] -2.89 -4.44 – -1.33 <0.001
Register [Instructional] * Level [C] -3.94 -5.12 – -2.76 <0.001
Register [Personal] * Level [C] -0.32 -2.71 – 2.07 0.793
Register [Fiction] * Level [D] -1.21 -2.76 – 0.35 0.128
Register [Informative] * Level [D] -2.13 -3.67 – -0.59 0.007
Register [Instructional] * Level [D] -3.59 -4.77 – -2.40 <0.001
Register [Personal] * Level [D] 2.76 0.27 – 5.26 0.030
Register [Fiction] * Level [E] -2.20 -3.81 – -0.59 0.007
Register [Informative] * Level [E] -2.39 -4.02 – -0.77 0.004
Register [Instructional] * Level [E] -2.85 -4.14 – -1.56 <0.001
Register [Personal] * Level [E] -0.12 -2.63 – 2.38 0.923
Random Effects
σ2 10.18
τ00 Series 0.59
ICC 0.06
N Series 9
Observations 1911
Marginal R2 / Conditional R2 0.213 / 0.256
# check distribution of residuals
library(predictmeans)
residplot(md_final4)

# We can access the estimated deviation between each series average Dim4 and the overall average:
ranef(md_final4)
## $Series
##           (Intercept)
## Access    -0.51443745
## Achievers  0.51979262
## EIM        0.02697037
## GreenLine -0.62892523
## HT        -1.29336978
## JTT       -0.06114683
## NGL       -0.11547528
## POC        1.29938009
## Solutions  0.76721149
## 
## with conditional variances for "Series"
TxBdim2_nopoetry[, "predicted"] <- predict(md_final4)

p <- ggplot(TxBdim2_nopoetry, aes(x = Level, y = Dim4)) +
  geom_point(shape = "circle filled", fill = "grey", position = position_jitter(width = 0.2, height = 0)) +
  facet_grid(rows = vars(Series), cols = vars(Register)) +
  geom_point(aes(y = predicted), shape = "triangle filled", fill = "red")+
  labs(y = "Dimension 4 (Biber 1988)", x = "Textbook Level")

top_label <- ggplot() +
  annotate("text", x = 0, y = 0, label = "Textbook Register") +
  theme_void()
right_label <- ggplot() +
  annotate("text", x = 0, y = 0, label = "Textbook Series", angle = -90) +
  theme_void()
blank_panel <- ggplot() +
  theme_void()

grid.arrange(
  top_label, blank_panel, p, right_label,
  nrow = 2, ncol = 2,
  widths = c(30, 1), heights = c(1, 30)
)

# Save plot using Rstudio export function (dimensions: 600 to 900 work well)

Register_results4 <- emmeans(md_final4, "Register")
## NOTE: Results may be misleading due to involvement in interactions
summary(Register_results4)
##  Register      emmean    SE   df lower.CL upper.CL
##  Conversation  -1.366 0.312 15.1    -2.03    -0.70
##  Fiction       -1.724 0.344 22.8    -2.44    -1.01
##  Informative   -2.350 0.333 20.0    -3.04    -1.66
##  Instructional -2.192 0.304 13.6    -2.85    -1.54
##  Personal      -0.439 0.445 68.1    -1.33     0.45
## 
## Results are averaged over the levels of: Level 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95
comparisons4 <- pairs(Register_results4, adjust = "tukey")
comparisons4
##  contrast                     estimate    SE   df t.ratio p.value
##  Conversation - Fiction          0.358 0.251 1936  1.430  0.6085 
##  Conversation - Informative      0.985 0.238 1935  4.146  0.0003 
##  Conversation - Instructional    0.827 0.196 1935  4.228  0.0002 
##  Conversation - Personal        -0.927 0.379 1931 -2.447  0.1035 
##  Fiction - Informative           0.626 0.280 1936  2.237  0.1666 
##  Fiction - Instructional         0.468 0.242 1936  1.936  0.2983 
##  Fiction - Personal             -1.285 0.403 1931 -3.187  0.0127 
##  Informative - Instructional    -0.158 0.225 1929 -0.703  0.9558 
##  Informative - Personal         -1.912 0.395 1928 -4.838  <.0001 
##  Instructional - Personal       -1.754 0.371 1928 -4.722  <.0001 
## 
## Results are averaged over the levels of: Level 
## Degrees-of-freedom method: kenward-roger 
## P value adjustment: tukey method for comparing a family of 5 estimates
# Visualise effects

visreg(md_final4, xvar = "Level", by="Register", type = "conditional", line=list(col="darkred"), xlab = "Textbook Level", ylab = "Dimension 4 (Biber 1988)")

# Or using a ggplot2 approach

ggplot(TxBdim_nopoetry, aes(x = Level, y = Dim4, colour = Register)) +
  geom_point(position = position_jitter(width = 0.27), size = 2, alpha = 0.8)+
  geom_boxplot(aes(x = Level, y = Dim4), 
               outlier.shape = NA, alpha = 0.3, width = .6, colour = "BLACK") +
  scale_colour_manual(values = colours[c(1,2,6,4,5)])+
  scale_fill_manual(values = colours[c(1,2,6,4,5)])+
  scale_y_continuous(limits=c(-10,15))+ # Removes two outliers
  theme_minimal() +
  theme(legend.position = "bottom", legend.title.align = 0.5, legend.margin=margin(0,0,0,0))+
  ylab('Dimension 4 (Biber 1988)')
## Warning: Removed 2 rows containing non-finite values (stat_boxplot).
## Warning: Removed 2 rows containing missing values (geom_point).

#ggsave(here("plots", "Dim4_boxplot_levels.svg"), width = 7, height = 9)

# Z-scores

dim4zscores <- TxBzscores %>% 
  select(Filename, Level, To_infinitives, Pred_modals, Suasive_verbs, if_unless, Necessity_modals, Split_auxiliaries) %>% 
  group_by(Level) %>% 
  summarise_if(is.numeric, mean, na.rm = TRUE) %>% 
  print.data.frame
##   Level To_infinitives Pred_modals Suasive_verbs   if_unless Necessity_modals
## 1     A    -0.93985088 -0.78691123     0.1541263 -0.77716351       -0.4392207
## 2     B    -0.06722843 -0.22506983     0.2294970 -0.34661546       -0.1909284
## 3     C     0.26932696  0.14349401     0.2810493  0.16012488       -0.2997090
## 4     D     0.35551982  0.08949912     0.2987740  0.09240969       -0.3655297
## 5     E     0.62622880  0.05079893     0.2649056  0.08877387       -0.3043565
##   Split_auxiliaries
## 1         -1.959834
## 2         -1.722025
## 3         -1.450334
## 4         -1.233483
## 5         -1.249927

Dim5

# Rainplots for all textbook registers on Dimension 5 

ggplot(TxBdimensions,aes(x=Register,y=Dim5, fill = Register, colour = Register))+ 
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .25)+
  geom_boxplot(position = position_nudge(x = .25), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Dimension 5 (Biber 1988)')+xlab('Textbook Registers')+
  theme_cowplot()+ 
  guides(fill = "none", colour = "none") +
  scale_colour_manual(values = colours)+
  scale_fill_manual(values = colours)+
  #ggtitle("Dimension 5: Abstract vs. Non-Abstract Information ")+
  scale_y_continuous(sec.axis = dup_axis(name=NULL), breaks = seq(from = -4, to = 10, by = 2))

#ggsave(here("plots", "TxB_Reg_Dim5.svg"), width = 10, height = 6)

# Mean Dim5 scores
TxBdimensions %>% group_by(Register) %>% summarise(mean = mean(Dim5), sd = sd(Dim5))
## # A tibble: 6 × 3
##   Register        mean    sd
##   <fct>          <dbl> <dbl>
## 1 Conversation  -2.20   1.75
## 2 Fiction       -1.91   1.76
## 3 Informative   -0.108  2.43
## 4 Instructional -2.75   1.29
## 5 Personal      -1.98   1.86
## 6 Poetry        -2.67   1.46
# Lots of texts reach the floor level:
TxBdimensions %>% filter(Dim5 < -3.915) %>% summarise(n = n())
##     n
## 1 265
# Clear level effect for Informative texts:
TxBdimensions %>% filter(Register=="Informative") %>% group_by(Level) %>% summarise(mean = mean(Dim5), sd = sd(Dim5))
## # A tibble: 5 × 3
##   Level    mean    sd
##   <fct>   <dbl> <dbl>
## 1 A     -2.52   0.989
## 2 B     -1.18   1.94 
## 3 C      0.0835 2.39 
## 4 D      0.459  2.28 
## 5 E      0.680  2.54
# Floor effect might be due to low frequencies of the features on Dimension 5 in the beginner/pre-intermediate textbook:
TxBdimensions %>% filter(as.numeric(Level)>3) %>% group_by(Register) %>% summarise(mean = mean(Dim5), sd = sd(Dim5))
## # A tibble: 6 × 3
##   Register        mean    sd
##   <fct>          <dbl> <dbl>
## 1 Conversation  -1.42   2.02
## 2 Fiction       -1.36   1.63
## 3 Informative    0.562  2.40
## 4 Instructional -2.39   1.32
## 5 Personal      -1.50   1.58
## 6 Poetry        -2.25   1.54
TxBdimensionsLevelsDE <- TxBdimensions %>% filter(as.numeric(Level)>3)

ggplot(TxBdimensionsLevelsDE,aes(x=Register,y=Dim5, fill = Register, colour = Register))+ # Or leave out "colour = Register" to keep the dots in black
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .25)+
# note that here we need to set the x-variable to a numeric variable and bump it to get the boxplots to line up with the rainclouds. 
  geom_boxplot(aes(x = as.numeric(Register)+0.25, y = Dim5), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Dimension 5 (Biber 1988)')+xlab('Textbook Registers (Levels D and E only)')+ 
  theme_cowplot()+ 
  guides(fill = "none", colour = "none") +
  scale_colour_manual(values = colours)+
  scale_fill_manual(values = colours)+
  #ggtitle("Dimension 5: Abstract vs. Non-Abstract Information") +
  scale_y_continuous(sec.axis = dup_axis(name=NULL), breaks = seq(from = -4, to = 10, by = 2))

#ggsave(here("plots", "TxB_Reg_Dim5_LevelsD-E.svg"), width = 10, height = 6)
md_final5 <- lmer(Dim5 ~ (1|Series) + Register + Level + Level:Register, TxBdim_nopoetry, REML = FALSE) # no warnings

tab_model(md_final5, wrap.labels = 100)
  Dim 5
Predictors Estimates CI p
(Intercept) -3.48 -3.87 – -3.09 <0.001
Register [Fiction] 0.12 -0.49 – 0.72 0.709
Register [Informative] 0.78 0.14 – 1.41 0.016
Register [Instructional] -0.21 -0.65 – 0.23 0.354
Register [Personal] -0.17 -1.08 – 0.75 0.717
Level [B] 0.48 0.06 – 0.91 0.027
Level [C] 1.53 1.10 – 1.95 <0.001
Level [D] 2.06 1.63 – 2.48 <0.001
Level [E] 1.85 1.37 – 2.33 <0.001
Register [Fiction] * Level [B] 0.56 -0.22 – 1.35 0.159
Register [Informative] * Level [B] 0.93 0.13 – 1.72 0.023
Register [Instructional] * Level [B] 0.21 -0.37 – 0.80 0.480
Register [Personal] * Level [B] 0.67 -0.49 – 1.83 0.256
Register [Fiction] * Level [C] 0.26 -0.53 – 1.05 0.514
Register [Informative] * Level [C] 1.07 0.30 – 1.83 0.006
Register [Instructional] * Level [C] -0.56 -1.14 – 0.03 0.061
Register [Personal] * Level [C] 1.06 -0.12 – 2.24 0.078
Register [Fiction] * Level [D] 0.38 -0.39 – 1.14 0.333
Register [Informative] * Level [D] 1.02 0.25 – 1.78 0.009
Register [Instructional] * Level [D] -0.91 -1.49 – -0.33 0.002
Register [Personal] * Level [D] 0.07 -1.16 – 1.30 0.915
Register [Fiction] * Level [E] 0.03 -0.77 – 0.82 0.949
Register [Informative] * Level [E] 1.66 0.86 – 2.46 <0.001
Register [Instructional] * Level [E] -0.29 -0.92 – 0.35 0.378
Register [Personal] * Level [E] 0.53 -0.71 – 1.76 0.403
Random Effects
σ2 2.47
τ00 Series 0.12
ICC 0.05
N Series 9
Observations 1912
Marginal R2 / Conditional R2 0.358 / 0.387
# check distribution of residuals
residplot(md_final5) # Major issues!!

TxBdim_nopoetry %>% filter(Dim5==min(TxBdim_nopoetry$Dim5)) %>%  nrow(.) # There are 257/1949 texts with the minimum Dim5 score. We obviously have a floor effect here.
## [1] 257
### Only looking at the upper level textbooks and excluding instructional language
UpperTxBDim <- TxBdim_nopoetry %>% filter(Level %in% c("C", "D", "E") & Register != "Instructional") %>% droplevels(.)

UpperTxBDim %>% filter(Dim5==-3.9201) # Reduces number of texts with the floor level to just 16
##                                       Filename Level    Dim1    Dim2    Dim3
## 1                  Access_3_Narrative_0013.txt     C -2.4361  3.8357 -8.2436
## 2                     Access_3_Spoken_0001.txt     C 12.8537 -5.6998 -0.7944
## 3                     Access_3_Spoken_0013.txt     C  5.9886 -3.1583 -0.0380
## 4                   Access_5_Personal_0001.txt     E  8.1586 -4.2561  0.6477
## 5                   EIM_2_Informative_0003.txt     C  2.9309 -0.2069  0.2607
## 6                      EIM_2_Personal_0001.txt     C 14.2851 -1.6148 -3.9124
## 7                        EIM_2_Spoken_0005.txt     C 25.1282 -4.8196 -3.2386
## 8               GreenLine_3_Narrative_0011.txt     C  0.3915  5.1584 -3.6444
## 9                  GreenLine_3_Spoken_0003.txt     C 23.3761 -3.3375  0.5133
## 10                 GreenLine_3_Spoken_0007.txt     C 16.2062 -3.7157 -1.8924
## 11                       JTT_3_Spoken_0002.txt     D 31.1243 -2.5753 -1.1061
## 12                    NGL_3_Narrative_0005.txt     C  5.1243  6.3279  1.3942
## 13                       NGL_4_Spoken_0004.txt     D 13.0234 -3.3312  1.0554
## 14                       NGL_4_Spoken_0010.txt     D 18.7797 -2.9715 -2.0073
## 15                      POC_3e_Spoken_0016.txt     D 24.9732 -4.9363 -1.6696
## 16 Solutions_Intermediate_Informative_0018.txt     C  4.4176 -6.4075 -2.3155
##       Dim4    Dim5    Dim6                  TextType     Register    Series
## 1  -3.2271 -3.9201 -2.4462        Situated reportage      Fiction    Access
## 2  -2.5996 -3.9201 -0.5986       Involved persuasion Conversation    Access
## 3  -3.8504 -3.9201 -2.5627       Involved persuasion Conversation    Access
## 4  -5.1964 -3.9201 -2.7798       Involved persuasion     Personal    Access
## 5   2.1652 -3.9201  1.5124       Involved persuasion  Informative       EIM
## 6   0.4186 -3.9201 -2.5070       Involved persuasion     Personal       EIM
## 7   5.6688 -3.9201 -2.3547 Informational interaction Conversation       EIM
## 8  -5.9071 -3.9201 -1.8820     Imaginative narrative      Fiction GreenLine
## 9   0.2310 -3.9201 -1.9659 Informational interaction Conversation GreenLine
## 10 -4.0050 -3.9201  2.2155       Involved persuasion Conversation GreenLine
## 11 -1.0901 -3.9201 -1.9952 Informational interaction Conversation       JTT
## 12  1.8832 -3.9201 -1.3817     Imaginative narrative      Fiction       NGL
## 13 -3.2447 -3.9201 -0.1897       Involved persuasion Conversation       NGL
## 14 -5.1905 -3.9201 -1.3047 Informational interaction Conversation       NGL
## 15 -1.4393 -3.9201 -1.8179 Informational interaction Conversation       POC
## 16  1.4029 -3.9201 -0.0561       Involved persuasion  Informative Solutions
##    Country   predicted
## 1  Germany -1.41151036
## 2  Germany -1.11244256
## 3  Germany -1.11244256
## 4  Germany -0.80723990
## 5    Spain  2.50229258
## 6    Spain -2.21681993
## 7    Spain -1.61309777
## 8  Germany -1.53117343
## 9  Germany -1.23210563
## 10 Germany -1.23210563
## 11  France  2.03578654
## 12 Germany -0.98611074
## 13 Germany  0.07837407
## 14 Germany  0.07837407
## 15  France  1.67346609
## 16   Spain  2.30890799
md_final5_Upper <- lmer(Dim5 ~ (1|Series) + Register + Level + Level:Register, UpperTxBDim, REML = FALSE) # no warnings

tab_model(md_final5_Upper, wrap.labels = 100) # Hardly explains anything and is therefore really not worth the trouble
  Dim 5
Predictors Estimates CI p
(Intercept) -2.07 -2.58 – -1.55 <0.001
Register [Fiction] 0.57 -0.05 – 1.20 0.071
Register [Informative] 1.78 1.25 – 2.31 <0.001
Register [Personal] 1.02 0.12 – 1.92 0.026
Level [D] 0.51 0.03 – 0.99 0.036
Level [E] 0.48 -0.09 – 1.04 0.096
Register [Fiction] * Level [D] 0.13 -0.70 – 0.97 0.752
Register [Informative] * Level [D] 0.05 -0.68 – 0.78 0.886
Register [Personal] * Level [D] -0.96 -2.29 – 0.38 0.160
Register [Fiction] * Level [E] -0.39 -1.26 – 0.48 0.375
Register [Informative] * Level [E] 0.67 -0.12 – 1.46 0.095
Register [Personal] * Level [E] -0.62 -1.97 – 0.72 0.363
Random Effects
σ2 3.57
τ00 Series 0.34
ICC 0.09
N Series 9
Observations 833
Marginal R2 / Conditional R2 0.184 / 0.255
# check distribution of residuals
library(predictmeans)
residplot(md_final5_Upper)

###

UpperTxBDim[, "predicted"] <- predict(md_final5_Upper)

p <- ggplot(UpperTxBDim, aes(x = Level, y = Dim5)) +
  geom_point(shape = "circle filled", fill = "grey", position = position_jitter(width = 0.2, height = 0)) +
  facet_grid(rows = vars(Series), cols = vars(Register)) +
  geom_point(aes(y = predicted), shape = "triangle filled", fill = "red")+
  labs(y = "Dimension 5 (Biber 1988)", x = "Textbook Level")

top_label <- ggplot() +
  annotate("text", x = 0, y = 0, label = "Textbook Register") +
  theme_void()
right_label <- ggplot() +
  annotate("text", x = 0, y = 0, label = "Textbook Series", angle = -90) +
  theme_void()
blank_panel <- ggplot() +
  theme_void()

grid.arrange(
  top_label, blank_panel, p, right_label,
  nrow = 2, ncol = 2,
  widths = c(30, 1), heights = c(1, 30)
)

Dim6

# Rainplots for all textbook registers on Dimension 6 

ggplot(TxBdimensions,aes(x=Register,y=Dim6, fill = Register, colour = Register))+ 
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .25)+
  geom_boxplot(aes(x = as.numeric(Register)+0.25, y = Dim6), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Dimension 6 (Biber 1988)')+xlab('Textbook Registers')+ 
  theme_cowplot()+ 
  guides(fill = "none", colour = "none") +
  scale_colour_manual(values = colours)+
  scale_fill_manual(values = colours)+
  #ggtitle("Dimension 6: On-Line Informational Elaboration") +
  scale_y_continuous(sec.axis = dup_axis(name=NULL), breaks = seq(from = -4, to = 10, by = 2))

#ggsave(here("plots", "TxB_Reg_Dim6.svg"), width = 10, height = 6)

TxBdimensions %>% filter(Dim6 > 5) # Two clear outliers
##                                 Filename Level    Dim1    Dim2    Dim3    Dim4
## 1               Access_2_Spoken_0016.txt     B  7.5089 -1.3987 -1.1996 -1.9249
## 2 Solutions_Intermediate_Poetry_0001.txt     C 24.7457 -4.8622  1.4280  7.8919
##      Dim5   Dim6                  TextType     Register    Series Country
## 1 -3.5864 5.2576       Involved persuasion Conversation    Access Germany
## 2 -3.1268 6.7785 Informational interaction       Poetry Solutions   Spain
TxBdimensions %>% group_by(Register) %>% summarise(mean = mean(Dim6))
## # A tibble: 6 × 2
##   Register       mean
##   <fct>         <dbl>
## 1 Conversation  -1.48
## 2 Fiction       -1.68
## 3 Informative   -1.45
## 4 Instructional -1.75
## 5 Personal      -1.76
## 6 Poetry        -1.58
summary(TxBdimensions$Dim6)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  -3.495  -2.451  -1.781  -1.609  -0.996   6.779
# Floor level:
TxBdimensions %>% filter(Dim6 < -3.494) %>% summarise(n = n()) # 66
##    n
## 1 66
md_final6 <- lmer(Dim6 ~ (1|Series) + Register + Level + Level:Register, TxBdim_nopoetry, REML = FALSE) # no warnings

tab_model(md_final6, wrap.labels = 100) 
  Dim 6
Predictors Estimates CI p
(Intercept) -2.38 -2.63 – -2.13 <0.001
Register [Fiction] 0.21 -0.21 – 0.63 0.330
Register [Informative] 0.16 -0.28 – 0.60 0.468
Register [Instructional] 0.16 -0.15 – 0.47 0.306
Register [Personal] -0.24 -0.88 – 0.40 0.459
Level [B] 0.64 0.35 – 0.94 <0.001
Level [C] 0.78 0.48 – 1.07 <0.001
Level [D] 1.31 1.01 – 1.61 <0.001
Level [E] 1.61 1.27 – 1.94 <0.001
Register [Fiction] * Level [B] -0.45 -0.99 – 0.10 0.109
Register [Informative] * Level [B] -0.22 -0.78 – 0.34 0.438
Register [Instructional] * Level [B] -0.24 -0.65 – 0.17 0.244
Register [Personal] * Level [B] 0.01 -0.80 – 0.82 0.979
Register [Fiction] * Level [C] -0.02 -0.57 – 0.53 0.930
Register [Informative] * Level [C] 0.09 -0.44 – 0.62 0.739
Register [Instructional] * Level [C] -0.24 -0.64 – 0.17 0.253
Register [Personal] * Level [C] 0.10 -0.72 – 0.93 0.802
Register [Fiction] * Level [D] -0.69 -1.22 – -0.16 0.011
Register [Informative] * Level [D] -0.28 -0.81 – 0.25 0.300
Register [Instructional] * Level [D] -0.81 -1.22 – -0.40 <0.001
Register [Personal] * Level [D] -0.28 -1.14 – 0.57 0.515
Register [Fiction] * Level [E] -0.97 -1.52 – -0.41 0.001
Register [Informative] * Level [E] -0.79 -1.34 – -0.23 0.006
Register [Instructional] * Level [E] -0.87 -1.31 – -0.42 <0.001
Register [Personal] * Level [E] 0.03 -0.83 – 0.89 0.946
Random Effects
σ2 1.20
τ00 Series 0.03
ICC 0.02
N Series 9
Observations 1912
Marginal R2 / Conditional R2 0.106 / 0.127
# check distribution of residuals
residplot(md_final6) # Not looking terribly good here, either!

ggplot(TxBdim_nopoetry, aes(x = Level, y = Dim6, facet = Register)) +
  geom_point(position = position_jitter(width = .15), size = .25, alpha = 0.7)+
  geom_boxplot(aes(x = Level, y = Dim6, fill = Register), 
               outlier.shape = NA, alpha = 0.9, width = .15) +
  scale_colour_manual(values = colours)+
  scale_fill_manual(values = colours)+
  scale_y_continuous(limits=c(-3.5,4))+
  facet_grid(cols = vars(Register)) +
  theme_minimal()
## Warning: Removed 1 rows containing non-finite values (stat_boxplot).
## Warning: Removed 1 rows containing missing values (geom_point).
ggplot(TxBdim_nopoetry, aes(x = Level, y = Dim6, colour = Register)) +
  geom_point(position = position_jitter(width = 0.3), size = 2, alpha = 0.8)+
  geom_boxplot(aes(x = Level, y = Dim6), 
               outlier.shape = NA, alpha = 0.3, width = .6, colour = "BLACK") +
  scale_colour_manual(values = colours[c(1,2,6,4,5)])+
  scale_fill_manual(values = colours[c(1,2,6,4,5)])+
  scale_y_continuous(limits=c(-3.5,3.9), breaks = c(-3,-2,-1,0,1,2,3,4))+ # Removes the outlier in Conversation (discussed in Diss. chapter)
  theme_minimal() +
  theme(legend.position = "bottom", legend.title.align = 0.5, legend.margin=margin(0,0,0,0))+
  ylab('Dimension 6 (Biber 1988)')
## Warning: Removed 1 rows containing non-finite values (stat_boxplot).

## Warning: Removed 1 rows containing missing values (geom_point).
#ggsave(here("plots", "Dim6_boxplot_levels.svg"), width = 7, height = 9)

visreg(md_final6, xvar = "Level", by="Register", type = "conditional", line=list(col="darkred"), xlab = "Textbook Level", ylab = "Biber's Dimension 6")

# Model with upper levels only
TxBdim_nopoetry %>% filter(Dim6==min(TxBdim_nopoetry$Dim6)) %>%  nrow(.) # There are 60/1949 texts with the minimum Dim6 score. We obviously have a floor effect here.
## [1] 60
minDim6 <- min(TxBdim_nopoetry[, "Dim6"])

UpperTxBDim <- TxBdim_nopoetry %>% filter(Level %in% c("C", "D", "E") & Register != "Instructional") %>% droplevels(.)

UpperTxBDim %>% filter(Dim6==min(TxBdim_nopoetry$Dim6)) %>%  nrow(.) # Now only 20/1949
## [1] 20
md_final6_Upper <- update(md_final6, data = UpperTxBDim)
tab_model(md_final6_Upper, wrap.labels = 100) 
  Dim 6
Predictors Estimates CI p
(Intercept) -1.67 -1.98 – -1.36 <0.001
Register [Fiction] 0.39 -0.01 – 0.78 0.055
Register [Informative] 0.17 -0.16 – 0.51 0.308
Register [Personal] -0.05 -0.62 – 0.53 0.876
Level [D] 0.52 0.21 – 0.82 0.001
Level [E] 0.94 0.58 – 1.29 <0.001
Register [Fiction] * Level [D] -0.67 -1.20 – -0.14 0.013
Register [Informative] * Level [D] -0.27 -0.74 – 0.19 0.248
Register [Personal] * Level [D] -0.35 -1.20 – 0.50 0.416
Register [Fiction] * Level [E] -1.10 -1.65 – -0.54 <0.001
Register [Informative] * Level [E] -0.82 -1.32 – -0.32 0.001
Register [Personal] * Level [E] -0.14 -0.99 – 0.71 0.747
Random Effects
σ2 1.44
τ00 Series 0.11
ICC 0.07
N Series 9
Observations 833
Marginal R2 / Conditional R2 0.042 / 0.112
residplot(md_final6_Upper) # Not ideal but better

visreg::visreg(md_final6_Upper, xvar = "Level", by="Register", type = "conditional", line=list(col="darkred"), xlab = "Textbook Level", ylab = "Dimension 6 (Biber 1988)")

Comparative Additive MDA

Data import

Reference corpora

# Spoken BNC2014 no mark-up (Jack & Jill version)

# Z-scores of individual features
BNCzscores <- read.delim(here("data", "SpokenBNC2014full_zscores.tsv"), header = TRUE)
BNCzscores <- BNCzscores %>% filter(Filename!=".DS_Store" & Filename!="CORPUS") # Remove this rows
colnames(BNCzscores)
##  [1] "Filename"  "AMP"       "ANDC"      "AWL"       "CAUS"      "CONC"     
##  [7] "COND"      "CONJ"      "DEMO"      "DEMP"      "DPAR"      "DWNT"     
## [13] "EMPH"      "EX"        "FPP1"      "GER"       "HDG"       "INPR"     
## [19] "JJ"        "NEMD"      "NN"        "NOMZ"      "OSUB"      "PHC"      
## [25] "PIN"       "PIT"       "PLACE"     "POMD"      "PRED"      "PRMD"     
## [31] "RB"        "SPP2"      "SYNE"      "THAC"      "THVC"      "TIME"     
## [37] "TO"        "TOBJ"      "TPP3"      "TSUB"      "TTR"       "VBD"      
## [43] "VPRT"      "XX0"       "X.BEMA."   "X.BYPA."   "X.CONT."   "X.PASS."  
## [49] "X.PASTP."  "X.PEAS."   "X.PIRE."   "X.PRESP."  "X.PRIV."   "X.PROD."  
## [55] "X.PUBV."   "X.SERE."   "X.SMP."    "X.SPAU."   "X.SPIN."   "X.STPR."  
## [61] "X.SUAV."   "X.THATD."  "X.WHCL."   "X.WHOBJ."  "X.WHQU."   "X.WHSUB." 
## [67] "X.WZPAST." "X.WZPRES." "Underused" "Overused"
MAT_features <- read.csv(here("metadata", "MAT_features_zscores_ref.csv"), header = F)
MAT_features <- MAT_features$V3 # Feature names without any spaces or hythens
colnames(BNCzscores) <- MAT_features
colnames(BNCzscores)
##  [1] "Filename"                     "Amplifiers"                  
##  [3] "Ind_clause_coord"             "AWL"                         
##  [5] "because"                      "Coord_conj"                  
##  [7] "if_unless"                    "although_though"             
##  [9] "Demonstratives"               "Dem_pronouns"                
## [11] "Discourse_particles"          "Downtoners"                  
## [13] "Emphatics"                    "Existential_there"           
## [15] "FPP1"                         "Gerunds"                     
## [17] "Hedges"                       "Ind_pronouns"                
## [19] "Attr_Adj"                     "Necessity_modals"            
## [21] "Nouns"                        "Nominalizations"             
## [23] "Adv_sub"                      "Phrasal_coord"               
## [25] "Prepositions"                 "it"                          
## [27] "Place_adv"                    "Poss_modals"                 
## [29] "Pred_adj"                     "Pred_modals"                 
## [31] "Adverbs"                      "SPP2"                        
## [33] "Syn_negation"                 "That_adj_comp"               
## [35] "That_verb_comp"               "Time_adv"                    
## [37] "To_infinitives"               "That_rel_clause_obj"         
## [39] "TPP3"                         "That_rel_clause_subj"        
## [41] "TTR"                          "Past_tense"                  
## [43] "Present_tense"                "Analytic_negation"           
## [45] "BE_main_verb"                 "By_passives"                 
## [47] "Contractions"                 "Agentless_passives"          
## [49] "Past_participial_clauses"     "Perfect_aspect"              
## [51] "Pied_piping_relative_clauses" "Present_part_clauses"        
## [53] "Private_verbs"                "Pro_verb_DO"                 
## [55] "Public_verbs"                 "Sentence_relatives"          
## [57] "seem_appear"                  "Split_auxiliaries"           
## [59] "Split_infinitives"            "Stranded_prepositions"       
## [61] "Suasive_verbs"                "That_deletion"               
## [63] "WH_clauses"                   "WH_rel_clauses_obj"          
## [65] "Direct_WH_questions"          "WH_rel_clauses_subj"         
## [67] "Past_part_WHIZ_del_rel"       "Present_part_WHIZ_del_rel"   
## [69] "Underused"                    "Overused"
# Dimensions Biber (1988)
BNCdimensions <- read.delim(here("data", "SpokenBNC2014full_dims.tsv"), header = TRUE)
#View(BNCdimensions)
glimpse(BNCdimensions)
## Rows: 1,253
## Columns: 8
## $ Filename <chr> "SFYX.txt", "SVH7.txt", "S75W.txt", "SH63.txt", "SAZ8.txt", "…
## $ Dim1     <dbl> 22.1993, 23.4792, 33.6168, 30.9853, 23.9637, 28.6082, 20.9903…
## $ Dim2     <dbl> -1.9363, -2.9455, -1.6510, -0.2400, -3.1933, -0.6629, -3.1299…
## $ Dim3     <dbl> -0.7729, -0.8446, -2.5404, -3.0247, 0.5859, -3.1513, 0.4093, …
## $ Dim4     <dbl> -2.0041, 0.3389, -0.1011, -1.9232, 4.4512, -0.2231, 0.5990, -…
## $ Dim5     <dbl> -0.8758, -1.0732, -2.5485, -3.2441, -1.9479, -1.4352, -2.2731…
## $ Dim6     <dbl> -0.6297, 0.4310, -1.0667, -0.4676, -0.2071, -0.3209, 2.0316, …
## $ TextType <chr> "Informational interaction", "Informational interaction", "In…
head(BNCdimensions)
##   Filename    Dim1    Dim2    Dim3    Dim4    Dim5    Dim6
## 1 SFYX.txt 22.1993 -1.9363 -0.7729 -2.0041 -0.8758 -0.6297
## 2 SVH7.txt 23.4792 -2.9455 -0.8446  0.3389 -1.0732  0.4310
## 3 S75W.txt 33.6168 -1.6510 -2.5404 -0.1011 -2.5485 -1.0667
## 4 SH63.txt 30.9853 -0.2400 -3.0247 -1.9232 -3.2441 -0.4676
## 5 SAZ8.txt 23.9637 -3.1933  0.5859  4.4512 -1.9479 -0.2071
## 6 SPG4.txt 28.6082 -0.6629 -3.1513 -0.2231 -1.4352 -0.3209
##                    TextType
## 1 Informational interaction
## 2 Informational interaction
## 3 Informational interaction
## 4 Informational interaction
## 5 Informational interaction
## 6 Informational interaction
BNCdimensions <- BNCdimensions %>% filter(Filename!="CORPUS") %>% filter(Filename!=".DS_Store") # Remove mean values output by the MAT + .DS_Store file due to working with the MAT on a MAC
# Adding metadata variables for future comparisons with TEC data
BNCdimensions$Series <- "Spoken BNC2014"
BNCdimensions$Level <- "Spoken BNC2014"
BNCdimensions$Country <- "Spoken BNC2014"
BNCdimensions$Register <- "Spoken BNC2014"
summary(BNCdimensions$Dim1)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   7.314  23.492  25.973  26.021  28.609  40.802
# Quick plot of distribution of Dim1 values:
boxplot(BNCdimensions$Dim1)

# Dimensions Biber (1988)
# Three datasets need to be uploaded because the files were so large and had to be processed by the MAT in three batches:
YFdimensionsa <- read.delim(here("data", "YF5000a_dims.tsv"), header = TRUE)
YFdimensionsb <- read.delim(here("data", "YF5000b_dims.tsv"), header = TRUE)
YFdimensionsc <- read.delim(here("data","YF5000c_dims.tsv"), header = TRUE)

# Merge the three datasets
YFdimensions <- rbind(YFdimensionsa, YFdimensionsb, YFdimensionsc)
nrow(YFdimensions)
## [1] 1194
YFdimensions <- YFdimensions %>% filter(Filename!="CORPUS" & Filename!=".DS_Store") # Remove mean values file
# Add metadata variables for comparison with TEC data
YFdimensions$Series <- "Youth Fiction"
YFdimensions$Level <- "Youth Fiction"
YFdimensions$Country <- "Youth Fiction"
YFdimensions$Register <- "Youth Fiction"
# Remove individual datasets no longer needed from the R environment
rm(YFdimensionsa, YFdimensionsb, YFdimensionsc)

# Check distribution of Dim scores
boxplot(YFdimensions$Dim1)

boxplot(YFdimensions$Dim2)

# Z-scores of individual features
YFzscoresa <- read.delim(here("data", "YF5000a_zscores.tsv"), header = TRUE)
YFzscoresb <- read.delim(here("data", "YF5000b_zscores.tsv"), header = TRUE)
YFzscoresc <- read.delim(here("data", "YF5000c_zscores.tsv"), header = TRUE)

YFzscores <- rbind(YFzscoresa, YFzscoresb, YFzscoresc)
YFzscores <- YFzscores %>% filter(Filename!="CORPUS") # Remove mean values rows
colnames(YFzscores)
##  [1] "Filename"  "AMP"       "ANDC"      "AWL"       "CAUS"      "CONC"     
##  [7] "COND"      "CONJ"      "DEMO"      "DEMP"      "DPAR"      "DWNT"     
## [13] "EMPH"      "EX"        "FPP1"      "GER"       "HDG"       "INPR"     
## [19] "JJ"        "NEMD"      "NN"        "NOMZ"      "OSUB"      "PHC"      
## [25] "PIN"       "PIT"       "PLACE"     "POMD"      "PRED"      "PRMD"     
## [31] "RB"        "SPP2"      "SYNE"      "THAC"      "THVC"      "TIME"     
## [37] "TO"        "TOBJ"      "TPP3"      "TSUB"      "TTR"       "VBD"      
## [43] "VPRT"      "XX0"       "X.BEMA."   "X.BYPA."   "X.CONT."   "X.PASS."  
## [49] "X.PASTP."  "X.PEAS."   "X.PIRE."   "X.PRESP."  "X.PRIV."   "X.PROD."  
## [55] "X.PUBV."   "X.SERE."   "X.SMP."    "X.SPAU."   "X.SPIN."   "X.STPR."  
## [61] "X.SUAV."   "X.THATD."  "X.WHCL."   "X.WHOBJ."  "X.WHQU."   "X.WHSUB." 
## [67] "X.WZPAST." "X.WZPRES." "Underused" "Overused"
MAT_features <- read.csv(here("metadata", "MAT_features_zscores_ref.csv"), header = F)
MAT_features <- MAT_features$V3 # Feature names without any spaces or hyphens
colnames(YFzscores) <- MAT_features
colnames(YFzscores)
##  [1] "Filename"                     "Amplifiers"                  
##  [3] "Ind_clause_coord"             "AWL"                         
##  [5] "because"                      "Coord_conj"                  
##  [7] "if_unless"                    "although_though"             
##  [9] "Demonstratives"               "Dem_pronouns"                
## [11] "Discourse_particles"          "Downtoners"                  
## [13] "Emphatics"                    "Existential_there"           
## [15] "FPP1"                         "Gerunds"                     
## [17] "Hedges"                       "Ind_pronouns"                
## [19] "Attr_Adj"                     "Necessity_modals"            
## [21] "Nouns"                        "Nominalizations"             
## [23] "Adv_sub"                      "Phrasal_coord"               
## [25] "Prepositions"                 "it"                          
## [27] "Place_adv"                    "Poss_modals"                 
## [29] "Pred_adj"                     "Pred_modals"                 
## [31] "Adverbs"                      "SPP2"                        
## [33] "Syn_negation"                 "That_adj_comp"               
## [35] "That_verb_comp"               "Time_adv"                    
## [37] "To_infinitives"               "That_rel_clause_obj"         
## [39] "TPP3"                         "That_rel_clause_subj"        
## [41] "TTR"                          "Past_tense"                  
## [43] "Present_tense"                "Analytic_negation"           
## [45] "BE_main_verb"                 "By_passives"                 
## [47] "Contractions"                 "Agentless_passives"          
## [49] "Past_participial_clauses"     "Perfect_aspect"              
## [51] "Pied_piping_relative_clauses" "Present_part_clauses"        
## [53] "Private_verbs"                "Pro_verb_DO"                 
## [55] "Public_verbs"                 "Sentence_relatives"          
## [57] "seem_appear"                  "Split_auxiliaries"           
## [59] "Split_infinitives"            "Stranded_prepositions"       
## [61] "Suasive_verbs"                "That_deletion"               
## [63] "WH_clauses"                   "WH_rel_clauses_obj"          
## [65] "Direct_WH_questions"          "WH_rel_clauses_subj"         
## [67] "Past_part_WHIZ_del_rel"       "Present_part_WHIZ_del_rel"   
## [69] "Underused"                    "Overused"
# Counts

YFcountsa <- read.delim(here("data","YF5000a_counts.tsv"), header = TRUE)
YFcountsb <- read.delim(here("data","YF5000b_counts.tsv"), header = TRUE)
YFcountsc <- read.delim(here("data","YF5000c_counts.tsv"), header = TRUE)
YFcountsc %>% filter(NNP>0) %>% select(Filename, NNP) # Tagging error, should have been added to NN count
##                         Filename    NNP
## 1 262_TheMagicBookmark_1.txt.txt 0.0236
YFcountsc <- YFcountsc %>% select(-NNP) # Removing parsing error
YFcounts <- rbind(YFcountsa, YFcountsb, YFcountsc)
rm(YFcountsa, YFcountsb, YFcountsc)
YFcounts <- YFcounts %>%  filter(Filename != "CORPUS" & Filename!=".DS_Store")
nrow(YFcounts)
## [1] 1191
colnames(YFcounts)
##  [1] "Filename"  "Tokens"    "AWL"       "TTR"       "X."        "X..1"     
##  [7] "X.."       "X..2"      "X.LRB."    "X.RRB."    "."         "X..3"     
## [13] "AMP"       "ANDC"      "CAUS"      "CC"        "CD"        "CONC"     
## [19] "COND"      "CONJ"      "DEMO"      "DEMP"      "DPAR"      "DT"       
## [25] "DWNT"      "EMPH"      "EX"        "FPP1"      "FW"        "GER"      
## [31] "HDG"       "IN"        "INPR"      "JJ"        "LS"        "NEMD"     
## [37] "NN"        "NOMZ"      "OSUB"      "PDT"       "PHC"       "PIN"      
## [43] "PIT"       "PLACE"     "POMD"      "POS"       "PRED"      "PRMD"     
## [49] "PRP"       "PRPS"      "QUAN"      "QUPR"      "RB"        "RP"       
## [55] "SPP2"      "SYM"       "SYNE"      "THAC"      "THVC"      "TIME"     
## [61] "TO"        "TOBJ"      "TPP3"      "TSUB"      "UH"        "VB"       
## [67] "VBD"       "VBG"       "VBN"       "VPRT"      "WDT"       "WP"       
## [73] "WPS"       "XX0"       "X.BEMA."   "X.BYPA."   "X.CONT."   "X.PASS."  
## [79] "X.PASTP."  "X.PEAS."   "X.PIRE."   "X.PRESP."  "X.PRIV."   "X.PROD."  
## [85] "X.PUBV."   "X.SERE."   "X.SMP."    "X.SPAU."   "X.SPIN."   "X.STPR."  
## [91] "X.SUAV."   "X.THATD."  "X.WHCL."   "X.WHOBJ."  "X.WHQU."   "X.WHSUB." 
## [97] "X.WZPAST." "X.WZPRES." "X...1"
MAT_features <- read.csv(here("metadata" ,"MAT_features.csv"), header = F)
MAT_features <- MAT_features$V3 # Feature names without any spaces or hythens
MAT_features
##   [1] "Filename"                     "Tokens"                      
##   [3] "AWL"                          "TTR"                         
##   [5] "Hashtag"                      "Dollar"                      
##   [7] "Quotation"                    "Comma"                       
##   [9] "LeftBracket"                  "RightBracket"                
##  [11] "Full_stop"                    "Colon"                       
##  [13] "Amplifiers"                   "Ind_clause_coord"            
##  [15] "because"                      "Coord_conj"                  
##  [17] "Card_numb"                    "although_though"             
##  [19] "if_unless"                    "Conjuncts"                   
##  [21] "Demonstratives"               "Dem_pronouns"                
##  [23] "Discourse_particles"          "Determiners"                 
##  [25] "Downtoners"                   "Emphatics"                   
##  [27] "Existential_there"            "FPP1"                        
##  [29] "Foreign_words"                "Gerunds"                     
##  [31] "Hedges"                       "Prep_subord_conj"            
##  [33] "Ind_pronouns"                 "Attr_Adj"                    
##  [35] "List_markers"                 "Necessity_modals"            
##  [37] "Nouns"                        "Plural_nouns"                
##  [39] "Nominalizations"              "Adv_sub"                     
##  [41] "Pre_determiners"              "Phrasal_coord"               
##  [43] "Prepositions"                 "it"                          
##  [45] "Place_adv"                    "Poss_modals"                 
##  [47] "Poss_S"                       "Pred_adj"                    
##  [49] "Pred_modals"                  "Personal_pronouns"           
##  [51] "Poss_pronouns"                "Quantifiers"                 
##  [53] "Quantifying_pronouns"         "Adverbs"                     
##  [55] "Particles"                    "SPP2"                        
##  [57] "Symbols"                      "Syn_negation"                
##  [59] "That_adj_comp"                "That_verb_comp"              
##  [61] "Time_adv"                     "To_infinitives"              
##  [63] "That_rel_clause_obj"          "TPP3"                        
##  [65] "That_rel_clause_subj"         "Interjection"                
##  [67] "Verb_base_form"               "Past_tense"                  
##  [69] "Verb_ing_form"                "Verb_past_par"               
##  [71] "Present_tense"                "WH_determiner"               
##  [73] "WH_pronoun"                   "Poss_WH_pronoun"             
##  [75] "Analytic_negation"            "BE_main_verb"                
##  [77] "By_passives"                  "Contractions"                
##  [79] "Agentless_passives"           "Past_participial_clauses"    
##  [81] "Perfect_aspect"               "Pied_piping_relative_clauses"
##  [83] "Present_part_clauses"         "Private_verbs"               
##  [85] "Pro_verb_DO"                  "Public_verbs"                
##  [87] "Sentence_relatives"           "seem_appear"                 
##  [89] "Split_auxiliaries"            "Split_infinitives"           
##  [91] "Stranded_prepositions"        "Suasive_verbs"               
##  [93] "That_deletion"                "WH_clauses"                  
##  [95] "WH_rel_clauses_obj"           "Direct_WH_questions"         
##  [97] "WH_rel_clauses_subj"          "Past_part_WHIZ_del_rel"      
##  [99] "Present_part_WHIZ_del_rel"    "Quotation2"                  
## [101] "Register"
colnames(YFcounts) <- MAT_features[c(1:37, 39:100)] # Excluding the proper noun tag
colnames(YFcounts)
##  [1] "Filename"                     "Tokens"                      
##  [3] "AWL"                          "TTR"                         
##  [5] "Hashtag"                      "Dollar"                      
##  [7] "Quotation"                    "Comma"                       
##  [9] "LeftBracket"                  "RightBracket"                
## [11] "Full_stop"                    "Colon"                       
## [13] "Amplifiers"                   "Ind_clause_coord"            
## [15] "because"                      "Coord_conj"                  
## [17] "Card_numb"                    "although_though"             
## [19] "if_unless"                    "Conjuncts"                   
## [21] "Demonstratives"               "Dem_pronouns"                
## [23] "Discourse_particles"          "Determiners"                 
## [25] "Downtoners"                   "Emphatics"                   
## [27] "Existential_there"            "FPP1"                        
## [29] "Foreign_words"                "Gerunds"                     
## [31] "Hedges"                       "Prep_subord_conj"            
## [33] "Ind_pronouns"                 "Attr_Adj"                    
## [35] "List_markers"                 "Necessity_modals"            
## [37] "Nouns"                        "Nominalizations"             
## [39] "Adv_sub"                      "Pre_determiners"             
## [41] "Phrasal_coord"                "Prepositions"                
## [43] "it"                           "Place_adv"                   
## [45] "Poss_modals"                  "Poss_S"                      
## [47] "Pred_adj"                     "Pred_modals"                 
## [49] "Personal_pronouns"            "Poss_pronouns"               
## [51] "Quantifiers"                  "Quantifying_pronouns"        
## [53] "Adverbs"                      "Particles"                   
## [55] "SPP2"                         "Symbols"                     
## [57] "Syn_negation"                 "That_adj_comp"               
## [59] "That_verb_comp"               "Time_adv"                    
## [61] "To_infinitives"               "That_rel_clause_obj"         
## [63] "TPP3"                         "That_rel_clause_subj"        
## [65] "Interjection"                 "Verb_base_form"              
## [67] "Past_tense"                   "Verb_ing_form"               
## [69] "Verb_past_par"                "Present_tense"               
## [71] "WH_determiner"                "WH_pronoun"                  
## [73] "Poss_WH_pronoun"              "Analytic_negation"           
## [75] "BE_main_verb"                 "By_passives"                 
## [77] "Contractions"                 "Agentless_passives"          
## [79] "Past_participial_clauses"     "Perfect_aspect"              
## [81] "Pied_piping_relative_clauses" "Present_part_clauses"        
## [83] "Private_verbs"                "Pro_verb_DO"                 
## [85] "Public_verbs"                 "Sentence_relatives"          
## [87] "seem_appear"                  "Split_auxiliaries"           
## [89] "Split_infinitives"            "Stranded_prepositions"       
## [91] "Suasive_verbs"                "That_deletion"               
## [93] "WH_clauses"                   "WH_rel_clauses_obj"          
## [95] "Direct_WH_questions"          "WH_rel_clauses_subj"         
## [97] "Past_part_WHIZ_del_rel"       "Present_part_WHIZ_del_rel"   
## [99] "Quotation2"
# InfoTeen Dimensions
InfoTeendimensions <- read.delim(here("data", "InfoTeen_dims.tsv"), header = TRUE)
nrow(InfoTeendimensions)
## [1] 1416
InfoTeendimensions <- InfoTeendimensions %>% filter(Filename!="CORPUS" & Filename!=".DS_Store")

InfoTeendimensions$Series <- "Info Teens"
InfoTeendimensions$Level <- "Info Teens"
InfoTeendimensions$Country <- "Info Teens"
InfoTeendimensions$Register <- "Info Teens"
boxplot(InfoTeendimensions$Dim1)

Dimensions <- dplyr::bind_rows(TxBdimensions, BNCdimensions, InfoTeendimensions, YFdimensions, .id = "Corpus")
nrow(Dimensions)
## [1] 5805
head(Dimensions); tail(Dimensions)
##   Corpus                        Filename Level    Dim1    Dim2    Dim3    Dim4
## 1      1   Access_1_Informative_0001.txt     A -7.3851 -4.1024 -0.9315 -6.6663
## 2      1 Access_1_Instructional_0001.txt     A -4.9261 -2.4173  5.1347 -7.4853
## 3      1 Access_1_Instructional_0002.txt     A -2.4381 -0.6398  4.7311 -5.6705
## 4      1 Access_1_Instructional_0003.txt     A -0.1935 -3.3565  4.5138 -7.3240
## 5      1 Access_1_Instructional_0004.txt     A -1.6453 -4.2051  4.6284 -7.3409
## 6      1 Access_1_Instructional_0005.txt     A  4.4156 -3.2099  5.5911 -4.0795
##      Dim5    Dim6                     TextType      Register Series Country
## 1 -3.4638 -2.9757 General narrative exposition   Informative Access Germany
## 2 -3.9201 -2.1686 General narrative exposition Instructional Access Germany
## 3 -3.9201 -2.1922 General narrative exposition Instructional Access Germany
## 4 -3.9201 -1.0148          Involved persuasion Instructional Access Germany
## 5 -3.9201 -2.1161 General narrative exposition Instructional Access Germany
## 6 -3.9201 -2.5710          Involved persuasion Instructional Access Germany
##      Corpus                                                Filename
## 5800      4                   283_Hartnett_Thursday_Child_2.txt.txt
## 5801      4             251_TheWolfWilderKatherineRundell_3.txt.txt
## 5802      4                      292_Adams_Watership_down_3.txt.txt
## 5803      4 271_Boyce_Frank-Cottrell-The-Unforgotten-Coat_4.txt.txt
## 5804      4                    277_Lewis_Alice_Wonderland_2.txt.txt
## 5805      4                    221_GREEN2010GHOSANCE.enuk_3.txt.txt
##              Level    Dim1   Dim2    Dim3    Dim4    Dim5    Dim6
## 5800 Youth Fiction 11.5351 7.7083 -0.4732  1.0855 -1.5048 -1.1593
## 5801 Youth Fiction  1.6479 6.5320 -1.0364 -1.2427 -2.6515 -2.6888
## 5802 Youth Fiction 12.5234 3.5948 -1.3319  4.3015 -1.3665 -0.1931
## 5803 Youth Fiction  9.3920 3.9129 -1.9078 -0.2747 -0.9714 -1.2909
## 5804 Youth Fiction 14.6399 5.9620 -3.4998  0.6420 -1.1585 -0.4828
## 5805 Youth Fiction  7.9830 5.6020 -0.5985  0.0463 -2.3492 -1.5609
##                   TextType      Register        Series       Country
## 5800 Imaginative narrative Youth Fiction Youth Fiction Youth Fiction
## 5801 Imaginative narrative Youth Fiction Youth Fiction Youth Fiction
## 5802 Imaginative narrative Youth Fiction Youth Fiction Youth Fiction
## 5803 Imaginative narrative Youth Fiction Youth Fiction Youth Fiction
## 5804 Imaginative narrative Youth Fiction Youth Fiction Youth Fiction
## 5805 Imaginative narrative Youth Fiction Youth Fiction Youth Fiction
#Convert all character vectors to factors
Dimensions[sapply(Dimensions, is.character)] <- lapply(Dimensions[sapply(Dimensions, is.character)], as.factor)

levels(Dimensions$Corpus)
## [1] "1" "2" "3" "4"
levels(Dimensions$Corpus) <- list(Textbook.English="1", Spoken.BNC2014="2", Informative.Teens="3", Youth.Fiction="4")
summary(Dimensions$Corpus)
##  Textbook.English    Spoken.BNC2014 Informative.Teens     Youth.Fiction 
##              1949              1251              1414              1191
summary(Dimensions$Series)
##         Access      Achievers            EIM      GreenLine             HT 
##            282            238            174            206            172 
##     Info Teens            JTT            NGL            POC      Solutions 
##           1414            175            300             92            310 
## Spoken BNC2014  Youth Fiction 
##           1251           1191
# Re-order registers
levels(Dimensions$Register)
## [1] "Conversation"   "Fiction"        "Info Teens"     "Informative"   
## [5] "Instructional"  "Personal"       "Poetry"         "Spoken BNC2014"
## [9] "Youth Fiction"
Dimensions$Register <- factor(Dimensions$Register, levels = c("Conversation", "Fiction", "Informative", "Instructional", "Personal", "Poetry", "Info Teens", "Spoken BNC2014", "Youth Fiction"))

#saveRDS(Dimensions, here("data", "Dimensions.rds"))
SpokenTxBzscores <- TxBzscores %>% filter(Register=="Conversation") %>% select(-Register)

SpokenZscores <- bind_rows("Textbook Conversation" = SpokenTxBzscores, "Spoken BNC2014" = BNCzscores, .id = "Corpus") # Ignore stupid warning in R 3.x
SpokenZscores <- SpokenZscores %>% mutate_if(is.character, as.factor)
glimpse(SpokenZscores)
## Rows: 1,780
## Columns: 74
## $ Corpus                       <fct> Textbook Conversation, Textbook Conversat…
## $ Filename                     <fct> Access_1_Spoken_0001.txt, Access_1_Spoken…
## $ Level                        <fct> A, A, A, A, A, A, A, A, A, A, A, A, A, A,…
## $ Amplifiers                   <dbl> -1.0385, -1.0385, -1.0385, 0.1450, -1.038…
## $ Ind_clause_coord             <dbl> 1.3027, -0.4108, 1.4004, 0.9856, 1.5427, …
## $ AWL                          <dbl> -2.7016, -2.4668, -2.0012, -2.3692, -2.09…
## $ because                      <dbl> -0.6471, -0.6471, -0.6471, 0.2576, 0.2282…
## $ Coord_conj                   <dbl> -0.625, -0.625, -0.625, -0.625, -0.625, -…
## $ if_unless                    <dbl> -1.1364, -1.1364, -1.1364, -1.1364, -1.13…
## $ although_though              <dbl> -0.7500, -0.7500, -0.7500, -0.7500, -0.75…
## $ Demonstratives               <dbl> -2.3571, -1.1531, -2.3571, -1.9910, -2.35…
## $ Dem_pronouns                 <dbl> 2.4019, 1.1488, 0.0808, 0.3237, 0.9019, 0…
## $ Discourse_particles          <dbl> 1.8157, 0.0278, 0.5626, 0.8161, 2.7130, 0…
## $ Downtoners                   <dbl> -1.2500, -1.2500, -0.4706, -1.2500, -1.25…
## $ Emphatics                    <dbl> -1.5000, -1.5000, -0.9062, -1.1338, -0.08…
## $ Existential_there            <dbl> -0.6250, 5.0989, 0.1633, 3.0511, 1.2578, …
## $ FPP1                         <dbl> 1.7593, 1.3797, 1.0599, 1.3746, 0.6683, 2…
## $ Gerunds                      <dbl> -1.2761, -0.8439, -0.2016, -1.0324, -0.27…
## $ Hedges                       <dbl> -0.4615, -0.4615, -0.4615, -0.4615, 1.827…
## $ Ind_pronouns                 <dbl> -0.7000, -0.7000, -0.7000, -0.7000, 0.788…
## $ Attr_Adj                     <dbl> -0.8265, -1.2786, -0.5758, -1.4284, -1.40…
## $ Necessity_modals             <dbl> -1.0000, -1.0000, -1.0000, -1.0000, -1.00…
## $ Nouns                        <dbl> 3.8400, 3.7012, 4.8068, 6.0793, 2.9554, 2…
## $ Nominalizations              <dbl> -1.1579, -0.9430, -1.2087, -1.3819, -1.17…
## $ Adv_sub                      <dbl> -0.9091, -0.9091, -0.9091, -0.9091, -0.90…
## $ Phrasal_coord                <dbl> -0.4626, 4.3596, 1.9733, 1.0200, -1.2593,…
## $ Prepositions                 <dbl> -2.1491, -2.2102, -1.5032, -1.8670, -2.53…
## $ it                           <dbl> 1.2754, 0.3299, -0.5727, 0.0661, 0.8548, …
## $ Place_adv                    <dbl> -0.9118, -0.1682, 0.9218, -0.9118, -0.474…
## $ Poss_modals                  <dbl> -0.4283, 5.9283, 1.9054, 0.5406, 2.5946, …
## $ Pred_adj                     <dbl> 5.2231, 1.1096, 0.1108, 3.5177, -0.0908, …
## $ Pred_modals                  <dbl> -1.3333, -1.3333, -1.3333, 0.4981, -1.333…
## $ Adverbs                      <dbl> -2.3832, -1.8597, -2.1687, -2.0664, -1.44…
## $ SPP2                         <dbl> 2.7889, 1.6645, 1.8125, 1.4008, 2.1941, 1…
## $ Syn_negation                 <dbl> -1.0625, -1.0625, -0.2831, 3.7450, -0.132…
## $ That_adj_comp                <dbl> -0.5000, -0.5000, -0.5000, -0.5000, -0.50…
## $ That_verb_comp               <dbl> -1.1379, -1.1379, -1.1379, -1.1379, -1.13…
## $ Time_adv                     <dbl> 0.6649, -0.4020, -1.1294, -1.0463, 1.0654…
## $ To_infinitives               <dbl> -2.4688, -2.4350, -2.6607, -1.5618, -1.33…
## $ That_rel_clause_obj          <dbl> -0.7273, -0.7273, -0.7273, -0.7273, -0.72…
## $ TPP3                         <dbl> -1.0421, -0.8232, 0.2782, -0.9870, 0.5230…
## $ That_rel_clause_subj         <dbl> -0.500, -0.500, -0.500, -0.500, -0.500, -…
## $ TTR                          <dbl> -3.5769, -2.8077, -2.6154, -2.8077, -3.04…
## $ Past_tense                   <dbl> -1.3191, -1.3191, -1.3191, -1.2685, -1.31…
## $ Present_tense                <dbl> 1.7787, 1.0887, 0.3884, 0.7399, 0.9885, -…
## $ Analytic_negation            <dbl> 0.8980, 1.0936, 1.4682, 0.6243, 1.5339, -…
## $ BE_main_verb                 <dbl> 5.3968, 1.5457, -0.3539, 0.0980, -0.0027,…
## $ By_passives                  <dbl> -0.6154, -0.6154, -0.6154, -0.6154, -0.61…
## $ Contractions                 <dbl> 3.4365, 1.5852, 1.1512, 1.7556, 1.3543, 0…
## $ Agentless_passives           <dbl> -1.4545, -1.2630, -1.4545, -1.4545, -1.45…
## $ Past_participial_clauses     <dbl> -0.2500, -0.2500, -0.2500, -0.2500, -0.25…
## $ Perfect_aspect               <dbl> -1.6538, -1.6538, -1.6538, -1.6538, -1.65…
## $ Pied_piping_relative_clauses <dbl> -0.6364, -0.6364, -0.6364, -0.6364, -0.63…
## $ Present_part_clauses         <dbl> -0.5882, -0.5882, -0.5882, -0.5882, -0.58…
## $ Private_verbs                <dbl> -0.8003, -0.1505, -0.8915, -0.6953, -0.58…
## $ Pro_verb_DO                  <dbl> -0.5500, -0.4960, -0.1446, 0.4614, 1.6940…
## $ Public_verbs                 <dbl> -1.0276, -0.9578, -0.9641, -1.4259, -1.15…
## $ Sentence_relatives           <dbl> -0.25, -0.25, -0.25, -0.25, -0.25, -0.25,…
## $ seem_appear                  <dbl> -0.8, -0.8, -0.8, -0.8, -0.8, -0.8, -0.8,…
## $ Split_auxiliaries            <dbl> -2.2000, -2.2000, -2.2000, -2.2000, -2.20…
## $ Split_infinitives            <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Stranded_prepositions        <dbl> 0.8522, 0.1956, -0.2789, -0.7407, -0.1896…
## $ Suasive_verbs                <dbl> -0.5887, -0.9355, -0.5332, -0.9355, -0.93…
## $ That_deletion                <dbl> -0.7561, -0.4478, -0.4520, -0.7561, -0.39…
## $ WH_clauses                   <dbl> -0.600, -0.600, -0.600, -0.600, -0.600, 0…
## $ WH_rel_clauses_obj           <dbl> -0.8235, -0.8235, -0.8235, -0.8235, -0.82…
## $ Direct_WH_questions          <dbl> 3.2517, 20.7367, 1.7450, 7.3583, 2.1467, …
## $ WH_rel_clauses_subj          <dbl> -1.050, -1.050, -1.050, -1.050, -1.050, -…
## $ Past_part_WHIZ_del_rel       <dbl> -0.8065, -0.8065, -0.8065, -0.8065, -0.80…
## $ Present_part_WHIZ_del_rel    <dbl> -0.8889, -0.8889, -0.8889, -0.0344, 0.764…
## $ Underused                    <fct> AWL DEMO PIN RB TO TTR [SPAU], AWL PIN TO…
## $ Overused                     <fct> DEMP NN PRED SPP2 [BEMA] [CONT] [WHQU], E…
## $ Series                       <fct> Access, Access, Access, Access, Access, A…
## $ Country                      <fct> Germany, Germany, Germany, Germany, Germa…
summary(SpokenZscores$Corpus)
##        Spoken BNC2014 Textbook Conversation 
##                  1251                   529
# This computes Dim 1 scores without the offending variables that reply on punctuation marks that are absent from the Spoken BNC2014:
SpokenNewDim1 <- SpokenZscores %>%
  mutate(Dim1nopunct = Private_verbs + That_deletion + Contractions + Present_tense + SPP2 + Pro_verb_DO + Analytic_negation + Dem_pronouns + Emphatics + FPP1 + it + BE_main_verb + because + Ind_pronouns + Hedges + Amplifiers + Poss_modals + WH_clauses - Nouns - AWL - Prepositions - TTR - Attr_Adj) %>%  
  select(Filename, Corpus, Dim1nopunct)

SpokenNewDim1 %>% 
  group_by(Corpus) %>% 
  summarise(meanDim1 = mean(Dim1nopunct), sdDim1 = sd(Dim1nopunct))
## # A tibble: 2 × 3
##   Corpus                meanDim1 sdDim1
##   <fct>                    <dbl>  <dbl>
## 1 Spoken BNC2014            30.7   4.61
## 2 Textbook Conversation     14.8   8.09
wilcox.test(Dim1nopunct ~ Corpus, data = SpokenNewDim1, corect = TRUE, conf.int = TRUE)
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  Dim1nopunct by Corpus
## W = 636194, p-value < 0.00000000000000022
## alternative hypothesis: true location shift is not equal to 0
## 95 percent confidence interval:
##  14.89054 16.23759
## sample estimates:
## difference in location 
##                15.5619
DimensionsNewDim1 <- merge(Dimensions, SpokenNewDim1, by = "Filename", all = TRUE)

DimensionsNewDim1$Corpus <- DimensionsNewDim1$Corpus.x

DimensionsNewDim1 <- DimensionsNewDim1 %>% 
  mutate(Dim1nopunct = 
           case_when(is.na(Dim1nopunct) ~ Dim1,
                     TRUE ~ Dim1nopunct))

# Checking output:
DimensionsNewDim1 %>% slice_sample(n = 10) %>% select(Corpus, Register, Dim1, Dim1nopunct)
##               Corpus       Register     Dim1 Dim1nopunct
## 1  Informative.Teens     Info Teens -12.2440    -12.2440
## 2     Spoken.BNC2014 Spoken BNC2014  27.7635     29.7102
## 3   Textbook.English  Instructional  -6.1088     -6.1088
## 4      Youth.Fiction  Youth Fiction   1.4239      1.4239
## 5     Spoken.BNC2014 Spoken BNC2014  22.8936     26.3682
## 6     Spoken.BNC2014 Spoken BNC2014  24.4378     27.3664
## 7      Youth.Fiction  Youth Fiction  11.9382     11.9382
## 8   Textbook.English        Fiction  -1.2246     -1.2246
## 9  Informative.Teens     Info Teens -14.7148    -14.7148
## 10 Informative.Teens     Info Teens -21.8527    -21.8527
# Add Source variable for random effect variable in mixed effect models
DimensionsNewDim1 <- DimensionsNewDim1 %>% mutate(Source = case_when(
  Corpus=="Youth.Fiction" ~ paste("Book", str_extract(Filename, "[0-9]{1,3}"), sep = ""),
  Corpus=="Spoken.BNC2014" ~ "Spoken.BNC2014",
  Corpus=="Textbook.English" ~ as.character(Series),
  Corpus=="Informative.Teens" ~ str_extract(Filename, "BBC|Science_Tech"),
  TRUE ~ "NA")) %>% 
  mutate(Source = case_when(
  Corpus=="Informative.Teens" & is.na(Source) ~ str_remove(Filename, "_.*"),
  TRUE ~ as.character(Source)))

DimensionsNewDim1$Source <- as.factor(DimensionsNewDim1$Source)
summary(DimensionsNewDim1$Source, 325)
##         Access      Achievers            BBC          Book1         Book10 
##            282            238            100              4              4 
##        Book100        Book101        Book102        Book103        Book104 
##              4              4              4              4              4 
##        Book105        Book106        Book107        Book108        Book109 
##              4              4              4              4              4 
##         Book11        Book110        Book111        Book112        Book113 
##              4              4              4              4              4 
##        Book114        Book115        Book116        Book117        Book118 
##              4              4              4              4              4 
##        Book119         Book12        Book120        Book121        Book122 
##              4              4              4              4              4 
##        Book123        Book124        Book125        Book126        Book127 
##              4              4              4              4              4 
##        Book128        Book129         Book13        Book130        Book131 
##              4              4              4              4              4 
##        Book132        Book133        Book134        Book135        Book136 
##              4              4              4              4              4 
##        Book137        Book138        Book139         Book14        Book140 
##              4              4              4              4              4 
##        Book141        Book142        Book143        Book144        Book145 
##              4              4              4              4              4 
##        Book146        Book147        Book148        Book149         Book15 
##              4              4              4              4              4 
##        Book150        Book151        Book152        Book153        Book154 
##              4              4              4              4              4 
##        Book155        Book156        Book157        Book158        Book159 
##              4              4              4              4              4 
##         Book16        Book160        Book161        Book162        Book163 
##              4              4              4              4              4 
##        Book164        Book165        Book166        Book167        Book168 
##              4              4              4              4              4 
##        Book169         Book17        Book170        Book171        Book172 
##              4              4              4              4              4 
##        Book173        Book174        Book175        Book176        Book177 
##              4              4              4              4              4 
##        Book178        Book179         Book18        Book180        Book181 
##              4              4              4              4              4 
##        Book182        Book183        Book184        Book185        Book186 
##              4              4              4              4              4 
##        Book187        Book188        Book189         Book19        Book190 
##              4              4              4              4              4 
##        Book191        Book192        Book193        Book194        Book195 
##              4              4              4              4              4 
##        Book196        Book197        Book198        Book199          Book2 
##              4              4              4              4              4 
##         Book20        Book200        Book201        Book202        Book203 
##              4              4              4              4              4 
##        Book204        Book205        Book206        Book207        Book208 
##              4              4              4              4              4 
##        Book209         Book21        Book210        Book211        Book212 
##              4              4              4              4              4 
##        Book213        Book214        Book215        Book216        Book217 
##              4              4              4              4              4 
##        Book218        Book219         Book22        Book220        Book221 
##              4              4              4              4              4 
##        Book222        Book223        Book224        Book225        Book226 
##              4              4              4              4              4 
##        Book227        Book228        Book229         Book23        Book230 
##              4              4              4              4              4 
##        Book231        Book232        Book233        Book234        Book235 
##              4              4              4              4              4 
##        Book236        Book237        Book238        Book239         Book24 
##              4              4              4              1              4 
##        Book240        Book241        Book242        Book243        Book244 
##              4              4              4              4              4 
##        Book245        Book246        Book247        Book248        Book249 
##              4              4              4              4              4 
##         Book25        Book250        Book251        Book252        Book253 
##              4              4              4              4              4 
##        Book254        Book255        Book256        Book257        Book258 
##              4              4              4              4              4 
##        Book259         Book26        Book260        Book261        Book262 
##              4              4              4              4              1 
##        Book263        Book264        Book265        Book266        Book267 
##              4              4              4              4              1 
##        Book268        Book269         Book27        Book270        Book271 
##              4              4              4              4              4 
##        Book272        Book273        Book274        Book275        Book276 
##              4              4              4              4              4 
##        Book277        Book278        Book279         Book28        Book280 
##              4              4              4              4              4 
##        Book281        Book282        Book283        Book284        Book285 
##              4              4              4              4              4 
##        Book286        Book287        Book288        Book289         Book29 
##              4              4              4              4              4 
##        Book290        Book291        Book292        Book293        Book294 
##              4              4              4              4              4 
##        Book295        Book296        Book297        Book298        Book299 
##              4              4              4              4              4 
##          Book3         Book30        Book300         Book31         Book32 
##              4              4              4              4              4 
##         Book33         Book34         Book35         Book36         Book37 
##              4              4              4              4              4 
##         Book38         Book39          Book4         Book40         Book41 
##              4              4              4              4              4 
##         Book42         Book43         Book44         Book45         Book46 
##              4              4              4              4              4 
##         Book47         Book48         Book49          Book5         Book50 
##              4              4              4              4              4 
##         Book51         Book52         Book53         Book54         Book55 
##              4              4              4              4              4 
##         Book56         Book57         Book58         Book59          Book6 
##              4              4              4              4              4 
##         Book60         Book61         Book62         Book63         Book64 
##              4              4              4              4              4 
##         Book65         Book66         Book67         Book68         Book69 
##              4              4              4              4              4 
##          Book7         Book70         Book71         Book72         Book73 
##              4              4              4              4              4 
##         Book74         Book75         Book76         Book77         Book78 
##              4              4              4              4              4 
##         Book79          Book8         Book80         Book81         Book82 
##              4              4              4              4              4 
##         Book83         Book84         Book85         Book86         Book87 
##              4              4              4              4              4 
##         Book88         Book89          Book9         Book90         Book91 
##              4              4              4              4              4 
##         Book92         Book93         Book94         Book95         Book96 
##              4              4              4              4              4 
##         Book97         Book98         Book99           Dogo      Ducksters 
##              4              4              4            100            100 
##            EIM   Encyclopedia    Factmonster      GreenLine        History 
##            174            100            100            206            100 
##             HT            JTT            NGL            POC          Quatr 
##            172            175            300             92            100 
##       Revision        Science   Science_Tech      Solutions Spoken.BNC2014 
##            100            100            100            310           1251 
##           Teen      TeenVogue   TweenTribute       WhyFiles          World 
##            100            100             29            100             85
## Re-arranging data frame

recoding_corpus <- list(
  Textbook.English = "Textbook",
  Spoken.BNC2014 = "Reference",
  Informative.Teens = "Reference",
  Youth.Fiction = "Reference")

recoding_register <- list(
  `Info Teens` = "Informative",
  `Spoken BNC2014` = "Conversation",
  `Youth Fiction` = "Fiction")

dimensions_ref <- DimensionsNewDim1 %>%
  mutate(
    Corpus = recode(Corpus, !!!recoding_corpus),
    Register = recode(Register, !!!recoding_register)) %>%
  filter(Register %in% c("Conversation", "Fiction", "Informative")) %>%
  mutate(Register = factor(Register))

dimensions_ref %>% count(Corpus, Register) # Check wrangled table is correct
##      Corpus     Register    n
## 1  Textbook Conversation  529
## 2  Textbook      Fiction  285
## 3  Textbook  Informative  363
## 4 Reference Conversation 1251
## 5 Reference      Fiction 1191
## 6 Reference  Informative 1414
## Check how many different observations there are in each random effect grouping
dimensions_ref %>%
  count(Corpus, Register, Source) %>%
  group_by(Corpus, Register) %>%
  summarize(min_n = min(n), median_n = median(n), max_n = max(n), .groups = "drop")
## # A tibble: 6 × 5
##   Corpus    Register     min_n median_n max_n
##   <fct>     <fct>        <int>    <dbl> <int>
## 1 Textbook  Conversation    15       39   118
## 2 Textbook  Fiction          3       28    67
## 3 Textbook  Informative     12       35    79
## 4 Reference Conversation  1251     1251  1251
## 5 Reference Fiction          1        4     4
## 6 Reference Informative     29      100   100
## Distributions of the dimension scores in the different combinations of corpus type and register.

dimensions_ref %>%
  pivot_longer(cols = starts_with("Dim"), names_to = "Dim", values_to = "Score") %>%
  ggplot(aes(x = Register, y = Score, fill = Corpus)) +
  geom_point(shape = "circle filled", position = position_jitterdodge()) +
  facet_wrap(vars(Dim))

#saveRDS(dimensions_ref, here("data", "AdditiveMDAdimensions_ref.rds"))

Quick data import

Dimensions <- readRDS(here("data", "Dimensions.rds"))

dimensions_ref <- readRDS(here("data", "AdditiveMDAdimensions_ref.rds"))
# Colours used in Register Studies paper and in the open access plots on Zenodo:
colours <- suf_palette(name = "london", n = 6, type = "continuous") # Very nice, similar to OrRd palette
colours2 <- suf_palette(name = "classic", n = 5, type = "continuous") # Just green and purple
colours <- c(colours, colours2[c(2:4)]) # Nine colours range
scales::show_col(colours)

# Colours as used in Register Studies paper (see also plot on Zenodo)
london <- suf_palette(name = "london", n = 6, type = "continuous") # Very nice, similar to OrRd palette
#scales::show_col(london)
classic <- suf_palette(name = "classic", n = 5, type = "continuous") # Just green and purple
#scales::show_col(classic)
colours3Reg <- c(classic[2], london[6], classic[4], london[5], london[c(2,4)])

# Colours as used in PhD thesis
colours3Reg <- c("#BD241E", "#F9B921","#267226", "#A18A33", "#15274D", "#722672")

Dimension 1

Dimension 1: Visualisations

# Rainplots for all textbook registers and the three ref. corpora on Dimension 1 (not included in thesis)

ggplot(Dimensions,aes(x=Register,y=Dim1, fill = Register, colour = Register))+ # Or leave out "colour = Register" to keep the dots in black
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .25)+
# note that here we need to set the x-variable to a numeric variable and bump it to get the boxplots to line up with the rainclouds. 
  geom_boxplot(aes(x = as.numeric(Register)+0.25, y = Dim1), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Dimension 1 (Biber 1988)')+ 
  theme_cowplot()+ 
  guides(fill = "none", colour = "none") +
  scale_colour_manual(values = colours)+
  scale_fill_manual(values = colours)+
  annotate(geom = "text", x = 8.3, y = -42, label = "Reference Corpora", size = 5) +
  annotate(geom = "segment", x = 7, xend = 9.5, y = -39, yend = -39) +
  annotate(geom = "text", x = 3.8, y = -42, label = "Textbook Corpus", size = 5) +
  annotate(geom = "segment", x = 1, xend = 6.5, y = -39, yend = -39) +
  #ggtitle("Dimension 1: Involved vs. Informational Discourse") +
  scale_y_continuous(sec.axis = dup_axis(name=NULL), breaks = seq(from = -45, to = 45, by = 5))

#ggsave(here("plots", "Dim1.svg"), width = 13, height = 8)
# Rainplots for all textbook registers and the three ref. corpora on Dimension 1 

dimensions_ref <- readRDS(here("data", "AdditiveMDAdimensions_ref.rds"))
summary(dimensions_ref)
##                                  Filename                 Corpus.x   
##  1_BaumWizardOz_1.txt.txt            :   1   Textbook.English :1177  
##  1_BaumWizardOz_2.txt.txt            :   1   Spoken.BNC2014   :1251  
##  1_BaumWizardOz_3.txt.txt            :   1   Informative.Teens:1414  
##  1_BaumWizardOz_4.txt.txt            :   1   Youth.Fiction    :1191  
##  10_Montgomery1923EmilyMoon_1.txt.txt:   1                           
##  10_Montgomery1923EmilyMoon_2.txt.txt:   1                           
##  (Other)                             :5027                           
##             Level           Dim1              Dim2              Dim3        
##  Info Teens    :1414   Min.   :-33.259   Min.   :-7.3784   Min.   :-9.1267  
##  Spoken BNC2014:1251   1st Qu.: -8.149   1st Qu.:-2.8574   1st Qu.:-1.5764  
##  Youth Fiction :1191   Median :  5.164   Median :-1.1079   Median :-0.2053  
##  D             : 285   Mean   :  5.579   Mean   :-0.1165   Mean   : 0.7889  
##  C             : 262   3rd Qu.: 21.191   3rd Qu.: 2.6976   3rd Qu.: 2.6426  
##  B             : 235   Max.   : 40.802   Max.   :11.4408   Max.   :32.1621  
##  (Other)       : 395                                                        
##       Dim4              Dim5              Dim6        
##  Min.   :-9.2659   Min.   :-3.9201   Min.   :-3.4950  
##  1st Qu.:-2.6768   1st Qu.:-2.1621   1st Qu.:-1.8910  
##  Median :-0.6504   Median :-1.3545   Median :-1.0764  
##  Mean   :-0.7798   Mean   :-0.7031   Mean   :-0.9905  
##  3rd Qu.: 1.0995   3rd Qu.: 0.0631   3rd Qu.:-0.1803  
##  Max.   :25.5345   Max.   :15.7538   Max.   : 6.7481  
##                                                       
##                          TextType            Register               Series    
##  Informational interaction   :1496   Conversation:1780   Info Teens    :1414  
##  Imaginative narrative       :1055   Fiction     :1476   Spoken BNC2014:1251  
##  General narrative exposition: 914   Informative :1777   Youth Fiction :1191  
##  Involved persuasion         : 716                       Solutions     : 202  
##  Learned exposition          : 655                       Access        : 194  
##  Scientific exposition       : 183                       NGL           : 194  
##  (Other)                     :  14                       (Other)       : 587  
##            Country                      Corpus.y     Dim1nopunct     
##  France        : 257   Spoken BNC2014       :1251   Min.   :-33.259  
##  Germany       : 519   Textbook Conversation: 529   1st Qu.: -8.153  
##  Info Teens    :1414   NA's                 :3253   Median :  5.111  
##  Spain         : 401                                Mean   :  6.638  
##  Spoken BNC2014:1251                                3rd Qu.: 23.699  
##  Youth Fiction :1191                                Max.   : 51.960  
##                                                                      
##        Corpus                Source    
##  Textbook :1177   Spoken.BNC2014:1251  
##  Reference:3856   Solutions     : 202  
##                   Access        : 194  
##                   NGL           : 194  
##                   GreenLine     : 131  
##                   Achievers     : 106  
##                   (Other)       :2955
dimensions_ref <- dimensions_ref %>% 
  unite("Subcorpus", c(Corpus, Register), remove = FALSE) %>% 
  mutate_if(is.character, as.factor)

dimensions_ref$Subcorpus <- fct_relevel(dimensions_ref$Subcorpus, "Reference_Conversation", "Textbook_Conversation", "Reference_Fiction", "Textbook_Fiction")

ggplot(dimensions_ref,aes(x=Subcorpus,y=Dim1, fill = Subcorpus, colour = Subcorpus))+ # Or leave out "colour = Register" to keep the dots in black
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .25)+
# note that here we need to set the x-variable to a numeric variable and bump it to get the boxplots to line up with the rainclouds. 
  geom_boxplot(aes(x = as.numeric(Subcorpus)+0.25, y = Dim1), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Dimension 1 (Biber 1988)')+ 
  theme_cowplot()+
  theme(axis.title.x=element_blank())+
  guides(fill = "none", colour = "none") +
  scale_colour_manual(values = colours3Reg)+
  scale_fill_manual(values = colours3Reg) +
  annotate(geom = "text", x = 1.5, y = -42, label = "Conversation", size = 5) +
  annotate(geom = "segment", x = 0.7, xend = 2.5, y = -39, yend = -39) +
  annotate(geom = "text", x = 3.5, y = -42, label = "Fiction", size = 5) +
  annotate(geom = "segment", x = 2.7, xend = 4.5, y = -39, yend = -39) +
  annotate(geom = "text", x = 5.7, y = -42, label = "Informative", size = 5) +
  annotate(geom = "segment", x = 4.7, xend = 6.5, y = -39, yend = -39) +
  scale_x_discrete(labels=rep(c("Reference", "Textbook"), 3))+
  scale_y_continuous(sec.axis = dup_axis(name=NULL), breaks = seq(from = -45, to = 45, by = 5))

#ggsave(here("plots", "Dim1_3RegComparison.svg"), width = 13, height = 8)
#ggsave(here("plots", "Dim1_3RegComparison.png"), width = 20, height = 15, units = "cm", dpi = 300)
# Simple comparison rainplot Dim1 no punctuation-reliant features

# Colours used in Register Studies paper
bicolour <- c(classic[2], london[6])

# Colours used in PhD thesis:
bicolour <- c("#BD241E", "#F9B921")

SpokenRef <- dimensions_ref %>% 
  filter(Register=="Conversation")

SpokenRef$Corpus <- relevel(SpokenRef$Corpus, "Reference")

ggplot(SpokenRef, aes(x=Corpus,y=Dim1nopunct, fill = Corpus))+
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .5, aes(x=Corpus,y=Dim1nopunct, fill = Corpus, colour = Corpus))+
# note that here we need to set the x-variable to a numeric variable and bump it to get the boxplots to line up with the rainclouds. 
  geom_boxplot(aes(x = as.numeric(Corpus)+0.25, y = Dim1nopunct), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  theme_cowplot()+ 
  guides(fill = "none", colour = "none") +
  ylab('Adjusted Biber (1988) Dimension 1 \n(excluding punctuation-dependent variables)') + 
  xlab('')+ 
  scale_x_discrete(labels=c("Spoken BNC2014", "Textbook Conversation"))+
  scale_colour_manual(values = bicolour)+
  scale_fill_manual(values = bicolour)+
  scale_y_continuous(sec.axis = dup_axis(name=NULL), breaks = seq(from = -10, to = 50, by = 5))

#ggsave(here("plots", "SpokenDim1-nopunct.svg"), width = 8, height = 6)
#ggsave(here("plots", "SpokenDim1-nopunct.png"), width = 20, height = 15, units = "cm", dpi = 300)

Testing Dim1

Comparing three textbook registers vs. three reference corpora

# Mixed effect model

# Check  distribution of the outcome variable. 

ggplot(dimensions_ref, aes(x = Dim1nopunct)) +
  geom_histogram(bins = 20) +
  facet_grid(rows = vars(Register), cols = vars(Corpus), scales = "free_y")

md0 <- lmer(Dim1nopunct ~ 1 + (Register|Source), dimensions_ref, REML = FALSE)
md_corpus <- update(md0, .~. + Corpus)
md_register <- update(md0, . ~ . + Register)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
## Model failed to converge with max|grad| = 0.00300994 (tol = 0.002, component 1)
md_both <- update(md_corpus, .~. + Register)
md_interaction <- update(md_both, . ~ . + Corpus:Register)

anova(md0, md_corpus, md_both, md_interaction)
## Data: dimensions_ref
## Models:
## md0: Dim1nopunct ~ 1 + (Register | Source)
## md_corpus: Dim1nopunct ~ (Register | Source) + Corpus
## md_both: Dim1nopunct ~ (Register | Source) + Corpus + Register
## md_interaction: Dim1nopunct ~ (Register | Source) + Corpus + Register + Corpus:Register
##                npar   AIC   BIC logLik deviance   Chisq Df           Pr(>Chisq)
## md0               8 32835 32887 -16409    32819                                
## md_corpus         9 32834 32893 -16408    32816  2.4653  1               0.1164
## md_both          11 32773 32844 -16375    32751 65.7910  2 0.000000000000005172
## md_interaction   13 32754 32838 -16364    32728 23.0039  2 0.000010110273397824
##                   
## md0               
## md_corpus         
## md_both        ***
## md_interaction ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(md0, md_register)
## Data: dimensions_ref
## Models:
## md0: Dim1nopunct ~ 1 + (Register | Source)
## md_register: Dim1nopunct ~ (Register | Source) + Register
##             npar   AIC   BIC logLik deviance  Chisq Df           Pr(>Chisq)    
## md0            8 32835 32887 -16409    32819                                   
## md_register   10 32771 32837 -16376    32751 67.455  2 0.000000000000002251 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
md_final1 <- lmer(Dim1nopunct ~ 1 + Corpus + Register + Corpus:Register + (Register|Source), dimensions_ref)

tab_model(md_final1)
  Dim 1 nopunct
Predictors Estimates CI p
(Intercept) 14.65 12.29 – 17.02 <0.001
Corpus [Reference] 16.01 8.72 – 23.30 <0.001
Register [Fiction] -10.75 -12.56 – -8.93 <0.001
Register [Informative] -20.72 -22.70 – -18.74 <0.001
Corpus [Reference] *
Register [Fiction]
-15.48 -22.64 – -8.33 <0.001
Corpus [Reference] *
Register [Informative]
-22.15 -29.71 – -14.59 <0.001
Random Effects
σ2 35.32
τ00 Source 12.34
τ11 Source.RegisterFiction 4.87
τ11 Source.RegisterInformative 7.32
ρ01 0.40
0.12
ICC 0.35
N Source 325
Observations 5033
Marginal R2 / Conditional R2 0.829 / 0.889
# The reference levels are `CorpusTextbook` and `RegisterConversation`. The estimate for `CorpusReference` is positive, since `Dim1nopunct` values are higher for `Reference` texts in the `Conversation` register. The estimates for `RegisterFiction` and `RegisterInformative` are negative, since `Dim1` values are generally lower in these two registers.

ranef(md_final1)
## $Source
##                          (Intercept)       RegisterFiction
## Access          -0.76244356309470196  1.658131412388347048
## Achievers       -0.27292168586377225 -1.746777523614002181
## BBC             -1.48451072245553073  0.013613910897331827
## Book1            1.56858377181185560  0.808150163526446752
## Book10          -1.17679073167432491 -0.606294441731024314
## Book100         -4.08057225803153933 -2.102351941203952634
## Book101         -0.04599447611808670 -0.023696817514062628
## Book102         -1.47092730944075067 -0.757836570173723967
## Book103          2.19972141274745159  1.133318635173096389
## Book104          2.29814210269453323  1.184025966272949315
## Book105          1.29592733002658322  0.667674817564663847
## Book106         -3.09785005023388571 -1.596043558314470756
## Book107          4.52201865598057129  2.329789573227002197
## Book108         -0.63054392914807389 -0.324862585351766708
## Book109         -3.49936336126617986 -1.802907261611608858
## Book11          -3.37502043363838800 -1.738844532478764915
## Book110         -1.49417949677374717 -0.769816331365440920
## Book111         -0.48989333975532773 -0.252397984569531553
## Book112         -2.84457841343940521 -1.465555459195834187
## Book113         -1.10070028342448234 -0.567091876142269302
## Book114         -3.68352499533869393 -1.897789191009034315
## Book115          4.66096903394114559  2.401378207948874799
## Book116         -0.37975076958218851 -0.195651422673235820
## Book117         -3.63227918597451982 -1.871386833696702112
## Book118          3.20314549072983690  1.650292830163751612
## Book119          1.63438913822902987  0.842053751327516586
## Book12          -2.30167216717778222 -1.185844691061936462
## Book120         -0.51048745006055729 -0.263008277695048087
## Book121          2.53380098585006452  1.305439797259239976
## Book122         -6.01759201207765315 -3.100324034959673902
## Book123         -0.59616852758626504 -0.307152032117256113
## Book124         -0.62649694700669833 -0.322777539377101075
## Book125          1.38709218808705370  0.714643870970294470
## Book126         -1.98982704921284870 -1.025178944286307070
## Book127         -1.44682501639166605 -0.745418825951825625
## Book128          1.58625639205053015  0.817255275534157555
## Book129          2.61045418013731867  1.344932295276424661
## Book13          -4.24757612462301193 -2.188394015921805824
## Book130         -0.24074052502189336 -0.124031944075998379
## Book131          0.28764208414656556  0.148196099894380873
## Book132         -1.38522228527515323 -0.713680478201370372
## Book133         -1.46180363964273674 -0.753135963568117073
## Book134          3.28645585090645653  1.693215167121510323
## Book135          1.26460512505072198  0.651537301973762251
## Book136          0.73354049221460527  0.377927452387036178
## Book137         -0.18111339169628918 -0.093311444212583597
## Book138         -1.41726288944770662 -0.730188120296650811
## Book139          0.59782291063915793  0.308004386934866703
## Book14          -2.45283533148215094 -1.263725476358243505
## Book140         -0.14506172534219311 -0.074737262467856447
## Book141          0.59581139288841412  0.306968032722607143
## Book142          0.85556059577308585  0.440793439155723221
## Book143          1.40360339629107189  0.723150611795926990
## Book144          2.95272350408224460  1.521272899512483123
## Book145          0.99684577112291228  0.513584985016825701
## Book146         -2.26049591988726961 -1.164630273585976150
## Book147          1.46440391497127642  0.754475651616493215
## Book148         -0.09125362550981052 -0.047014787289907572
## Book149          0.65692321788718644  0.338453460695070651
## Book15          -3.07307725126788700 -1.583280362688485710
## Book150          0.76468309739129081  0.393972436351844202
## Book151          1.35201036064849545  0.696569360006478289
## Book152          1.67603234499739395  0.863508751031322741
## Book153          0.75421841575944781  0.388580926938064342
## Book154          1.05227026914785649  0.542140244829626861
## Book155          3.63999206891953175  1.875360588701238118
## Book156          1.83593603286153928  0.945892742130901798
## Book157          1.26110891562681160  0.649736019652453312
## Book158          3.06696094967654043  1.580129182483735573
## Book159         -4.75286219961775647 -2.448722492776416182
## Book16           2.78989832615154265  1.437383727295098224
## Book160          0.87577155984007793  0.451206331478904654
## Book161          0.29567618182959371  0.152335347968346912
## Book162          0.62681031822576283  0.322938991386538865
## Book163          2.68561070943145941  1.383653696409487877
## Book164         -2.73780034617078316 -1.410542323095044681
## Book165         -0.55178343055051871 -0.284284382921738410
## Book166          0.08469431108050204  0.043635362407457495
## Book167          5.73246143581028988  2.953421889229392416
## Book168          0.70593001642166486  0.363702257068756363
## Book169         -0.41604190233518162 -0.214348979919422644
## Book17          -3.77282201548776230 -1.943795915503280458
## Book170         -1.17590470599840224 -0.605837952375624100
## Book171         -0.64879126874410253 -0.334263798562980441
## Book172          1.65780895204125467  0.854119875370255466
## Book173         -0.81128119371634722 -0.417980245078321766
## Book174         -4.08032081831269622 -2.102222396927420078
## Book175         -1.27564246113942348 -0.657223848733504479
## Book176         -2.60991331583930153 -1.344653636540600550
## Book177         -6.94332121693758086 -3.577269048501796611
## Book178          1.49857577009402254  0.772081335674763336
## Book179          0.46438025985324111  0.239253388746562268
## Book18          -2.23296925733394325 -1.150448259693206854
## Book180          2.93084824854291126  1.510002547454158517
## Book181          1.33013510510916233  0.685299007948153127
## Book182         -0.25976613041434049 -0.133834127666955405
## Book183          2.20909652226430886  1.138148786055235284
## Book184         -5.72056986420450642 -2.947295231724387676
## Book185          7.98139814774100476  4.112096742411181616
## Book186          1.06870963743220448  0.550609973004821174
## Book187          1.44030162192219180  0.742057907394594762
## Book188         -1.58420688943945431 -0.816199351139138773
## Book189          1.05136029683204391  0.541671417924080467
## Book19           0.83010531757022743  0.427678623350578713
## Book190         -3.73334597962942549 -1.923457464087682478
## Book191          2.84535874413632017  1.465957493433118319
## Book192          2.18637116100888784  1.126440450966728957
## Book193         -0.62377900337920567 -0.321377227435535928
## Book194         -2.64037344177912692 -1.360347000326248335
## Book195          2.43573949550132962  1.254917529411576194
## Book196         -4.62657959415889319 -2.383660422081750774
## Book197         -1.92393786955606116 -0.991232175059726606
## Book198         -0.63855408019121296 -0.328989495875586846
## Book199         -0.39101766365034002 -0.201456240016905430
## Book2            3.17009912768191393  1.633267010962340837
## Book20          -0.24167444397759577 -0.124513108531690161
## Book200          0.08643044247251248  0.044529834793039083
## Book201         -4.24733665822411410 -2.188270640420346247
## Book202          1.99774347859692458  1.029257568467083939
## Book203         -1.06164331376421717 -0.546969331854225360
## Book204          4.48815810717639341  2.312344277320629526
## Book205          1.94429457836288933  1.001720156541324069
## Book206         -2.27589360933641194 -1.172563318329821858
## Book207          2.45384315525801844  1.264244717321913791
## Book208          0.06426782725450225  0.033111432132962540
## Book209          2.19466867173070401  1.130715412092301086
## Book21           4.38110465354904033  2.257189259393161507
## Book210          0.00635287868101807  0.003273067104983272
## Book211         -2.95754668711954283 -1.523757852009351765
## Book212          3.55658592218335556  1.832388901542895354
## Book213          1.24174805727590742  0.639761110359452712
## Book214          1.10648546185836594  0.570072458360056600
## Book215          2.03633348877933962  1.049139530527281483
## Book216          2.63017423808656847  1.355092267821614627
## Book217         -4.01748483524185929 -2.069848665344448335
## Book218          0.22059149245512288  0.113650959485721653
## Book219          1.15659380582777516  0.595888782040456144
## Book22          -2.08388945069998721 -1.073640841259597467
## Book220          2.60596418515798067  1.342619004624059365
## Book221          0.97008540104605956  0.499797772728727607
## Book222         -0.68560922757467213 -0.353232781912377947
## Book223         -0.70665832403780726 -0.364077488490667456
## Book224         -0.47389698430894078 -0.244156501072037208
## Book225          1.87979430381970958  0.968488965223209153
## Book226          3.11503382925531591  1.604896814401730154
## Book227          1.79508306520953909  0.924844881581911915
## Book228          0.10853319109079904  0.055917393577750441
## Book229         -1.82478680709234053 -0.940148548680421969
## Book23           3.41344488224207021  1.758641195545481040
## Book230          4.95824262153313455  2.554536555460693581
## Book231         -0.49243168358364714 -0.253705764885002016
## Book232          3.67884549214073564  1.895378263813041197
## Book233         -2.57140711889650087 -1.324814855905913413
## Book234         -1.65866896617679060 -0.854562963317969215
## Book235          2.83205638567753581  1.459103984327043246
## Book236          0.54673275443426717  0.281682223698483281
## Book237          0.30566193066364089  0.157480106379208007
## Book238         -2.24440377788132306 -1.156339439887897891
## Book239          4.23253087914970294  2.180642553865363098
## Book24          -1.48733075776526458 -0.766287792023699454
## Book240         -5.40486933721731511 -2.784643139375260645
## Book241         -4.09511984176459443 -2.109847002917616621
## Book242         -1.33845449757037183 -0.689585242766330375
## Book243         -1.26032858492989597 -0.649333985415169845
## Book244         -1.75550917789114602 -0.904456016108189598
## Book245         -1.89159793238488483 -0.974570313587621584
## Book246          0.28340352888607151  0.146012353518547799
## Book247         -3.22154641858465318 -1.659773173593373619
## Book248         -1.74557132233687851 -0.899335932797620474
## Book249         -0.90485268908574445 -0.466189222273620141
## Book25           2.60978367422040414  1.344586843872338289
## Book250          0.27216058145780925  0.140219873725024424
## Book251          0.36690546218180736  0.189033390877474172
## Book252         -1.81124498223465813 -0.933171664072887541
## Book253          3.91266048402475208  2.015842103438093780
## Book254          0.51378217794590186  0.264705754697656226
## Book255         -7.43699317158577244 -3.831613813535621027
## Book256        -10.10934239672800672 -5.208435059623019114
## Book257          2.09392515771430920  1.078811338628290928
## Book258         -1.05232807084708480 -0.542170024847451026
## Book259         -0.68072411303715197 -0.350715921682604348
## Book26           3.70843156572458321  1.910621307018362192
## Book260          1.80936723590380510  0.932204230243970478
## Book261          3.59500830588654052  1.852184500752071861
## Book262         -3.19121562510544177 -1.644146443194526075
## Book263         -2.92794864021574819 -1.508508640028957792
## Book264         -0.49049200575257301 -0.252706423323180385
## Book265         -3.54501763021608518 -1.826428800964861709
## Book266         -0.56691770696087274 -0.292081714613978582
## Book267         -0.04490885961860926 -0.023137496955386708
## Book268         -0.21002895936322416 -0.108209036013817733
## Book269          3.51181767890937202  1.809323851545042938
## Book27          -4.10248343353070677 -2.113640799587496844
## Book270          1.81931706477801747  0.937330482329613024
## Book271          2.45470523429405274  1.264688869127167825
## Book272          4.26429294416658866  2.197006689781219713
## Book273         -0.60208334763904625 -0.310199407003305394
## Book274          0.00046200526812710  0.000238029769079616
## Book275          3.42313129807749394  1.763631734579518273
## Book276         -1.54846652940392637 -0.797785557546308977
## Book277          3.68103660969065194  1.896507149651396329
## Book278          0.47249817077588363  0.243435818246039548
## Book279         -5.54641792560592783 -2.857570398287969216
## Book28           2.75843244133634480  1.421172186403320215
## Book280          2.46866612534980678  1.271881660862256513
## Book281         -0.64686356423297353 -0.333270625776231344
## Book282          0.42159958769011180  0.217212355410823510
## Book283          1.95449584695594480  1.006975952903498506
## Book284          1.34990305633819263  0.695483655593635230
## Book285          2.43953503792386384  1.256873031109709160
## Book286          2.37997974451792782  1.226189543896732737
## Book287          4.09677422481748810  2.110699357735227544
## Book288          3.82110050640609833  1.968669480455054632
## Book289          4.22687631933877483  2.177729267678172320
## Book29          -2.17702990655136830 -1.121627742552268714
## Book290         -2.31928492081673054 -1.194918959194282593
## Book291          2.33474454176609392  1.202883911671033257
## Book292         -0.05266361532739638 -0.027132825229709483
## Book293         -0.79047156365211035 -0.407258914001491501
## Book294          1.28827637858179078  0.663732970293033131
## Book295         -1.47971572628030801 -0.762364451077287342
## Book296         -5.94995472770890999 -3.065476624572439857
## Book297          1.40953018966379817  0.726204155457049749
## Book298         -0.30884476886848716 -0.159119936691079156
## Book299         -0.06567861410750322 -0.033838283734033373
## Book3           -5.81541053148806419 -2.996158099077422143
## Book30           3.34168877581228063  1.721671726533143598
## Book300         -4.34866686491780730 -2.240476983862931704
## Book31          -0.44887274562409912 -0.231263761169519605
## Book32           3.06300975409472187  1.578093486709654325
## Book33           2.04807931564528634  1.055191098873870192
## Book34           3.60459893516240593  1.857125689585524153
## Book35          -0.19795985285876405 -0.101990910740259094
## Book36           5.39916012850409199  2.781701697522993122
## Book37           3.53091512422149023  1.819163047786437115
## Book38          -5.39942147664238625 -2.781836346717057040
## Book39          -1.98854590397874453 -1.024518885353498776
## Book4            0.22772759114228366  0.117327549429215056
## Book40           0.08268279332975945  0.042599008195197699
## Book41          -1.38421652639978121 -0.713162301095240148
## Book42           1.25485884261557290  0.646515919064361011
## Book43           1.31409085638299583  0.677032849350367116
## Book44           5.39611890523808668  2.780134828654456491
## Book45          -1.87363795246753395 -0.965317150978159177
## Book46           0.24532837146128728  0.126395648786487680
## Book47           1.12017096655538761  0.577123368268466663
## Book48          -6.09270064809201273 -3.139020760992445869
## Book49           3.13083861158258481  1.613039597498056699
## Book5            0.83788797553441297  0.431688327148012252
## Book50           0.37163492356004224  0.191470057031299212
## Book51           0.53980020218617009  0.278110502931230630
## Book52          -3.19821041801204231 -1.647750230976146035
## Book53          -0.52091621173256553 -0.268381280783609011
## Book54           1.73547987852382435  0.894136719268643354
## Book55           1.77398607546662412  0.913975499903330491
## Book56          -0.50242940573763872 -0.258856692070936034
## Book57           1.36404354719312071  0.702768978954817825
## Book58           0.09884677525537422  0.050926854543713970
## Book59          -0.58235131636984960 -0.300033265683043004
## Book6           -4.69804834091000334 -2.420481840492337611
## Book60          -2.02068229471085736 -1.041075877649363157
## Book61          -0.36078503078946594 -0.185880082957644188
## Book62          -0.45899020097753984 -0.236476376106183162
## Book63           0.04295531775257873  0.022131012503067420
## Book64          -1.13906280052794351 -0.586856631476080581
## Book65          -1.64797679146599441 -0.849054247177802868
## Book66           0.75618204023041213  0.389592606050031875
## Book67           1.10928721872547342  0.571515951727132432
## Book68           2.05408992225762610  1.058287823960503138
## Book69          -0.26685433582172147 -0.137486042510156281
## Book7            0.61402281252460822  0.316350739608601828
## Book70          -2.76112437342344919 -1.422559096937199730
## Book71          -0.02307754174354709 -0.011889782024388940
## Book72          -5.07019109811745583 -2.612213538535468338
## Book73           1.16200574644287036  0.598677068373440591
## Book74           0.82553150935127562  0.425322151272702398
## Book75          -1.64467215516120224 -0.847351665257661812
## Book76          -8.64954325572579208 -4.456331833950856414
## Book77          -4.08767243675886505 -2.106010024822226878
## Book78           4.13498108876166270  2.130383918993091541
## Book79           0.00270101609782318  0.001391590707726020
## Book8            0.50532901406480146  0.260350599496136648
## Book80           6.20870023661870718  3.198784917756966273
## Book81          -2.84647019799070033 -1.466530125657364181
## Book82           0.53647161924148801  0.276395583460943783
## Book83          -3.35128931350759496 -1.726618020284128807
## Book84           1.62348144375922487  0.836433997236036841
## Book85           6.74406329131504290  3.474609357594888870
## Book86          -1.31899785265990843 -0.679560983272746388
## Book87          -0.79055537689172461 -0.407302095427002353
## Book88          -5.22252764777642486 -2.690698863788927309
## Book89          -2.96286284117507748 -1.526496788141752603
## Book9           -4.39101649756292023 -2.262295941296043722
## Book90           1.26570667048565277  0.652104829280475862
## Book91           1.81814367942341693  0.936725942372461540
## Book92           1.97905312616293538  1.019628110578169933
## Book93           3.40669192979314595  1.755162006404324293
## Book94           2.11147804475353507  1.087854762885271720
## Book95           0.71822661600507742  0.370037589068701989
## Book96           0.30427302555003211  0.156764528470743181
## Book97          -6.60639199368808061 -3.403679717948284278
## Book98          -0.49578421316821925 -0.255433021905434932
## Book99           2.02151051868755216  1.041502586986938983
## Dogo            -1.05471503592226146  0.009672410110716123
## Ducksters       -2.71129389744770544  0.024864295674814407
## EIM              4.37363336853911466  0.428912400655695358
## Encyclopedia    -0.79747517382869559  0.007313356377533303
## Factmonster     -5.67022796916759919  0.051999609817532377
## GreenLine        1.97893168765736860  0.517597701261653720
## History         -2.33791653145736555  0.021440186899843505
## HT              -2.82718577669806903  2.200907310089581070
## JTT             -1.64596453709429569  0.374906344498937172
## NGL              2.76437273720136201  0.043865486802689646
## POC             -3.60461805048577988 -2.008145598959947709
## Quatr            0.64382234671657967 -0.005904261874602246
## Revision         0.28611999609619287 -0.002623902995848873
## Science          0.18638034631938261 -0.001709226742943916
## Science_Tech    -0.56077784461206359  0.005142690783267873
## Solutions       -0.00380418017697378 -1.469397533125226696
## Spoken.BNC2014  -0.00000000003062265 -0.000000000007615864
## Teen             4.39394607474602505 -0.040295290186541877
## TeenVogue        5.35639709949097309 -0.049121580421598976
## TweenTribute     3.12461431627395703 -0.028654707739824814
## WhyFiles         1.28622698795597912 -0.011795522485306520
## World           -0.66058999269444907  0.006058031891810894
##                  RegisterInformative
## Access         -0.605981988140108729
## Achievers       3.439032234309786329
## BBC            -0.930788272414960094
## Book1          -0.209724710676426701
## Book10          0.157340717252238471
## Book100         0.545585675173342333
## Book101         0.006149609839095708
## Book102         0.196667726609324522
## Book103        -0.294109849373435484
## Book104        -0.307269013132909996
## Book105        -0.173269664796772860
## Book106         0.414192545645043875
## Book107        -0.604608482722901242
## Book108         0.084305757515652460
## Book109         0.467876170646286171
## Book11          0.451251120081548829
## Book110         0.199776619069287897
## Book111         0.065500319963031545
## Book112         0.380329310729695946
## Book113         0.147167178846951463
## Book114         0.492499175242937570
## Book115        -0.623186596522011693
## Book116         0.050773903001546467
## Book117         0.485647445207590678
## Book118        -0.428270885731433959
## Book119        -0.218523100460133485
## Book12          0.307740994142610080
## Book120         0.068253818949198561
## Book121        -0.338777366066483565
## Book122         0.804571465280427223
## Book123         0.079709655428857967
## Book124         0.083764662947440144
## Book125        -0.185458700425075007
## Book126         0.266046295831720903
## Book127         0.193445172272606436
## Book128        -0.212087597015718665
## Book129        -0.349026145432438373
## Book13          0.567914630905355544
## Book130         0.032187784844917036
## Book131        -0.038458674608319407
## Book132         0.185208688386658188
## Book133         0.195447862523592059
## Book134        -0.439409749653382586
## Book135        -0.169081784943393654
## Book136        -0.098076730273353632
## Book137         0.024215444757060091
## Book138         0.189492620530253425
## Book139        -0.079930851780210116
## Book14          0.327951996875379348
## Book140         0.019395220659763839
## Book141        -0.079661905367608032
## Book142        -0.114391211766395981
## Book143        -0.187666302228519877
## Book144        -0.394788658233938883
## Book145        -0.133281495508706549
## Book146         0.302235597041778825
## Book147        -0.195795527723727963
## Book148         0.012200904122649703
## Book149        -0.087832753521909307
## Book15          0.410880342504125029
## Book150        -0.102240597054180607
## Book151        -0.180768146919569050
## Book152        -0.224090931549604189
## Book153        -0.100841435360046805
## Book154        -0.140691929698805257
## Book155        -0.486678682539757601
## Book156        -0.245470570479991435
## Book157        -0.168614330464346152
## Book158        -0.410062573249649565
## Book159         0.635473009228175290
## Book16         -0.373018406656677071
## Book160        -0.117093482864448539
## Book161        -0.039532859387225353
## Book162        -0.083806561690390913
## Book163        -0.359074815860445984
## Book164         0.366052738660718635
## Book165         0.073775224765065872
## Book166        -0.011323902622542011
## Book167        -0.766448587377895563
## Book168        -0.094385120586085114
## Book169         0.055626144528914873
## Book17          0.504438474916679480
## Book170         0.157222252760973125
## Book171         0.086745485687117097
## Book172        -0.221654405121147396
## Book173         0.108470912862278362
## Book174         0.545552056871767332
## Book175         0.170557512385841992
## Book176         0.348953830130919851
## Book177         0.928344446451658034
## Book178        -0.200364414994961437
## Book179        -0.062089138872747876
## Book18          0.298555193455035395
## Book180        -0.391863865996888217
## Book181        -0.177843354682517829
## Book182         0.034731569664114600
## Book183        -0.295363331760742809
## Book184         0.764858645890977518
## Book185        -1.067138681024891511
## Book186        -0.142889926273228440
## Book187        -0.192572973387009849
## Book188         0.211813571904748615
## Book189        -0.140570263464532524
## Book19         -0.110987758949772752
## Book190         0.499160401569357481
## Book191        -0.380433643461286830
## Book192        -0.292324877646936876
## Book193         0.083401265116126444
## Book194         0.353026447236041929
## Book195        -0.325666228452116679
## Book196         0.618588617479856495
## Book197         0.257236699947488878
## Book198         0.085376740551551131
## Book199         0.052280323086420805
## Book2          -0.423852480381536556
## Book20          0.032312652822196440
## Book200        -0.011556028990562173
## Book201         0.567882613475284015
## Book202        -0.267104747979448776
## Book203         0.141945136002254835
## Book204        -0.600081218110760872
## Book205        -0.259958457587441738
## Book206         0.304294317795389957
## Book207        -0.328086746165538234
## Book208        -0.008592815837424776
## Book209        -0.293434281598922264
## Book21         -0.585767825997200564
## Book210        -0.000849400374580936
## Book211         0.395433533366026657
## Book212        -0.475527011645779429
## Book213        -0.166025721243047875
## Book214        -0.147940675867041016
## Book215        -0.272264356835504873
## Book216        -0.351662780798844943
## Book217         0.537150683220949388
## Book218        -0.029493794188239362
## Book219        -0.154640323109546840
## Book22          0.278622742363889953
## Book220        -0.348425818618594563
## Book221        -0.129703547698193034
## Book222         0.091668165560642806
## Book223         0.094482497663946258
## Book224         0.063361555634241062
## Book225        -0.251334562797626337
## Book226        -0.416490072336546613
## Book227        -0.240008396909757199
## Book228        -0.014511237786181132
## Book229         0.243979883026295724
## Book23         -0.456388592820412498
## Book230        -0.662933034213037065
## Book231         0.065839704721791431
## Book232        -0.491873510568892280
## Book233         0.343805427375388384
## Book234         0.221769391785547887
## Book235        -0.378655075220803272
## Book236        -0.073099933074410275
## Book237        -0.040867986221215846
## Book238         0.300084025740959714
## Book239        -0.565903033048327231
## Book24          0.198860920569236793
## Book240         0.722648466955933211
## Book241         0.547530734050198697
## Book242         0.178955684293652301
## Book243         0.168509997732755934
## Book244         0.234717240506548963
## Book245         0.252912746016303980
## Book246        -0.037891966096049862
## Book247         0.430731149148587511
## Book248         0.233388517158572811
## Book249         0.120981723662800605
## Book25         -0.348936496628238002
## Book250        -0.036388747754183104
## Book251        -0.049056443962056440
## Book252         0.242169297355740276
## Book253        -0.523135329290913775
## Book254        -0.068694334696541917
## Book255         0.994349979415999452
## Book256         1.351651692044295583
## Book257        -0.279964548767753063
## Book258         0.140699657972465253
## Book259         0.091015009987180179
## Book26         -0.495829264054253427
## Book260        -0.241918236613534704
## Book261        -0.480664208300786433
## Book262         0.426675824210687671
## Book263         0.391476179009162872
## Book264         0.065580363538210826
## Book265         0.473980293689458376
## Book266         0.075798726345598255
## Book267         0.006004459410824003
## Book268         0.028081549438219389
## Book269        -0.469541353093873126
## Book27          0.548515270024904633
## Book270        -0.243248560833014715
## Book271        -0.328202008913795806
## Book272        -0.570149723608219583
## Book273         0.080500485951628939
## Book274        -0.000061771594816720
## Book275        -0.457683697866814065
## Book276         0.207034970466545371
## Book277        -0.492166470054049343
## Book278        -0.063174529752179298
## Book279         0.741573969871323735
## Book28         -0.368811316345253604
## Book280        -0.330068625086976652
## Book281         0.086487745375039629
## Book282        -0.056369224990436444
## Book283        -0.261322400108496777
## Book284        -0.180486393534938394
## Book285        -0.326173704718753177
## Book286        -0.318210969859918591
## Book287        -0.547751930401550791
## Book288        -0.510893464902993699
## Book289        -0.565147000159513579
## Book29          0.291075921790283076
## Book290         0.310095876124384717
## Book291        -0.312162877319371090
## Book292         0.007041295266592798
## Book293         0.105688598189046412
## Book294        -0.172246707905982066
## Book295         0.197842766292956190
## Book296         0.795528142156672002
## Book297        -0.188458733622794666
## Book298         0.041293541957312441
## Book299         0.008781442590990646
## Book3           0.777539149070879843
## Book30         -0.446794569899424177
## Book300         0.581430789010129123
## Book31          0.060015734191746689
## Book32         -0.409534285653467167
## Book33         -0.273834811780523046
## Book34         -0.481946506375158179
## Book35          0.026467870962605122
## Book36         -0.721885127332582366
## Book37         -0.472094743142091156
## Book38          0.721920070421801952
## Book39          0.265875002580837183
## Book4          -0.030447913604376764
## Book40         -0.011054956209939388
## Book41          0.185074215180356882
## Book42         -0.167778675539475064
## Book43         -0.175698186867713102
## Book44         -0.721478505970671202
## Book45          0.250511438760925353
## Book46         -0.032801194714647451
## Book47         -0.149770471995639143
## Book48          0.814613732222421172
## Book49         -0.418603222721279478
## Book5          -0.112028325427103323
## Book50         -0.049688788205973007
## Book51         -0.072173028473833847
## Book52          0.427611050588099006
## Book53          0.069648178028821672
## Book54         -0.232039258564907730
## Book55         -0.237187661320439419
## Book56          0.067176432427285604
## Book57         -0.182377022780672388
## Book58         -0.013216132739780546
## Book59          0.077862249713720064
## Book6           0.628144219484759514
## Book60          0.270171741696461187
## Book61          0.048238122539867201
## Book62          0.061368470612276516
## Book63         -0.005743264561042511
## Book64          0.152296371144440001
## Book65          0.220339813532846068
## Book66         -0.101103978286634436
## Book67         -0.148315279798879540
## Book68         -0.274638449275322660
## Book69          0.035679285594237178
## Book7          -0.082096830924561742
## Book70          0.369171236349703613
## Book71          0.003085541781232836
## Book72          0.677900906687706861
## Book73         -0.155363917029167409
## Book74         -0.110376226035403036
## Book75          0.219897972997856295
## Book76          1.156471837455626428
## Book77          0.546534991974968909
## Book78         -0.552860311369494428
## Book79         -0.000361134565987433
## Book8          -0.067564119415011156
## Book80         -0.830123251433016685
## Book81          0.380582248427262237
## Book82         -0.071727986195837062
## Book83          0.448078192761441896
## Book84         -0.217064706520367412
## Book85         -0.901703018972842552
## Book86          0.176354268100325673
## Book87          0.105699804289571514
## Book88          0.698268794827827444
## Book89          0.396144320313618903
## Book9           0.587093071518311804
## Book90         -0.169229065121723449
## Book91         -0.243091675425663456
## Book92         -0.264605787562351091
## Book93         -0.455485701292391076
## Book94         -0.282311426392008735
## Book95         -0.096029215620268074
## Book96         -0.040682285126800215
## Book97          0.883295922340756712
## Book98          0.066287948742795352
## Book99         -0.270282477914066344
## Dogo           -0.661306362646309265
## Ducksters      -1.699981363987139726
## EIM             1.367131560834593529
## Encyclopedia   -0.500016960547408296
## Factmonster    -3.555233125488755697
## GreenLine       0.964283132993086434
## History        -1.465873743077808822
## HT             -4.329443744225784485
## JTT            -3.052325585958935328
## NGL            -0.852107547059569703
## POC             0.579985832516267785
## Quatr           0.403676632830194004
## Revision        0.179397247079479738
## Science         0.116860483347946104
## Science_Tech   -0.351607727246369628
## Solutions       2.489426104726500721
## Spoken.BNC2014 -0.000000000002809848
## Teen            2.755004335184580544
## TeenVogue       3.358461159749563052
## TweenTribute    1.959133280354183659
## WhyFiles        0.806464364279367407
## World          -0.414189947417665905
## 
## with conditional variances for "Source"
# check distribution of residuals
plot(md_final1)

# This function can be used to estimate mean and sd of all the terms of the model
library(merTools)
## Loading required package: arm
## Loading required package: MASS
## 
## Attaching package: 'MASS'
## The following object is masked _by_ '.GlobalEnv':
## 
##     select
## The following object is masked from 'package:dplyr':
## 
##     select
## 
## arm (Version 1.11-2, built: 2020-7-27)
## Working directory is /Users/Elen/Documents/PhD/GitHubRepo/6_7_MDAs
## 
## Attaching package: 'arm'
## The following object is masked from 'package:scales':
## 
##     rescale
## The following object is masked from 'package:car':
## 
##     logit
(randomSims <- REsim(md_final1, n.sims = 500))
##     groupFctr        groupID                term          mean         median
## 1      Source         Access         (Intercept)  -0.738954439  -0.6852231098
## 2      Source      Achievers         (Intercept)  -0.272026472  -0.2975384152
## 3      Source            BBC         (Intercept)  -1.490354619  -1.5352112256
## 4      Source          Book1         (Intercept)   1.498175293   1.5680681891
## 5      Source         Book10         (Intercept)  -1.330456433  -1.3600749799
## 6      Source        Book100         (Intercept)  -4.195233395  -4.1959301576
## 7      Source        Book101         (Intercept)   0.009925686   0.0024220479
## 8      Source        Book102         (Intercept)  -1.364628531  -1.2883309234
## 9      Source        Book103         (Intercept)   2.213601727   2.3528064416
## 10     Source        Book104         (Intercept)   2.364239625   2.2279685226
## 11     Source        Book105         (Intercept)   1.405088882   1.3465905005
## 12     Source        Book106         (Intercept)  -3.050055634  -3.1917778204
## 13     Source        Book107         (Intercept)   4.420694673   4.4418873641
## 14     Source        Book108         (Intercept)  -0.589192797  -0.6130686890
## 15     Source        Book109         (Intercept)  -3.423418587  -3.4207400150
## 16     Source         Book11         (Intercept)  -3.300515697  -3.3373909920
## 17     Source        Book110         (Intercept)  -1.478295082  -1.6080043950
## 18     Source        Book111         (Intercept)  -0.355600620  -0.4061290006
## 19     Source        Book112         (Intercept)  -2.787846366  -2.8490328732
## 20     Source        Book113         (Intercept)  -1.046683442  -1.1452619662
## 21     Source        Book114         (Intercept)  -3.770305736  -3.7407703382
## 22     Source        Book115         (Intercept)   4.786999137   4.6960359748
## 23     Source        Book116         (Intercept)  -0.553517101  -0.5469057131
## 24     Source        Book117         (Intercept)  -3.697560420  -3.7581131796
## 25     Source        Book118         (Intercept)   3.377505817   3.4114232473
## 26     Source        Book119         (Intercept)   1.463748799   1.4663060321
## 27     Source         Book12         (Intercept)  -2.233690922  -2.3079143209
## 28     Source        Book120         (Intercept)  -0.497310362  -0.4774552451
## 29     Source        Book121         (Intercept)   2.432573774   2.5005822706
## 30     Source        Book122         (Intercept)  -6.069836157  -6.1147337220
## 31     Source        Book123         (Intercept)  -0.634745676  -0.6821761864
## 32     Source        Book124         (Intercept)  -0.600753277  -0.5376055400
## 33     Source        Book125         (Intercept)   1.425354036   1.4212318661
## 34     Source        Book126         (Intercept)  -2.025789968  -2.0195138982
## 35     Source        Book127         (Intercept)  -1.371257182  -1.2777597407
## 36     Source        Book128         (Intercept)   1.617943877   1.5836619646
## 37     Source        Book129         (Intercept)   2.536886320   2.5972964873
## 38     Source         Book13         (Intercept)  -4.290499559  -4.3545935814
## 39     Source        Book130         (Intercept)  -0.235319205  -0.1720110434
## 40     Source        Book131         (Intercept)   0.403672465   0.4724931677
## 41     Source        Book132         (Intercept)  -1.249619653  -1.2955309678
## 42     Source        Book133         (Intercept)  -1.246460020  -1.2340819177
## 43     Source        Book134         (Intercept)   3.488201993   3.5716737098
## 44     Source        Book135         (Intercept)   1.234803822   1.1963536520
## 45     Source        Book136         (Intercept)   0.592490684   0.6342967963
## 46     Source        Book137         (Intercept)  -0.048625889  -0.0811732842
## 47     Source        Book138         (Intercept)  -1.444462721  -1.3855486804
## 48     Source        Book139         (Intercept)   0.767423091   0.7587522350
## 49     Source         Book14         (Intercept)  -2.451984173  -2.5003481634
## 50     Source        Book140         (Intercept)  -0.077532782  -0.0791755055
## 51     Source        Book141         (Intercept)   0.428275350   0.4890458648
## 52     Source        Book142         (Intercept)   0.974120079   0.8928612369
## 53     Source        Book143         (Intercept)   1.466538577   1.4122931963
## 54     Source        Book144         (Intercept)   2.848193190   2.7718682782
## 55     Source        Book145         (Intercept)   1.100927931   1.0812894161
## 56     Source        Book146         (Intercept)  -2.299557858  -2.2564958982
## 57     Source        Book147         (Intercept)   1.514454431   1.4721723023
## 58     Source        Book148         (Intercept)  -0.086403925  -0.1653178778
## 59     Source        Book149         (Intercept)   0.723152084   0.7934384648
## 60     Source         Book15         (Intercept)  -3.109427002  -3.0660493034
## 61     Source        Book150         (Intercept)   0.786713311   0.7998684289
## 62     Source        Book151         (Intercept)   1.333745265   1.3977056940
## 63     Source        Book152         (Intercept)   1.536867516   1.4835327655
## 64     Source        Book153         (Intercept)   0.753105215   0.7727520505
## 65     Source        Book154         (Intercept)   1.047567484   1.0455918029
## 66     Source        Book155         (Intercept)   3.609172206   3.6770626790
## 67     Source        Book156         (Intercept)   1.845045570   1.7995128293
## 68     Source        Book157         (Intercept)   1.344240621   1.3700873274
## 69     Source        Book158         (Intercept)   3.075144130   3.1165774178
## 70     Source        Book159         (Intercept)  -4.699927052  -4.7064773207
## 71     Source         Book16         (Intercept)   2.807757534   2.7024694298
## 72     Source        Book160         (Intercept)   0.881892082   0.8756038883
## 73     Source        Book161         (Intercept)   0.463930400   0.5145735306
## 74     Source        Book162         (Intercept)   0.527366274   0.4261551526
## 75     Source        Book163         (Intercept)   2.461639200   2.4392049732
## 76     Source        Book164         (Intercept)  -2.834783866  -2.7698568181
## 77     Source        Book165         (Intercept)  -0.349528166  -0.5266601735
## 78     Source        Book166         (Intercept)   0.190017168   0.1677464932
## 79     Source        Book167         (Intercept)   5.678060776   5.6304168624
## 80     Source        Book168         (Intercept)   0.674801222   0.6978984049
## 81     Source        Book169         (Intercept)  -0.199877754  -0.1705315185
## 82     Source         Book17         (Intercept)  -3.880417134  -3.8873269321
## 83     Source        Book170         (Intercept)  -1.173987168  -1.1852650187
## 84     Source        Book171         (Intercept)  -0.678939090  -0.7222456505
## 85     Source        Book172         (Intercept)   1.696106994   1.5565855419
## 86     Source        Book173         (Intercept)  -0.703692369  -0.6496011694
## 87     Source        Book174         (Intercept)  -4.046213925  -4.0463531734
## 88     Source        Book175         (Intercept)  -1.247423477  -1.2748482565
## 89     Source        Book176         (Intercept)  -2.680135409  -2.6056841604
## 90     Source        Book177         (Intercept)  -6.888839065  -6.8418620384
## 91     Source        Book178         (Intercept)   1.561113411   1.6227168256
## 92     Source        Book179         (Intercept)   0.301329425   0.3352258381
## 93     Source         Book18         (Intercept)  -2.189605633  -2.2037122042
## 94     Source        Book180         (Intercept)   3.015401743   3.0190657313
## 95     Source        Book181         (Intercept)   1.336865079   1.2835191429
## 96     Source        Book182         (Intercept)  -0.295092552  -0.2323651317
## 97     Source        Book183         (Intercept)   2.099036730   2.0514095712
## 98     Source        Book184         (Intercept)  -5.526765294  -5.4329989761
## 99     Source        Book185         (Intercept)   7.942233579   7.9284456922
## 100    Source        Book186         (Intercept)   0.949179857   0.9846686432
## 101    Source        Book187         (Intercept)   1.523416872   1.5639789658
## 102    Source        Book188         (Intercept)  -1.505379022  -1.5842698045
## 103    Source        Book189         (Intercept)   0.907331260   1.0164108290
## 104    Source         Book19         (Intercept)   0.682451530   0.7168723086
## 105    Source        Book190         (Intercept)  -3.586721387  -3.4311952873
## 106    Source        Book191         (Intercept)   2.854722842   2.9274384156
## 107    Source        Book192         (Intercept)   2.006893882   2.0343361185
## 108    Source        Book193         (Intercept)  -0.736686631  -0.7235803883
## 109    Source        Book194         (Intercept)  -2.563179324  -2.4823444896
## 110    Source        Book195         (Intercept)   2.462398902   2.5113502149
## 111    Source        Book196         (Intercept)  -4.663786548  -4.6329313043
## 112    Source        Book197         (Intercept)  -1.902680230  -1.8908869043
## 113    Source        Book198         (Intercept)  -0.621566511  -0.6291284846
## 114    Source        Book199         (Intercept)  -0.307987832  -0.2909830086
## 115    Source          Book2         (Intercept)   3.272390341   3.2876896569
## 116    Source         Book20         (Intercept)  -0.231481302  -0.2173803263
## 117    Source        Book200         (Intercept)  -0.009255846  -0.0955357430
## 118    Source        Book201         (Intercept)  -4.352409534  -4.4131132557
## 119    Source        Book202         (Intercept)   1.991263023   2.0451766130
## 120    Source        Book203         (Intercept)  -0.988888319  -1.0228258939
## 121    Source        Book204         (Intercept)   4.379774081   4.4208588050
## 122    Source        Book205         (Intercept)   1.858375218   1.9005629967
## 123    Source        Book206         (Intercept)  -2.305018475  -2.3401818633
## 124    Source        Book207         (Intercept)   2.439455221   2.4350469852
## 125    Source        Book208         (Intercept)   0.162828970   0.2979159798
## 126    Source        Book209         (Intercept)   2.188221378   2.2119509018
## 127    Source         Book21         (Intercept)   4.381546898   4.4653194955
## 128    Source        Book210         (Intercept)  -0.051376836   0.0432624758
## 129    Source        Book211         (Intercept)  -2.980192248  -3.0023069811
## 130    Source        Book212         (Intercept)   3.477569712   3.4652662331
## 131    Source        Book213         (Intercept)   1.454160611   1.5305863800
## 132    Source        Book214         (Intercept)   1.173426159   1.1089833508
## 133    Source        Book215         (Intercept)   2.138513263   2.0980992751
## 134    Source        Book216         (Intercept)   2.659939997   2.7167728750
## 135    Source        Book217         (Intercept)  -4.076803286  -4.1594730352
## 136    Source        Book218         (Intercept)   0.184554722   0.1319562105
## 137    Source        Book219         (Intercept)   1.045837099   1.1114267900
## 138    Source         Book22         (Intercept)  -2.138039114  -2.0983507693
## 139    Source        Book220         (Intercept)   2.649876719   2.5750836520
## 140    Source        Book221         (Intercept)   1.012956157   0.9500700720
## 141    Source        Book222         (Intercept)  -0.675396064  -0.6632462128
## 142    Source        Book223         (Intercept)  -0.852940379  -0.8036897675
## 143    Source        Book224         (Intercept)  -0.533171931  -0.5176443741
## 144    Source        Book225         (Intercept)   1.891325925   1.8254002288
## 145    Source        Book226         (Intercept)   3.288538375   3.3461344194
## 146    Source        Book227         (Intercept)   1.807471886   1.8330294049
## 147    Source        Book228         (Intercept)   0.242314277   0.1920031905
## 148    Source        Book229         (Intercept)  -1.695955162  -1.7078809039
## 149    Source         Book23         (Intercept)   3.521068242   3.4965222246
## 150    Source        Book230         (Intercept)   4.896898797   4.9066522817
## 151    Source        Book231         (Intercept)  -0.427730047  -0.3554793739
## 152    Source        Book232         (Intercept)   3.740412076   3.7870123266
## 153    Source        Book233         (Intercept)  -2.502839674  -2.4570041416
## 154    Source        Book234         (Intercept)  -1.709330894  -1.7460669308
## 155    Source        Book235         (Intercept)   3.016173269   3.0235827587
## 156    Source        Book236         (Intercept)   0.624534661   0.7238752243
## 157    Source        Book237         (Intercept)   0.335942693   0.2677270109
## 158    Source        Book238         (Intercept)  -2.124709357  -2.2391072352
## 159    Source        Book239         (Intercept)   4.397751468   4.4924737064
## 160    Source         Book24         (Intercept)  -1.351393275  -1.3215793653
## 161    Source        Book240         (Intercept)  -5.608584561  -5.7073780409
## 162    Source        Book241         (Intercept)  -4.262647603  -4.2669132602
## 163    Source        Book242         (Intercept)  -1.148429718  -1.1809052135
## 164    Source        Book243         (Intercept)  -1.137531570  -1.1817392619
## 165    Source        Book244         (Intercept)  -1.567879261  -1.5819493583
## 166    Source        Book245         (Intercept)  -1.935253095  -1.9431882120
## 167    Source        Book246         (Intercept)   0.367528684   0.3733901879
## 168    Source        Book247         (Intercept)  -3.227811685  -3.0538709809
## 169    Source        Book248         (Intercept)  -1.713350190  -1.6987698522
## 170    Source        Book249         (Intercept)  -0.844321950  -0.8300494524
## 171    Source         Book25         (Intercept)   2.629160738   2.5133399990
## 172    Source        Book250         (Intercept)   0.313387802   0.2051933332
## 173    Source        Book251         (Intercept)   0.324471310   0.1834061296
## 174    Source        Book252         (Intercept)  -1.730293559  -1.6466141043
## 175    Source        Book253         (Intercept)   3.771484118   3.8461454957
## 176    Source        Book254         (Intercept)   0.610931946   0.6389674870
## 177    Source        Book255         (Intercept)  -7.368708414  -7.4619329359
## 178    Source        Book256         (Intercept) -10.045061893 -10.0928533123
## 179    Source        Book257         (Intercept)   2.136182431   2.0736402297
## 180    Source        Book258         (Intercept)  -0.983503378  -0.9105157279
## 181    Source        Book259         (Intercept)  -0.712792697  -0.6755948599
## 182    Source         Book26         (Intercept)   3.669552131   3.7180286596
## 183    Source        Book260         (Intercept)   1.807958005   1.8532718579
## 184    Source        Book261         (Intercept)   3.578876489   3.5190738148
## 185    Source        Book262         (Intercept)  -3.334669362  -3.1945600483
## 186    Source        Book263         (Intercept)  -3.082506625  -3.2523674930
## 187    Source        Book264         (Intercept)  -0.502211091  -0.5269310814
## 188    Source        Book265         (Intercept)  -3.575224107  -3.5753816414
## 189    Source        Book266         (Intercept)  -0.560177205  -0.5780524212
## 190    Source        Book267         (Intercept)  -0.085471155   0.0516213035
## 191    Source        Book268         (Intercept)  -0.094655498  -0.0665326268
## 192    Source        Book269         (Intercept)   3.642303265   3.6768794303
## 193    Source         Book27         (Intercept)  -4.001148340  -3.9663448976
## 194    Source        Book270         (Intercept)   1.882898774   1.7876854010
## 195    Source        Book271         (Intercept)   2.596974922   2.6537419547
## 196    Source        Book272         (Intercept)   4.239824683   4.1945960379
## 197    Source        Book273         (Intercept)  -0.614945928  -0.5528907736
## 198    Source        Book274         (Intercept)  -0.019426385   0.0226591216
## 199    Source        Book275         (Intercept)   3.309552315   3.3028356906
## 200    Source        Book276         (Intercept)  -1.432773181  -1.4617798285
## 201    Source        Book277         (Intercept)   3.640569849   3.5975022001
## 202    Source        Book278         (Intercept)   0.655576923   0.7028966516
## 203    Source        Book279         (Intercept)  -5.527092671  -5.5614768874
## 204    Source         Book28         (Intercept)   2.741883257   2.7538295243
## 205    Source        Book280         (Intercept)   2.377553878   2.3979345084
## 206    Source        Book281         (Intercept)  -0.672124696  -0.6245619466
## 207    Source        Book282         (Intercept)   0.424590636   0.5372093869
## 208    Source        Book283         (Intercept)   1.925456764   1.8238280984
## 209    Source        Book284         (Intercept)   1.308460080   1.4612959418
## 210    Source        Book285         (Intercept)   2.282084640   2.4445264728
## 211    Source        Book286         (Intercept)   2.277308882   2.3319216782
## 212    Source        Book287         (Intercept)   4.183002579   4.2086288761
## 213    Source        Book288         (Intercept)   3.719459852   3.7898649309
## 214    Source        Book289         (Intercept)   4.271102895   4.2149090509
## 215    Source         Book29         (Intercept)  -2.173842748  -2.1307337225
## 216    Source        Book290         (Intercept)  -2.337309902  -2.3947503738
## 217    Source        Book291         (Intercept)   2.377105195   2.2941185981
## 218    Source        Book292         (Intercept)  -0.158795330  -0.2116071436
## 219    Source        Book293         (Intercept)  -0.762002725  -0.8504100730
## 220    Source        Book294         (Intercept)   1.379019035   1.3393286740
## 221    Source        Book295         (Intercept)  -1.419349173  -1.3963484421
## 222    Source        Book296         (Intercept)  -5.682579796  -5.6848488830
## 223    Source        Book297         (Intercept)   1.365389081   1.2895895185
## 224    Source        Book298         (Intercept)  -0.299224869  -0.1904037811
## 225    Source        Book299         (Intercept)   0.025785468   0.1011447780
## 226    Source          Book3         (Intercept)  -5.741119928  -5.6537105530
## 227    Source         Book30         (Intercept)   3.232871494   3.2909732425
## 228    Source        Book300         (Intercept)  -4.419632219  -4.4775836270
## 229    Source         Book31         (Intercept)  -0.397946927  -0.3895836235
## 230    Source         Book32         (Intercept)   3.073263406   3.1129607310
## 231    Source         Book33         (Intercept)   2.123131424   2.2267362365
## 232    Source         Book34         (Intercept)   3.578044704   3.5086603621
## 233    Source         Book35         (Intercept)  -0.175281572  -0.2495679551
## 234    Source         Book36         (Intercept)   5.441042175   5.5939733830
## 235    Source         Book37         (Intercept)   3.662147537   3.6056851381
## 236    Source         Book38         (Intercept)  -5.337518026  -5.2746304589
## 237    Source         Book39         (Intercept)  -2.028527818  -1.9793500526
## 238    Source          Book4         (Intercept)   0.374636543   0.3903137240
## 239    Source         Book40         (Intercept)   0.175282416   0.1451540507
## 240    Source         Book41         (Intercept)  -1.374981002  -1.3821788693
## 241    Source         Book42         (Intercept)   1.404630147   1.3531660381
## 242    Source         Book43         (Intercept)   1.320697786   1.3863999724
## 243    Source         Book44         (Intercept)   5.487441265   5.4540574906
## 244    Source         Book45         (Intercept)  -1.739028057  -1.7478708780
## 245    Source         Book46         (Intercept)   0.212819112   0.2377185797
## 246    Source         Book47         (Intercept)   1.212980592   1.3009706287
## 247    Source         Book48         (Intercept)  -5.956380421  -6.0214343237
## 248    Source         Book49         (Intercept)   3.141848403   3.1162522342
## 249    Source          Book5         (Intercept)   0.790103121   0.7645261768
## 250    Source         Book50         (Intercept)   0.329356855   0.2248667598
## 251    Source         Book51         (Intercept)   0.517833703   0.5198002321
## 252    Source         Book52         (Intercept)  -3.250076273  -3.2227865418
## 253    Source         Book53         (Intercept)  -0.488079511  -0.5428008396
## 254    Source         Book54         (Intercept)   1.849347667   1.8347835030
## 255    Source         Book55         (Intercept)   1.777269782   1.7464747338
## 256    Source         Book56         (Intercept)  -0.500673120  -0.4742496283
## 257    Source         Book57         (Intercept)   1.296710930   1.4302661800
## 258    Source         Book58         (Intercept)   0.002865334   0.0105702110
## 259    Source         Book59         (Intercept)  -0.624800300  -0.6359006144
## 260    Source          Book6         (Intercept)  -4.714326020  -4.8137347519
## 261    Source         Book60         (Intercept)  -2.168701582  -2.2251628509
## 262    Source         Book61         (Intercept)  -0.399809426  -0.5234111864
## 263    Source         Book62         (Intercept)  -0.611859325  -0.5414162296
## 264    Source         Book63         (Intercept)   0.062847985   0.1848141259
## 265    Source         Book64         (Intercept)  -1.183548033  -1.1438816011
## 266    Source         Book65         (Intercept)  -1.637678698  -1.6375238446
## 267    Source         Book66         (Intercept)   0.892410019   0.8724282246
## 268    Source         Book67         (Intercept)   1.175968598   0.9858246667
## 269    Source         Book68         (Intercept)   2.138254845   2.1200762697
## 270    Source         Book69         (Intercept)  -0.136906201  -0.1914247662
## 271    Source          Book7         (Intercept)   0.735300221   0.8180617088
## 272    Source         Book70         (Intercept)  -2.688321739  -2.7295013059
## 273    Source         Book71         (Intercept)  -0.095172715  -0.1641680787
## 274    Source         Book72         (Intercept)  -5.223011456  -5.1545576017
## 275    Source         Book73         (Intercept)   1.108167501   1.1785206349
## 276    Source         Book74         (Intercept)   0.823191576   0.8389637340
## 277    Source         Book75         (Intercept)  -1.676973370  -1.6384104009
## 278    Source         Book76         (Intercept)  -8.820914895  -8.7345225176
## 279    Source         Book77         (Intercept)  -3.819101428  -3.7536536914
## 280    Source         Book78         (Intercept)   4.287647895   4.2691734717
## 281    Source         Book79         (Intercept)   0.026984575   0.0695777454
## 282    Source          Book8         (Intercept)   0.446731563   0.3530251391
## 283    Source         Book80         (Intercept)   6.193815918   6.1124829992
## 284    Source         Book81         (Intercept)  -2.704115607  -2.7282691042
## 285    Source         Book82         (Intercept)   0.465185351   0.4985275390
## 286    Source         Book83         (Intercept)  -3.432869808  -3.3792846896
## 287    Source         Book84         (Intercept)   1.617874244   1.7094715449
## 288    Source         Book85         (Intercept)   6.723438662   6.7264718225
## 289    Source         Book86         (Intercept)  -1.238706512  -1.2516860355
## 290    Source         Book87         (Intercept)  -0.925138438  -0.9685923134
## 291    Source         Book88         (Intercept)  -5.211118194  -5.2677092342
## 292    Source         Book89         (Intercept)  -3.131500817  -3.2012200408
## 293    Source          Book9         (Intercept)  -4.431846484  -4.4775275239
## 294    Source         Book90         (Intercept)   1.334041513   1.3476266769
## 295    Source         Book91         (Intercept)   1.812408863   1.7222649851
## 296    Source         Book92         (Intercept)   1.935098347   1.9323026172
## 297    Source         Book93         (Intercept)   3.380156490   3.4112206087
## 298    Source         Book94         (Intercept)   2.046056169   2.0825509453
## 299    Source         Book95         (Intercept)   0.704108989   0.5851737372
## 300    Source         Book96         (Intercept)   0.230819622   0.2344541945
## 301    Source         Book97         (Intercept)  -6.488427844  -6.4395560329
## 302    Source         Book98         (Intercept)  -0.573412655  -0.6551567868
## 303    Source         Book99         (Intercept)   2.001303414   1.9747350171
## 304    Source           Dogo         (Intercept)  -1.037565948  -0.9900659909
## 305    Source      Ducksters         (Intercept)  -2.806855933  -2.7704918453
## 306    Source            EIM         (Intercept)   4.245682225   4.2052633134
## 307    Source   Encyclopedia         (Intercept)  -0.830635098  -0.9996824226
## 308    Source    Factmonster         (Intercept)  -5.630653589  -5.5857371688
## 309    Source      GreenLine         (Intercept)   1.941265345   1.9387053296
## 310    Source        History         (Intercept)  -2.353877978  -2.4004645600
## 311    Source             HT         (Intercept)  -2.848989634  -2.8120351293
## 312    Source            JTT         (Intercept)  -1.621353666  -1.6077100914
## 313    Source            NGL         (Intercept)   2.777200024   2.7512005311
## 314    Source            POC         (Intercept)  -3.674678976  -3.6275273232
## 315    Source          Quatr         (Intercept)   0.582643237   0.5257351641
## 316    Source       Revision         (Intercept)   0.343874029   0.1654422259
## 317    Source        Science         (Intercept)   0.117413401   0.1981636069
## 318    Source   Science_Tech         (Intercept)  -0.866948490  -0.7882464762
## 319    Source      Solutions         (Intercept)  -0.009681306   0.0213605744
## 320    Source Spoken.BNC2014         (Intercept)  -0.047177852   0.0243420951
## 321    Source           Teen         (Intercept)   4.375363918   4.4165367802
## 322    Source      TeenVogue         (Intercept)   5.323873696   5.3565913959
## 323    Source   TweenTribute         (Intercept)   3.222055226   3.3158883254
## 324    Source       WhyFiles         (Intercept)   1.413232595   1.6403149052
## 325    Source          World         (Intercept)  -0.671001458  -0.7990991726
## 326    Source         Access     RegisterFiction   1.694570210   1.6642228904
## 327    Source      Achievers     RegisterFiction  -1.677434436  -1.6714292592
## 328    Source            BBC     RegisterFiction   0.004951684  -0.0155757831
## 329    Source          Book1     RegisterFiction   0.883958171   0.8648689708
## 330    Source         Book10     RegisterFiction  -0.556513862  -0.6206259353
## 331    Source        Book100     RegisterFiction  -2.082624455  -2.1193873167
## 332    Source        Book101     RegisterFiction  -0.002637102  -0.0197392970
## 333    Source        Book102     RegisterFiction  -0.958336838  -0.9017344760
## 334    Source        Book103     RegisterFiction   1.190719184   1.3713476287
## 335    Source        Book104     RegisterFiction   1.085335258   0.9683548671
## 336    Source        Book105     RegisterFiction   0.528343404   0.5020631788
## 337    Source        Book106     RegisterFiction  -1.414936612  -1.4636341163
## 338    Source        Book107     RegisterFiction   2.385026383   2.4162805254
## 339    Source        Book108     RegisterFiction  -0.254858427  -0.2897542642
## 340    Source        Book109     RegisterFiction  -1.639251448  -1.6754685266
## 341    Source         Book11     RegisterFiction  -1.905999947  -1.9166676458
## 342    Source        Book110     RegisterFiction  -0.923834910  -0.8792737269
## 343    Source        Book111     RegisterFiction  -0.414738013  -0.4400889563
## 344    Source        Book112     RegisterFiction  -1.307727891  -1.3473686235
## 345    Source        Book113     RegisterFiction  -0.719533436  -0.6095766483
## 346    Source        Book114     RegisterFiction  -1.938329658  -1.9851582427
## 347    Source        Book115     RegisterFiction   2.380320874   2.5058456508
## 348    Source        Book116     RegisterFiction  -0.125484803  -0.0017113412
## 349    Source        Book117     RegisterFiction  -1.789709960  -1.7366462255
## 350    Source        Book118     RegisterFiction   1.545705819   1.7034838166
## 351    Source        Book119     RegisterFiction   0.684575208   0.7233226820
## 352    Source         Book12     RegisterFiction  -1.141548753  -1.3006503572
## 353    Source        Book120     RegisterFiction  -0.116451214  -0.1485777373
## 354    Source        Book121     RegisterFiction   1.141904845   1.3019605588
## 355    Source        Book122     RegisterFiction  -3.031102878  -2.9235024081
## 356    Source        Book123     RegisterFiction  -0.260398847  -0.2118108671
## 357    Source        Book124     RegisterFiction  -0.458333960  -0.4852886277
## 358    Source        Book125     RegisterFiction   0.540960972   0.6613561411
## 359    Source        Book126     RegisterFiction  -0.912581918  -0.8793592144
## 360    Source        Book127     RegisterFiction  -0.680368113  -0.5773455600
## 361    Source        Book128     RegisterFiction   0.758661707   0.7917037520
## 362    Source        Book129     RegisterFiction   1.453020209   1.5051046459
## 363    Source         Book13     RegisterFiction  -2.124279051  -2.1163592307
## 364    Source        Book130     RegisterFiction  -0.089336208  -0.1291263319
## 365    Source        Book131     RegisterFiction   0.337628988   0.3222540494
## 366    Source        Book132     RegisterFiction  -0.812224776  -0.7319011705
## 367    Source        Book133     RegisterFiction  -0.842528470  -0.7032360401
## 368    Source        Book134     RegisterFiction   1.861898709   1.8089844349
## 369    Source        Book135     RegisterFiction   0.730600220   0.7968940167
## 370    Source        Book136     RegisterFiction   0.665059254   0.8286141985
## 371    Source        Book137     RegisterFiction   0.060885397  -0.0169107145
## 372    Source        Book138     RegisterFiction  -0.798309814  -0.8670134820
## 373    Source        Book139     RegisterFiction   0.302583800   0.1901390368
## 374    Source         Book14     RegisterFiction  -1.347373272  -1.3861262385
## 375    Source        Book140     RegisterFiction   0.010465767  -0.0117891020
## 376    Source        Book141     RegisterFiction   0.399249657   0.3261482614
## 377    Source        Book142     RegisterFiction   0.363038399   0.3428278317
## 378    Source        Book143     RegisterFiction   0.613483019   0.5177561918
## 379    Source        Book144     RegisterFiction   1.471501235   1.5787794657
## 380    Source        Book145     RegisterFiction   0.532560701   0.4606298920
## 381    Source        Book146     RegisterFiction  -1.072415676  -1.0753823548
## 382    Source        Book147     RegisterFiction   0.560985295   0.5891458722
## 383    Source        Book148     RegisterFiction   0.020720525   0.1009711284
## 384    Source        Book149     RegisterFiction   0.146501327   0.2863369191
## 385    Source         Book15     RegisterFiction  -1.504913883  -1.4626560244
## 386    Source        Book150     RegisterFiction   0.278685677   0.2319628802
## 387    Source        Book151     RegisterFiction   0.663172046   0.4448840410
## 388    Source        Book152     RegisterFiction   0.792033421   0.8539419253
## 389    Source        Book153     RegisterFiction   0.346920036   0.4367068082
## 390    Source        Book154     RegisterFiction   0.469874108   0.5059454350
## 391    Source        Book155     RegisterFiction   1.861860345   1.8783514442
## 392    Source        Book156     RegisterFiction   0.980208260   1.0019920721
## 393    Source        Book157     RegisterFiction   0.661108209   0.6420510072
## 394    Source        Book158     RegisterFiction   1.505499988   1.4663735629
## 395    Source        Book159     RegisterFiction  -2.373842412  -2.5184892048
## 396    Source         Book16     RegisterFiction   1.065252213   1.0725946324
## 397    Source        Book160     RegisterFiction   0.335817199   0.2669864024
## 398    Source        Book161     RegisterFiction   0.374243916   0.2860769105
## 399    Source        Book162     RegisterFiction   0.322417885   0.3114748141
## 400    Source        Book163     RegisterFiction   1.459545664   1.4275619145
## 401    Source        Book164     RegisterFiction  -1.329162498  -1.4516463111
## 402    Source        Book165     RegisterFiction  -0.301014741  -0.1851300344
## 403    Source        Book166     RegisterFiction   0.108634590   0.0437782472
## 404    Source        Book167     RegisterFiction   2.955627071   3.0418410220
## 405    Source        Book168     RegisterFiction   0.339143756   0.2227122556
## 406    Source        Book169     RegisterFiction  -0.542202363  -0.6175202239
## 407    Source         Book17     RegisterFiction  -2.060801249  -2.0095360651
## 408    Source        Book170     RegisterFiction  -0.445991243  -0.4346698470
## 409    Source        Book171     RegisterFiction  -0.369900647  -0.4599116462
## 410    Source        Book172     RegisterFiction   0.707584983   0.7128652642
## 411    Source        Book173     RegisterFiction  -0.354166833  -0.2832460445
## 412    Source        Book174     RegisterFiction  -2.186332432  -2.2318394384
## 413    Source        Book175     RegisterFiction  -0.618277190  -0.6731386238
## 414    Source        Book176     RegisterFiction  -1.225080074  -1.2572659196
## 415    Source        Book177     RegisterFiction  -3.542686808  -3.5237497530
## 416    Source        Book178     RegisterFiction   0.599642436   0.5032452475
## 417    Source        Book179     RegisterFiction   0.149426971   0.0027960672
## 418    Source         Book18     RegisterFiction  -0.935050678  -0.9587588442
## 419    Source        Book180     RegisterFiction   1.440218930   1.3325800659
## 420    Source        Book181     RegisterFiction   0.727405228   0.7689872732
## 421    Source        Book182     RegisterFiction  -0.188840855  -0.2311563015
## 422    Source        Book183     RegisterFiction   1.163808168   1.1599735288
## 423    Source        Book184     RegisterFiction  -2.881748135  -3.0107575946
## 424    Source        Book185     RegisterFiction   4.164547401   4.1599748421
## 425    Source        Book186     RegisterFiction   0.723186995   0.7224302085
## 426    Source        Book187     RegisterFiction   0.564965902   0.4965264083
## 427    Source        Book188     RegisterFiction  -0.849465135  -0.7894323103
## 428    Source        Book189     RegisterFiction   0.716385556   0.7811830266
## 429    Source         Book19     RegisterFiction   0.448439486   0.5107722393
## 430    Source        Book190     RegisterFiction  -1.846070614  -1.9141786116
## 431    Source        Book191     RegisterFiction   1.572948354   1.7345157824
## 432    Source        Book192     RegisterFiction   1.244055268   1.2736703259
## 433    Source        Book193     RegisterFiction  -0.290874366  -0.2888471810
## 434    Source        Book194     RegisterFiction  -1.158496832  -1.3318189794
## 435    Source        Book195     RegisterFiction   1.244702292   1.2403309435
## 436    Source        Book196     RegisterFiction  -2.342435611  -2.2080857631
## 437    Source        Book197     RegisterFiction  -1.050021212  -1.0809624655
## 438    Source        Book198     RegisterFiction  -0.520602470  -0.4839707475
## 439    Source        Book199     RegisterFiction  -0.294926085  -0.2509348246
## 440    Source          Book2     RegisterFiction   1.514893996   1.5864523790
## 441    Source         Book20     RegisterFiction  -0.078705047  -0.0885110098
## 442    Source        Book200     RegisterFiction   0.025822733   0.1047539391
## 443    Source        Book201     RegisterFiction  -2.059597379  -2.1702610219
## 444    Source        Book202     RegisterFiction   1.120735886   1.1466149078
## 445    Source        Book203     RegisterFiction  -0.674389375  -0.7165092622
## 446    Source        Book204     RegisterFiction   2.225565999   2.2812055819
## 447    Source        Book205     RegisterFiction   0.987947315   0.9730338364
## 448    Source        Book206     RegisterFiction  -1.029730452  -1.0500863919
## 449    Source        Book207     RegisterFiction   1.446269971   1.4646102533
## 450    Source        Book208     RegisterFiction   0.108470143   0.1729755602
## 451    Source        Book209     RegisterFiction   0.960707614   1.0919421622
## 452    Source         Book21     RegisterFiction   2.223117712   2.2517281848
## 453    Source        Book210     RegisterFiction  -0.153979466  -0.0677515690
## 454    Source        Book211     RegisterFiction  -1.543911341  -1.5184805847
## 455    Source        Book212     RegisterFiction   2.176521070   2.3332262580
## 456    Source        Book213     RegisterFiction   0.545810522   0.5250095835
## 457    Source        Book214     RegisterFiction   0.502977299   0.4676009799
## 458    Source        Book215     RegisterFiction   1.049129253   1.1122212273
## 459    Source        Book216     RegisterFiction   1.247590415   1.1672170949
## 460    Source        Book217     RegisterFiction  -2.136711425  -2.2633733542
## 461    Source        Book218     RegisterFiction   0.076384899   0.1401575359
## 462    Source        Book219     RegisterFiction   0.549937812   0.5381274890
## 463    Source         Book22     RegisterFiction  -1.243241378  -1.2297800279
## 464    Source        Book220     RegisterFiction   1.407888950   1.5619788377
## 465    Source        Book221     RegisterFiction   0.469125691   0.4623056681
## 466    Source        Book222     RegisterFiction  -0.312965177  -0.3896018463
## 467    Source        Book223     RegisterFiction  -0.180013585  -0.2007342078
## 468    Source        Book224     RegisterFiction  -0.338617490  -0.3809566179
## 469    Source        Book225     RegisterFiction   1.027646785   1.0844464608
## 470    Source        Book226     RegisterFiction   1.469034937   1.5624144079
## 471    Source        Book227     RegisterFiction   0.804021525   0.6728974344
## 472    Source        Book228     RegisterFiction   0.039191363   0.0656075585
## 473    Source        Book229     RegisterFiction  -1.012909240  -1.0962718531
## 474    Source         Book23     RegisterFiction   1.674411270   1.6446997052
## 475    Source        Book230     RegisterFiction   2.577285657   2.4830671064
## 476    Source        Book231     RegisterFiction  -0.271830863  -0.1285163351
## 477    Source        Book232     RegisterFiction   1.993287438   1.9151823572
## 478    Source        Book233     RegisterFiction  -1.440196736  -1.4274817755
## 479    Source        Book234     RegisterFiction  -0.738555627  -0.8505303636
## 480    Source        Book235     RegisterFiction   1.239875854   1.2259590269
## 481    Source        Book236     RegisterFiction   0.249486739   0.4608134457
## 482    Source        Book237     RegisterFiction   0.175497977   0.2828447411
## 483    Source        Book238     RegisterFiction  -0.907336630  -0.8221984755
## 484    Source        Book239     RegisterFiction   2.083685284   1.8817345456
## 485    Source         Book24     RegisterFiction  -0.737787318  -0.6614907182
## 486    Source        Book240     RegisterFiction  -2.681336824  -2.8112678044
## 487    Source        Book241     RegisterFiction  -2.103951841  -1.9886641305
## 488    Source        Book242     RegisterFiction  -0.862611674  -0.7610882913
## 489    Source        Book243     RegisterFiction  -0.777040017  -0.6966335903
## 490    Source        Book244     RegisterFiction  -0.920885949  -0.8510479290
## 491    Source        Book245     RegisterFiction  -0.786214877  -0.8294859319
## 492    Source        Book246     RegisterFiction   0.293555215   0.3426673025
## 493    Source        Book247     RegisterFiction  -1.509327582  -1.4237694694
## 494    Source        Book248     RegisterFiction  -0.853179851  -0.7602229992
## 495    Source        Book249     RegisterFiction  -0.492187830  -0.4341134575
## 496    Source         Book25     RegisterFiction   1.429427418   1.5528454271
## 497    Source        Book250     RegisterFiction   0.177909706   0.2746258979
## 498    Source        Book251     RegisterFiction   0.385818429   0.5902293781
## 499    Source        Book252     RegisterFiction  -0.927378147  -0.7911769786
## 500    Source        Book253     RegisterFiction   1.952997760   1.9863759265
## 501    Source        Book254     RegisterFiction   0.390065157   0.3226687709
## 502    Source        Book255     RegisterFiction  -4.067293942  -4.0873476608
## 503    Source        Book256     RegisterFiction  -5.094675824  -4.9778297376
## 504    Source        Book257     RegisterFiction   1.004723519   0.9270762573
## 505    Source        Book258     RegisterFiction  -0.565709822  -0.6462887605
## 506    Source        Book259     RegisterFiction  -0.386311357  -0.4358840769
## 507    Source         Book26     RegisterFiction   2.095354348   1.9615553543
## 508    Source        Book260     RegisterFiction   0.877914833   0.9011528779
## 509    Source        Book261     RegisterFiction   1.853941816   1.8838344686
## 510    Source        Book262     RegisterFiction  -1.538718129  -1.4226574580
## 511    Source        Book263     RegisterFiction  -1.416515137  -1.4630855857
## 512    Source        Book264     RegisterFiction  -0.235374586  -0.2309292345
## 513    Source        Book265     RegisterFiction  -1.586766974  -1.4886949619
## 514    Source        Book266     RegisterFiction  -0.235631690  -0.2857788729
## 515    Source        Book267     RegisterFiction  -0.107661461  -0.2506554350
## 516    Source        Book268     RegisterFiction  -0.152311934  -0.1520657654
## 517    Source        Book269     RegisterFiction   1.720527403   1.5620599107
## 518    Source         Book27     RegisterFiction  -2.031142666  -1.9551952149
## 519    Source        Book270     RegisterFiction   0.849005998   0.8877737211
## 520    Source        Book271     RegisterFiction   1.301488711   1.3262004769
## 521    Source        Book272     RegisterFiction   2.126124016   2.0831034378
## 522    Source        Book273     RegisterFiction  -0.454032041  -0.3043516644
## 523    Source        Book274     RegisterFiction   0.113994011   0.1015194677
## 524    Source        Book275     RegisterFiction   1.893914627   1.7776873769
## 525    Source        Book276     RegisterFiction  -0.874524765  -1.0142689896
## 526    Source        Book277     RegisterFiction   2.046858294   2.0035161855
## 527    Source        Book278     RegisterFiction   0.105722665   0.1195876420
## 528    Source        Book279     RegisterFiction  -2.783288529  -2.8263304622
## 529    Source         Book28     RegisterFiction   1.268216426   1.2888573209
## 530    Source        Book280     RegisterFiction   1.384393355   1.2850360227
## 531    Source        Book281     RegisterFiction  -0.392664524  -0.4466965641
## 532    Source        Book282     RegisterFiction   0.334760882   0.3312166376
## 533    Source        Book283     RegisterFiction   0.929693414   1.0047933858
## 534    Source        Book284     RegisterFiction   0.820778384   0.7425670639
## 535    Source        Book285     RegisterFiction   1.164519617   1.2911085770
## 536    Source        Book286     RegisterFiction   1.142430820   1.0560648840
## 537    Source        Book287     RegisterFiction   2.047105359   1.9771993270
## 538    Source        Book288     RegisterFiction   2.001035235   2.0022038896
## 539    Source        Book289     RegisterFiction   2.208882966   2.1047934299
## 540    Source         Book29     RegisterFiction  -1.049558245  -1.0768397984
## 541    Source        Book290     RegisterFiction  -1.124991565  -1.0534543514
## 542    Source        Book291     RegisterFiction   1.256614895   1.3267610572
## 543    Source        Book292     RegisterFiction  -0.139413137  -0.1744672129
## 544    Source        Book293     RegisterFiction  -0.148563595  -0.1308432485
## 545    Source        Book294     RegisterFiction   0.583451695   0.5943630169
## 546    Source        Book295     RegisterFiction  -0.781126621  -0.7766302867
## 547    Source        Book296     RegisterFiction  -2.908534951  -2.8648474238
## 548    Source        Book297     RegisterFiction   0.757522937   0.7571049045
## 549    Source        Book298     RegisterFiction  -0.027129753   0.1254933208
## 550    Source        Book299     RegisterFiction   0.118964759   0.1828961926
## 551    Source          Book3     RegisterFiction  -3.045650553  -3.1324166824
## 552    Source         Book30     RegisterFiction   1.967662326   1.8733848462
## 553    Source        Book300     RegisterFiction  -2.220322131  -2.4048697693
## 554    Source         Book31     RegisterFiction  -0.150484694  -0.0511806838
## 555    Source         Book32     RegisterFiction   1.540840528   1.5072711437
## 556    Source         Book33     RegisterFiction   1.247361122   1.2999679224
## 557    Source         Book34     RegisterFiction   2.155463150   2.1625382965
## 558    Source         Book35     RegisterFiction  -0.109406063  -0.2163723768
## 559    Source         Book36     RegisterFiction   2.512455767   2.5018335223
## 560    Source         Book37     RegisterFiction   1.692640736   1.7301102176
## 561    Source         Book38     RegisterFiction  -3.115540135  -3.1020614976
## 562    Source         Book39     RegisterFiction  -1.221683722  -1.1367128761
## 563    Source          Book4     RegisterFiction   0.227296305   0.1343842778
## 564    Source         Book40     RegisterFiction   0.270323518   0.3779519419
## 565    Source         Book41     RegisterFiction  -0.504323230  -0.4381386742
## 566    Source         Book42     RegisterFiction   0.449140956   0.6413934686
## 567    Source         Book43     RegisterFiction   0.443801254   0.5292062666
## 568    Source         Book44     RegisterFiction   2.752715154   2.8511202154
## 569    Source         Book45     RegisterFiction  -1.135703213  -1.2718589940
## 570    Source         Book46     RegisterFiction   0.152572936   0.0455088652
## 571    Source         Book47     RegisterFiction   0.629358791   0.6168519783
## 572    Source         Book48     RegisterFiction  -3.189253218  -3.1423129070
## 573    Source         Book49     RegisterFiction   1.542253443   1.5674192663
## 574    Source          Book5     RegisterFiction   0.399674764   0.3822912127
## 575    Source         Book50     RegisterFiction   0.155170083   0.1883050690
## 576    Source         Book51     RegisterFiction   0.256952714   0.3113688793
## 577    Source         Book52     RegisterFiction  -1.781844580  -1.8224892431
## 578    Source         Book53     RegisterFiction  -0.235519870  -0.3260782696
## 579    Source         Book54     RegisterFiction   1.030613123   1.1094657495
## 580    Source         Book55     RegisterFiction   0.930143437   1.0003668973
## 581    Source         Book56     RegisterFiction  -0.116328161  -0.0928404839
## 582    Source         Book57     RegisterFiction   0.562382133   0.6208668143
## 583    Source         Book58     RegisterFiction  -0.049058678   0.0149860780
## 584    Source         Book59     RegisterFiction  -0.396362185  -0.5361305720
## 585    Source          Book6     RegisterFiction  -2.471705220  -2.5198452565
## 586    Source         Book60     RegisterFiction  -1.230782865  -1.3095355665
## 587    Source         Book61     RegisterFiction  -0.199919685  -0.2967618570
## 588    Source         Book62     RegisterFiction  -0.087032070  -0.0890034758
## 589    Source         Book63     RegisterFiction   0.054054693   0.0408420700
## 590    Source         Book64     RegisterFiction  -0.753840298  -0.8909210531
## 591    Source         Book65     RegisterFiction  -0.879325931  -0.8537711863
## 592    Source         Book66     RegisterFiction   0.473516513   0.4072965785
## 593    Source         Book67     RegisterFiction   0.373115184   0.3636831007
## 594    Source         Book68     RegisterFiction   1.192823205   1.0280184810
## 595    Source         Book69     RegisterFiction  -0.293363639  -0.2480985169
## 596    Source          Book7     RegisterFiction   0.419305804   0.5286942671
## 597    Source         Book70     RegisterFiction  -1.349207115  -1.3410301815
## 598    Source         Book71     RegisterFiction  -0.168745980   0.0301594389
## 599    Source         Book72     RegisterFiction  -2.417609595  -2.4756945652
## 600    Source         Book73     RegisterFiction   0.620503551   0.5923196402
## 601    Source         Book74     RegisterFiction   0.425569957   0.5004781992
## 602    Source         Book75     RegisterFiction  -0.916026315  -0.9386922263
## 603    Source         Book76     RegisterFiction  -4.365752898  -4.3605205303
## 604    Source         Book77     RegisterFiction  -2.217372817  -2.0428505752
## 605    Source         Book78     RegisterFiction   2.168691549   2.0372066858
## 606    Source         Book79     RegisterFiction  -0.139974885  -0.0943833037
## 607    Source          Book8     RegisterFiction   0.328967959   0.3376191520
## 608    Source         Book80     RegisterFiction   3.233727301   3.1910045647
## 609    Source         Book81     RegisterFiction  -1.522693102  -1.4443500496
## 610    Source         Book82     RegisterFiction   0.242827411   0.2461464625
## 611    Source         Book83     RegisterFiction  -1.673723924  -1.7206150659
## 612    Source         Book84     RegisterFiction   1.017538871   1.0422505739
## 613    Source         Book85     RegisterFiction   3.165730063   3.2060538695
## 614    Source         Book86     RegisterFiction  -0.763484850  -0.6534173174
## 615    Source         Book87     RegisterFiction  -0.476695629  -0.5320933332
## 616    Source         Book88     RegisterFiction  -2.698202220  -2.7552692029
## 617    Source         Book89     RegisterFiction  -1.547059055  -1.5679564313
## 618    Source          Book9     RegisterFiction  -2.243224670  -2.0939020851
## 619    Source         Book90     RegisterFiction   0.624486221   0.6276933155
## 620    Source         Book91     RegisterFiction   0.965248785   0.9706480955
## 621    Source         Book92     RegisterFiction   1.168286045   1.1282628135
## 622    Source         Book93     RegisterFiction   1.724372721   1.7578108165
## 623    Source         Book94     RegisterFiction   1.109280843   1.0996704312
## 624    Source         Book95     RegisterFiction   0.555373205   0.5176061016
## 625    Source         Book96     RegisterFiction   0.109893246  -0.0628141370
## 626    Source         Book97     RegisterFiction  -3.395423276  -3.3917398859
## 627    Source         Book98     RegisterFiction  -0.500579612  -0.6915703522
## 628    Source         Book99     RegisterFiction   1.102561153   0.9363703092
## 629    Source           Dogo     RegisterFiction   0.024105546  -0.0905216665
## 630    Source      Ducksters     RegisterFiction  -0.051293010   0.0307933196
## 631    Source            EIM     RegisterFiction   0.379406682   0.3333117095
## 632    Source   Encyclopedia     RegisterFiction  -0.034911167  -0.1754909492
## 633    Source    Factmonster     RegisterFiction   0.068461356   0.0583854096
## 634    Source      GreenLine     RegisterFiction   0.448104515   0.4065345410
## 635    Source        History     RegisterFiction  -0.002088087  -0.0117365673
## 636    Source             HT     RegisterFiction   2.201912843   2.2396814032
## 637    Source            JTT     RegisterFiction   0.449298491   0.4503472951
## 638    Source            NGL     RegisterFiction   0.065196529   0.0521157179
## 639    Source            POC     RegisterFiction  -2.014945888  -2.0426152019
## 640    Source          Quatr     RegisterFiction  -0.056850064  -0.1787906114
## 641    Source       Revision     RegisterFiction   0.025709758   0.0557665690
## 642    Source        Science     RegisterFiction  -0.060085247   0.0334879266
## 643    Source   Science_Tech     RegisterFiction  -0.272341534  -0.2400828355
## 644    Source      Solutions     RegisterFiction  -1.389597757  -1.4374073276
## 645    Source Spoken.BNC2014     RegisterFiction  -0.048263972   0.0803612517
## 646    Source           Teen     RegisterFiction  -0.046937374  -0.0311426439
## 647    Source      TeenVogue     RegisterFiction  -0.078097584  -0.0157168380
## 648    Source   TweenTribute     RegisterFiction   0.050077106   0.0415585956
## 649    Source       WhyFiles     RegisterFiction   0.082955835   0.0677263423
## 650    Source          World     RegisterFiction  -0.023734621  -0.0289361611
## 651    Source         Access RegisterInformative  -0.586654662  -0.5888683155
## 652    Source      Achievers RegisterInformative   3.387669906   3.2951826038
## 653    Source            BBC RegisterInformative  -0.894887336  -0.8281678389
## 654    Source          Book1 RegisterInformative  -0.296831744  -0.3338441483
## 655    Source         Book10 RegisterInformative   0.129854095   0.1801727759
## 656    Source        Book100 RegisterInformative   0.600669104   0.5448269800
## 657    Source        Book101 RegisterInformative  -0.010261289  -0.1423440872
## 658    Source        Book102 RegisterInformative   0.255136600   0.2127305938
## 659    Source        Book103 RegisterInformative  -0.291153516  -0.2448641594
## 660    Source        Book104 RegisterInformative  -0.355974114  -0.3189519241
## 661    Source        Book105 RegisterInformative  -0.057715170  -0.1660538605
## 662    Source        Book106 RegisterInformative   0.236647164   0.2214550401
## 663    Source        Book107 RegisterInformative  -0.586713709  -0.6888558980
## 664    Source        Book108 RegisterInformative   0.101763236   0.1491118152
## 665    Source        Book109 RegisterInformative   0.291003947   0.2938612295
## 666    Source         Book11 RegisterInformative   0.577781163   0.5539261453
## 667    Source        Book110 RegisterInformative   0.367512067   0.4237629654
## 668    Source        Book111 RegisterInformative   0.087278769   0.1260849507
## 669    Source        Book112 RegisterInformative   0.359216663   0.3897668055
## 670    Source        Book113 RegisterInformative   0.340853013   0.4067779028
## 671    Source        Book114 RegisterInformative   0.460147255   0.5509998266
## 672    Source        Book115 RegisterInformative  -0.641886899  -0.5953740220
## 673    Source        Book116 RegisterInformative   0.067892291   0.0938076552
## 674    Source        Book117 RegisterInformative   0.551234315   0.5105852139
## 675    Source        Book118 RegisterInformative  -0.328151151  -0.3494809535
## 676    Source        Book119 RegisterInformative  -0.175689489  -0.1101259360
## 677    Source         Book12 RegisterInformative   0.295624563   0.2352338151
## 678    Source        Book120 RegisterInformative  -0.130505761  -0.0469376605
## 679    Source        Book121 RegisterInformative  -0.326069380  -0.3995754576
## 680    Source        Book122 RegisterInformative   0.548793267   0.6415792385
## 681    Source        Book123 RegisterInformative   0.035161918  -0.0601776814
## 682    Source        Book124 RegisterInformative   0.217356598   0.2219241741
## 683    Source        Book125 RegisterInformative  -0.103880241  -0.0906938985
## 684    Source        Book126 RegisterInformative   0.236694451   0.0820356714
## 685    Source        Book127 RegisterInformative   0.189259119   0.1620584765
## 686    Source        Book128 RegisterInformative  -0.277754000  -0.2051464909
## 687    Source        Book129 RegisterInformative  -0.367848798  -0.4546914388
## 688    Source         Book13 RegisterInformative   0.480682224   0.4401594214
## 689    Source        Book130 RegisterInformative   0.067439397   0.1101293361
## 690    Source        Book131 RegisterInformative  -0.135660577  -0.1239422400
## 691    Source        Book132 RegisterInformative   0.265590385   0.2621687867
## 692    Source        Book133 RegisterInformative   0.417806790   0.4856450898
## 693    Source        Book134 RegisterInformative  -0.564714933  -0.5718408076
## 694    Source        Book135 RegisterInformative  -0.417164264  -0.4107774589
## 695    Source        Book136 RegisterInformative  -0.245261223  -0.3176702621
## 696    Source        Book137 RegisterInformative   0.039686364   0.0316267326
## 697    Source        Book138 RegisterInformative   0.230216244   0.2818620971
## 698    Source        Book139 RegisterInformative  -0.109195838  -0.1030147559
## 699    Source         Book14 RegisterInformative   0.348389889   0.3987786309
## 700    Source        Book140 RegisterInformative  -0.091023882   0.0178726081
## 701    Source        Book141 RegisterInformative  -0.022600837  -0.0001478081
## 702    Source        Book142 RegisterInformative  -0.073373262   0.0526969951
## 703    Source        Book143 RegisterInformative  -0.102428269  -0.2142168866
## 704    Source        Book144 RegisterInformative  -0.190380911  -0.1251433966
## 705    Source        Book145 RegisterInformative  -0.057696497  -0.1078991984
## 706    Source        Book146 RegisterInformative   0.263600785   0.2428673892
## 707    Source        Book147 RegisterInformative  -0.068486530  -0.0437610483
## 708    Source        Book148 RegisterInformative  -0.011878464  -0.0827891507
## 709    Source        Book149 RegisterInformative  -0.033362047   0.0197688766
## 710    Source         Book15 RegisterInformative   0.336418217   0.3734146707
## 711    Source        Book150 RegisterInformative   0.030841406  -0.0737983866
## 712    Source        Book151 RegisterInformative  -0.126354095  -0.0546546802
## 713    Source        Book152 RegisterInformative  -0.206284402  -0.2333374780
## 714    Source        Book153 RegisterInformative   0.113899073   0.1040085345
## 715    Source        Book154 RegisterInformative  -0.096681990  -0.0799895406
## 716    Source        Book155 RegisterInformative  -0.464722040  -0.4249196494
## 717    Source        Book156 RegisterInformative  -0.326390558  -0.3066047865
## 718    Source        Book157 RegisterInformative  -0.242966610  -0.2322987821
## 719    Source        Book158 RegisterInformative  -0.276459045  -0.3808227571
## 720    Source        Book159 RegisterInformative   0.706020326   0.7931062366
## 721    Source         Book16 RegisterInformative  -0.171668207  -0.2144628428
## 722    Source        Book160 RegisterInformative   0.009286506  -0.0255946508
## 723    Source        Book161 RegisterInformative  -0.151672158  -0.1183863401
## 724    Source        Book162 RegisterInformative  -0.062205590  -0.1240643327
## 725    Source        Book163 RegisterInformative  -0.408986571  -0.3703912438
## 726    Source        Book164 RegisterInformative   0.270698635   0.2089918053
## 727    Source        Book165 RegisterInformative   0.114350344   0.0483711140
## 728    Source        Book166 RegisterInformative  -0.002040982   0.0123163607
## 729    Source        Book167 RegisterInformative  -0.817687871  -0.7505426685
## 730    Source        Book168 RegisterInformative  -0.057005130  -0.0657288723
## 731    Source        Book169 RegisterInformative   0.205485703   0.1834146258
## 732    Source         Book17 RegisterInformative   0.602996015   0.6994597664
## 733    Source        Book170 RegisterInformative  -0.030095767  -0.1383531700
## 734    Source        Book171 RegisterInformative   0.070787403  -0.0063666508
## 735    Source        Book172 RegisterInformative  -0.020740301  -0.0333092595
## 736    Source        Book173 RegisterInformative   0.152419592   0.0623252101
## 737    Source        Book174 RegisterInformative   0.621488335   0.6740937812
## 738    Source        Book175 RegisterInformative   0.180936961   0.2671710734
## 739    Source        Book176 RegisterInformative   0.356829496   0.3964038872
## 740    Source        Book177 RegisterInformative   1.046428401   1.1170054190
## 741    Source        Book178 RegisterInformative  -0.052349515  -0.1386477901
## 742    Source        Book179 RegisterInformative   0.140104791   0.2117126118
## 743    Source         Book18 RegisterInformative   0.106132638   0.1385068769
## 744    Source        Book180 RegisterInformative  -0.374541636  -0.3028550357
## 745    Source        Book181 RegisterInformative  -0.219030913  -0.2041107869
## 746    Source        Book182 RegisterInformative  -0.026714600  -0.0615882712
## 747    Source        Book183 RegisterInformative  -0.315645129  -0.3511216160
## 748    Source        Book184 RegisterInformative   0.637604478   0.6918733371
## 749    Source        Book185 RegisterInformative  -1.044484637  -1.0050679535
## 750    Source        Book186 RegisterInformative  -0.223694472  -0.1994080311
## 751    Source        Book187 RegisterInformative  -0.172334255  -0.1331500572
## 752    Source        Book188 RegisterInformative   0.215263733   0.2180386420
## 753    Source        Book189 RegisterInformative  -0.189420843  -0.2303830893
## 754    Source         Book19 RegisterInformative  -0.176808256  -0.2475001130
## 755    Source        Book190 RegisterInformative   0.433579224   0.4356832720
## 756    Source        Book191 RegisterInformative  -0.467692362  -0.4275883090
## 757    Source        Book192 RegisterInformative  -0.412487504  -0.5119842835
## 758    Source        Book193 RegisterInformative   0.114921695   0.0202997366
## 759    Source        Book194 RegisterInformative   0.316877356   0.3299754704
## 760    Source        Book195 RegisterInformative  -0.198849186  -0.2401340557
## 761    Source        Book196 RegisterInformative   0.800950193   0.7221514299
## 762    Source        Book197 RegisterInformative   0.388811033   0.4002308057
## 763    Source        Book198 RegisterInformative   0.143651850   0.2216239734
## 764    Source        Book199 RegisterInformative   0.156792198   0.0583332963
## 765    Source          Book2 RegisterInformative  -0.369336866  -0.3686292326
## 766    Source         Book20 RegisterInformative  -0.088674710  -0.1054730146
## 767    Source        Book200 RegisterInformative  -0.117902107  -0.1468709272
## 768    Source        Book201 RegisterInformative   0.497975492   0.4817895733
## 769    Source        Book202 RegisterInformative  -0.307241844  -0.4097631949
## 770    Source        Book203 RegisterInformative   0.285321641   0.3913446955
## 771    Source        Book204 RegisterInformative  -0.569034892  -0.6929099423
## 772    Source        Book205 RegisterInformative  -0.253752406  -0.2889909149
## 773    Source        Book206 RegisterInformative   0.246914775   0.2297869747
## 774    Source        Book207 RegisterInformative  -0.529418409  -0.5295690315
## 775    Source        Book208 RegisterInformative  -0.015084267  -0.0805088481
## 776    Source        Book209 RegisterInformative  -0.170795047  -0.2533710427
## 777    Source         Book21 RegisterInformative  -0.558706100  -0.5155493064
## 778    Source        Book210 RegisterInformative  -0.037654091  -0.0207252721
## 779    Source        Book211 RegisterInformative   0.565701864   0.5029241101
## 780    Source        Book212 RegisterInformative  -0.588445538  -0.5899780316
## 781    Source        Book213 RegisterInformative  -0.026384810   0.0037018695
## 782    Source        Book214 RegisterInformative  -0.058153580  -0.1100722747
## 783    Source        Book215 RegisterInformative  -0.317432801  -0.3760263936
## 784    Source        Book216 RegisterInformative  -0.343534340  -0.3934198842
## 785    Source        Book217 RegisterInformative   0.462377551   0.4517637463
## 786    Source        Book218 RegisterInformative  -0.200315938  -0.1993501469
## 787    Source        Book219 RegisterInformative  -0.068176436  -0.1946953933
## 788    Source         Book22 RegisterInformative   0.398204708   0.3232945565
## 789    Source        Book220 RegisterInformative  -0.409323693  -0.4727785692
## 790    Source        Book221 RegisterInformative  -0.032602264   0.0100616042
## 791    Source        Book222 RegisterInformative   0.103149242   0.0901158314
## 792    Source        Book223 RegisterInformative  -0.028535880  -0.0929941408
## 793    Source        Book224 RegisterInformative   0.130904934   0.1741160069
## 794    Source        Book225 RegisterInformative  -0.265730642  -0.2206717935
## 795    Source        Book226 RegisterInformative  -0.376007056  -0.4016700776
## 796    Source        Book227 RegisterInformative  -0.071117675   0.0346809555
## 797    Source        Book228 RegisterInformative   0.020341639  -0.0678769950
## 798    Source        Book229 RegisterInformative   0.324072953   0.2716720505
## 799    Source         Book23 RegisterInformative  -0.332178942  -0.4648207727
## 800    Source        Book230 RegisterInformative  -0.730137115  -0.7994106204
## 801    Source        Book231 RegisterInformative   0.054129399   0.0826036551
## 802    Source        Book232 RegisterInformative  -0.553390837  -0.5559228706
## 803    Source        Book233 RegisterInformative   0.432684066   0.3988676149
## 804    Source        Book234 RegisterInformative   0.172859144   0.1830600094
## 805    Source        Book235 RegisterInformative  -0.178747061  -0.1548455627
## 806    Source        Book236 RegisterInformative  -0.146275751  -0.2505678685
## 807    Source        Book237 RegisterInformative  -0.073606466  -0.1169048910
## 808    Source        Book238 RegisterInformative   0.214216183   0.3245141395
## 809    Source        Book239 RegisterInformative  -0.505819071  -0.3609925462
## 810    Source         Book24 RegisterInformative   0.140800737   0.0371412786
## 811    Source        Book240 RegisterInformative   0.632422646   0.6159387902
## 812    Source        Book241 RegisterInformative   0.698280523   0.6682280171
## 813    Source        Book242 RegisterInformative   0.144800294  -0.0288934246
## 814    Source        Book243 RegisterInformative   0.315690265   0.3309752457
## 815    Source        Book244 RegisterInformative   0.326260666   0.3716128058
## 816    Source        Book245 RegisterInformative   0.233307844   0.2537742074
## 817    Source        Book246 RegisterInformative  -0.111671903  -0.1918149464
## 818    Source        Book247 RegisterInformative   0.339535151   0.3789258029
## 819    Source        Book248 RegisterInformative   0.149795610   0.1290999875
## 820    Source        Book249 RegisterInformative   0.282678383   0.2396347779
## 821    Source         Book25 RegisterInformative  -0.411806807  -0.6018089198
## 822    Source        Book250 RegisterInformative  -0.002476937   0.0342979712
## 823    Source        Book251 RegisterInformative  -0.301982190  -0.3532201043
## 824    Source        Book252 RegisterInformative   0.116714681   0.0542022239
## 825    Source        Book253 RegisterInformative  -0.519693669  -0.4898525660
## 826    Source        Book254 RegisterInformative  -0.016605575   0.0579875529
## 827    Source        Book255 RegisterInformative   1.163870722   1.2446403876
## 828    Source        Book256 RegisterInformative   1.380954589   1.3150608242
## 829    Source        Book257 RegisterInformative  -0.253301011  -0.2508771350
## 830    Source        Book258 RegisterInformative   0.064658404   0.0257129490
## 831    Source        Book259 RegisterInformative   0.173640687   0.1564249980
## 832    Source         Book26 RegisterInformative  -0.696317750  -0.6189534363
## 833    Source        Book260 RegisterInformative  -0.317794462  -0.3908202560
## 834    Source        Book261 RegisterInformative  -0.583059855  -0.4573539764
## 835    Source        Book262 RegisterInformative   0.252357688   0.1082953628
## 836    Source        Book263 RegisterInformative   0.360565376   0.5222828459
## 837    Source        Book264 RegisterInformative   0.188547022   0.3025145995
## 838    Source        Book265 RegisterInformative   0.285847209   0.2435917476
## 839    Source        Book266 RegisterInformative  -0.039810953  -0.0764226921
## 840    Source        Book267 RegisterInformative   0.014239054   0.1410894428
## 841    Source        Book268 RegisterInformative  -0.038252000  -0.1269129338
## 842    Source        Book269 RegisterInformative  -0.449482657  -0.4744849502
## 843    Source         Book27 RegisterInformative   0.471659629   0.5047098009
## 844    Source        Book270 RegisterInformative  -0.212769875  -0.2382297861
## 845    Source        Book271 RegisterInformative  -0.257662381  -0.2782103736
## 846    Source        Book272 RegisterInformative  -0.568486137  -0.5711427403
## 847    Source        Book273 RegisterInformative   0.215316839   0.1605455667
## 848    Source        Book274 RegisterInformative  -0.020146697  -0.1338797820
## 849    Source        Book275 RegisterInformative  -0.529478831  -0.4114230066
## 850    Source        Book276 RegisterInformative   0.293083948   0.3131659368
## 851    Source        Book277 RegisterInformative  -0.547745671  -0.4682954533
## 852    Source        Book278 RegisterInformative  -0.073014646  -0.1043987250
## 853    Source        Book279 RegisterInformative   0.770366931   0.7195963940
## 854    Source         Book28 RegisterInformative  -0.275002347  -0.2182289059
## 855    Source        Book280 RegisterInformative  -0.254695701  -0.1492071126
## 856    Source        Book281 RegisterInformative   0.139945352   0.1203872953
## 857    Source        Book282 RegisterInformative  -0.115811881  -0.1373990249
## 858    Source        Book283 RegisterInformative  -0.220688225  -0.1284529760
## 859    Source        Book284 RegisterInformative  -0.368758514  -0.4376635793
## 860    Source        Book285 RegisterInformative  -0.299719339  -0.3580770481
## 861    Source        Book286 RegisterInformative  -0.488295649  -0.6773532856
## 862    Source        Book287 RegisterInformative  -0.556622899  -0.6169587708
## 863    Source        Book288 RegisterInformative  -0.570051958  -0.4962334415
## 864    Source        Book289 RegisterInformative  -0.653694286  -0.5609440298
## 865    Source         Book29 RegisterInformative   0.315056834   0.2607948010
## 866    Source        Book290 RegisterInformative   0.247248253   0.2669890131
## 867    Source        Book291 RegisterInformative  -0.339944491  -0.3474690011
## 868    Source        Book292 RegisterInformative   0.054121154   0.0333260321
## 869    Source        Book293 RegisterInformative   0.019496588   0.0861540317
## 870    Source        Book294 RegisterInformative  -0.056385654   0.0588171554
## 871    Source        Book295 RegisterInformative   0.258851665   0.2754724765
## 872    Source        Book296 RegisterInformative   0.721187704   0.7812527501
## 873    Source        Book297 RegisterInformative  -0.140926968  -0.2147648784
## 874    Source        Book298 RegisterInformative  -0.023459196   0.0401705837
## 875    Source        Book299 RegisterInformative  -0.149409642  -0.1801014288
## 876    Source          Book3 RegisterInformative   0.850250520   0.8273770830
## 877    Source         Book30 RegisterInformative  -0.649777076  -0.7073282678
## 878    Source        Book300 RegisterInformative   0.597208363   0.6066022234
## 879    Source         Book31 RegisterInformative   0.136264794   0.1872538564
## 880    Source         Book32 RegisterInformative  -0.353577006  -0.4823086434
## 881    Source         Book33 RegisterInformative  -0.438063876  -0.5671120202
## 882    Source         Book34 RegisterInformative  -0.557544768  -0.5312430832
## 883    Source         Book35 RegisterInformative   0.211424244   0.3076670496
## 884    Source         Book36 RegisterInformative  -0.519379164  -0.4948779098
## 885    Source         Book37 RegisterInformative  -0.339791492  -0.3311571144
## 886    Source         Book38 RegisterInformative   0.832492768   0.8839003385
## 887    Source         Book39 RegisterInformative   0.247932756   0.1328302344
## 888    Source          Book4 RegisterInformative  -0.117814626  -0.1135398414
## 889    Source         Book40 RegisterInformative  -0.002309198  -0.0396364411
## 890    Source         Book41 RegisterInformative  -0.016069474   0.0454374031
## 891    Source         Book42 RegisterInformative  -0.043789495  -0.1113775198
## 892    Source         Book43 RegisterInformative  -0.067734995  -0.0884226553
## 893    Source         Book44 RegisterInformative  -0.706053200  -0.7369427849
## 894    Source         Book45 RegisterInformative   0.470863563   0.5124665466
## 895    Source         Book46 RegisterInformative  -0.059754928  -0.0779050063
## 896    Source         Book47 RegisterInformative  -0.210873793  -0.1977215397
## 897    Source         Book48 RegisterInformative   0.861093842   0.7559270014
## 898    Source         Book49 RegisterInformative  -0.483583710  -0.4983115044
## 899    Source          Book5 RegisterInformative  -0.102770159  -0.1772189070
## 900    Source         Book50 RegisterInformative  -0.051715501  -0.1273257395
## 901    Source         Book51 RegisterInformative  -0.059130650  -0.0586517909
## 902    Source         Book52 RegisterInformative   0.459122872   0.3759739676
## 903    Source         Book53 RegisterInformative  -0.068010764  -0.1630077181
## 904    Source         Book54 RegisterInformative  -0.330142147  -0.3536237984
## 905    Source         Book55 RegisterInformative  -0.308960951  -0.3600826691
## 906    Source         Book56 RegisterInformative   0.002846205   0.0154659620
## 907    Source         Book57 RegisterInformative  -0.058796612  -0.1349012113
## 908    Source         Book58 RegisterInformative  -0.031844143  -0.0779926998
## 909    Source         Book59 RegisterInformative   0.214824912   0.3625304017
## 910    Source          Book6 RegisterInformative   0.635949600   0.5853487310
## 911    Source         Book60 RegisterInformative   0.498094686   0.6229964346
## 912    Source         Book61 RegisterInformative   0.081960431   0.1170187586
## 913    Source         Book62 RegisterInformative  -0.075455073  -0.1211639689
## 914    Source         Book63 RegisterInformative  -0.135224779  -0.0375457615
## 915    Source         Book64 RegisterInformative   0.185796574   0.1493612038
## 916    Source         Book65 RegisterInformative   0.198926857   0.2641437991
## 917    Source         Book66 RegisterInformative  -0.069080632   0.0188153927
## 918    Source         Book67 RegisterInformative  -0.026187627  -0.0160995970
## 919    Source         Book68 RegisterInformative  -0.309803624  -0.3482745824
## 920    Source         Book69 RegisterInformative   0.045627158   0.1083237727
## 921    Source          Book7 RegisterInformative  -0.080986058  -0.0272586912
## 922    Source         Book70 RegisterInformative   0.295907655   0.3471591364
## 923    Source         Book71 RegisterInformative   0.044373477  -0.0737360709
## 924    Source         Book72 RegisterInformative   0.441358512   0.3107308300
## 925    Source         Book73 RegisterInformative  -0.272615236  -0.2785027784
## 926    Source         Book74 RegisterInformative  -0.136613370  -0.2972280046
## 927    Source         Book75 RegisterInformative   0.136283059   0.0881998425
## 928    Source         Book76 RegisterInformative   1.212224310   1.1458100349
## 929    Source         Book77 RegisterInformative   0.632082990   0.6941452902
## 930    Source         Book78 RegisterInformative  -0.539320837  -0.4143147924
## 931    Source         Book79 RegisterInformative   0.179109135   0.1682957011
## 932    Source          Book8 RegisterInformative  -0.245201264  -0.1734773436
## 933    Source         Book80 RegisterInformative  -0.820831059  -0.8107559995
## 934    Source         Book81 RegisterInformative   0.327908082   0.2591047821
## 935    Source         Book82 RegisterInformative  -0.099982602  -0.1381288263
## 936    Source         Book83 RegisterInformative   0.370163293   0.3981030756
## 937    Source         Book84 RegisterInformative  -0.318536462  -0.2522495068
## 938    Source         Book85 RegisterInformative  -0.754756418  -0.7559486923
## 939    Source         Book86 RegisterInformative   0.208454708   0.1890697241
## 940    Source         Book87 RegisterInformative   0.229617397   0.1343008796
## 941    Source         Book88 RegisterInformative   0.635793593   0.5436905777
## 942    Source         Book89 RegisterInformative   0.464030314   0.5084559112
## 943    Source          Book9 RegisterInformative   0.657754833   0.6539115902
## 944    Source         Book90 RegisterInformative  -0.137134179  -0.0893880420
## 945    Source         Book91 RegisterInformative  -0.222622976  -0.1744997842
## 946    Source         Book92 RegisterInformative  -0.248724413  -0.1322318275
## 947    Source         Book93 RegisterInformative  -0.385023618  -0.4771781856
## 948    Source         Book94 RegisterInformative  -0.262736521  -0.3246328159
## 949    Source         Book95 RegisterInformative  -0.208486458  -0.1274984683
## 950    Source         Book96 RegisterInformative  -0.055337345  -0.1356168133
## 951    Source         Book97 RegisterInformative   0.934099190   0.9209802723
## 952    Source         Book98 RegisterInformative   0.280051754   0.2491097030
## 953    Source         Book99 RegisterInformative  -0.317900168  -0.3044575383
## 954    Source           Dogo RegisterInformative  -0.670391695  -0.7496301170
## 955    Source      Ducksters RegisterInformative  -1.743683603  -1.7729557246
## 956    Source            EIM RegisterInformative   1.237321949   1.1749446823
## 957    Source   Encyclopedia RegisterInformative  -0.468485018  -0.4884756132
## 958    Source    Factmonster RegisterInformative  -3.550203181  -3.4712782120
## 959    Source      GreenLine RegisterInformative   1.067112590   1.0157536622
## 960    Source        History RegisterInformative  -1.386587783  -1.3985205183
## 961    Source             HT RegisterInformative  -4.275797965  -4.3110539287
## 962    Source            JTT RegisterInformative  -2.999644056  -3.0520810724
## 963    Source            NGL RegisterInformative  -0.853514790  -0.8024717043
## 964    Source            POC RegisterInformative   0.475832662   0.5308849098
## 965    Source          Quatr RegisterInformative   0.458318078   0.4318709564
## 966    Source       Revision RegisterInformative   0.210556674   0.2278987316
## 967    Source        Science RegisterInformative   0.065236175   0.0897473194
## 968    Source   Science_Tech RegisterInformative  -0.178925983  -0.0795799547
## 969    Source      Solutions RegisterInformative   2.480714848   2.5009172615
## 970    Source Spoken.BNC2014 RegisterInformative   0.075535409   0.0414710534
## 971    Source           Teen RegisterInformative   2.751041458   2.8125067256
## 972    Source      TeenVogue RegisterInformative   3.325165816   3.3345910043
## 973    Source   TweenTribute RegisterInformative   1.878663801   1.8220531648
## 974    Source       WhyFiles RegisterInformative   0.783654727   0.7160627460
## 975    Source          World RegisterInformative  -0.408280104  -0.2881024798
##           sd
## 1   1.290196
## 2   1.359719
## 3   2.510588
## 4   2.009644
## 5   2.005272
## 6   1.971217
## 7   2.115101
## 8   2.048888
## 9   2.016616
## 10  2.033484
## 11  2.028153
## 12  2.080875
## 13  2.025305
## 14  1.960662
## 15  1.969154
## 16  1.997946
## 17  1.941083
## 18  2.005896
## 19  2.074364
## 20  1.955372
## 21  2.044805
## 22  2.009814
## 23  2.097194
## 24  2.044394
## 25  2.047731
## 26  2.016328
## 27  2.167799
## 28  2.011712
## 29  2.044992
## 30  1.976326
## 31  2.026344
## 32  1.949097
## 33  1.942944
## 34  2.011134
## 35  2.064394
## 36  1.892210
## 37  2.099910
## 38  2.055091
## 39  2.021516
## 40  2.089210
## 41  2.047276
## 42  1.920610
## 43  2.084027
## 44  2.051698
## 45  2.061696
## 46  2.029176
## 47  1.946341
## 48  2.060504
## 49  2.034451
## 50  2.068533
## 51  2.049414
## 52  1.912158
## 53  2.049152
## 54  2.051001
## 55  2.050117
## 56  2.040027
## 57  2.112108
## 58  2.100282
## 59  1.950367
## 60  2.048373
## 61  1.983745
## 62  1.995542
## 63  1.963661
## 64  2.070975
## 65  2.024492
## 66  2.088109
## 67  1.971763
## 68  1.952851
## 69  2.042823
## 70  2.123959
## 71  2.042184
## 72  2.100306
## 73  2.092798
## 74  1.986585
## 75  2.002818
## 76  2.038192
## 77  1.947067
## 78  2.000182
## 79  2.005480
## 80  2.036312
## 81  1.958125
## 82  2.034941
## 83  2.050019
## 84  1.976223
## 85  1.934188
## 86  1.959658
## 87  2.025181
## 88  2.051625
## 89  2.069451
## 90  2.035398
## 91  1.970898
## 92  2.025794
## 93  1.914719
## 94  1.943866
## 95  2.045348
## 96  2.110767
## 97  2.079281
## 98  2.101888
## 99  1.999373
## 100 2.067583
## 101 2.005627
## 102 2.035437
## 103 2.017328
## 104 2.068789
## 105 2.046501
## 106 2.069348
## 107 1.998190
## 108 1.999178
## 109 2.106439
## 110 2.005990
## 111 1.943112
## 112 2.062106
## 113 1.977453
## 114 2.044890
## 115 1.916464
## 116 2.013834
## 117 2.028857
## 118 1.896021
## 119 1.862892
## 120 2.048383
## 121 2.162567
## 122 1.970734
## 123 2.004845
## 124 1.993258
## 125 2.004763
## 126 1.994322
## 127 1.996041
## 128 2.034655
## 129 2.062160
## 130 2.055643
## 131 2.039483
## 132 1.911981
## 133 2.000252
## 134 2.119595
## 135 1.904832
## 136 2.104795
## 137 1.923315
## 138 2.040870
## 139 1.899731
## 140 2.075167
## 141 2.090183
## 142 2.020349
## 143 1.882679
## 144 1.988483
## 145 1.861661
## 146 2.029946
## 147 1.971002
## 148 2.089888
## 149 2.107564
## 150 2.077047
## 151 2.002007
## 152 2.043856
## 153 1.989553
## 154 2.008169
## 155 2.087345
## 156 1.963013
## 157 2.131638
## 158 2.067822
## 159 2.873881
## 160 2.113750
## 161 2.045114
## 162 2.048263
## 163 2.028369
## 164 2.002591
## 165 1.933058
## 166 2.095563
## 167 1.958060
## 168 2.039769
## 169 2.058966
## 170 2.092580
## 171 2.134106
## 172 1.944146
## 173 1.966949
## 174 2.039747
## 175 2.013729
## 176 2.072513
## 177 2.028496
## 178 2.026584
## 179 2.061238
## 180 1.923340
## 181 2.126789
## 182 2.134291
## 183 1.991895
## 184 1.965668
## 185 2.958981
## 186 2.065338
## 187 1.907228
## 188 1.964171
## 189 2.030547
## 190 3.033967
## 191 2.078220
## 192 1.954203
## 193 1.943176
## 194 1.952785
## 195 2.054621
## 196 2.143379
## 197 2.081906
## 198 1.967058
## 199 2.047059
## 200 1.983262
## 201 1.986814
## 202 1.993058
## 203 2.064306
## 204 2.055255
## 205 2.092959
## 206 2.090873
## 207 2.044723
## 208 1.923282
## 209 2.097893
## 210 2.082091
## 211 2.142074
## 212 2.095931
## 213 2.015362
## 214 2.020303
## 215 2.009579
## 216 2.026344
## 217 2.028198
## 218 2.004641
## 219 2.018059
## 220 2.034653
## 221 2.059102
## 222 2.124875
## 223 1.961029
## 224 2.071815
## 225 1.995713
## 226 2.116482
## 227 1.940377
## 228 2.007999
## 229 2.073191
## 230 2.040412
## 231 2.024606
## 232 1.987063
## 233 2.010875
## 234 2.024049
## 235 1.950578
## 236 2.004324
## 237 2.048674
## 238 2.031659
## 239 2.007426
## 240 2.059055
## 241 2.016101
## 242 1.931302
## 243 2.029270
## 244 1.975436
## 245 2.088698
## 246 2.037077
## 247 2.010427
## 248 1.970136
## 249 1.975429
## 250 1.978255
## 251 2.031361
## 252 2.098680
## 253 1.935349
## 254 2.020143
## 255 2.012662
## 256 1.949487
## 257 1.833694
## 258 1.964397
## 259 1.989521
## 260 2.034588
## 261 1.981868
## 262 2.124144
## 263 2.018369
## 264 1.884384
## 265 1.980487
## 266 1.988142
## 267 2.093288
## 268 1.878200
## 269 1.977295
## 270 1.967987
## 271 2.022501
## 272 1.891477
## 273 2.013864
## 274 1.907055
## 275 1.953401
## 276 1.938692
## 277 2.013092
## 278 1.994753
## 279 1.901902
## 280 1.989799
## 281 1.946057
## 282 1.992655
## 283 2.191434
## 284 2.037295
## 285 2.118522
## 286 1.963641
## 287 1.913415
## 288 1.964788
## 289 2.116387
## 290 1.998107
## 291 1.935369
## 292 2.038261
## 293 2.064849
## 294 2.175006
## 295 2.041414
## 296 1.964980
## 297 1.999206
## 298 2.037626
## 299 2.068411
## 300 2.045083
## 301 1.984966
## 302 2.073331
## 303 1.984694
## 304 2.428503
## 305 2.467283
## 306 1.484947
## 307 2.628259
## 308 2.441499
## 309 1.266452
## 310 2.520937
## 311 1.356217
## 312 1.330515
## 313 1.227540
## 314 1.651448
## 315 2.487183
## 316 2.432468
## 317 2.495821
## 318 2.545252
## 319 1.438225
## 320 3.958293
## 321 2.573778
## 322 2.503836
## 323 2.496813
## 324 2.613186
## 325 2.483875
## 326 1.193953
## 327 1.176907
## 328 2.191723
## 329 2.424384
## 330 2.521844
## 331 2.532945
## 332 2.552927
## 333 2.482091
## 334 2.604573
## 335 2.521811
## 336 2.513247
## 337 2.562089
## 338 2.529070
## 339 2.571434
## 340 2.566226
## 341 2.580555
## 342 2.564732
## 343 2.461038
## 344 2.617011
## 345 2.618553
## 346 2.433620
## 347 2.643146
## 348 2.602245
## 349 2.634059
## 350 2.517544
## 351 2.522118
## 352 2.596053
## 353 2.523319
## 354 2.554009
## 355 2.497908
## 356 2.489962
## 357 2.526359
## 358 2.666859
## 359 2.592212
## 360 2.464549
## 361 2.510704
## 362 2.585931
## 363 2.588038
## 364 2.569089
## 365 2.412895
## 366 2.725195
## 367 2.548240
## 368 2.637522
## 369 2.554894
## 370 2.489182
## 371 2.626007
## 372 2.620306
## 373 2.499348
## 374 2.536720
## 375 2.636109
## 376 2.539037
## 377 2.545811
## 378 2.530222
## 379 2.639541
## 380 2.634990
## 381 2.630686
## 382 2.592456
## 383 2.713891
## 384 2.535931
## 385 2.571295
## 386 2.481119
## 387 2.573297
## 388 2.768981
## 389 2.552295
## 390 2.557531
## 391 2.511359
## 392 2.545022
## 393 2.574046
## 394 2.511111
## 395 2.580591
## 396 2.683785
## 397 2.556316
## 398 2.541367
## 399 2.480745
## 400 2.434755
## 401 2.536563
## 402 2.782917
## 403 2.558605
## 404 2.692531
## 405 2.527517
## 406 2.592625
## 407 2.561296
## 408 2.432452
## 409 2.596429
## 410 2.491955
## 411 2.537090
## 412 2.428173
## 413 2.595577
## 414 2.511041
## 415 2.415213
## 416 2.676048
## 417 2.436148
## 418 2.550238
## 419 2.568701
## 420 2.585552
## 421 2.702124
## 422 2.568922
## 423 2.630112
## 424 2.513170
## 425 2.566208
## 426 2.531783
## 427 2.716950
## 428 2.449182
## 429 2.490702
## 430 2.499390
## 431 2.659461
## 432 2.696999
## 433 2.486327
## 434 2.751133
## 435 2.543737
## 436 2.458533
## 437 2.454571
## 438 2.462556
## 439 2.520118
## 440 2.497254
## 441 2.530238
## 442 2.625102
## 443 2.430602
## 444 2.576912
## 445 2.591835
## 446 2.486402
## 447 2.599078
## 448 2.431196
## 449 2.586003
## 450 2.617365
## 451 2.642217
## 452 2.647948
## 453 2.409836
## 454 2.601363
## 455 2.596131
## 456 2.494653
## 457 2.475953
## 458 2.510714
## 459 2.496369
## 460 2.402256
## 461 2.506077
## 462 2.514736
## 463 2.489406
## 464 2.528682
## 465 2.518221
## 466 2.687515
## 467 2.543948
## 468 2.415526
## 469 2.489688
## 470 2.443233
## 471 2.596443
## 472 2.569538
## 473 2.592350
## 474 2.630227
## 475 2.606971
## 476 2.563332
## 477 2.583912
## 478 2.702494
## 479 2.737811
## 480 2.626575
## 481 2.542442
## 482 2.588752
## 483 2.497402
## 484 2.540525
## 485 2.483411
## 486 2.620975
## 487 2.742715
## 488 2.440184
## 489 2.547879
## 490 2.338789
## 491 2.614354
## 492 2.521597
## 493 2.575491
## 494 2.513956
## 495 2.539307
## 496 2.492808
## 497 2.508954
## 498 2.500726
## 499 2.493727
## 500 2.795678
## 501 2.645321
## 502 2.585398
## 503 2.665253
## 504 2.559871
## 505 2.590067
## 506 2.533042
## 507 2.645450
## 508 2.680018
## 509 2.383111
## 510 2.553383
## 511 2.528032
## 512 2.617265
## 513 2.572867
## 514 2.552048
## 515 2.649133
## 516 2.518466
## 517 2.490822
## 518 2.585277
## 519 2.627326
## 520 2.461537
## 521 2.554136
## 522 2.518086
## 523 2.673662
## 524 2.486331
## 525 2.571790
## 526 2.511931
## 527 2.504615
## 528 2.561023
## 529 2.495055
## 530 2.577001
## 531 2.629534
## 532 2.517455
## 533 2.579493
## 534 2.411135
## 535 2.469142
## 536 2.554760
## 537 2.569947
## 538 2.545717
## 539 2.494875
## 540 2.520458
## 541 2.595579
## 542 2.535848
## 543 2.637295
## 544 2.583085
## 545 2.633520
## 546 2.596876
## 547 2.374014
## 548 2.640739
## 549 2.551324
## 550 2.543713
## 551 2.485095
## 552 2.611989
## 553 2.584816
## 554 2.545236
## 555 2.625202
## 556 2.460264
## 557 2.583265
## 558 2.616475
## 559 2.369880
## 560 2.530388
## 561 2.468212
## 562 2.505029
## 563 2.584160
## 564 2.559310
## 565 2.560657
## 566 2.588410
## 567 2.522927
## 568 2.549805
## 569 2.601262
## 570 2.419453
## 571 2.530546
## 572 2.472160
## 573 2.553297
## 574 2.478674
## 575 2.682588
## 576 2.394791
## 577 2.680753
## 578 2.630481
## 579 2.638941
## 580 2.553685
## 581 2.499343
## 582 2.587589
## 583 2.559265
## 584 2.363247
## 585 2.730654
## 586 2.398941
## 587 2.499837
## 588 2.607393
## 589 2.412933
## 590 2.581457
## 591 2.461373
## 592 2.544545
## 593 2.704661
## 594 2.495810
## 595 2.448338
## 596 2.349370
## 597 2.476047
## 598 2.551054
## 599 2.731237
## 600 2.508042
## 601 2.650888
## 602 2.461713
## 603 2.542168
## 604 2.497323
## 605 2.492921
## 606 2.600913
## 607 2.475344
## 608 2.724788
## 609 2.482292
## 610 2.468376
## 611 2.493166
## 612 2.497782
## 613 2.597521
## 614 2.514542
## 615 2.484145
## 616 2.548649
## 617 2.564210
## 618 2.581785
## 619 2.565860
## 620 2.689157
## 621 2.555166
## 622 2.566169
## 623 2.632502
## 624 2.560374
## 625 2.634459
## 626 2.656622
## 627 2.619652
## 628 2.571939
## 629 2.140158
## 630 2.161094
## 631 1.273599
## 632 2.311206
## 633 2.217782
## 634 1.180507
## 635 2.160592
## 636 1.215045
## 637 1.168098
## 638 1.184790
## 639 1.584217
## 640 2.093207
## 641 2.083396
## 642 2.155245
## 643 2.231620
## 644 1.172364
## 645 2.683018
## 646 2.198944
## 647 2.163242
## 648 2.326415
## 649 2.237784
## 650 2.190490
## 651 1.513740
## 652 1.632922
## 653 1.809163
## 654 2.109545
## 655 2.058444
## 656 2.128805
## 657 2.106327
## 658 2.001390
## 659 2.153629
## 660 2.055380
## 661 2.120588
## 662 1.956496
## 663 2.097987
## 664 2.026100
## 665 2.108134
## 666 2.189181
## 667 2.117661
## 668 2.004098
## 669 2.017742
## 670 2.094492
## 671 1.974951
## 672 2.080925
## 673 2.116347
## 674 2.096053
## 675 2.058166
## 676 1.994869
## 677 1.992457
## 678 2.009882
## 679 2.043975
## 680 2.074250
## 681 2.004047
## 682 2.039384
## 683 2.053544
## 684 2.148223
## 685 2.132181
## 686 2.043379
## 687 2.079544
## 688 1.959353
## 689 2.062883
## 690 1.984617
## 691 2.144202
## 692 2.136313
## 693 2.010840
## 694 2.001035
## 695 2.094812
## 696 2.125580
## 697 2.152643
## 698 2.051323
## 699 2.087526
## 700 2.126270
## 701 2.094501
## 702 2.046526
## 703 2.082257
## 704 2.027585
## 705 2.018020
## 706 2.063798
## 707 2.105169
## 708 2.034495
## 709 2.036700
## 710 1.973873
## 711 2.099295
## 712 2.075092
## 713 2.237424
## 714 2.158990
## 715 2.140423
## 716 2.035073
## 717 2.026759
## 718 2.116831
## 719 2.058611
## 720 2.051224
## 721 2.103557
## 722 2.204428
## 723 2.074486
## 724 2.124220
## 725 1.952977
## 726 2.030109
## 727 2.160609
## 728 2.140546
## 729 2.161691
## 730 2.020068
## 731 2.119320
## 732 2.209663
## 733 2.025725
## 734 2.086865
## 735 2.031086
## 736 1.996457
## 737 2.027883
## 738 2.040140
## 739 2.000743
## 740 1.987152
## 741 2.118928
## 742 2.034942
## 743 2.079291
## 744 2.079692
## 745 2.052837
## 746 2.138795
## 747 2.097013
## 748 2.059274
## 749 2.063625
## 750 2.086914
## 751 2.130523
## 752 2.099417
## 753 2.051342
## 754 2.048008
## 755 1.952570
## 756 2.152947
## 757 2.136326
## 758 1.998388
## 759 2.083767
## 760 2.102628
## 761 2.080830
## 762 2.003065
## 763 2.082593
## 764 2.121819
## 765 2.011999
## 766 2.156295
## 767 1.922607
## 768 2.131392
## 769 2.118014
## 770 2.122845
## 771 2.120259
## 772 1.984920
## 773 1.995102
## 774 2.124407
## 775 2.138020
## 776 2.123703
## 777 2.024604
## 778 1.954508
## 779 2.149775
## 780 2.120959
## 781 2.019074
## 782 2.042520
## 783 2.011214
## 784 2.007158
## 785 2.072492
## 786 1.997368
## 787 2.041860
## 788 1.987650
## 789 2.096780
## 790 2.080911
## 791 2.135164
## 792 2.139845
## 793 2.017740
## 794 2.050348
## 795 1.929369
## 796 2.116272
## 797 2.042323
## 798 2.033835
## 799 2.080483
## 800 2.070307
## 801 2.114492
## 802 2.109327
## 803 2.151916
## 804 2.139388
## 805 2.111744
## 806 1.934807
## 807 2.110259
## 808 2.118225
## 809 1.982764
## 810 2.021326
## 811 2.102993
## 812 2.161909
## 813 2.001453
## 814 2.043789
## 815 1.958304
## 816 2.151959
## 817 2.011894
## 818 2.054906
## 819 2.105352
## 820 2.009032
## 821 2.166549
## 822 2.126462
## 823 2.065118
## 824 2.012789
## 825 2.132537
## 826 2.079599
## 827 2.129852
## 828 2.044144
## 829 2.109267
## 830 2.063037
## 831 2.033091
## 832 2.054775
## 833 2.055604
## 834 2.104275
## 835 2.068880
## 836 2.117076
## 837 2.094117
## 838 2.085858
## 839 2.159849
## 840 2.047203
## 841 2.093090
## 842 1.972063
## 843 2.063294
## 844 2.098411
## 845 2.133772
## 846 2.100061
## 847 2.003267
## 848 1.979587
## 849 1.967856
## 850 2.075073
## 851 2.049968
## 852 2.047140
## 853 2.057309
## 854 1.984074
## 855 2.058768
## 856 2.143103
## 857 2.033499
## 858 2.128031
## 859 1.988740
## 860 1.990932
## 861 2.200287
## 862 2.103233
## 863 2.116960
## 864 2.096530
## 865 2.063334
## 866 2.087188
## 867 2.068500
## 868 2.059579
## 869 2.162446
## 870 2.036963
## 871 2.057512
## 872 2.003827
## 873 2.069747
## 874 2.108603
## 875 2.119820
## 876 2.054354
## 877 2.094425
## 878 1.961454
## 879 2.041597
## 880 2.087686
## 881 2.052192
## 882 2.065552
## 883 2.057895
## 884 1.921396
## 885 2.001025
## 886 1.986720
## 887 2.053027
## 888 2.082929
## 889 2.033056
## 890 2.041758
## 891 2.132878
## 892 2.109659
## 893 2.147723
## 894 2.117232
## 895 2.112056
## 896 2.056692
## 897 2.022522
## 898 2.114222
## 899 1.985420
## 900 2.160718
## 901 2.055353
## 902 2.141800
## 903 2.199766
## 904 2.202712
## 905 2.171786
## 906 2.102622
## 907 2.101655
## 908 2.090374
## 909 1.981467
## 910 2.086609
## 911 1.922598
## 912 2.035327
## 913 2.072840
## 914 1.926529
## 915 2.025484
## 916 2.052837
## 917 2.088815
## 918 2.120195
## 919 1.953715
## 920 2.025463
## 921 1.891888
## 922 2.060415
## 923 2.132616
## 924 2.137157
## 925 2.004492
## 926 2.053331
## 927 1.934652
## 928 2.002595
## 929 2.069764
## 930 1.953618
## 931 2.013820
## 932 1.998012
## 933 2.038309
## 934 2.001905
## 935 2.104656
## 936 2.036542
## 937 2.113036
## 938 2.070706
## 939 2.012276
## 940 1.959332
## 941 2.080930
## 942 2.130407
## 943 2.157330
## 944 2.092434
## 945 2.041466
## 946 1.987416
## 947 2.025688
## 948 2.101839
## 949 2.088773
## 950 2.146136
## 951 2.093944
## 952 2.125968
## 953 2.122707
## 954 1.940596
## 955 1.829106
## 956 1.511929
## 957 1.947638
## 958 1.885730
## 959 1.587666
## 960 1.736776
## 961 1.464111
## 962 1.493073
## 963 1.376340
## 964 1.652360
## 965 1.972096
## 966 1.829364
## 967 1.847455
## 968 1.823430
## 969 1.430790
## 970 2.156096
## 971 1.887226
## 972 1.876439
## 973 1.983400
## 974 1.910087
## 975 1.842566
# We can access the estimated deviation between each series average Dim1 and the overall average:
ranef(md_final1)
## $Source
##                          (Intercept)       RegisterFiction
## Access          -0.76244356309470196  1.658131412388347048
## Achievers       -0.27292168586377225 -1.746777523614002181
## BBC             -1.48451072245553073  0.013613910897331827
## Book1            1.56858377181185560  0.808150163526446752
## Book10          -1.17679073167432491 -0.606294441731024314
## Book100         -4.08057225803153933 -2.102351941203952634
## Book101         -0.04599447611808670 -0.023696817514062628
## Book102         -1.47092730944075067 -0.757836570173723967
## Book103          2.19972141274745159  1.133318635173096389
## Book104          2.29814210269453323  1.184025966272949315
## Book105          1.29592733002658322  0.667674817564663847
## Book106         -3.09785005023388571 -1.596043558314470756
## Book107          4.52201865598057129  2.329789573227002197
## Book108         -0.63054392914807389 -0.324862585351766708
## Book109         -3.49936336126617986 -1.802907261611608858
## Book11          -3.37502043363838800 -1.738844532478764915
## Book110         -1.49417949677374717 -0.769816331365440920
## Book111         -0.48989333975532773 -0.252397984569531553
## Book112         -2.84457841343940521 -1.465555459195834187
## Book113         -1.10070028342448234 -0.567091876142269302
## Book114         -3.68352499533869393 -1.897789191009034315
## Book115          4.66096903394114559  2.401378207948874799
## Book116         -0.37975076958218851 -0.195651422673235820
## Book117         -3.63227918597451982 -1.871386833696702112
## Book118          3.20314549072983690  1.650292830163751612
## Book119          1.63438913822902987  0.842053751327516586
## Book12          -2.30167216717778222 -1.185844691061936462
## Book120         -0.51048745006055729 -0.263008277695048087
## Book121          2.53380098585006452  1.305439797259239976
## Book122         -6.01759201207765315 -3.100324034959673902
## Book123         -0.59616852758626504 -0.307152032117256113
## Book124         -0.62649694700669833 -0.322777539377101075
## Book125          1.38709218808705370  0.714643870970294470
## Book126         -1.98982704921284870 -1.025178944286307070
## Book127         -1.44682501639166605 -0.745418825951825625
## Book128          1.58625639205053015  0.817255275534157555
## Book129          2.61045418013731867  1.344932295276424661
## Book13          -4.24757612462301193 -2.188394015921805824
## Book130         -0.24074052502189336 -0.124031944075998379
## Book131          0.28764208414656556  0.148196099894380873
## Book132         -1.38522228527515323 -0.713680478201370372
## Book133         -1.46180363964273674 -0.753135963568117073
## Book134          3.28645585090645653  1.693215167121510323
## Book135          1.26460512505072198  0.651537301973762251
## Book136          0.73354049221460527  0.377927452387036178
## Book137         -0.18111339169628918 -0.093311444212583597
## Book138         -1.41726288944770662 -0.730188120296650811
## Book139          0.59782291063915793  0.308004386934866703
## Book14          -2.45283533148215094 -1.263725476358243505
## Book140         -0.14506172534219311 -0.074737262467856447
## Book141          0.59581139288841412  0.306968032722607143
## Book142          0.85556059577308585  0.440793439155723221
## Book143          1.40360339629107189  0.723150611795926990
## Book144          2.95272350408224460  1.521272899512483123
## Book145          0.99684577112291228  0.513584985016825701
## Book146         -2.26049591988726961 -1.164630273585976150
## Book147          1.46440391497127642  0.754475651616493215
## Book148         -0.09125362550981052 -0.047014787289907572
## Book149          0.65692321788718644  0.338453460695070651
## Book15          -3.07307725126788700 -1.583280362688485710
## Book150          0.76468309739129081  0.393972436351844202
## Book151          1.35201036064849545  0.696569360006478289
## Book152          1.67603234499739395  0.863508751031322741
## Book153          0.75421841575944781  0.388580926938064342
## Book154          1.05227026914785649  0.542140244829626861
## Book155          3.63999206891953175  1.875360588701238118
## Book156          1.83593603286153928  0.945892742130901798
## Book157          1.26110891562681160  0.649736019652453312
## Book158          3.06696094967654043  1.580129182483735573
## Book159         -4.75286219961775647 -2.448722492776416182
## Book16           2.78989832615154265  1.437383727295098224
## Book160          0.87577155984007793  0.451206331478904654
## Book161          0.29567618182959371  0.152335347968346912
## Book162          0.62681031822576283  0.322938991386538865
## Book163          2.68561070943145941  1.383653696409487877
## Book164         -2.73780034617078316 -1.410542323095044681
## Book165         -0.55178343055051871 -0.284284382921738410
## Book166          0.08469431108050204  0.043635362407457495
## Book167          5.73246143581028988  2.953421889229392416
## Book168          0.70593001642166486  0.363702257068756363
## Book169         -0.41604190233518162 -0.214348979919422644
## Book17          -3.77282201548776230 -1.943795915503280458
## Book170         -1.17590470599840224 -0.605837952375624100
## Book171         -0.64879126874410253 -0.334263798562980441
## Book172          1.65780895204125467  0.854119875370255466
## Book173         -0.81128119371634722 -0.417980245078321766
## Book174         -4.08032081831269622 -2.102222396927420078
## Book175         -1.27564246113942348 -0.657223848733504479
## Book176         -2.60991331583930153 -1.344653636540600550
## Book177         -6.94332121693758086 -3.577269048501796611
## Book178          1.49857577009402254  0.772081335674763336
## Book179          0.46438025985324111  0.239253388746562268
## Book18          -2.23296925733394325 -1.150448259693206854
## Book180          2.93084824854291126  1.510002547454158517
## Book181          1.33013510510916233  0.685299007948153127
## Book182         -0.25976613041434049 -0.133834127666955405
## Book183          2.20909652226430886  1.138148786055235284
## Book184         -5.72056986420450642 -2.947295231724387676
## Book185          7.98139814774100476  4.112096742411181616
## Book186          1.06870963743220448  0.550609973004821174
## Book187          1.44030162192219180  0.742057907394594762
## Book188         -1.58420688943945431 -0.816199351139138773
## Book189          1.05136029683204391  0.541671417924080467
## Book19           0.83010531757022743  0.427678623350578713
## Book190         -3.73334597962942549 -1.923457464087682478
## Book191          2.84535874413632017  1.465957493433118319
## Book192          2.18637116100888784  1.126440450966728957
## Book193         -0.62377900337920567 -0.321377227435535928
## Book194         -2.64037344177912692 -1.360347000326248335
## Book195          2.43573949550132962  1.254917529411576194
## Book196         -4.62657959415889319 -2.383660422081750774
## Book197         -1.92393786955606116 -0.991232175059726606
## Book198         -0.63855408019121296 -0.328989495875586846
## Book199         -0.39101766365034002 -0.201456240016905430
## Book2            3.17009912768191393  1.633267010962340837
## Book20          -0.24167444397759577 -0.124513108531690161
## Book200          0.08643044247251248  0.044529834793039083
## Book201         -4.24733665822411410 -2.188270640420346247
## Book202          1.99774347859692458  1.029257568467083939
## Book203         -1.06164331376421717 -0.546969331854225360
## Book204          4.48815810717639341  2.312344277320629526
## Book205          1.94429457836288933  1.001720156541324069
## Book206         -2.27589360933641194 -1.172563318329821858
## Book207          2.45384315525801844  1.264244717321913791
## Book208          0.06426782725450225  0.033111432132962540
## Book209          2.19466867173070401  1.130715412092301086
## Book21           4.38110465354904033  2.257189259393161507
## Book210          0.00635287868101807  0.003273067104983272
## Book211         -2.95754668711954283 -1.523757852009351765
## Book212          3.55658592218335556  1.832388901542895354
## Book213          1.24174805727590742  0.639761110359452712
## Book214          1.10648546185836594  0.570072458360056600
## Book215          2.03633348877933962  1.049139530527281483
## Book216          2.63017423808656847  1.355092267821614627
## Book217         -4.01748483524185929 -2.069848665344448335
## Book218          0.22059149245512288  0.113650959485721653
## Book219          1.15659380582777516  0.595888782040456144
## Book22          -2.08388945069998721 -1.073640841259597467
## Book220          2.60596418515798067  1.342619004624059365
## Book221          0.97008540104605956  0.499797772728727607
## Book222         -0.68560922757467213 -0.353232781912377947
## Book223         -0.70665832403780726 -0.364077488490667456
## Book224         -0.47389698430894078 -0.244156501072037208
## Book225          1.87979430381970958  0.968488965223209153
## Book226          3.11503382925531591  1.604896814401730154
## Book227          1.79508306520953909  0.924844881581911915
## Book228          0.10853319109079904  0.055917393577750441
## Book229         -1.82478680709234053 -0.940148548680421969
## Book23           3.41344488224207021  1.758641195545481040
## Book230          4.95824262153313455  2.554536555460693581
## Book231         -0.49243168358364714 -0.253705764885002016
## Book232          3.67884549214073564  1.895378263813041197
## Book233         -2.57140711889650087 -1.324814855905913413
## Book234         -1.65866896617679060 -0.854562963317969215
## Book235          2.83205638567753581  1.459103984327043246
## Book236          0.54673275443426717  0.281682223698483281
## Book237          0.30566193066364089  0.157480106379208007
## Book238         -2.24440377788132306 -1.156339439887897891
## Book239          4.23253087914970294  2.180642553865363098
## Book24          -1.48733075776526458 -0.766287792023699454
## Book240         -5.40486933721731511 -2.784643139375260645
## Book241         -4.09511984176459443 -2.109847002917616621
## Book242         -1.33845449757037183 -0.689585242766330375
## Book243         -1.26032858492989597 -0.649333985415169845
## Book244         -1.75550917789114602 -0.904456016108189598
## Book245         -1.89159793238488483 -0.974570313587621584
## Book246          0.28340352888607151  0.146012353518547799
## Book247         -3.22154641858465318 -1.659773173593373619
## Book248         -1.74557132233687851 -0.899335932797620474
## Book249         -0.90485268908574445 -0.466189222273620141
## Book25           2.60978367422040414  1.344586843872338289
## Book250          0.27216058145780925  0.140219873725024424
## Book251          0.36690546218180736  0.189033390877474172
## Book252         -1.81124498223465813 -0.933171664072887541
## Book253          3.91266048402475208  2.015842103438093780
## Book254          0.51378217794590186  0.264705754697656226
## Book255         -7.43699317158577244 -3.831613813535621027
## Book256        -10.10934239672800672 -5.208435059623019114
## Book257          2.09392515771430920  1.078811338628290928
## Book258         -1.05232807084708480 -0.542170024847451026
## Book259         -0.68072411303715197 -0.350715921682604348
## Book26           3.70843156572458321  1.910621307018362192
## Book260          1.80936723590380510  0.932204230243970478
## Book261          3.59500830588654052  1.852184500752071861
## Book262         -3.19121562510544177 -1.644146443194526075
## Book263         -2.92794864021574819 -1.508508640028957792
## Book264         -0.49049200575257301 -0.252706423323180385
## Book265         -3.54501763021608518 -1.826428800964861709
## Book266         -0.56691770696087274 -0.292081714613978582
## Book267         -0.04490885961860926 -0.023137496955386708
## Book268         -0.21002895936322416 -0.108209036013817733
## Book269          3.51181767890937202  1.809323851545042938
## Book27          -4.10248343353070677 -2.113640799587496844
## Book270          1.81931706477801747  0.937330482329613024
## Book271          2.45470523429405274  1.264688869127167825
## Book272          4.26429294416658866  2.197006689781219713
## Book273         -0.60208334763904625 -0.310199407003305394
## Book274          0.00046200526812710  0.000238029769079616
## Book275          3.42313129807749394  1.763631734579518273
## Book276         -1.54846652940392637 -0.797785557546308977
## Book277          3.68103660969065194  1.896507149651396329
## Book278          0.47249817077588363  0.243435818246039548
## Book279         -5.54641792560592783 -2.857570398287969216
## Book28           2.75843244133634480  1.421172186403320215
## Book280          2.46866612534980678  1.271881660862256513
## Book281         -0.64686356423297353 -0.333270625776231344
## Book282          0.42159958769011180  0.217212355410823510
## Book283          1.95449584695594480  1.006975952903498506
## Book284          1.34990305633819263  0.695483655593635230
## Book285          2.43953503792386384  1.256873031109709160
## Book286          2.37997974451792782  1.226189543896732737
## Book287          4.09677422481748810  2.110699357735227544
## Book288          3.82110050640609833  1.968669480455054632
## Book289          4.22687631933877483  2.177729267678172320
## Book29          -2.17702990655136830 -1.121627742552268714
## Book290         -2.31928492081673054 -1.194918959194282593
## Book291          2.33474454176609392  1.202883911671033257
## Book292         -0.05266361532739638 -0.027132825229709483
## Book293         -0.79047156365211035 -0.407258914001491501
## Book294          1.28827637858179078  0.663732970293033131
## Book295         -1.47971572628030801 -0.762364451077287342
## Book296         -5.94995472770890999 -3.065476624572439857
## Book297          1.40953018966379817  0.726204155457049749
## Book298         -0.30884476886848716 -0.159119936691079156
## Book299         -0.06567861410750322 -0.033838283734033373
## Book3           -5.81541053148806419 -2.996158099077422143
## Book30           3.34168877581228063  1.721671726533143598
## Book300         -4.34866686491780730 -2.240476983862931704
## Book31          -0.44887274562409912 -0.231263761169519605
## Book32           3.06300975409472187  1.578093486709654325
## Book33           2.04807931564528634  1.055191098873870192
## Book34           3.60459893516240593  1.857125689585524153
## Book35          -0.19795985285876405 -0.101990910740259094
## Book36           5.39916012850409199  2.781701697522993122
## Book37           3.53091512422149023  1.819163047786437115
## Book38          -5.39942147664238625 -2.781836346717057040
## Book39          -1.98854590397874453 -1.024518885353498776
## Book4            0.22772759114228366  0.117327549429215056
## Book40           0.08268279332975945  0.042599008195197699
## Book41          -1.38421652639978121 -0.713162301095240148
## Book42           1.25485884261557290  0.646515919064361011
## Book43           1.31409085638299583  0.677032849350367116
## Book44           5.39611890523808668  2.780134828654456491
## Book45          -1.87363795246753395 -0.965317150978159177
## Book46           0.24532837146128728  0.126395648786487680
## Book47           1.12017096655538761  0.577123368268466663
## Book48          -6.09270064809201273 -3.139020760992445869
## Book49           3.13083861158258481  1.613039597498056699
## Book5            0.83788797553441297  0.431688327148012252
## Book50           0.37163492356004224  0.191470057031299212
## Book51           0.53980020218617009  0.278110502931230630
## Book52          -3.19821041801204231 -1.647750230976146035
## Book53          -0.52091621173256553 -0.268381280783609011
## Book54           1.73547987852382435  0.894136719268643354
## Book55           1.77398607546662412  0.913975499903330491
## Book56          -0.50242940573763872 -0.258856692070936034
## Book57           1.36404354719312071  0.702768978954817825
## Book58           0.09884677525537422  0.050926854543713970
## Book59          -0.58235131636984960 -0.300033265683043004
## Book6           -4.69804834091000334 -2.420481840492337611
## Book60          -2.02068229471085736 -1.041075877649363157
## Book61          -0.36078503078946594 -0.185880082957644188
## Book62          -0.45899020097753984 -0.236476376106183162
## Book63           0.04295531775257873  0.022131012503067420
## Book64          -1.13906280052794351 -0.586856631476080581
## Book65          -1.64797679146599441 -0.849054247177802868
## Book66           0.75618204023041213  0.389592606050031875
## Book67           1.10928721872547342  0.571515951727132432
## Book68           2.05408992225762610  1.058287823960503138
## Book69          -0.26685433582172147 -0.137486042510156281
## Book7            0.61402281252460822  0.316350739608601828
## Book70          -2.76112437342344919 -1.422559096937199730
## Book71          -0.02307754174354709 -0.011889782024388940
## Book72          -5.07019109811745583 -2.612213538535468338
## Book73           1.16200574644287036  0.598677068373440591
## Book74           0.82553150935127562  0.425322151272702398
## Book75          -1.64467215516120224 -0.847351665257661812
## Book76          -8.64954325572579208 -4.456331833950856414
## Book77          -4.08767243675886505 -2.106010024822226878
## Book78           4.13498108876166270  2.130383918993091541
## Book79           0.00270101609782318  0.001391590707726020
## Book8            0.50532901406480146  0.260350599496136648
## Book80           6.20870023661870718  3.198784917756966273
## Book81          -2.84647019799070033 -1.466530125657364181
## Book82           0.53647161924148801  0.276395583460943783
## Book83          -3.35128931350759496 -1.726618020284128807
## Book84           1.62348144375922487  0.836433997236036841
## Book85           6.74406329131504290  3.474609357594888870
## Book86          -1.31899785265990843 -0.679560983272746388
## Book87          -0.79055537689172461 -0.407302095427002353
## Book88          -5.22252764777642486 -2.690698863788927309
## Book89          -2.96286284117507748 -1.526496788141752603
## Book9           -4.39101649756292023 -2.262295941296043722
## Book90           1.26570667048565277  0.652104829280475862
## Book91           1.81814367942341693  0.936725942372461540
## Book92           1.97905312616293538  1.019628110578169933
## Book93           3.40669192979314595  1.755162006404324293
## Book94           2.11147804475353507  1.087854762885271720
## Book95           0.71822661600507742  0.370037589068701989
## Book96           0.30427302555003211  0.156764528470743181
## Book97          -6.60639199368808061 -3.403679717948284278
## Book98          -0.49578421316821925 -0.255433021905434932
## Book99           2.02151051868755216  1.041502586986938983
## Dogo            -1.05471503592226146  0.009672410110716123
## Ducksters       -2.71129389744770544  0.024864295674814407
## EIM              4.37363336853911466  0.428912400655695358
## Encyclopedia    -0.79747517382869559  0.007313356377533303
## Factmonster     -5.67022796916759919  0.051999609817532377
## GreenLine        1.97893168765736860  0.517597701261653720
## History         -2.33791653145736555  0.021440186899843505
## HT              -2.82718577669806903  2.200907310089581070
## JTT             -1.64596453709429569  0.374906344498937172
## NGL              2.76437273720136201  0.043865486802689646
## POC             -3.60461805048577988 -2.008145598959947709
## Quatr            0.64382234671657967 -0.005904261874602246
## Revision         0.28611999609619287 -0.002623902995848873
## Science          0.18638034631938261 -0.001709226742943916
## Science_Tech    -0.56077784461206359  0.005142690783267873
## Solutions       -0.00380418017697378 -1.469397533125226696
## Spoken.BNC2014  -0.00000000003062265 -0.000000000007615864
## Teen             4.39394607474602505 -0.040295290186541877
## TeenVogue        5.35639709949097309 -0.049121580421598976
## TweenTribute     3.12461431627395703 -0.028654707739824814
## WhyFiles         1.28622698795597912 -0.011795522485306520
## World           -0.66058999269444907  0.006058031891810894
##                  RegisterInformative
## Access         -0.605981988140108729
## Achievers       3.439032234309786329
## BBC            -0.930788272414960094
## Book1          -0.209724710676426701
## Book10          0.157340717252238471
## Book100         0.545585675173342333
## Book101         0.006149609839095708
## Book102         0.196667726609324522
## Book103        -0.294109849373435484
## Book104        -0.307269013132909996
## Book105        -0.173269664796772860
## Book106         0.414192545645043875
## Book107        -0.604608482722901242
## Book108         0.084305757515652460
## Book109         0.467876170646286171
## Book11          0.451251120081548829
## Book110         0.199776619069287897
## Book111         0.065500319963031545
## Book112         0.380329310729695946
## Book113         0.147167178846951463
## Book114         0.492499175242937570
## Book115        -0.623186596522011693
## Book116         0.050773903001546467
## Book117         0.485647445207590678
## Book118        -0.428270885731433959
## Book119        -0.218523100460133485
## Book12          0.307740994142610080
## Book120         0.068253818949198561
## Book121        -0.338777366066483565
## Book122         0.804571465280427223
## Book123         0.079709655428857967
## Book124         0.083764662947440144
## Book125        -0.185458700425075007
## Book126         0.266046295831720903
## Book127         0.193445172272606436
## Book128        -0.212087597015718665
## Book129        -0.349026145432438373
## Book13          0.567914630905355544
## Book130         0.032187784844917036
## Book131        -0.038458674608319407
## Book132         0.185208688386658188
## Book133         0.195447862523592059
## Book134        -0.439409749653382586
## Book135        -0.169081784943393654
## Book136        -0.098076730273353632
## Book137         0.024215444757060091
## Book138         0.189492620530253425
## Book139        -0.079930851780210116
## Book14          0.327951996875379348
## Book140         0.019395220659763839
## Book141        -0.079661905367608032
## Book142        -0.114391211766395981
## Book143        -0.187666302228519877
## Book144        -0.394788658233938883
## Book145        -0.133281495508706549
## Book146         0.302235597041778825
## Book147        -0.195795527723727963
## Book148         0.012200904122649703
## Book149        -0.087832753521909307
## Book15          0.410880342504125029
## Book150        -0.102240597054180607
## Book151        -0.180768146919569050
## Book152        -0.224090931549604189
## Book153        -0.100841435360046805
## Book154        -0.140691929698805257
## Book155        -0.486678682539757601
## Book156        -0.245470570479991435
## Book157        -0.168614330464346152
## Book158        -0.410062573249649565
## Book159         0.635473009228175290
## Book16         -0.373018406656677071
## Book160        -0.117093482864448539
## Book161        -0.039532859387225353
## Book162        -0.083806561690390913
## Book163        -0.359074815860445984
## Book164         0.366052738660718635
## Book165         0.073775224765065872
## Book166        -0.011323902622542011
## Book167        -0.766448587377895563
## Book168        -0.094385120586085114
## Book169         0.055626144528914873
## Book17          0.504438474916679480
## Book170         0.157222252760973125
## Book171         0.086745485687117097
## Book172        -0.221654405121147396
## Book173         0.108470912862278362
## Book174         0.545552056871767332
## Book175         0.170557512385841992
## Book176         0.348953830130919851
## Book177         0.928344446451658034
## Book178        -0.200364414994961437
## Book179        -0.062089138872747876
## Book18          0.298555193455035395
## Book180        -0.391863865996888217
## Book181        -0.177843354682517829
## Book182         0.034731569664114600
## Book183        -0.295363331760742809
## Book184         0.764858645890977518
## Book185        -1.067138681024891511
## Book186        -0.142889926273228440
## Book187        -0.192572973387009849
## Book188         0.211813571904748615
## Book189        -0.140570263464532524
## Book19         -0.110987758949772752
## Book190         0.499160401569357481
## Book191        -0.380433643461286830
## Book192        -0.292324877646936876
## Book193         0.083401265116126444
## Book194         0.353026447236041929
## Book195        -0.325666228452116679
## Book196         0.618588617479856495
## Book197         0.257236699947488878
## Book198         0.085376740551551131
## Book199         0.052280323086420805
## Book2          -0.423852480381536556
## Book20          0.032312652822196440
## Book200        -0.011556028990562173
## Book201         0.567882613475284015
## Book202        -0.267104747979448776
## Book203         0.141945136002254835
## Book204        -0.600081218110760872
## Book205        -0.259958457587441738
## Book206         0.304294317795389957
## Book207        -0.328086746165538234
## Book208        -0.008592815837424776
## Book209        -0.293434281598922264
## Book21         -0.585767825997200564
## Book210        -0.000849400374580936
## Book211         0.395433533366026657
## Book212        -0.475527011645779429
## Book213        -0.166025721243047875
## Book214        -0.147940675867041016
## Book215        -0.272264356835504873
## Book216        -0.351662780798844943
## Book217         0.537150683220949388
## Book218        -0.029493794188239362
## Book219        -0.154640323109546840
## Book22          0.278622742363889953
## Book220        -0.348425818618594563
## Book221        -0.129703547698193034
## Book222         0.091668165560642806
## Book223         0.094482497663946258
## Book224         0.063361555634241062
## Book225        -0.251334562797626337
## Book226        -0.416490072336546613
## Book227        -0.240008396909757199
## Book228        -0.014511237786181132
## Book229         0.243979883026295724
## Book23         -0.456388592820412498
## Book230        -0.662933034213037065
## Book231         0.065839704721791431
## Book232        -0.491873510568892280
## Book233         0.343805427375388384
## Book234         0.221769391785547887
## Book235        -0.378655075220803272
## Book236        -0.073099933074410275
## Book237        -0.040867986221215846
## Book238         0.300084025740959714
## Book239        -0.565903033048327231
## Book24          0.198860920569236793
## Book240         0.722648466955933211
## Book241         0.547530734050198697
## Book242         0.178955684293652301
## Book243         0.168509997732755934
## Book244         0.234717240506548963
## Book245         0.252912746016303980
## Book246        -0.037891966096049862
## Book247         0.430731149148587511
## Book248         0.233388517158572811
## Book249         0.120981723662800605
## Book25         -0.348936496628238002
## Book250        -0.036388747754183104
## Book251        -0.049056443962056440
## Book252         0.242169297355740276
## Book253        -0.523135329290913775
## Book254        -0.068694334696541917
## Book255         0.994349979415999452
## Book256         1.351651692044295583
## Book257        -0.279964548767753063
## Book258         0.140699657972465253
## Book259         0.091015009987180179
## Book26         -0.495829264054253427
## Book260        -0.241918236613534704
## Book261        -0.480664208300786433
## Book262         0.426675824210687671
## Book263         0.391476179009162872
## Book264         0.065580363538210826
## Book265         0.473980293689458376
## Book266         0.075798726345598255
## Book267         0.006004459410824003
## Book268         0.028081549438219389
## Book269        -0.469541353093873126
## Book27          0.548515270024904633
## Book270        -0.243248560833014715
## Book271        -0.328202008913795806
## Book272        -0.570149723608219583
## Book273         0.080500485951628939
## Book274        -0.000061771594816720
## Book275        -0.457683697866814065
## Book276         0.207034970466545371
## Book277        -0.492166470054049343
## Book278        -0.063174529752179298
## Book279         0.741573969871323735
## Book28         -0.368811316345253604
## Book280        -0.330068625086976652
## Book281         0.086487745375039629
## Book282        -0.056369224990436444
## Book283        -0.261322400108496777
## Book284        -0.180486393534938394
## Book285        -0.326173704718753177
## Book286        -0.318210969859918591
## Book287        -0.547751930401550791
## Book288        -0.510893464902993699
## Book289        -0.565147000159513579
## Book29          0.291075921790283076
## Book290         0.310095876124384717
## Book291        -0.312162877319371090
## Book292         0.007041295266592798
## Book293         0.105688598189046412
## Book294        -0.172246707905982066
## Book295         0.197842766292956190
## Book296         0.795528142156672002
## Book297        -0.188458733622794666
## Book298         0.041293541957312441
## Book299         0.008781442590990646
## Book3           0.777539149070879843
## Book30         -0.446794569899424177
## Book300         0.581430789010129123
## Book31          0.060015734191746689
## Book32         -0.409534285653467167
## Book33         -0.273834811780523046
## Book34         -0.481946506375158179
## Book35          0.026467870962605122
## Book36         -0.721885127332582366
## Book37         -0.472094743142091156
## Book38          0.721920070421801952
## Book39          0.265875002580837183
## Book4          -0.030447913604376764
## Book40         -0.011054956209939388
## Book41          0.185074215180356882
## Book42         -0.167778675539475064
## Book43         -0.175698186867713102
## Book44         -0.721478505970671202
## Book45          0.250511438760925353
## Book46         -0.032801194714647451
## Book47         -0.149770471995639143
## Book48          0.814613732222421172
## Book49         -0.418603222721279478
## Book5          -0.112028325427103323
## Book50         -0.049688788205973007
## Book51         -0.072173028473833847
## Book52          0.427611050588099006
## Book53          0.069648178028821672
## Book54         -0.232039258564907730
## Book55         -0.237187661320439419
## Book56          0.067176432427285604
## Book57         -0.182377022780672388
## Book58         -0.013216132739780546
## Book59          0.077862249713720064
## Book6           0.628144219484759514
## Book60          0.270171741696461187
## Book61          0.048238122539867201
## Book62          0.061368470612276516
## Book63         -0.005743264561042511
## Book64          0.152296371144440001
## Book65          0.220339813532846068
## Book66         -0.101103978286634436
## Book67         -0.148315279798879540
## Book68         -0.274638449275322660
## Book69          0.035679285594237178
## Book7          -0.082096830924561742
## Book70          0.369171236349703613
## Book71          0.003085541781232836
## Book72          0.677900906687706861
## Book73         -0.155363917029167409
## Book74         -0.110376226035403036
## Book75          0.219897972997856295
## Book76          1.156471837455626428
## Book77          0.546534991974968909
## Book78         -0.552860311369494428
## Book79         -0.000361134565987433
## Book8          -0.067564119415011156
## Book80         -0.830123251433016685
## Book81          0.380582248427262237
## Book82         -0.071727986195837062
## Book83          0.448078192761441896
## Book84         -0.217064706520367412
## Book85         -0.901703018972842552
## Book86          0.176354268100325673
## Book87          0.105699804289571514
## Book88          0.698268794827827444
## Book89          0.396144320313618903
## Book9           0.587093071518311804
## Book90         -0.169229065121723449
## Book91         -0.243091675425663456
## Book92         -0.264605787562351091
## Book93         -0.455485701292391076
## Book94         -0.282311426392008735
## Book95         -0.096029215620268074
## Book96         -0.040682285126800215
## Book97          0.883295922340756712
## Book98          0.066287948742795352
## Book99         -0.270282477914066344
## Dogo           -0.661306362646309265
## Ducksters      -1.699981363987139726
## EIM             1.367131560834593529
## Encyclopedia   -0.500016960547408296
## Factmonster    -3.555233125488755697
## GreenLine       0.964283132993086434
## History        -1.465873743077808822
## HT             -4.329443744225784485
## JTT            -3.052325585958935328
## NGL            -0.852107547059569703
## POC             0.579985832516267785
## Quatr           0.403676632830194004
## Revision        0.179397247079479738
## Science         0.116860483347946104
## Science_Tech   -0.351607727246369628
## Solutions       2.489426104726500721
## Spoken.BNC2014 -0.000000000002809848
## Teen            2.755004335184580544
## TeenVogue       3.358461159749563052
## TweenTribute    1.959133280354183659
## WhyFiles        0.806464364279367407
## World          -0.414189947417665905
## 
## with conditional variances for "Source"
# Diagnostic plots (in new window)
residplot(md_final1)

## Plot predicted vs. observed values
dimensions_ref[, "predicted"] <- predict(md_final1)

dimensions_ref %>%
  ggplot(aes(x = Corpus, y = Dim1nopunct)) +
  geom_point(shape = "circle filled", fill = "grey", position = position_jitter(width = 0.2, height = 0)) +
  geom_point(aes(y = predicted), shape = "triangle filled", fill = "red", position = position_jitter(width = 0.2, height = 0)) +
  facet_wrap(vars(Register))

## Compare means

comparisons <- emmeans(md_final1, "Corpus", by = "Register")
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 5033' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 5033)' or larger];
## but be warned that this may result in large computation time and memory use.
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'lmerTest.limit = 5033' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 5033)' or larger];
## but be warned that this may result in large computation time and memory use.
comparisons
## Register = Conversation:
##  Corpus    emmean    SE  df asymp.LCL asymp.UCL
##  Textbook   14.65 1.206 Inf    12.290     17.02
##  Reference  30.66 3.517 Inf    23.769     37.56
## 
## Register = Fiction:
##  Corpus    emmean    SE  df asymp.LCL asymp.UCL
##  Textbook    3.91 1.681 Inf     0.612      7.20
##  Reference   4.43 0.328 Inf     3.789      5.08
## 
## Register = Informative:
##  Corpus    emmean    SE  df asymp.LCL asymp.UCL
##  Textbook   -6.07 1.599 Inf    -9.202     -2.93
##  Reference -12.20 1.220 Inf   -14.596     -9.81
## 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95
pairs(comparisons)
## Register = Conversation:
##  contrast             estimate   SE  df z.ratio p.value
##  Textbook - Reference  -16.009 3.72 Inf -4.305  <.0001 
## 
## Register = Fiction:
##  contrast             estimate   SE  df z.ratio p.value
##  Textbook - Reference   -0.525 1.71 Inf -0.306  0.7593 
## 
## Register = Informative:
##  contrast             estimate   SE  df z.ratio p.value
##  Textbook - Reference    6.137 2.01 Inf  3.051  0.0023 
## 
## Degrees-of-freedom method: asymptotic
confint(comparisons)
## Register = Conversation:
##  Corpus    emmean    SE  df asymp.LCL asymp.UCL
##  Textbook   14.65 1.206 Inf    12.290     17.02
##  Reference  30.66 3.517 Inf    23.769     37.56
## 
## Register = Fiction:
##  Corpus    emmean    SE  df asymp.LCL asymp.UCL
##  Textbook    3.91 1.681 Inf     0.612      7.20
##  Reference   4.43 0.328 Inf     3.789      5.08
## 
## Register = Informative:
##  Corpus    emmean    SE  df asymp.LCL asymp.UCL
##  Textbook   -6.07 1.599 Inf    -9.202     -2.93
##  Reference -12.20 1.220 Inf   -14.596     -9.81
## 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95
# This is a warning that the degrees of freedom have been calculated according to the naive 'asymptotic' method (i.e. are assumed to be infinite), because we have a very large number of observations and so a more complex estimation method like Kenward-Roger might take a lot of computation.

Dimension 2: Narrative vs. Non-narrative

# Rainplots for all textbook registers and the three ref. corpora on Dimension 2 

Dimensions[Dimensions$Dim2>15,] # Remove one poetry outlier with a very high Dim 2 score
##                Corpus                             Filename Level    Dim1
## 1674 Textbook.English Solutions_Elementary_Poetry_0001.txt     A 17.4036
##         Dim2    Dim3    Dim4    Dim5    Dim6              TextType Register
## 1674 16.6553 -2.2428 -0.7473 -3.9201 -2.6293 Imaginative narrative   Poetry
##         Series Country
## 1674 Solutions   Spain
Dimensions2 <- Dimensions[Dimensions$Dim2<15,] 

colours <- suf_palette(name = "london", n = 6, type = "continuous") # Very nice, similar to OrRd palette
colours2 <- suf_palette(name = "classic", n = 5, type = "continuous") # Just green and purple
colours <- c(colours, colours2[c(2:4)]) # Nine colours range
#scales::show_col(colours)

p2 <- ggplot(Dimensions2,aes(x=Register,y=Dim2, fill = Register, colour = Register))+ #Or leave out "colour = Register" to keep the dots in black
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .25)+
#note that here we need to set the x-variable to a numeric variable and bump it to get the boxplots to line up with the rainclouds. 
  geom_boxplot(aes(x = as.numeric(Register)+0.25, y = Dim2), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Dimension 2 (Biber 1988)')+ 
  theme_cowplot()+ 
  guides(fill = "none", colour = "none") +
  scale_colour_manual(values = colours)+
  scale_fill_manual(values = colours)+
  annotate(geom = "text", x = 8.3, y = -10.5, label = "Reference Corpora", size = 5) +
  annotate(geom = "segment", x = 7, xend = 9.5, y = -9.5, yend = -9.5) +
  annotate(geom = "text", x = 3.8, y = -10.5, label = "Textbook Corpus", size = 5) +
  annotate(geom = "segment", x = 1, xend = 6.5, y = -9.5, yend = -9.5) +
  ggtitle("Dimension 2: Narrative vs. Non-narrative Concerns")

p2 + scale_y_continuous(sec.axis = dup_axis(name=NULL), breaks = seq(from = -15, to = 20, by = 5))

#ggsave(here("plots", "Dim2.svg"), width = 13, height = 8)
# Rainplots comparing the three textbook and reference corpora on Dimension 2 

ggplot(dimensions_ref,aes(x=Subcorpus,y=Dim2, fill = Subcorpus, colour = Subcorpus))+ # Or leave out "colour = Register" to keep the dots in black
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .25)+
# note that here we need to set the x-variable to a numeric variable and bump it to get the boxplots to line up with the rainclouds. 
  geom_boxplot(aes(x = as.numeric(Subcorpus)+0.25, y = Dim2), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Dimension 2 (Biber 1988)')+ 
  theme_cowplot()+
  theme(axis.title.x=element_blank())+
  guides(fill = "none", colour = "none") +
  scale_colour_manual(values = colours3Reg)+
  scale_fill_manual(values = colours3Reg) +
  annotate(geom = "text", x = 1.5, y = -11, label = "Conversation", size = 5) +
  annotate(geom = "segment", x = 0.7, xend = 2.5, y = -10, yend = -10) +
  annotate(geom = "text", x = 3.5, y = -11, label = "Fiction", size = 5) +
  annotate(geom = "segment", x = 2.7, xend = 4.5, y = -10, yend = -10) +
  annotate(geom = "text", x = 5.7, y = -11, label = "Informative", size = 5) +
  annotate(geom = "segment", x = 4.7, xend = 6.5, y = -10, yend = -10) +
  scale_x_discrete(labels=rep(c("Reference", "Textbook"), 3))+
  scale_y_continuous(sec.axis = dup_axis(name=NULL), breaks = seq(from = -14, to = 14, by = 2))

#ggsave(here("plots", "Dim2_3RegComparison.svg"), width = 13, height = 8)
# Mixed effect model

# Check  distribution of the outcome variable. 

ggplot(dimensions_ref, aes(x = Dim2)) +
  geom_histogram(bins = 20) +
  facet_grid(rows = vars(Register), cols = vars(Corpus), scales = "free_y")

md0 <- lmer(Dim2 ~ 1 + (Register|Source), dimensions_ref, REML = FALSE)
md_corpus <- update(md0, .~. + Corpus)
md_register <- update(md0, . ~ . + Register)
md_both <- update(md_corpus, .~. + Register)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
## Model failed to converge with max|grad| = 0.0619279 (tol = 0.002, component 1)
md_interaction <- update(md_both, . ~ . + Corpus:Register)

anova(md0, md_corpus, md_both, md_interaction)
## Data: dimensions_ref
## Models:
## md0: Dim2 ~ 1 + (Register | Source)
## md_corpus: Dim2 ~ (Register | Source) + Corpus
## md_both: Dim2 ~ (Register | Source) + Corpus + Register
## md_interaction: Dim2 ~ (Register | Source) + Corpus + Register + Corpus:Register
##                npar   AIC   BIC logLik deviance   Chisq Df           Pr(>Chisq)
## md0               8 21440 21492 -10712    21424                                
## md_corpus         9 21433 21492 -10707    21415  9.2772  1              0.00232
## md_both          11 21345 21417 -10662    21323 91.7409  2 < 0.0000000000000002
## md_interaction   13 21343 21428 -10658    21317  6.1982  2              0.04509
##                   
## md0               
## md_corpus      ** 
## md_both        ***
## md_interaction *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(md0, md_register)
## Data: dimensions_ref
## Models:
## md0: Dim2 ~ 1 + (Register | Source)
## md_register: Dim2 ~ (Register | Source) + Register
##             npar   AIC   BIC logLik deviance  Chisq Df            Pr(>Chisq)
## md0            8 21440 21492 -10712    21424                                
## md_register   10 21357 21422 -10668    21337 87.226  2 < 0.00000000000000022
##                
## md0            
## md_register ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
md_final2 <- lmer(Dim2 ~ 1 + Corpus + Register + Corpus:Register + (Register|Source), dimensions_ref)

tab_model(md_final2)
  Dim 2
Predictors Estimates CI p
(Intercept) -3.10 -3.47 – -2.74 <0.001
Corpus [Reference] 1.15 0.14 – 2.17 0.026
Register [Fiction] 5.75 4.51 – 6.98 <0.001
Register [Informative] 1.37 0.68 – 2.06 <0.001
Corpus [Reference] *
Register [Fiction]
1.10 -0.47 – 2.68 0.169
Corpus [Reference] *
Register [Informative]
-1.15 -2.45 – 0.16 0.084
Random Effects
σ2 3.67
τ00 Source 0.23
τ11 Source.RegisterFiction 3.23
τ11 Source.RegisterInformative 0.92
ρ01 -0.58
0.10
ICC 0.25
N Source 325
Observations 5033
Marginal R2 / Conditional R2 0.649 / 0.738
# Diagnostic plots (in new window)
residplot(md_final2) # I've seen worse, but I've also seen better... 

# This function can be used to estimate mean and sd of all the terms of the model
library(merTools)
(randomSims <- REsim(md_final2, n.sims = 500))
##     groupFctr        groupID                term         mean        median
## 1      Source         Access         (Intercept) -0.882428581 -0.8785489075
## 2      Source      Achievers         (Intercept)  0.199800508  0.2060298318
## 3      Source            BBC         (Intercept)  0.190793331  0.1360883224
## 4      Source          Book1         (Intercept) -0.041592488 -0.0331700008
## 5      Source         Book10         (Intercept)  0.109794092  0.1265650193
## 6      Source        Book100         (Intercept) -0.017174211 -0.0197542967
## 7      Source        Book101         (Intercept)  0.130652034  0.1285118054
## 8      Source        Book102         (Intercept)  0.024651742  0.0542703656
## 9      Source        Book103         (Intercept) -0.133811965 -0.1560515244
## 10     Source        Book104         (Intercept)  0.246470638  0.2426626056
## 11     Source        Book105         (Intercept)  0.129970743  0.1470971618
## 12     Source        Book106         (Intercept)  0.148008601  0.1718435032
## 13     Source        Book107         (Intercept) -0.076117123 -0.0937249292
## 14     Source        Book108         (Intercept) -0.193536459 -0.1846967447
## 15     Source        Book109         (Intercept) -0.043113891 -0.0531284120
## 16     Source         Book11         (Intercept)  0.067110519  0.0898802046
## 17     Source        Book110         (Intercept)  0.092638800  0.1396305004
## 18     Source        Book111         (Intercept)  0.372847043  0.3917447078
## 19     Source        Book112         (Intercept) -0.090328551 -0.0943664268
## 20     Source        Book113         (Intercept) -0.085031239 -0.0961611084
## 21     Source        Book114         (Intercept) -0.062212418 -0.0397267175
## 22     Source        Book115         (Intercept)  0.152008009  0.1876498439
## 23     Source        Book116         (Intercept)  0.215168596  0.2134949816
## 24     Source        Book117         (Intercept) -0.156615947 -0.1447465151
## 25     Source        Book118         (Intercept)  0.037327567  0.0351978134
## 26     Source        Book119         (Intercept) -0.031472668 -0.0493354182
## 27     Source         Book12         (Intercept) -0.096096913 -0.0824603553
## 28     Source        Book120         (Intercept) -0.033383486 -0.0354378961
## 29     Source        Book121         (Intercept) -0.042621947 -0.0474167904
## 30     Source        Book122         (Intercept)  0.058385879  0.0017634125
## 31     Source        Book123         (Intercept) -0.069599783 -0.0835531557
## 32     Source        Book124         (Intercept) -0.002821799 -0.0013216188
## 33     Source        Book125         (Intercept)  0.148128256  0.1873460844
## 34     Source        Book126         (Intercept) -0.107278578 -0.1216251887
## 35     Source        Book127         (Intercept) -0.017169757 -0.0257191962
## 36     Source        Book128         (Intercept) -0.088128200 -0.0692394490
## 37     Source        Book129         (Intercept) -0.129304598 -0.1232625889
## 38     Source         Book13         (Intercept)  0.194875342  0.1990671838
## 39     Source        Book130         (Intercept)  0.016272673 -0.0104903740
## 40     Source        Book131         (Intercept) -0.099533926 -0.1207582090
## 41     Source        Book132         (Intercept) -0.132233515 -0.1459400826
## 42     Source        Book133         (Intercept) -0.046563028 -0.0373215541
## 43     Source        Book134         (Intercept) -0.099215640 -0.0824087389
## 44     Source        Book135         (Intercept) -0.081025062 -0.0870972728
## 45     Source        Book136         (Intercept) -0.112771162 -0.0973638989
## 46     Source        Book137         (Intercept) -0.071945809 -0.0610046277
## 47     Source        Book138         (Intercept) -0.055669729 -0.0736183750
## 48     Source        Book139         (Intercept) -0.123488748 -0.1338279538
## 49     Source         Book14         (Intercept)  0.004010921 -0.0204996159
## 50     Source        Book140         (Intercept)  0.017504624 -0.0159453144
## 51     Source        Book141         (Intercept) -0.095068984 -0.0875634399
## 52     Source        Book142         (Intercept) -0.006421892  0.0174458255
## 53     Source        Book143         (Intercept)  0.004021176  0.0390287966
## 54     Source        Book144         (Intercept) -0.087395584 -0.1083553116
## 55     Source        Book145         (Intercept) -0.237871345 -0.2443592294
## 56     Source        Book146         (Intercept) -0.013322538  0.0013589155
## 57     Source        Book147         (Intercept) -0.064006501 -0.0855909355
## 58     Source        Book148         (Intercept)  0.064051030  0.0782960587
## 59     Source        Book149         (Intercept)  0.121434877  0.1461299333
## 60     Source         Book15         (Intercept) -0.111770395 -0.1021581697
## 61     Source        Book150         (Intercept) -0.180595810 -0.2113761628
## 62     Source        Book151         (Intercept) -0.047082545 -0.0262241911
## 63     Source        Book152         (Intercept)  0.274105197  0.2658646740
## 64     Source        Book153         (Intercept) -0.219300088 -0.2185463629
## 65     Source        Book154         (Intercept) -0.079142064 -0.0879778008
## 66     Source        Book155         (Intercept) -0.190776297 -0.2020267579
## 67     Source        Book156         (Intercept) -0.138248227 -0.0960578534
## 68     Source        Book157         (Intercept)  0.010758568 -0.0063290761
## 69     Source        Book158         (Intercept)  0.068853933  0.0597866888
## 70     Source        Book159         (Intercept) -0.079845728 -0.1003614547
## 71     Source         Book16         (Intercept)  0.063490299  0.0108488540
## 72     Source        Book160         (Intercept)  0.064049746  0.0682238380
## 73     Source        Book161         (Intercept)  0.180803746  0.1945485900
## 74     Source        Book162         (Intercept) -0.052493709 -0.0530758850
## 75     Source        Book163         (Intercept) -0.060078276 -0.0586189623
## 76     Source        Book164         (Intercept) -0.199070391 -0.2135294239
## 77     Source        Book165         (Intercept) -0.031399576 -0.0416852451
## 78     Source        Book166         (Intercept)  0.071108638  0.1113509496
## 79     Source        Book167         (Intercept)  0.053821756  0.0528120077
## 80     Source        Book168         (Intercept)  0.051571239  0.0444761030
## 81     Source        Book169         (Intercept)  0.421776242  0.4132545820
## 82     Source         Book17         (Intercept)  0.372887794  0.4085416613
## 83     Source        Book170         (Intercept) -0.201777330 -0.2553082170
## 84     Source        Book171         (Intercept) -0.103487600 -0.1144136019
## 85     Source        Book172         (Intercept) -0.018828678  0.0334603904
## 86     Source        Book173         (Intercept) -0.113673268 -0.0897055758
## 87     Source        Book174         (Intercept) -0.166427797 -0.1501161836
## 88     Source        Book175         (Intercept)  0.048853420  0.0643001663
## 89     Source        Book176         (Intercept)  0.232666102  0.2299496480
## 90     Source        Book177         (Intercept) -0.173830154 -0.1859760629
## 91     Source        Book178         (Intercept) -0.076378477 -0.0720706248
## 92     Source        Book179         (Intercept) -0.107038475 -0.0740900983
## 93     Source         Book18         (Intercept)  0.006097527  0.0134188513
## 94     Source        Book180         (Intercept) -0.046042108 -0.0412606838
## 95     Source        Book181         (Intercept)  0.186715446  0.1416380061
## 96     Source        Book182         (Intercept) -0.049827484 -0.0431151386
## 97     Source        Book183         (Intercept) -0.018398243 -0.0057251636
## 98     Source        Book184         (Intercept) -0.176903473 -0.1503663732
## 99     Source        Book185         (Intercept)  0.176811371  0.1382880793
## 100    Source        Book186         (Intercept) -0.048734937 -0.0310475865
## 101    Source        Book187         (Intercept) -0.179528909 -0.1595413687
## 102    Source        Book188         (Intercept) -0.146897740 -0.1388104855
## 103    Source        Book189         (Intercept)  0.094446554  0.0791194034
## 104    Source         Book19         (Intercept) -0.312099496 -0.3427449837
## 105    Source        Book190         (Intercept) -0.068653892 -0.0421035624
## 106    Source        Book191         (Intercept)  0.037096444  0.0693435635
## 107    Source        Book192         (Intercept)  0.056164719  0.0656678154
## 108    Source        Book193         (Intercept)  0.053457757  0.0368574186
## 109    Source        Book194         (Intercept)  0.071112263  0.0718063386
## 110    Source        Book195         (Intercept)  0.022445620  0.0396254258
## 111    Source        Book196         (Intercept)  0.183848567  0.2135516742
## 112    Source        Book197         (Intercept)  0.251892568  0.2149840008
## 113    Source        Book198         (Intercept) -0.275670863 -0.2803981001
## 114    Source        Book199         (Intercept)  0.138460595  0.1267746476
## 115    Source          Book2         (Intercept)  0.131655153  0.0950948696
## 116    Source         Book20         (Intercept)  0.019921986  0.0298173009
## 117    Source        Book200         (Intercept) -0.119326074 -0.1537404995
## 118    Source        Book201         (Intercept) -0.230005439 -0.2452046222
## 119    Source        Book202         (Intercept) -0.225273619 -0.2279940849
## 120    Source        Book203         (Intercept)  0.047225946  0.0602268167
## 121    Source        Book204         (Intercept) -0.024085466  0.0076916325
## 122    Source        Book205         (Intercept) -0.003620036  0.0129617914
## 123    Source        Book206         (Intercept) -0.195704937 -0.1979849605
## 124    Source        Book207         (Intercept)  0.407392745  0.4138314850
## 125    Source        Book208         (Intercept)  0.019680746  0.0269891552
## 126    Source        Book209         (Intercept)  0.021930445  0.0433607672
## 127    Source         Book21         (Intercept)  0.277953805  0.2596757975
## 128    Source        Book210         (Intercept)  0.166840273  0.1587366620
## 129    Source        Book211         (Intercept) -0.010046669  0.0215532522
## 130    Source        Book212         (Intercept)  0.054724139  0.0440398617
## 131    Source        Book213         (Intercept) -0.025444570 -0.0653290758
## 132    Source        Book214         (Intercept) -0.002711284 -0.0206541046
## 133    Source        Book215         (Intercept)  0.196993036  0.1784670997
## 134    Source        Book216         (Intercept) -0.011722273  0.0020372213
## 135    Source        Book217         (Intercept) -0.006982735 -0.0457028491
## 136    Source        Book218         (Intercept) -0.093314932 -0.0949031699
## 137    Source        Book219         (Intercept)  0.271536636  0.2858475092
## 138    Source         Book22         (Intercept) -0.158546858 -0.1354472983
## 139    Source        Book220         (Intercept)  0.083590673  0.0827338575
## 140    Source        Book221         (Intercept) -0.088121804 -0.1072590709
## 141    Source        Book222         (Intercept) -0.169832603 -0.1755644654
## 142    Source        Book223         (Intercept) -0.136210160 -0.1407284108
## 143    Source        Book224         (Intercept)  0.310632567  0.3579532926
## 144    Source        Book225         (Intercept)  0.183447219  0.2015656652
## 145    Source        Book226         (Intercept)  0.288348885  0.3043947541
## 146    Source        Book227         (Intercept) -0.045291840 -0.0756115426
## 147    Source        Book228         (Intercept)  0.053914797  0.0631576893
## 148    Source        Book229         (Intercept) -0.176399608 -0.1710671174
## 149    Source         Book23         (Intercept)  0.002595729 -0.0077289721
## 150    Source        Book230         (Intercept) -0.115252593 -0.1304593692
## 151    Source        Book231         (Intercept) -0.173728445 -0.1670428919
## 152    Source        Book232         (Intercept)  0.218011116  0.1916121514
## 153    Source        Book233         (Intercept) -0.136812466 -0.1246957121
## 154    Source        Book234         (Intercept) -0.124275896 -0.1610474341
## 155    Source        Book235         (Intercept) -0.065287075 -0.0746261760
## 156    Source        Book236         (Intercept)  0.178547812  0.1745274152
## 157    Source        Book237         (Intercept)  0.193059634  0.1767624413
## 158    Source        Book238         (Intercept) -0.172478434 -0.1732190930
## 159    Source        Book239         (Intercept)  0.226462639  0.2219567723
## 160    Source         Book24         (Intercept) -0.025444485 -0.0355494277
## 161    Source        Book240         (Intercept) -0.074443725 -0.0719528361
## 162    Source        Book241         (Intercept)  0.026564686  0.0486085515
## 163    Source        Book242         (Intercept) -0.242506321 -0.2269354537
## 164    Source        Book243         (Intercept) -0.091756031 -0.0576299683
## 165    Source        Book244         (Intercept) -0.114229896 -0.1115743336
## 166    Source        Book245         (Intercept) -0.222447592 -0.2282191588
## 167    Source        Book246         (Intercept) -0.144802785 -0.1166950494
## 168    Source        Book247         (Intercept) -0.144913103 -0.1164519995
## 169    Source        Book248         (Intercept) -0.168564597 -0.1572101165
## 170    Source        Book249         (Intercept) -0.052110748 -0.0535061333
## 171    Source         Book25         (Intercept) -0.086908105 -0.0442735980
## 172    Source        Book250         (Intercept) -0.135233015 -0.1209648124
## 173    Source        Book251         (Intercept) -0.091733775 -0.0718604154
## 174    Source        Book252         (Intercept)  0.056857598  0.0457951212
## 175    Source        Book253         (Intercept)  0.055171450  0.0369476124
## 176    Source        Book254         (Intercept) -0.092382401 -0.0696915152
## 177    Source        Book255         (Intercept)  0.021961226  0.0300178725
## 178    Source        Book256         (Intercept)  0.394405495  0.3954346992
## 179    Source        Book257         (Intercept)  0.089558815  0.0875659915
## 180    Source        Book258         (Intercept) -0.206446720 -0.2313381981
## 181    Source        Book259         (Intercept) -0.011371814 -0.0289695612
## 182    Source         Book26         (Intercept) -0.177994994 -0.1721863020
## 183    Source        Book260         (Intercept) -0.044125615  0.0011804255
## 184    Source        Book261         (Intercept)  0.172501641  0.1814680910
## 185    Source        Book262         (Intercept)  0.228142944  0.2364109738
## 186    Source        Book263         (Intercept)  0.119722750  0.1486488097
## 187    Source        Book264         (Intercept) -0.101787379 -0.0936342927
## 188    Source        Book265         (Intercept) -0.119357277 -0.1012927287
## 189    Source        Book266         (Intercept) -0.109303168 -0.1282209928
## 190    Source        Book267         (Intercept)  0.157688167  0.1737865050
## 191    Source        Book268         (Intercept)  0.262308675  0.2705937425
## 192    Source        Book269         (Intercept)  0.005746812  0.0098766687
## 193    Source         Book27         (Intercept)  0.131036795  0.1626273833
## 194    Source        Book270         (Intercept)  0.218084337  0.2366240365
## 195    Source        Book271         (Intercept)  0.076768445  0.0842893519
## 196    Source        Book272         (Intercept)  0.269333682  0.2516179644
## 197    Source        Book273         (Intercept) -0.224872091 -0.2408870098
## 198    Source        Book274         (Intercept)  0.070421363  0.0888500497
## 199    Source        Book275         (Intercept)  0.003790868  0.0162344451
## 200    Source        Book276         (Intercept)  0.115341991  0.1067700428
## 201    Source        Book277         (Intercept) -0.243087857 -0.2695769979
## 202    Source        Book278         (Intercept) -0.221526021 -0.2218705474
## 203    Source        Book279         (Intercept) -0.011859706  0.0152619438
## 204    Source         Book28         (Intercept)  0.032275303 -0.0093031237
## 205    Source        Book280         (Intercept)  0.236625353  0.2152124429
## 206    Source        Book281         (Intercept)  0.007310335  0.0194179788
## 207    Source        Book282         (Intercept)  0.120934103  0.1280016034
## 208    Source        Book283         (Intercept) -0.043308712 -0.0318005389
## 209    Source        Book284         (Intercept)  0.085432916  0.1113803012
## 210    Source        Book285         (Intercept) -0.095789949 -0.1072221836
## 211    Source        Book286         (Intercept)  0.133731189  0.1433990983
## 212    Source        Book287         (Intercept)  0.039113936  0.0310613191
## 213    Source        Book288         (Intercept) -0.029544490 -0.0334636923
## 214    Source        Book289         (Intercept)  0.047671759  0.0562548167
## 215    Source         Book29         (Intercept) -0.125079217 -0.1264990678
## 216    Source        Book290         (Intercept) -0.158831236 -0.1528420223
## 217    Source        Book291         (Intercept)  0.017647591  0.0245283093
## 218    Source        Book292         (Intercept) -0.027812208 -0.0161727026
## 219    Source        Book293         (Intercept)  0.040219612  0.0201004530
## 220    Source        Book294         (Intercept)  0.250893712  0.2501592897
## 221    Source        Book295         (Intercept)  0.089072435  0.0757070502
## 222    Source        Book296         (Intercept)  0.072299596  0.0475801005
## 223    Source        Book297         (Intercept)  0.014709379  0.0252107521
## 224    Source        Book298         (Intercept)  0.017762066 -0.0101848183
## 225    Source        Book299         (Intercept) -0.148427038 -0.1370890668
## 226    Source          Book3         (Intercept) -0.095394440 -0.0674395242
## 227    Source         Book30         (Intercept) -0.166313280 -0.1632864779
## 228    Source        Book300         (Intercept) -0.057577206 -0.1002510470
## 229    Source         Book31         (Intercept) -0.086368489 -0.1070090688
## 230    Source         Book32         (Intercept) -0.131527850 -0.1640798349
## 231    Source         Book33         (Intercept) -0.019432734 -0.0092206053
## 232    Source         Book34         (Intercept)  0.135680338  0.1193518205
## 233    Source         Book35         (Intercept) -0.033408692 -0.0459443502
## 234    Source         Book36         (Intercept) -0.164228926 -0.1598224299
## 235    Source         Book37         (Intercept) -0.122154918 -0.1230610050
## 236    Source         Book38         (Intercept)  0.094678582  0.0993534345
## 237    Source         Book39         (Intercept)  0.010881217 -0.0102718446
## 238    Source          Book4         (Intercept)  0.194340317  0.1993134375
## 239    Source         Book40         (Intercept)  0.174415281  0.1330619865
## 240    Source         Book41         (Intercept) -0.050285777  0.0054381398
## 241    Source         Book42         (Intercept) -0.101567525 -0.1154954921
## 242    Source         Book43         (Intercept) -0.153407297 -0.1192370843
## 243    Source         Book44         (Intercept)  0.310679946  0.3181836835
## 244    Source         Book45         (Intercept)  0.086826711  0.0896198084
## 245    Source         Book46         (Intercept)  0.014877349  0.0144210527
## 246    Source         Book47         (Intercept) -0.396147385 -0.3495655488
## 247    Source         Book48         (Intercept)  0.108751883  0.1086808116
## 248    Source         Book49         (Intercept) -0.166784449 -0.1550991199
## 249    Source          Book5         (Intercept) -0.104272533 -0.0765224507
## 250    Source         Book50         (Intercept)  0.108876333  0.1145877458
## 251    Source         Book51         (Intercept) -0.007260960  0.0035207949
## 252    Source         Book52         (Intercept)  0.006884530  0.0148190146
## 253    Source         Book53         (Intercept) -0.132637280 -0.1302155349
## 254    Source         Book54         (Intercept) -0.141557499 -0.1700055789
## 255    Source         Book55         (Intercept) -0.088612766 -0.0790832098
## 256    Source         Book56         (Intercept)  0.063929637  0.0479946762
## 257    Source         Book57         (Intercept) -0.077442518 -0.0748630983
## 258    Source         Book58         (Intercept)  0.034063609  0.0534435811
## 259    Source         Book59         (Intercept) -0.151603113 -0.1384518530
## 260    Source          Book6         (Intercept) -0.133459544 -0.1378634504
## 261    Source         Book60         (Intercept) -0.034866117 -0.0350174623
## 262    Source         Book61         (Intercept)  0.178268120  0.1998236508
## 263    Source         Book62         (Intercept) -0.103941403 -0.0958744071
## 264    Source         Book63         (Intercept)  0.054126395  0.0461207431
## 265    Source         Book64         (Intercept) -0.034917500 -0.0137367020
## 266    Source         Book65         (Intercept) -0.048514125 -0.0676042077
## 267    Source         Book66         (Intercept)  0.046002159  0.0511691468
## 268    Source         Book67         (Intercept) -0.080180541 -0.0846292943
## 269    Source         Book68         (Intercept)  0.172680567  0.1648237871
## 270    Source         Book69         (Intercept) -0.081151336 -0.0790620798
## 271    Source          Book7         (Intercept)  0.309395935  0.3289635218
## 272    Source         Book70         (Intercept) -0.067808119 -0.0467764523
## 273    Source         Book71         (Intercept)  0.117479489  0.1119788365
## 274    Source         Book72         (Intercept)  0.133622781  0.1343208390
## 275    Source         Book73         (Intercept)  0.149898631  0.1625917114
## 276    Source         Book74         (Intercept) -0.091717462 -0.0660948809
## 277    Source         Book75         (Intercept) -0.018140665 -0.0533932742
## 278    Source         Book76         (Intercept) -0.053895707 -0.0537004526
## 279    Source         Book77         (Intercept) -0.333284528 -0.3522654471
## 280    Source         Book78         (Intercept)  0.048629566  0.0273798183
## 281    Source         Book79         (Intercept) -0.023507266 -0.0266770446
## 282    Source          Book8         (Intercept) -0.207893263 -0.2359085004
## 283    Source         Book80         (Intercept)  0.139112747  0.1581649111
## 284    Source         Book81         (Intercept)  0.063446035  0.0746008430
## 285    Source         Book82         (Intercept) -0.003430520 -0.0048429409
## 286    Source         Book83         (Intercept) -0.277774498 -0.2753465318
## 287    Source         Book84         (Intercept) -0.051450510 -0.0816912412
## 288    Source         Book85         (Intercept)  0.432598062  0.4430519725
## 289    Source         Book86         (Intercept)  0.118638436  0.1086829115
## 290    Source         Book87         (Intercept) -0.088137243 -0.0914314596
## 291    Source         Book88         (Intercept) -0.262033895 -0.2854179796
## 292    Source         Book89         (Intercept)  0.263937227  0.2652945915
## 293    Source          Book9         (Intercept)  0.024860308  0.0401238140
## 294    Source         Book90         (Intercept)  0.056190959  0.0630078661
## 295    Source         Book91         (Intercept) -0.017652857 -0.0287224787
## 296    Source         Book92         (Intercept)  0.405634157  0.3698238495
## 297    Source         Book93         (Intercept) -0.026632187 -0.0170755323
## 298    Source         Book94         (Intercept) -0.175341008 -0.1877755357
## 299    Source         Book95         (Intercept) -0.245399134 -0.2468292880
## 300    Source         Book96         (Intercept) -0.089245593 -0.0556343360
## 301    Source         Book97         (Intercept)  0.170534324  0.2099812022
## 302    Source         Book98         (Intercept) -0.025486349 -0.0150206229
## 303    Source         Book99         (Intercept) -0.255736933 -0.2753026966
## 304    Source           Dogo         (Intercept)  0.070334118  0.0476096429
## 305    Source      Ducksters         (Intercept) -0.040303297 -0.0322160157
## 306    Source            EIM         (Intercept)  0.217556611  0.2006593127
## 307    Source   Encyclopedia         (Intercept) -0.292103466 -0.3218605693
## 308    Source    Factmonster         (Intercept)  0.167354143  0.1961132123
## 309    Source      GreenLine         (Intercept)  0.001995317 -0.0007061291
## 310    Source        History         (Intercept)  0.129750531  0.1489608644
## 311    Source             HT         (Intercept)  0.132097991  0.1426457149
## 312    Source            JTT         (Intercept)  0.236575362  0.2249080122
## 313    Source            NGL         (Intercept) -0.156088192 -0.1432969928
## 314    Source            POC         (Intercept) -0.186088580 -0.2217920942
## 315    Source          Quatr         (Intercept) -0.015232966 -0.0380242221
## 316    Source       Revision         (Intercept) -0.357336875 -0.3293842705
## 317    Source        Science         (Intercept) -0.271435225 -0.2705852540
## 318    Source   Science_Tech         (Intercept) -0.585873776 -0.5989298220
## 319    Source      Solutions         (Intercept)  0.360451350  0.3732190812
## 320    Source Spoken.BNC2014         (Intercept) -0.037375286 -0.0360133157
## 321    Source           Teen         (Intercept)  0.204644066  0.2409499730
## 322    Source      TeenVogue         (Intercept)  0.363586789  0.3643389315
## 323    Source   TweenTribute         (Intercept)  0.140974193  0.1393586588
## 324    Source       WhyFiles         (Intercept)  0.105622576  0.1410344643
## 325    Source          World         (Intercept)  0.013135661  0.0075329267
## 326    Source         Access     RegisterFiction  1.393783466  1.3958320702
## 327    Source      Achievers     RegisterFiction  0.687159395  0.7071152111
## 328    Source            BBC     RegisterFiction -1.009753739 -0.9048185929
## 329    Source          Book1     RegisterFiction  0.081607307  0.1109487190
## 330    Source         Book10     RegisterFiction -1.070297924 -1.0499918925
## 331    Source        Book100     RegisterFiction  0.317299252  0.3810496237
## 332    Source        Book101     RegisterFiction -1.398332518 -1.4053218336
## 333    Source        Book102     RegisterFiction -0.690482419 -0.6762544852
## 334    Source        Book103     RegisterFiction  1.062729311  1.0805292292
## 335    Source        Book104     RegisterFiction -1.620680285 -1.6437474898
## 336    Source        Book105     RegisterFiction -1.482639516 -1.5237160446
## 337    Source        Book106     RegisterFiction -1.575692332 -1.6136094340
## 338    Source        Book107     RegisterFiction  0.654384463  0.6677600581
## 339    Source        Book108     RegisterFiction  1.606832946  1.6049979691
## 340    Source        Book109     RegisterFiction  0.441530607  0.4929262866
## 341    Source         Book11     RegisterFiction -0.880392522 -0.8617769225
## 342    Source        Book110     RegisterFiction -1.270929220 -1.2675886525
## 343    Source        Book111     RegisterFiction -4.054156477 -4.0673894619
## 344    Source        Book112     RegisterFiction  0.794227265  0.7764494733
## 345    Source        Book113     RegisterFiction  0.457032295  0.4455684234
## 346    Source        Book114     RegisterFiction  0.771858096  0.8214472845
## 347    Source        Book115     RegisterFiction -1.694254281 -1.7220726054
## 348    Source        Book116     RegisterFiction -2.169250652 -2.1851767191
## 349    Source        Book117     RegisterFiction  1.530484578  1.5257124593
## 350    Source        Book118     RegisterFiction -0.380140312 -0.4035806124
## 351    Source        Book119     RegisterFiction  0.096977872  0.1538213060
## 352    Source         Book12     RegisterFiction  0.950868356  0.9717707465
## 353    Source        Book120     RegisterFiction  0.316418294  0.3306237075
## 354    Source        Book121     RegisterFiction  0.688813057  0.6665993645
## 355    Source        Book122     RegisterFiction -0.987221770 -0.9344817745
## 356    Source        Book123     RegisterFiction  0.698967345  0.6931809758
## 357    Source        Book124     RegisterFiction  0.253349539  0.2546288186
## 358    Source        Book125     RegisterFiction -1.814455407 -1.8230512990
## 359    Source        Book126     RegisterFiction  0.629250785  0.5745082612
## 360    Source        Book127     RegisterFiction  0.381357510  0.3276142734
## 361    Source        Book128     RegisterFiction  0.929512689  0.9491792137
## 362    Source        Book129     RegisterFiction  1.218451642  1.2014978321
## 363    Source         Book13     RegisterFiction -1.593103962 -1.6277232144
## 364    Source        Book130     RegisterFiction  0.045488444  0.0885725867
## 365    Source        Book131     RegisterFiction  0.775726831  0.7397418648
## 366    Source        Book132     RegisterFiction  1.653980630  1.6171882149
## 367    Source        Book133     RegisterFiction  0.650123834  0.6391520359
## 368    Source        Book134     RegisterFiction  0.554288224  0.5759566282
## 369    Source        Book135     RegisterFiction  0.424799169  0.4388543745
## 370    Source        Book136     RegisterFiction  0.907641688  0.9211043143
## 371    Source        Book137     RegisterFiction  0.679618069  0.6716562749
## 372    Source        Book138     RegisterFiction -0.196581086 -0.2451024007
## 373    Source        Book139     RegisterFiction  1.109376279  1.1642830056
## 374    Source         Book14     RegisterFiction -0.213881834 -0.2129190004
## 375    Source        Book140     RegisterFiction  0.300318082  0.3688819441
## 376    Source        Book141     RegisterFiction  0.817910996  0.7965277412
## 377    Source        Book142     RegisterFiction  0.027878080  0.0227947479
## 378    Source        Book143     RegisterFiction  0.310892860  0.3121315454
## 379    Source        Book144     RegisterFiction  1.121877463  1.1128523523
## 380    Source        Book145     RegisterFiction  2.321926192  2.3660115332
## 381    Source        Book146     RegisterFiction  0.297322218  0.3158617871
## 382    Source        Book147     RegisterFiction  0.498564136  0.5301921155
## 383    Source        Book148     RegisterFiction -0.573535666 -0.5837413566
## 384    Source        Book149     RegisterFiction -1.308939622 -1.3415024260
## 385    Source         Book15     RegisterFiction  0.962864883  0.9256745524
## 386    Source        Book150     RegisterFiction  1.797880387  1.8610108675
## 387    Source        Book151     RegisterFiction  0.332808760  0.3391292823
## 388    Source        Book152     RegisterFiction -2.747636573 -2.7389220310
## 389    Source        Book153     RegisterFiction  2.095783130  2.0749323185
## 390    Source        Book154     RegisterFiction  0.648010737  0.6691286343
## 391    Source        Book155     RegisterFiction  1.874473747  1.8789517355
## 392    Source        Book156     RegisterFiction  1.229351717  1.2504145810
## 393    Source        Book157     RegisterFiction  0.121994118  0.1485104349
## 394    Source        Book158     RegisterFiction -0.709816110 -0.6187268858
## 395    Source        Book159     RegisterFiction  1.006417515  1.0606237804
## 396    Source         Book16     RegisterFiction -0.741493390 -0.7627431640
## 397    Source        Book160     RegisterFiction -0.619931230 -0.5369033273
## 398    Source        Book161     RegisterFiction -1.997010787 -1.9997060880
## 399    Source        Book162     RegisterFiction  0.437045937  0.4829799612
## 400    Source        Book163     RegisterFiction  0.715602451  0.7134540228
## 401    Source        Book164     RegisterFiction  1.876808502  1.8243235811
## 402    Source        Book165     RegisterFiction  0.716198211  0.6851886254
## 403    Source        Book166     RegisterFiction -0.484756106 -0.5555498282
## 404    Source        Book167     RegisterFiction -0.512044078 -0.4708654167
## 405    Source        Book168     RegisterFiction  0.007791643 -0.0131165662
## 406    Source        Book169     RegisterFiction -4.165086556 -4.1911831862
## 407    Source         Book17     RegisterFiction -3.970726382 -3.9607325015
## 408    Source        Book170     RegisterFiction  2.131686044  2.1402309963
## 409    Source        Book171     RegisterFiction  1.082270676  1.1004458657
## 410    Source        Book172     RegisterFiction  0.513124178  0.5569665812
## 411    Source        Book173     RegisterFiction  1.017027164  0.9835211719
## 412    Source        Book174     RegisterFiction  1.961640668  1.9674964819
## 413    Source        Book175     RegisterFiction -0.788159984 -0.7262845070
## 414    Source        Book176     RegisterFiction -2.496251348 -2.4354372985
## 415    Source        Book177     RegisterFiction  1.771339107  1.7715063406
## 416    Source        Book178     RegisterFiction  0.693729978  0.6964749488
## 417    Source        Book179     RegisterFiction  0.970081031  0.9714494914
## 418    Source         Book18     RegisterFiction -0.457724466 -0.5053373537
## 419    Source        Book180     RegisterFiction  0.563816371  0.6291850231
## 420    Source        Book181     RegisterFiction -2.117214792 -2.0680054131
## 421    Source        Book182     RegisterFiction  0.908229564  0.8952432454
## 422    Source        Book183     RegisterFiction  0.477505953  0.5263760216
## 423    Source        Book184     RegisterFiction  1.306673544  1.3336849401
## 424    Source        Book185     RegisterFiction -1.907667431 -1.9144836498
## 425    Source        Book186     RegisterFiction  0.334633658  0.3079162647
## 426    Source        Book187     RegisterFiction  1.454266575  1.4150976351
## 427    Source        Book188     RegisterFiction  2.044531663  1.9792650542
## 428    Source        Book189     RegisterFiction -1.302396593 -1.2741542323
## 429    Source         Book19     RegisterFiction  2.787920331  2.7770100053
## 430    Source        Book190     RegisterFiction  0.755611584  0.7422552642
## 431    Source        Book191     RegisterFiction -0.642405481 -0.6100620048
## 432    Source        Book192     RegisterFiction -0.293292306 -0.3163142794
## 433    Source        Book193     RegisterFiction -0.292985641 -0.3268323216
## 434    Source        Book194     RegisterFiction -0.697490590 -0.7098505307
## 435    Source        Book195     RegisterFiction -0.075319956 -0.0802412006
## 436    Source        Book196     RegisterFiction -2.048656638 -2.0775509710
## 437    Source        Book197     RegisterFiction -2.753846527 -2.7235238291
## 438    Source        Book198     RegisterFiction  2.870988734  2.8664359433
## 439    Source        Book199     RegisterFiction -1.311991326 -1.2882592879
## 440    Source          Book2     RegisterFiction -1.238109160 -1.2430262902
## 441    Source         Book20     RegisterFiction -0.453989504 -0.4094322603
## 442    Source        Book200     RegisterFiction  0.550914040  0.5748614725
## 443    Source        Book201     RegisterFiction  2.529652445  2.5423804731
## 444    Source        Book202     RegisterFiction  2.704326916  2.6959174720
## 445    Source        Book203     RegisterFiction -0.728419958 -0.6837967729
## 446    Source        Book204     RegisterFiction  0.188562007  0.1949770383
## 447    Source        Book205     RegisterFiction -0.008440720 -0.0093557950
## 448    Source        Book206     RegisterFiction  1.622706997  1.6545004514
## 449    Source        Book207     RegisterFiction -4.361393173 -4.3513018919
## 450    Source        Book208     RegisterFiction -0.432850700 -0.4262214782
## 451    Source        Book209     RegisterFiction -0.490151491 -0.4558934066
## 452    Source         Book21     RegisterFiction -3.013745741 -3.0025801207
## 453    Source        Book210     RegisterFiction -1.409937438 -1.4535563222
## 454    Source        Book211     RegisterFiction  0.307185478  0.3648328780
## 455    Source        Book212     RegisterFiction -0.306010742 -0.3272809480
## 456    Source        Book213     RegisterFiction  0.217807551  0.2046680341
## 457    Source        Book214     RegisterFiction -0.122631995 -0.0928289349
## 458    Source        Book215     RegisterFiction -2.073683334 -2.0710263190
## 459    Source        Book216     RegisterFiction -0.443245776 -0.4536002582
## 460    Source        Book217     RegisterFiction -0.585828486 -0.5978374405
## 461    Source        Book218     RegisterFiction  0.664688720  0.6753268975
## 462    Source        Book219     RegisterFiction -2.668771581 -2.6677082238
## 463    Source         Book22     RegisterFiction  1.696832089  1.7006189779
## 464    Source        Book220     RegisterFiction -0.716928942 -0.7125112196
## 465    Source        Book221     RegisterFiction  1.130540640  1.1416463599
## 466    Source        Book222     RegisterFiction  1.652617207  1.5761487640
## 467    Source        Book223     RegisterFiction  1.331849331  1.2955958519
## 468    Source        Book224     RegisterFiction -2.933741893 -2.9492002725
## 469    Source        Book225     RegisterFiction -1.699409625 -1.6672445234
## 470    Source        Book226     RegisterFiction -2.914076577 -2.9263788954
## 471    Source        Book227     RegisterFiction  0.111192328  0.0962545620
## 472    Source        Book228     RegisterFiction -0.497166312 -0.4275632239
## 473    Source        Book229     RegisterFiction  1.927877738  1.9462260671
## 474    Source         Book23     RegisterFiction  0.182225999  0.1808338288
## 475    Source        Book230     RegisterFiction  1.197096120  1.1161880294
## 476    Source        Book231     RegisterFiction  1.648694002  1.6000782051
## 477    Source        Book232     RegisterFiction -2.349918988 -2.2618665657
## 478    Source        Book233     RegisterFiction  1.280756641  1.2461083830
## 479    Source        Book234     RegisterFiction  1.282435411  1.2407812983
## 480    Source        Book235     RegisterFiction  0.170682529  0.1727781090
## 481    Source        Book236     RegisterFiction -1.369140408 -1.3622382173
## 482    Source        Book237     RegisterFiction -2.004440195 -1.9636964165
## 483    Source        Book238     RegisterFiction  1.724858881  1.7231951113
## 484    Source        Book239     RegisterFiction -2.460538304 -2.4888250079
## 485    Source         Book24     RegisterFiction  0.309831458  0.3004493792
## 486    Source        Book240     RegisterFiction  0.621971893  0.6253612957
## 487    Source        Book241     RegisterFiction -0.454986743 -0.4709744621
## 488    Source        Book242     RegisterFiction  2.269219775  2.3187256396
## 489    Source        Book243     RegisterFiction  1.108602689  1.0891957464
## 490    Source        Book244     RegisterFiction  0.859722299  0.7994830211
## 491    Source        Book245     RegisterFiction  2.239384288  2.2512687310
## 492    Source        Book246     RegisterFiction  1.183054453  1.2302416101
## 493    Source        Book247     RegisterFiction  1.185816162  1.1848332460
## 494    Source        Book248     RegisterFiction  1.876852752  1.8695672785
## 495    Source        Book249     RegisterFiction  0.109370966  0.1251970027
## 496    Source         Book25     RegisterFiction  0.905046383  0.8877703952
## 497    Source        Book250     RegisterFiction  1.848285644  1.8275184293
## 498    Source        Book251     RegisterFiction  0.959103796  1.0023676006
## 499    Source        Book252     RegisterFiction -0.462841551 -0.4098623631
## 500    Source        Book253     RegisterFiction -0.394763569 -0.3715733441
## 501    Source        Book254     RegisterFiction  0.777548397  0.7731346648
## 502    Source        Book255     RegisterFiction  0.093465796  0.1331922147
## 503    Source        Book256     RegisterFiction -4.454168412 -4.4671113742
## 504    Source        Book257     RegisterFiction -0.582764229 -0.5797232293
## 505    Source        Book258     RegisterFiction  1.679954512  1.6206251724
## 506    Source        Book259     RegisterFiction  0.377311525  0.3931701648
## 507    Source         Book26     RegisterFiction  1.847021043  1.8879979011
## 508    Source        Book260     RegisterFiction -0.036792860 -0.0131820808
## 509    Source        Book261     RegisterFiction -2.258915665 -2.2591546814
## 510    Source        Book262     RegisterFiction -1.965289895 -1.9889479230
## 511    Source        Book263     RegisterFiction -1.364290121 -1.3307255155
## 512    Source        Book264     RegisterFiction  1.088793861  1.0842588455
## 513    Source        Book265     RegisterFiction  1.327042565  1.3357467963
## 514    Source        Book266     RegisterFiction  0.959248564  0.8797890319
## 515    Source        Book267     RegisterFiction -1.367207203 -1.3198812570
## 516    Source        Book268     RegisterFiction -2.437526879 -2.4291101055
## 517    Source        Book269     RegisterFiction  0.310297845  0.3533100531
## 518    Source         Book27     RegisterFiction -1.246085010 -1.2104432585
## 519    Source        Book270     RegisterFiction -2.559628170 -2.6334046859
## 520    Source        Book271     RegisterFiction -0.837239995 -0.8088103069
## 521    Source        Book272     RegisterFiction -2.541317869 -2.5579384930
## 522    Source        Book273     RegisterFiction  2.185863144  2.1909084505
## 523    Source        Book274     RegisterFiction -0.454225982 -0.4167334065
## 524    Source        Book275     RegisterFiction  0.384918794  0.3925464203
## 525    Source        Book276     RegisterFiction -1.376600966 -1.3877665654
## 526    Source        Book277     RegisterFiction  2.418897485  2.4516238900
## 527    Source        Book278     RegisterFiction  2.028022969  2.0773599166
## 528    Source        Book279     RegisterFiction -0.076697366 -0.0404993802
## 529    Source         Book28     RegisterFiction -0.287694162 -0.2616216403
## 530    Source        Book280     RegisterFiction -2.219548749 -2.1857132023
## 531    Source        Book281     RegisterFiction  0.404647638  0.4189915660
## 532    Source        Book282     RegisterFiction -1.714444761 -1.7131855230
## 533    Source        Book283     RegisterFiction  0.881267762  0.9141247036
## 534    Source        Book284     RegisterFiction -1.149409748 -1.1014841906
## 535    Source        Book285     RegisterFiction  1.223060376  1.2584049486
## 536    Source        Book286     RegisterFiction -1.151802308 -1.2347274640
## 537    Source        Book287     RegisterFiction -0.654116010 -0.6760458898
## 538    Source        Book288     RegisterFiction  0.167273814  0.1194848357
## 539    Source        Book289     RegisterFiction -0.153487472 -0.1844203319
## 540    Source         Book29     RegisterFiction  1.293508887  1.2728586734
## 541    Source        Book290     RegisterFiction  1.964324027  1.8862510431
## 542    Source        Book291     RegisterFiction -0.347738027 -0.3403090063
## 543    Source        Book292     RegisterFiction  0.362007903  0.3722871965
## 544    Source        Book293     RegisterFiction -0.399603718 -0.3610929027
## 545    Source        Book294     RegisterFiction -2.801211865 -2.8263249007
## 546    Source        Book295     RegisterFiction -1.134056569 -1.2058602976
## 547    Source        Book296     RegisterFiction -0.307186779 -0.3327996030
## 548    Source        Book297     RegisterFiction -0.263455352 -0.2726065680
## 549    Source        Book298     RegisterFiction -0.523772320 -0.5005785443
## 550    Source        Book299     RegisterFiction  1.320560041  1.3255321870
## 551    Source          Book3     RegisterFiction  0.908755402  0.8946153943
## 552    Source         Book30     RegisterFiction  1.528863490  1.5582512243
## 553    Source        Book300     RegisterFiction  0.667115935  0.6921409849
## 554    Source         Book31     RegisterFiction  1.032457109  1.0420945157
## 555    Source         Book32     RegisterFiction  1.342257203  1.3730207003
## 556    Source         Book33     RegisterFiction  0.217563474  0.2025109609
## 557    Source         Book34     RegisterFiction -1.681472420 -1.6835514311
## 558    Source         Book35     RegisterFiction  0.010723174  0.0276192586
## 559    Source         Book36     RegisterFiction  1.822199487  1.8338474643
## 560    Source         Book37     RegisterFiction  1.154791305  1.2142968594
## 561    Source         Book38     RegisterFiction -0.237960580 -0.2462860704
## 562    Source         Book39     RegisterFiction -0.223645181 -0.2547454404
## 563    Source          Book4     RegisterFiction -1.973544646 -1.9767192967
## 564    Source         Book40     RegisterFiction -1.442484809 -1.4337467417
## 565    Source         Book41     RegisterFiction  0.517188158  0.5498533295
## 566    Source         Book42     RegisterFiction  0.732347888  0.7742303565
## 567    Source         Book43     RegisterFiction  1.616281989  1.6583427603
## 568    Source         Book44     RegisterFiction -3.332229949 -3.3249563089
## 569    Source         Book45     RegisterFiction -0.454336978 -0.4932560828
## 570    Source         Book46     RegisterFiction -0.015835846 -0.0318698593
## 571    Source         Book47     RegisterFiction  3.893275842  3.8540811098
## 572    Source         Book48     RegisterFiction -1.034900869 -0.9936288122
## 573    Source         Book49     RegisterFiction  1.374533670  1.3205574743
## 574    Source          Book5     RegisterFiction  1.276497854  1.2397871445
## 575    Source         Book50     RegisterFiction -1.165028714 -1.1562994438
## 576    Source         Book51     RegisterFiction  0.066141114  0.1211266986
## 577    Source         Book52     RegisterFiction  0.094098649  0.0546472219
## 578    Source         Book53     RegisterFiction  1.441769875  1.4529045834
## 579    Source         Book54     RegisterFiction  1.196774901  1.2648318740
## 580    Source         Book55     RegisterFiction  0.771121395  0.7875873564
## 581    Source         Book56     RegisterFiction -0.800466869 -0.7807074013
## 582    Source         Book57     RegisterFiction  1.028280179  0.9941053478
## 583    Source         Book58     RegisterFiction -0.682794795 -0.7135319168
## 584    Source         Book59     RegisterFiction  1.575887831  1.5431366516
## 585    Source          Book6     RegisterFiction  1.181582136  1.2475271353
## 586    Source         Book60     RegisterFiction  0.031072282  0.0168456769
## 587    Source         Book61     RegisterFiction -1.929073640 -1.9456274089
## 588    Source         Book62     RegisterFiction  1.230652847  1.1859019262
## 589    Source         Book63     RegisterFiction -0.437002703 -0.4849873738
## 590    Source         Book64     RegisterFiction  0.379205886  0.4125181799
## 591    Source         Book65     RegisterFiction  0.257902567  0.2908936097
## 592    Source         Book66     RegisterFiction -0.770130794 -0.6776503932
## 593    Source         Book67     RegisterFiction  1.356993816  1.3110669149
## 594    Source         Book68     RegisterFiction -1.697641584 -1.7047346354
## 595    Source         Book69     RegisterFiction  0.582279804  0.5765466988
## 596    Source          Book7     RegisterFiction -2.968228943 -2.9826768909
## 597    Source         Book70     RegisterFiction  0.856049731  0.7986389477
## 598    Source         Book71     RegisterFiction -1.345258592 -1.2730308759
## 599    Source         Book72     RegisterFiction -1.734756756 -1.7466368849
## 600    Source         Book73     RegisterFiction -1.030004123 -1.0960278323
## 601    Source         Book74     RegisterFiction  1.040436416  1.0984238084
## 602    Source         Book75     RegisterFiction -0.201857950 -0.1741129739
## 603    Source         Book76     RegisterFiction  0.702756260  0.7315024477
## 604    Source         Book77     RegisterFiction  2.971191258  2.9232986579
## 605    Source         Book78     RegisterFiction -0.978114503 -0.9665276756
## 606    Source         Book79     RegisterFiction  0.485447905  0.4908163534
## 607    Source          Book8     RegisterFiction  1.915754890  1.9717433559
## 608    Source         Book80     RegisterFiction -1.340239162 -1.2841552493
## 609    Source         Book81     RegisterFiction -0.528189408 -0.5594438858
## 610    Source         Book82     RegisterFiction  0.198123681  0.2091579281
## 611    Source         Book83     RegisterFiction  2.483827878  2.4562304995
## 612    Source         Book84     RegisterFiction  0.022392903  0.0546203113
## 613    Source         Book85     RegisterFiction -4.591028860 -4.4940009012
## 614    Source         Book86     RegisterFiction -1.570013061 -1.5043055028
## 615    Source         Book87     RegisterFiction  0.638334817  0.6080494253
## 616    Source         Book88     RegisterFiction  2.543378129  2.5327830890
## 617    Source         Book89     RegisterFiction -2.657077200 -2.6528579600
## 618    Source          Book9     RegisterFiction -0.687880613 -0.6361232744
## 619    Source         Book90     RegisterFiction -0.792942411 -0.8148025382
## 620    Source         Book91     RegisterFiction  0.076778410  0.0680730374
## 621    Source         Book92     RegisterFiction -4.234785371 -4.2830430678
## 622    Source         Book93     RegisterFiction -0.246799163 -0.2944785518
## 623    Source         Book94     RegisterFiction  1.925473803  1.8798119917
## 624    Source         Book95     RegisterFiction  2.874132360  2.9633590703
## 625    Source         Book96     RegisterFiction  1.011257727  0.9890626990
## 626    Source         Book97     RegisterFiction -1.934151714 -1.8798688739
## 627    Source         Book98     RegisterFiction  0.107246342  0.0918514451
## 628    Source         Book99     RegisterFiction  2.102733495  2.0604456307
## 629    Source           Dogo     RegisterFiction -0.527519953 -0.4885565344
## 630    Source      Ducksters     RegisterFiction  0.164702108  0.0954029650
## 631    Source            EIM     RegisterFiction  0.666647877  0.6767587399
## 632    Source   Encyclopedia     RegisterFiction  1.652913871  1.6256015351
## 633    Source    Factmonster     RegisterFiction -0.835419504 -0.8751350116
## 634    Source      GreenLine     RegisterFiction -0.539924233 -0.5572671189
## 635    Source        History     RegisterFiction -0.998965694 -1.0157097175
## 636    Source             HT     RegisterFiction  0.066862553  0.0345654582
## 637    Source            JTT     RegisterFiction -0.022046388 -0.0169124668
## 638    Source            NGL     RegisterFiction -0.933877123 -0.9363595004
## 639    Source            POC     RegisterFiction  0.588537808  0.6062411044
## 640    Source          Quatr     RegisterFiction  0.047899997  0.0556709701
## 641    Source       Revision     RegisterFiction  1.828427290  1.7942572331
## 642    Source        Science     RegisterFiction  1.382635623  1.3104711708
## 643    Source   Science_Tech     RegisterFiction  3.297640803  3.3411184079
## 644    Source      Solutions     RegisterFiction -1.864877835 -1.8564894231
## 645    Source Spoken.BNC2014     RegisterFiction -0.011688098 -0.0634872055
## 646    Source           Teen     RegisterFiction -1.060164970 -1.0552850841
## 647    Source      TeenVogue     RegisterFiction -2.067091164 -2.0844182580
## 648    Source   TweenTribute     RegisterFiction -0.773685432 -0.7486021125
## 649    Source       WhyFiles     RegisterFiction -0.807598539 -0.8143884371
## 650    Source          World     RegisterFiction -0.162190274 -0.1663577262
## 651    Source         Access RegisterInformative  0.565841885  0.5777657173
## 652    Source      Achievers RegisterInformative -0.353756050 -0.3407308554
## 653    Source            BBC RegisterInformative  0.662416606  0.6371892304
## 654    Source          Book1 RegisterInformative -0.013318466  0.0079171386
## 655    Source         Book10 RegisterInformative  0.347015775  0.3331657153
## 656    Source        Book100 RegisterInformative -0.121295389 -0.1420589683
## 657    Source        Book101 RegisterInformative  0.515370137  0.5294474773
## 658    Source        Book102 RegisterInformative  0.280827427  0.2796908100
## 659    Source        Book103 RegisterInformative -0.338259761 -0.3587391191
## 660    Source        Book104 RegisterInformative  0.493957361  0.4823920879
## 661    Source        Book105 RegisterInformative  0.475912373  0.4434844618
## 662    Source        Book106 RegisterInformative  0.503534973  0.4882444854
## 663    Source        Book107 RegisterInformative -0.202271895 -0.1750622034
## 664    Source        Book108 RegisterInformative -0.546587112 -0.5867650947
## 665    Source        Book109 RegisterInformative -0.147908281 -0.1281621766
## 666    Source         Book11 RegisterInformative  0.311165865  0.3189785702
## 667    Source        Book110 RegisterInformative  0.462278991  0.4424396392
## 668    Source        Book111 RegisterInformative  1.430139411  1.4811407948
## 669    Source        Book112 RegisterInformative -0.265155748 -0.2744822689
## 670    Source        Book113 RegisterInformative -0.113175570 -0.1516707526
## 671    Source        Book114 RegisterInformative -0.261158579 -0.2848356674
## 672    Source        Book115 RegisterInformative  0.575407621  0.5580515644
## 673    Source        Book116 RegisterInformative  0.714042120  0.7143106380
## 674    Source        Book117 RegisterInformative -0.509435677 -0.4582054257
## 675    Source        Book118 RegisterInformative  0.139608300  0.1664392822
## 676    Source        Book119 RegisterInformative -0.040663750 -0.0951003631
## 677    Source         Book12 RegisterInformative -0.343229753 -0.3685145514
## 678    Source        Book120 RegisterInformative -0.097031528 -0.0901957307
## 679    Source        Book121 RegisterInformative -0.211504562 -0.2261312205
## 680    Source        Book122 RegisterInformative  0.383360394  0.3520568061
## 681    Source        Book123 RegisterInformative -0.255833864 -0.2322267979
## 682    Source        Book124 RegisterInformative -0.081430934 -0.0731089716
## 683    Source        Book125 RegisterInformative  0.632531802  0.6348620930
## 684    Source        Book126 RegisterInformative -0.193426924 -0.2054111200
## 685    Source        Book127 RegisterInformative -0.116857872 -0.1843747877
## 686    Source        Book128 RegisterInformative -0.320420178 -0.2968341345
## 687    Source        Book129 RegisterInformative -0.399677530 -0.3822531110
## 688    Source         Book13 RegisterInformative  0.518841996  0.5447034961
## 689    Source        Book130 RegisterInformative -0.009872289 -0.0055987904
## 690    Source        Book131 RegisterInformative -0.225733278 -0.2289573609
## 691    Source        Book132 RegisterInformative -0.618341435 -0.6407105078
## 692    Source        Book133 RegisterInformative -0.239697287 -0.2574979698
## 693    Source        Book134 RegisterInformative -0.190662364 -0.1661304409
## 694    Source        Book135 RegisterInformative -0.160928220 -0.2025407860
## 695    Source        Book136 RegisterInformative -0.328125980 -0.3311501057
## 696    Source        Book137 RegisterInformative -0.221498491 -0.2468095270
## 697    Source        Book138 RegisterInformative  0.058574643  0.0734517962
## 698    Source        Book139 RegisterInformative -0.388515287 -0.3757278215
## 699    Source         Book14 RegisterInformative  0.066870580  0.0657952984
## 700    Source        Book140 RegisterInformative -0.109157459 -0.1152087823
## 701    Source        Book141 RegisterInformative -0.260744174 -0.2890521422
## 702    Source        Book142 RegisterInformative  0.005741013 -0.0059743012
## 703    Source        Book143 RegisterInformative -0.116937866 -0.1232147249
## 704    Source        Book144 RegisterInformative -0.362746682 -0.3666421179
## 705    Source        Book145 RegisterInformative -0.794572083 -0.7441374415
## 706    Source        Book146 RegisterInformative -0.078974308 -0.0612617831
## 707    Source        Book147 RegisterInformative -0.146887411 -0.1713214586
## 708    Source        Book148 RegisterInformative  0.203107821  0.2452357734
## 709    Source        Book149 RegisterInformative  0.412813402  0.4372351711
## 710    Source         Book15 RegisterInformative -0.290383846 -0.2939724096
## 711    Source        Book150 RegisterInformative -0.632851281 -0.6332395936
## 712    Source        Book151 RegisterInformative -0.140807076 -0.1693605427
## 713    Source        Book152 RegisterInformative  0.934379918  0.9555416128
## 714    Source        Book153 RegisterInformative -0.679177707 -0.7403471414
## 715    Source        Book154 RegisterInformative -0.218239013 -0.2084516703
## 716    Source        Book155 RegisterInformative -0.614743738 -0.6612803897
## 717    Source        Book156 RegisterInformative -0.414050940 -0.3783062604
## 718    Source        Book157 RegisterInformative -0.048696342 -0.0568094397
## 719    Source        Book158 RegisterInformative  0.236569384  0.2108913434
## 720    Source        Book159 RegisterInformative -0.291187076 -0.2823361851
## 721    Source         Book16 RegisterInformative  0.260885557  0.2752053426
## 722    Source        Book160 RegisterInformative  0.189370304  0.2044628704
## 723    Source        Book161 RegisterInformative  0.678243827  0.6256587235
## 724    Source        Book162 RegisterInformative -0.179507421 -0.1676844102
## 725    Source        Book163 RegisterInformative -0.290915011 -0.3130487024
## 726    Source        Book164 RegisterInformative -0.647780860 -0.6316134433
## 727    Source        Book165 RegisterInformative -0.274587701 -0.2776751526
## 728    Source        Book166 RegisterInformative  0.145480229  0.1261662804
## 729    Source        Book167 RegisterInformative  0.169517883  0.1905500362
## 730    Source        Book168 RegisterInformative  0.002659109 -0.0203112721
## 731    Source        Book169 RegisterInformative  1.406307873  1.3635385237
## 732    Source         Book17 RegisterInformative  1.325108727  1.3383668775
## 733    Source        Book170 RegisterInformative -0.716253690 -0.7429277911
## 734    Source        Book171 RegisterInformative -0.374689465 -0.3801654387
## 735    Source        Book172 RegisterInformative -0.141400742 -0.0966006160
## 736    Source        Book173 RegisterInformative -0.357888473 -0.3641499018
## 737    Source        Book174 RegisterInformative -0.709424675 -0.7395364354
## 738    Source        Book175 RegisterInformative  0.268466820  0.2698283481
## 739    Source        Book176 RegisterInformative  0.870111677  0.8650621245
## 740    Source        Book177 RegisterInformative -0.591299559 -0.6089362736
## 741    Source        Book178 RegisterInformative -0.259828269 -0.2577726282
## 742    Source        Book179 RegisterInformative -0.325386611 -0.3010396621
## 743    Source         Book18 RegisterInformative  0.144365699  0.1619703910
## 744    Source        Book180 RegisterInformative -0.166733862 -0.2164046941
## 745    Source        Book181 RegisterInformative  0.722941433  0.7302958436
## 746    Source        Book182 RegisterInformative -0.333608008 -0.2872959922
## 747    Source        Book183 RegisterInformative -0.153068130 -0.1807491521
## 748    Source        Book184 RegisterInformative -0.459524897 -0.4612912520
## 749    Source        Book185 RegisterInformative  0.671186236  0.6563068964
## 750    Source        Book186 RegisterInformative -0.154408997 -0.1709668749
## 751    Source        Book187 RegisterInformative -0.463692543 -0.5151934915
## 752    Source        Book188 RegisterInformative -0.718511900 -0.7208281443
## 753    Source        Book189 RegisterInformative  0.409554523  0.4576412055
## 754    Source         Book19 RegisterInformative -0.914890147 -0.9224334637
## 755    Source        Book190 RegisterInformative -0.243088934 -0.2737783253
## 756    Source        Book191 RegisterInformative  0.235922762  0.1907899982
## 757    Source        Book192 RegisterInformative  0.077845676  0.0764675570
## 758    Source        Book193 RegisterInformative  0.077780722  0.0228099922
## 759    Source        Book194 RegisterInformative  0.263071033  0.2535911739
## 760    Source        Book195 RegisterInformative -0.006829959  0.0074747626
## 761    Source        Book196 RegisterInformative  0.702566406  0.7258409679
## 762    Source        Book197 RegisterInformative  0.965533677  1.0069761944
## 763    Source        Book198 RegisterInformative -1.003656565 -1.0250481333
## 764    Source        Book199 RegisterInformative  0.432818435  0.4329550042
## 765    Source          Book2 RegisterInformative  0.439435175  0.4365956428
## 766    Source         Book20 RegisterInformative  0.202171564  0.1792369859
## 767    Source        Book200 RegisterInformative -0.153661533 -0.1755393307
## 768    Source        Book201 RegisterInformative -0.870098581 -0.9043708381
## 769    Source        Book202 RegisterInformative -0.958945979 -0.9331320018
## 770    Source        Book203 RegisterInformative  0.264415760  0.2775828561
## 771    Source        Book204 RegisterInformative -0.058114805 -0.0572670122
## 772    Source        Book205 RegisterInformative  0.077125639  0.0976605512
## 773    Source        Book206 RegisterInformative -0.511524723 -0.4983049578
## 774    Source        Book207 RegisterInformative  1.517839175  1.5216355934
## 775    Source        Book208 RegisterInformative  0.201484448  0.2527687887
## 776    Source        Book209 RegisterInformative  0.159452750  0.1291436249
## 777    Source         Book21 RegisterInformative  1.056315667  1.0588916729
## 778    Source        Book210 RegisterInformative  0.439418607  0.3863660571
## 779    Source        Book211 RegisterInformative -0.122143751 -0.0957292213
## 780    Source        Book212 RegisterInformative  0.114476037  0.1152817830
## 781    Source        Book213 RegisterInformative -0.103107422 -0.1017547373
## 782    Source        Book214 RegisterInformative  0.063043084  0.1028120373
## 783    Source        Book215 RegisterInformative  0.738151126  0.7487886709
## 784    Source        Book216 RegisterInformative  0.142621846  0.1238427881
## 785    Source        Book217 RegisterInformative  0.231484844  0.2584979383
## 786    Source        Book218 RegisterInformative -0.222312018 -0.2597453389
## 787    Source        Book219 RegisterInformative  0.936575811  0.9365882684
## 788    Source         Book22 RegisterInformative -0.598174019 -0.6038148313
## 789    Source        Book220 RegisterInformative  0.254423393  0.2198311401
## 790    Source        Book221 RegisterInformative -0.356826590 -0.3821515592
## 791    Source        Book222 RegisterInformative -0.557490643 -0.5470548809
## 792    Source        Book223 RegisterInformative -0.444383924 -0.5071428722
## 793    Source        Book224 RegisterInformative  0.995282764  1.0200162391
## 794    Source        Book225 RegisterInformative  0.665286152  0.6408043421
## 795    Source        Book226 RegisterInformative  1.019671091  1.0303995191
## 796    Source        Book227 RegisterInformative  0.010814440  0.0318933533
## 797    Source        Book228 RegisterInformative  0.154145280  0.1480212341
## 798    Source        Book229 RegisterInformative -0.659974311 -0.6779418064
## 799    Source         Book23 RegisterInformative -0.024077347 -0.0514823315
## 800    Source        Book230 RegisterInformative -0.429275363 -0.4638169121
## 801    Source        Book231 RegisterInformative -0.542938520 -0.5521552167
## 802    Source        Book232 RegisterInformative  0.831260897  0.8044687898
## 803    Source        Book233 RegisterInformative -0.442141005 -0.3980870769
## 804    Source        Book234 RegisterInformative -0.469074717 -0.4684413206
## 805    Source        Book235 RegisterInformative -0.093278559 -0.0988632472
## 806    Source        Book236 RegisterInformative  0.440910212  0.4079954595
## 807    Source        Book237 RegisterInformative  0.661883602  0.6615638328
## 808    Source        Book238 RegisterInformative -0.597448440 -0.5588321283
## 809    Source        Book239 RegisterInformative  0.856944891  0.8825068356
## 810    Source         Book24 RegisterInformative -0.072434149 -0.1152681863
## 811    Source        Book240 RegisterInformative -0.194263630 -0.1950376284
## 812    Source        Book241 RegisterInformative  0.142066482  0.1539650918
## 813    Source        Book242 RegisterInformative -0.733906029 -0.7268965689
## 814    Source        Book243 RegisterInformative -0.373693868 -0.4039375272
## 815    Source        Book244 RegisterInformative -0.276602209 -0.3055006601
## 816    Source        Book245 RegisterInformative -0.809170667 -0.7917135950
## 817    Source        Book246 RegisterInformative -0.423901528 -0.4173747720
## 818    Source        Book247 RegisterInformative -0.444177145 -0.4223936731
## 819    Source        Book248 RegisterInformative -0.676739472 -0.6999394801
## 820    Source        Book249 RegisterInformative -0.050318952 -0.0189766730
## 821    Source         Book25 RegisterInformative -0.307154739 -0.3057420548
## 822    Source        Book250 RegisterInformative -0.663568465 -0.6259385249
## 823    Source        Book251 RegisterInformative -0.318572991 -0.3121682376
## 824    Source        Book252 RegisterInformative  0.162453542  0.1189478730
## 825    Source        Book253 RegisterInformative  0.155535018  0.1982094490
## 826    Source        Book254 RegisterInformative -0.270781180 -0.2685143762
## 827    Source        Book255 RegisterInformative -0.040440007 -0.0330955441
## 828    Source        Book256 RegisterInformative  1.541853463  1.5812774667
## 829    Source        Book257 RegisterInformative  0.220777633  0.2266249938
## 830    Source        Book258 RegisterInformative -0.556379345 -0.5195626119
## 831    Source        Book259 RegisterInformative -0.122769016 -0.1050030816
## 832    Source         Book26 RegisterInformative -0.601282465 -0.5536981240
## 833    Source        Book260 RegisterInformative  0.008459376  0.0252156419
## 834    Source        Book261 RegisterInformative  0.796866223  0.7733344962
## 835    Source        Book262 RegisterInformative  0.650411453  0.6297091733
## 836    Source        Book263 RegisterInformative  0.456605785  0.4746302707
## 837    Source        Book264 RegisterInformative -0.406022595 -0.4312912015
## 838    Source        Book265 RegisterInformative -0.431045997 -0.4512863004
## 839    Source        Book266 RegisterInformative -0.317993470 -0.2859703553
## 840    Source        Book267 RegisterInformative  0.416645741  0.4017647537
## 841    Source        Book268 RegisterInformative  0.798050677  0.8160634016
## 842    Source        Book269 RegisterInformative -0.133032468 -0.1306114971
## 843    Source         Book27 RegisterInformative  0.402468484  0.4190812754
## 844    Source        Book270 RegisterInformative  0.913771291  0.9268567628
## 845    Source        Book271 RegisterInformative  0.304728327  0.2673979595
## 846    Source        Book272 RegisterInformative  0.848701191  0.8186650013
## 847    Source        Book273 RegisterInformative -0.707952084 -0.7451244269
## 848    Source        Book274 RegisterInformative  0.137635196  0.1189203724
## 849    Source        Book275 RegisterInformative -0.171613204 -0.1271376520
## 850    Source        Book276 RegisterInformative  0.497071475  0.5187965260
## 851    Source        Book277 RegisterInformative -0.834458218 -0.8216301285
## 852    Source        Book278 RegisterInformative -0.683516756 -0.6689145167
## 853    Source        Book279 RegisterInformative  0.023483195  0.0107279564
## 854    Source         Book28 RegisterInformative  0.074417624  0.0186148161
## 855    Source        Book280 RegisterInformative  0.776596320  0.7354176466
## 856    Source        Book281 RegisterInformative -0.159569700 -0.1638378355
## 857    Source        Book282 RegisterInformative  0.643972828  0.6660961719
## 858    Source        Book283 RegisterInformative -0.308414018 -0.2824677989
## 859    Source        Book284 RegisterInformative  0.395513723  0.4260783869
## 860    Source        Book285 RegisterInformative -0.425699155 -0.4757221528
## 861    Source        Book286 RegisterInformative  0.395381400  0.4035861999
## 862    Source        Book287 RegisterInformative  0.260653995  0.2090441307
## 863    Source        Book288 RegisterInformative -0.095601953 -0.0681589894
## 864    Source        Book289 RegisterInformative  0.062961960  0.0240319319
## 865    Source         Book29 RegisterInformative -0.455866168 -0.4110850906
## 866    Source        Book290 RegisterInformative -0.666485915 -0.6440710273
## 867    Source        Book291 RegisterInformative  0.092470784  0.1028755657
## 868    Source        Book292 RegisterInformative -0.114738001 -0.0895046267
## 869    Source        Book293 RegisterInformative  0.103149302  0.0936903490
## 870    Source        Book294 RegisterInformative  0.983336320  1.0023055255
## 871    Source        Book295 RegisterInformative  0.375885749  0.3488577815
## 872    Source        Book296 RegisterInformative  0.084872625  0.0450875722
## 873    Source        Book297 RegisterInformative  0.122076684  0.1442560217
## 874    Source        Book298 RegisterInformative  0.229610336  0.2226399818
## 875    Source        Book299 RegisterInformative -0.444700446 -0.4646997483
## 876    Source          Book3 RegisterInformative -0.235684666 -0.2915215308
## 877    Source         Book30 RegisterInformative -0.525368604 -0.5311009975
## 878    Source        Book300 RegisterInformative -0.235797009 -0.2438946773
## 879    Source         Book31 RegisterInformative -0.335921650 -0.3205657370
## 880    Source         Book32 RegisterInformative -0.457357830 -0.4302553186
## 881    Source         Book33 RegisterInformative -0.075495250 -0.1124300834
## 882    Source         Book34 RegisterInformative  0.610289566  0.6055526928
## 883    Source         Book35 RegisterInformative -0.102618615 -0.0855522531
## 884    Source         Book36 RegisterInformative -0.639882863 -0.6404644140
## 885    Source         Book37 RegisterInformative -0.344869624 -0.3633105619
## 886    Source         Book38 RegisterInformative  0.065935930  0.0735982321
## 887    Source         Book39 RegisterInformative  0.060857347  0.0711453413
## 888    Source          Book4 RegisterInformative  0.647436862  0.6805592732
## 889    Source         Book40 RegisterInformative  0.498599114  0.4730036644
## 890    Source         Book41 RegisterInformative -0.148185719 -0.1496423499
## 891    Source         Book42 RegisterInformative -0.268528724 -0.2504372835
## 892    Source         Book43 RegisterInformative -0.537994046 -0.5582865487
## 893    Source         Book44 RegisterInformative  1.129952561  1.1653770520
## 894    Source         Book45 RegisterInformative  0.152381595  0.1829385559
## 895    Source         Book46 RegisterInformative  0.039984701  0.0487392394
## 896    Source         Book47 RegisterInformative -1.336715081 -1.2927409055
## 897    Source         Book48 RegisterInformative  0.359607011  0.3244003532
## 898    Source         Book49 RegisterInformative -0.474671802 -0.4687207594
## 899    Source          Book5 RegisterInformative -0.432641083 -0.4011359358
## 900    Source         Book50 RegisterInformative  0.377112508  0.3525333395
## 901    Source         Book51 RegisterInformative  0.026869259 -0.0241236839
## 902    Source         Book52 RegisterInformative -0.020202886 -0.0309137186
## 903    Source         Book53 RegisterInformative -0.466730838 -0.4810444294
## 904    Source         Book54 RegisterInformative -0.390184511 -0.4175498375
## 905    Source         Book55 RegisterInformative -0.225744298 -0.2381892307
## 906    Source         Book56 RegisterInformative  0.310505962  0.3290265985
## 907    Source         Book57 RegisterInformative -0.338954920 -0.3486230741
## 908    Source         Book58 RegisterInformative  0.194896696  0.1905584407
## 909    Source         Book59 RegisterInformative -0.517367970 -0.5599832759
## 910    Source          Book6 RegisterInformative -0.406705064 -0.3743799718
## 911    Source         Book60 RegisterInformative -0.003054707 -0.0708939476
## 912    Source         Book61 RegisterInformative  0.676624088  0.7135487554
## 913    Source         Book62 RegisterInformative -0.502534973 -0.5197230234
## 914    Source         Book63 RegisterInformative  0.145697493  0.1584908469
## 915    Source         Book64 RegisterInformative -0.112637122 -0.0980905489
## 916    Source         Book65 RegisterInformative -0.095339585 -0.1024669679
## 917    Source         Book66 RegisterInformative  0.255465174  0.2358822232
## 918    Source         Book67 RegisterInformative -0.447793735 -0.4027515076
## 919    Source         Book68 RegisterInformative  0.541243759  0.5583677610
## 920    Source         Book69 RegisterInformative -0.203073302 -0.2050965458
## 921    Source          Book7 RegisterInformative  0.998471252  1.0064439584
## 922    Source         Book70 RegisterInformative -0.301073405 -0.2937275093
## 923    Source         Book71 RegisterInformative  0.504683821  0.4851385611
## 924    Source         Book72 RegisterInformative  0.637996382  0.6358575755
## 925    Source         Book73 RegisterInformative  0.296264022  0.3199763364
## 926    Source         Book74 RegisterInformative -0.408859356 -0.3849829214
## 927    Source         Book75 RegisterInformative  0.114844408  0.0871646881
## 928    Source         Book76 RegisterInformative -0.259123410 -0.2629234407
## 929    Source         Book77 RegisterInformative -0.991074780 -0.9692307719
## 930    Source         Book78 RegisterInformative  0.341127234  0.3129318386
## 931    Source         Book79 RegisterInformative -0.161632505 -0.1655250039
## 932    Source          Book8 RegisterInformative -0.654911110 -0.6565125522
## 933    Source         Book80 RegisterInformative  0.429510552  0.4234922429
## 934    Source         Book81 RegisterInformative  0.186315473  0.1601455534
## 935    Source         Book82 RegisterInformative -0.064044395 -0.0483395630
## 936    Source         Book83 RegisterInformative -0.803634448 -0.8391838804
## 937    Source         Book84 RegisterInformative -0.010944635 -0.0028401012
## 938    Source         Book85 RegisterInformative  1.567658986  1.5441937065
## 939    Source         Book86 RegisterInformative  0.538282064  0.5709297506
## 940    Source         Book87 RegisterInformative -0.206840464 -0.1948625810
## 941    Source         Book88 RegisterInformative -0.905505402 -0.8758085454
## 942    Source         Book89 RegisterInformative  0.937973618  0.9648949075
## 943    Source          Book9 RegisterInformative  0.262468957  0.2578274674
## 944    Source         Book90 RegisterInformative  0.295783285  0.2740032766
## 945    Source         Book91 RegisterInformative  0.006797191 -0.0005768066
## 946    Source         Book92 RegisterInformative  1.434561639  1.4608151768
## 947    Source         Book93 RegisterInformative  0.085658471  0.1089753314
## 948    Source         Book94 RegisterInformative -0.642070521 -0.6140759832
## 949    Source         Book95 RegisterInformative -0.958654281 -0.9939692681
## 950    Source         Book96 RegisterInformative -0.333085688 -0.3529085755
## 951    Source         Book97 RegisterInformative  0.640106639  0.6577056537
## 952    Source         Book98 RegisterInformative -0.033778313 -0.0102373864
## 953    Source         Book99 RegisterInformative -0.678022019 -0.6863984774
## 954    Source           Dogo RegisterInformative  0.365083457  0.3904939352
## 955    Source      Ducksters RegisterInformative -0.080606468 -0.0999720175
## 956    Source            EIM RegisterInformative  0.614294912  0.5967644655
## 957    Source   Encyclopedia RegisterInformative -1.101779369 -1.0668825054
## 958    Source    Factmonster RegisterInformative  0.526057731  0.5633473112
## 959    Source      GreenLine RegisterInformative  0.010093833 -0.0002796852
## 960    Source        History RegisterInformative  0.735246245  0.7173316998
## 961    Source             HT RegisterInformative -0.845386394 -0.8523977017
## 962    Source            JTT RegisterInformative -0.340767522 -0.3471577264
## 963    Source            NGL RegisterInformative  0.013177242  0.0085514574
## 964    Source            POC RegisterInformative -0.598773532 -0.5796577028
## 965    Source          Quatr RegisterInformative -0.058967670 -0.0518246899
## 966    Source       Revision RegisterInformative -1.195322335 -1.1715577014
## 967    Source        Science RegisterInformative -0.870202282 -0.8505099830
## 968    Source   Science_Tech RegisterInformative -2.181147463 -2.1703089670
## 969    Source      Solutions RegisterInformative  0.959757589  0.9895234679
## 970    Source Spoken.BNC2014 RegisterInformative  0.003472077  0.0281132189
## 971    Source           Teen RegisterInformative  0.691206076  0.6528825304
## 972    Source      TeenVogue RegisterInformative  1.398969633  1.3797493190
## 973    Source   TweenTribute RegisterInformative  0.495339314  0.4605920368
## 974    Source       WhyFiles RegisterInformative  0.597273444  0.5796412744
## 975    Source          World RegisterInformative  0.114004954  0.1117743599
##            sd
## 1   0.4156689
## 2   0.4164900
## 3   0.7837332
## 4   0.5898412
## 5   0.6121647
## 6   0.6210976
## 7   0.6044885
## 8   0.6022772
## 9   0.6536755
## 10  0.6085665
## 11  0.5973797
## 12  0.5862229
## 13  0.6087894
## 14  0.6052474
## 15  0.6177118
## 16  0.6251623
## 17  0.6280383
## 18  0.6176521
## 19  0.5852518
## 20  0.6078680
## 21  0.6158856
## 22  0.5859336
## 23  0.6059424
## 24  0.6072051
## 25  0.5897256
## 26  0.6021569
## 27  0.5870200
## 28  0.6074405
## 29  0.5841827
## 30  0.5749767
## 31  0.6054578
## 32  0.6051124
## 33  0.6103368
## 34  0.6002744
## 35  0.5874648
## 36  0.6067991
## 37  0.6242778
## 38  0.6091164
## 39  0.6159451
## 40  0.6149036
## 41  0.6254855
## 42  0.6245145
## 43  0.6192327
## 44  0.6446843
## 45  0.6075575
## 46  0.6506994
## 47  0.5883010
## 48  0.5780632
## 49  0.5978266
## 50  0.5776977
## 51  0.6383411
## 52  0.6355670
## 53  0.6177396
## 54  0.6131735
## 55  0.6084805
## 56  0.6035225
## 57  0.6608026
## 58  0.5925966
## 59  0.6150743
## 60  0.6152919
## 61  0.6227800
## 62  0.5998879
## 63  0.6167710
## 64  0.6259023
## 65  0.5967784
## 66  0.6001819
## 67  0.6220704
## 68  0.6237236
## 69  0.6143713
## 70  0.6081314
## 71  0.6425977
## 72  0.5958361
## 73  0.6297058
## 74  0.5974681
## 75  0.5809569
## 76  0.6312158
## 77  0.6111908
## 78  0.6031850
## 79  0.5948895
## 80  0.5998238
## 81  0.6320864
## 82  0.6007932
## 83  0.6173494
## 84  0.6257684
## 85  0.6247825
## 86  0.6493711
## 87  0.6217821
## 88  0.6245620
## 89  0.6452085
## 90  0.6186232
## 91  0.6216795
## 92  0.6198474
## 93  0.6195648
## 94  0.5861627
## 95  0.6350653
## 96  0.6231642
## 97  0.6418257
## 98  0.6148621
## 99  0.5786707
## 100 0.6102391
## 101 0.5871695
## 102 0.6187379
## 103 0.6534412
## 104 0.5869815
## 105 0.6230022
## 106 0.6093540
## 107 0.6063714
## 108 0.6336612
## 109 0.6329782
## 110 0.6454847
## 111 0.5925318
## 112 0.6097324
## 113 0.6092760
## 114 0.6105331
## 115 0.6147488
## 116 0.6073395
## 117 0.6410001
## 118 0.6489845
## 119 0.6128873
## 120 0.6052396
## 121 0.5917779
## 122 0.5968382
## 123 0.6285480
## 124 0.5886858
## 125 0.5963836
## 126 0.6236853
## 127 0.5991882
## 128 0.6467741
## 129 0.6059706
## 130 0.6491541
## 131 0.5908131
## 132 0.6503689
## 133 0.6088586
## 134 0.5889224
## 135 0.5761927
## 136 0.6144336
## 137 0.5700481
## 138 0.6145991
## 139 0.6043543
## 140 0.6317096
## 141 0.6014331
## 142 0.6103563
## 143 0.5821189
## 144 0.6468632
## 145 0.5892720
## 146 0.6370014
## 147 0.6092379
## 148 0.6135439
## 149 0.6157283
## 150 0.5811384
## 151 0.5967180
## 152 0.5965642
## 153 0.6023049
## 154 0.6099106
## 155 0.5944554
## 156 0.6433193
## 157 0.6017623
## 158 0.6329943
## 159 0.9231876
## 160 0.6371930
## 161 0.6203510
## 162 0.6017971
## 163 0.6301267
## 164 0.5865654
## 165 0.5873305
## 166 0.6032995
## 167 0.6023604
## 168 0.6175215
## 169 0.5962283
## 170 0.6093274
## 171 0.6439414
## 172 0.5893340
## 173 0.6113345
## 174 0.6127363
## 175 0.6144788
## 176 0.6284187
## 177 0.5743171
## 178 0.6167331
## 179 0.5805917
## 180 0.5968097
## 181 0.6047864
## 182 0.6342181
## 183 0.6197005
## 184 0.6163521
## 185 0.8625822
## 186 0.6046674
## 187 0.6052728
## 188 0.6227239
## 189 0.6181100
## 190 0.8452321
## 191 0.6289239
## 192 0.5910481
## 193 0.6241053
## 194 0.5908627
## 195 0.5958104
## 196 0.6139803
## 197 0.5804633
## 198 0.6328089
## 199 0.5993569
## 200 0.5997889
## 201 0.6038281
## 202 0.5930557
## 203 0.6273117
## 204 0.6013403
## 205 0.6277095
## 206 0.6116288
## 207 0.6140783
## 208 0.5907531
## 209 0.6301404
## 210 0.6366838
## 211 0.6139008
## 212 0.5746126
## 213 0.6275090
## 214 0.5790813
## 215 0.6090921
## 216 0.6358138
## 217 0.5759348
## 218 0.6193513
## 219 0.6110659
## 220 0.6155646
## 221 0.5995228
## 222 0.5930846
## 223 0.5953816
## 224 0.6056030
## 225 0.5854380
## 226 0.6027361
## 227 0.6167203
## 228 0.6090799
## 229 0.6311073
## 230 0.6055901
## 231 0.6124703
## 232 0.6187979
## 233 0.6006241
## 234 0.6135382
## 235 0.6406307
## 236 0.6063846
## 237 0.5841936
## 238 0.6172877
## 239 0.6092626
## 240 0.6169064
## 241 0.6111655
## 242 0.5733252
## 243 0.6197244
## 244 0.6055584
## 245 0.6362271
## 246 0.6195689
## 247 0.6039526
## 248 0.6144370
## 249 0.5822393
## 250 0.6027487
## 251 0.5997788
## 252 0.6516774
## 253 0.6213999
## 254 0.6028889
## 255 0.6025611
## 256 0.6262514
## 257 0.6202498
## 258 0.6288957
## 259 0.6442672
## 260 0.6146556
## 261 0.6077450
## 262 0.6351011
## 263 0.6385184
## 264 0.5941687
## 265 0.5795853
## 266 0.6163476
## 267 0.6334750
## 268 0.6038924
## 269 0.6256806
## 270 0.6193162
## 271 0.6120501
## 272 0.5964862
## 273 0.5860906
## 274 0.5968261
## 275 0.5886662
## 276 0.6076221
## 277 0.6154609
## 278 0.5703540
## 279 0.6202103
## 280 0.6029453
## 281 0.6108265
## 282 0.6006887
## 283 0.6045749
## 284 0.6401561
## 285 0.6118915
## 286 0.5944019
## 287 0.6067542
## 288 0.6355580
## 289 0.6129178
## 290 0.6072284
## 291 0.5937540
## 292 0.5914546
## 293 0.5837916
## 294 0.6314292
## 295 0.6047005
## 296 0.6303064
## 297 0.6210911
## 298 0.5770784
## 299 0.5987870
## 300 0.6250179
## 301 0.5908241
## 302 0.6088438
## 303 0.5944566
## 304 0.8170083
## 305 0.7890567
## 306 0.5123380
## 307 0.8007828
## 308 0.8088418
## 309 0.4196986
## 310 0.8075859
## 311 0.4484977
## 312 0.4319364
## 313 0.4218969
## 314 0.6523811
## 315 0.8433477
## 316 0.7697181
## 317 0.7837213
## 318 0.7748318
## 319 0.5511056
## 320 1.0763088
## 321 0.8037587
## 322 0.7654706
## 323 0.8248317
## 324 0.7873524
## 325 0.7736780
## 326 0.6725325
## 327 0.7206089
## 328 1.1622588
## 329 1.0196066
## 330 1.0576260
## 331 1.0801773
## 332 1.0474261
## 333 1.1019777
## 334 1.0592771
## 335 1.0826461
## 336 1.1289990
## 337 1.0907851
## 338 1.0889242
## 339 1.1232974
## 340 1.0984392
## 341 1.0488933
## 342 1.1218000
## 343 1.0893996
## 344 1.0530222
## 345 1.0971568
## 346 1.0573368
## 347 1.0546267
## 348 1.1170840
## 349 1.0578803
## 350 1.0962772
## 351 1.0697000
## 352 0.9980265
## 353 1.0876392
## 354 1.0774233
## 355 1.0552049
## 356 1.0569342
## 357 1.0928147
## 358 1.0835351
## 359 1.0736905
## 360 1.0219953
## 361 1.0457845
## 362 1.0379435
## 363 1.0381199
## 364 1.0583913
## 365 1.0848521
## 366 1.0726768
## 367 1.0634018
## 368 1.0336098
## 369 1.1200776
## 370 1.0694120
## 371 1.1456401
## 372 1.0416730
## 373 1.0285948
## 374 1.0531293
## 375 1.0687247
## 376 1.0726829
## 377 1.0471075
## 378 1.0598320
## 379 1.0740231
## 380 1.1387166
## 381 1.0495859
## 382 1.1099285
## 383 1.0711130
## 384 1.1150589
## 385 1.0841913
## 386 1.0728312
## 387 1.0559878
## 388 1.1296417
## 389 1.0885897
## 390 1.1327975
## 391 1.1145510
## 392 1.1134325
## 393 1.0772341
## 394 1.0452383
## 395 1.0917478
## 396 1.1611484
## 397 1.0273247
## 398 1.0837611
## 399 1.0882876
## 400 1.0317132
## 401 1.0948291
## 402 1.0483982
## 403 1.0008973
## 404 1.0720294
## 405 1.1361216
## 406 1.0983355
## 407 1.1002336
## 408 1.0689328
## 409 1.1179261
## 410 1.1263933
## 411 1.1207903
## 412 1.0606797
## 413 1.1101005
## 414 1.0643913
## 415 1.0702589
## 416 1.1073153
## 417 0.9949185
## 418 1.1266085
## 419 1.0539243
## 420 1.0382547
## 421 1.1172343
## 422 1.0620984
## 423 1.0510363
## 424 1.0210428
## 425 1.0756427
## 426 1.0157063
## 427 1.0314591
## 428 1.1486082
## 429 1.0571314
## 430 1.0868698
## 431 1.0368458
## 432 1.0353532
## 433 1.0586805
## 434 1.0837073
## 435 1.0969712
## 436 1.0307247
## 437 1.0986824
## 438 1.0826950
## 439 1.0056225
## 440 1.0484664
## 441 1.1007262
## 442 1.0594657
## 443 1.0798097
## 444 1.0279777
## 445 1.0667750
## 446 1.0671810
## 447 1.0532581
## 448 1.0911735
## 449 1.0799033
## 450 1.0183312
## 451 1.0537235
## 452 1.0817082
## 453 1.0906587
## 454 1.0553100
## 455 1.0636389
## 456 1.1102229
## 457 1.0710505
## 458 1.0302130
## 459 1.0448997
## 460 1.0448970
## 461 1.0566510
## 462 0.9994065
## 463 1.0558293
## 464 1.1106803
## 465 1.0330213
## 466 1.0798934
## 467 1.0634287
## 468 0.9937375
## 469 1.1503421
## 470 1.0239251
## 471 1.0635863
## 472 1.0565377
## 473 1.0480155
## 474 1.0751627
## 475 1.0248769
## 476 1.0813922
## 477 1.0872790
## 478 1.0219827
## 479 1.0717732
## 480 1.0100869
## 481 1.1369750
## 482 1.0647762
## 483 1.1383143
## 484 1.3745766
## 485 1.0961328
## 486 1.0863654
## 487 1.0715850
## 488 1.0974104
## 489 1.0408408
## 490 1.0982768
## 491 1.0463946
## 492 1.0720581
## 493 1.0844405
## 494 1.0047470
## 495 1.1142711
## 496 1.0494631
## 497 1.0616916
## 498 1.0906715
## 499 1.0460702
## 500 1.0813353
## 501 1.0665167
## 502 1.0590487
## 503 1.0838797
## 504 1.0623970
## 505 1.0576611
## 506 1.0851974
## 507 1.0926495
## 508 1.0374702
## 509 1.0671475
## 510 1.3255767
## 511 1.0656175
## 512 1.1004391
## 513 1.0579151
## 514 1.0498661
## 515 1.2401219
## 516 1.0695229
## 517 1.0244992
## 518 1.1352837
## 519 1.0992026
## 520 1.1212860
## 521 1.1068342
## 522 1.0376145
## 523 1.0599693
## 524 1.0629462
## 525 1.0883125
## 526 1.0126311
## 527 1.0003281
## 528 1.0899433
## 529 1.0835547
## 530 1.0607805
## 531 1.1539416
## 532 1.0897567
## 533 1.0937154
## 534 1.0786013
## 535 1.0774882
## 536 1.1153190
## 537 1.0254438
## 538 1.1108674
## 539 1.0586576
## 540 1.0606882
## 541 1.1227741
## 542 1.0109812
## 543 1.0708797
## 544 1.0812381
## 545 1.0596027
## 546 1.0395079
## 547 1.0615823
## 548 1.0305689
## 549 1.0473744
## 550 1.0592968
## 551 1.0933914
## 552 1.1270481
## 553 1.1059511
## 554 1.0204301
## 555 1.0865907
## 556 1.0910774
## 557 1.0113172
## 558 1.0156362
## 559 1.0670746
## 560 1.1194213
## 561 1.0719453
## 562 1.0526140
## 563 1.0646119
## 564 1.0808106
## 565 1.0753249
## 566 1.0432891
## 567 1.0842998
## 568 1.1097800
## 569 1.0450696
## 570 1.1195586
## 571 1.0820945
## 572 1.0521353
## 573 1.0901588
## 574 1.0406244
## 575 1.0796182
## 576 1.0846914
## 577 1.1091052
## 578 1.0062400
## 579 1.0762406
## 580 1.0728329
## 581 1.0882935
## 582 1.0401896
## 583 1.0878405
## 584 1.0703552
## 585 1.0744398
## 586 1.0371693
## 587 1.1051450
## 588 1.0860457
## 589 1.1092362
## 590 1.0770075
## 591 1.0528506
## 592 1.1479583
## 593 1.1111731
## 594 1.0641791
## 595 1.1336062
## 596 1.1063693
## 597 1.0533902
## 598 1.0301527
## 599 1.1316820
## 600 1.0704431
## 601 1.0667108
## 602 1.0940635
## 603 1.0617583
## 604 1.0468972
## 605 1.0301568
## 606 1.0820181
## 607 1.0464271
## 608 1.0991652
## 609 1.1111474
## 610 1.1238483
## 611 1.0848086
## 612 1.0498864
## 613 1.0627906
## 614 1.1495494
## 615 1.0803959
## 616 1.1029074
## 617 1.0680815
## 618 1.0311070
## 619 1.0922289
## 620 1.0144627
## 621 1.0925729
## 622 1.1282955
## 623 1.0011826
## 624 1.0207198
## 625 1.0736684
## 626 1.0144900
## 627 1.0574659
## 628 1.0947958
## 629 1.1537429
## 630 1.1085425
## 631 0.7418385
## 632 1.1318902
## 633 1.0846068
## 634 0.7505756
## 635 1.0560540
## 636 0.7139307
## 637 0.7051467
## 638 0.6773258
## 639 0.9203595
## 640 1.1281905
## 641 1.0975842
## 642 1.1347436
## 643 1.0740695
## 644 0.7489783
## 645 1.4844937
## 646 1.1184737
## 647 1.0597482
## 648 1.1252655
## 649 1.1147219
## 650 1.1274399
## 651 0.4283157
## 652 0.3915272
## 653 0.5588784
## 654 0.7200516
## 655 0.7551518
## 656 0.7052890
## 657 0.6855785
## 658 0.7001970
## 659 0.7263001
## 660 0.7407848
## 661 0.7527776
## 662 0.7676135
## 663 0.7851809
## 664 0.7368320
## 665 0.7548075
## 666 0.7590378
## 667 0.7148398
## 668 0.7283613
## 669 0.7864078
## 670 0.7673906
## 671 0.7222830
## 672 0.7743647
## 673 0.7252847
## 674 0.7728669
## 675 0.7539985
## 676 0.7401885
## 677 0.7304461
## 678 0.7332767
## 679 0.7536081
## 680 0.7522116
## 681 0.7469639
## 682 0.7010930
## 683 0.7453302
## 684 0.7382419
## 685 0.7579890
## 686 0.6957731
## 687 0.7256736
## 688 0.7459693
## 689 0.7069789
## 690 0.7338955
## 691 0.7034957
## 692 0.7332019
## 693 0.7447322
## 694 0.7707842
## 695 0.7438279
## 696 0.8031153
## 697 0.7477535
## 698 0.7031233
## 699 0.7382514
## 700 0.7649130
## 701 0.7194503
## 702 0.7401601
## 703 0.7229851
## 704 0.7832351
## 705 0.7256845
## 706 0.7299575
## 707 0.7286533
## 708 0.7402337
## 709 0.7744357
## 710 0.7373843
## 711 0.7754419
## 712 0.7383727
## 713 0.7483252
## 714 0.7299988
## 715 0.7214773
## 716 0.7302625
## 717 0.7767335
## 718 0.7636550
## 719 0.7395239
## 720 0.7324986
## 721 0.7814246
## 722 0.7131367
## 723 0.7405845
## 724 0.7716846
## 725 0.7314369
## 726 0.7633097
## 727 0.7663116
## 728 0.7061864
## 729 0.7288348
## 730 0.7635656
## 731 0.7508636
## 732 0.8003157
## 733 0.6912268
## 734 0.7552874
## 735 0.7801618
## 736 0.7032138
## 737 0.7417324
## 738 0.7521494
## 739 0.7627904
## 740 0.7608060
## 741 0.7283254
## 742 0.7040380
## 743 0.7852458
## 744 0.7252050
## 745 0.7233660
## 746 0.7642843
## 747 0.7092617
## 748 0.7404947
## 749 0.7242168
## 750 0.7509175
## 751 0.7232377
## 752 0.7171938
## 753 0.7339928
## 754 0.7560017
## 755 0.7625589
## 756 0.7046678
## 757 0.7166976
## 758 0.6775339
## 759 0.7606577
## 760 0.7198687
## 761 0.7422171
## 762 0.7342001
## 763 0.6816254
## 764 0.7380909
## 765 0.7159844
## 766 0.7372510
## 767 0.7471325
## 768 0.7453982
## 769 0.7137533
## 770 0.7386424
## 771 0.7391711
## 772 0.7115376
## 773 0.7286510
## 774 0.7325219
## 775 0.7456991
## 776 0.7154346
## 777 0.7430996
## 778 0.7465847
## 779 0.7412245
## 780 0.7276010
## 781 0.7563428
## 782 0.7486346
## 783 0.7079338
## 784 0.7790349
## 785 0.7378496
## 786 0.7526025
## 787 0.7063730
## 788 0.7223443
## 789 0.7402876
## 790 0.7287865
## 791 0.7549479
## 792 0.7717874
## 793 0.7525019
## 794 0.7570750
## 795 0.7646610
## 796 0.7227695
## 797 0.7331847
## 798 0.7111210
## 799 0.7195320
## 800 0.7260303
## 801 0.7498212
## 802 0.7181282
## 803 0.7460001
## 804 0.7568831
## 805 0.7040144
## 806 0.7400329
## 807 0.7490139
## 808 0.7497499
## 809 0.7297840
## 810 0.7804970
## 811 0.7061162
## 812 0.7492727
## 813 0.7578967
## 814 0.7570769
## 815 0.7477121
## 816 0.7746079
## 817 0.7582579
## 818 0.7418013
## 819 0.7210385
## 820 0.7275879
## 821 0.7296830
## 822 0.7505676
## 823 0.7047353
## 824 0.7151293
## 825 0.7714896
## 826 0.7129467
## 827 0.7414991
## 828 0.7249714
## 829 0.7883587
## 830 0.7242997
## 831 0.7520808
## 832 0.7186139
## 833 0.7483110
## 834 0.7205428
## 835 0.7407106
## 836 0.7598665
## 837 0.7855574
## 838 0.7121192
## 839 0.7440774
## 840 0.7557104
## 841 0.7367868
## 842 0.7674043
## 843 0.7769044
## 844 0.7652271
## 845 0.7053182
## 846 0.7182617
## 847 0.7311512
## 848 0.7226690
## 849 0.7072845
## 850 0.7168487
## 851 0.7387421
## 852 0.7636658
## 853 0.7698211
## 854 0.7262551
## 855 0.7345581
## 856 0.7772502
## 857 0.7771878
## 858 0.7607255
## 859 0.7653086
## 860 0.7439234
## 861 0.7678074
## 862 0.7220626
## 863 0.7216483
## 864 0.7141620
## 865 0.7544002
## 866 0.7277274
## 867 0.7397052
## 868 0.7539319
## 869 0.7398581
## 870 0.7386427
## 871 0.7705670
## 872 0.7522593
## 873 0.7414441
## 874 0.6948297
## 875 0.7356047
## 876 0.7935104
## 877 0.7554346
## 878 0.7419777
## 879 0.6893367
## 880 0.7654247
## 881 0.7529001
## 882 0.6909348
## 883 0.7352001
## 884 0.7134873
## 885 0.7313394
## 886 0.7178730
## 887 0.7258425
## 888 0.7496946
## 889 0.7376079
## 890 0.7389575
## 891 0.6979122
## 892 0.7618618
## 893 0.7445492
## 894 0.7744710
## 895 0.7580115
## 896 0.7024774
## 897 0.7075978
## 898 0.7630501
## 899 0.7419265
## 900 0.7816151
## 901 0.7668001
## 902 0.7644076
## 903 0.7030022
## 904 0.7231372
## 905 0.7501219
## 906 0.7400955
## 907 0.7196520
## 908 0.7526148
## 909 0.7479391
## 910 0.7643542
## 911 0.7040428
## 912 0.7568539
## 913 0.7525163
## 914 0.8003050
## 915 0.7641240
## 916 0.7666921
## 917 0.7651778
## 918 0.7699912
## 919 0.7394165
## 920 0.7495449
## 921 0.7161281
## 922 0.7723713
## 923 0.7467721
## 924 0.7116218
## 925 0.7368474
## 926 0.7132191
## 927 0.6940617
## 928 0.7330442
## 929 0.7208235
## 930 0.7458842
## 931 0.7577433
## 932 0.7455403
## 933 0.7418804
## 934 0.7968792
## 935 0.7362157
## 936 0.7510551
## 937 0.7303143
## 938 0.7303777
## 939 0.7503829
## 940 0.7488281
## 941 0.7550064
## 942 0.7683137
## 943 0.7284277
## 944 0.7549093
## 945 0.7102605
## 946 0.7317904
## 947 0.7669386
## 948 0.7342083
## 949 0.7535312
## 950 0.7193403
## 951 0.7602047
## 952 0.7421264
## 953 0.7424823
## 954 0.5777185
## 955 0.6184890
## 956 0.4138185
## 957 0.5901989
## 958 0.6141872
## 959 0.4248093
## 960 0.5660774
## 961 0.4308375
## 962 0.4378406
## 963 0.4135766
## 964 0.5390797
## 965 0.5905478
## 966 0.5478158
## 967 0.5680658
## 968 0.5754429
## 969 0.4097403
## 970 0.7499033
## 971 0.5869273
## 972 0.5644726
## 973 0.6005391
## 974 0.5542444
## 975 0.5507464
# We can access the estimated deviation between each series average Dim2 and the overall average:
ranef(md_final2)
## $Source
##                          (Intercept)       RegisterFiction
## Access         -0.876509732933187680  1.397585348817344642
## Achievers       0.216403111752454302  0.715024368667208643
## BBC             0.190537604674936550 -1.012265602908283935
## Book1          -0.001830655015635874  0.018684984308233749
## Book10          0.104402024781476019 -1.065602299793086516
## Book100        -0.034003539723212045  0.347064630269411090
## Book101         0.136663992667235695 -1.394891192866511753
## Book102         0.074226582891395443 -0.757609994637645667
## Book103        -0.103678462819929734  1.058217104995573976
## Book104         0.151590374078454382 -1.547240597896494041
## Book105         0.146261220396889241 -1.492847415092686481
## Book106         0.162207109291765489 -1.655602648185061643
## Book107        -0.057093899508418582  0.582741481764068370
## Book108        -0.155099252893723200  1.583054743676449050
## Book109        -0.047320485048579400  0.482986970804781479
## Book11          0.093886250503439656 -0.958270729565067203
## Book110         0.134636855457011873 -1.374200769690026469
## Book111         0.400510549811615824 -4.087899289922361845
## Book112        -0.073847475885493119  0.753740555340824514
## Book113        -0.038210245359663310  0.390001299458895667
## Book114        -0.075549954401892050  0.771117277930451483
## Book115         0.163670053040159413 -1.670534506317310708
## Book116         0.213928802545201496 -2.183511521556196211
## Book117        -0.155075497379540850  1.582812277779849230
## Book118         0.032882090083265474 -0.335618307097700908
## Book119        -0.008112008890675516  0.082797008467402733
## Book12         -0.085345144749731483  0.871094049294954265
## Book120        -0.034037193368303915  0.347408123622927001
## Book121        -0.072340980361098206  0.738364176398143557
## Book122         0.108990798271025605 -1.112438628819545805
## Book123        -0.061926167018336475  0.632063086230671978
## Book124        -0.026967948272884887  0.275254313893209979
## Book125         0.179126974268116190 -1.828298983038014303
## Book126        -0.056979081189870585  0.581569563263837686
## Book127        -0.034013437854121191  0.347165657726327348
## Book128        -0.091703704045863491  0.935994087618071680
## Book129        -0.115106844767802724  1.174863406751288641
## Book13          0.151764581182458003 -1.549018681138223608
## Book130        -0.000927945476708217  0.009471280237454961
## Book131        -0.077264310675381837  0.788615233468378030
## Book132        -0.164492579126645250  1.678929800290144936
## Book133        -0.066404081441702248  0.677767907739666109
## Book134        -0.047839147108226288  0.488280809547203098
## Book135        -0.036634462918903217  0.373917728317799347
## Book136        -0.082892387910407817  0.846059445471061711
## Book137        -0.073999907101495968  0.755296378177338079
## Book138         0.028645690054086726 -0.292378555537466722
## Book139        -0.105796662834518898  1.079836980775691124
## Book14          0.020871698037925591 -0.213031590875299770
## Book140        -0.034664734867953115  0.353813264391428850
## Book141        -0.076209169920450834  0.777845706561085981
## Book142        -0.004291330359686954  0.043800410097659573
## Book143        -0.028205214636546686  0.287882746007764090
## Book144        -0.113952722703779208  1.163083605274832122
## Book145        -0.223400315420230200  2.280184607382610196
## Book146        -0.028185418374728013  0.287680691093931573
## Book147        -0.049630708802808871  0.506566779249077115
## Book148         0.050374067026173842 -0.514154028960422393
## Book149         0.129759056544910628 -1.324414438921607484
## Book15         -0.093853578079362274  0.957937251260321365
## Book150        -0.172027036374801462  1.755831900494934095
## Book151        -0.032376287001724069  0.330455716352349604
## Book152         0.268083456376142448 -2.736252943837389928
## Book153        -0.204861116227118667  2.090960180578128824
## Book154        -0.059778272611019388  0.610140128079805444
## Book155        -0.187198891432570569  1.910686786456445185
## Book156        -0.120637920319917324  1.231317549676192336
## Book157        -0.014205298278438024  0.144989510945159994
## Book158         0.064415555534101152 -0.657471579342076340
## Book159        -0.101245502242424582  1.033384556085514383
## Book16          0.069073615940016111 -0.705015100566950270
## Book160         0.058726109887437664 -0.599400997106509847
## Book161         0.199948682448911619 -2.040820341407424632
## Book162        -0.041096540332813881  0.419460905895727487
## Book163        -0.071978708769817892  0.734666571475002694
## Book164        -0.177853076228013163  1.815296661635947828
## Book165        -0.076143842256449448  0.777178925345437310
## Book166         0.043684910157671369 -0.445879673576296709
## Book167         0.052292324796395492 -0.533733150110827337
## Book168        -0.006981642340834008  0.071259672887546560
## Book169         0.405332919190624863 -4.137119866932049028
## Book17          0.393859005840568710 -4.020008838874518098
## Book170        -0.215733223217889986  2.201928739255140322
## Book171        -0.107293260228004589  1.095112332261455990
## Book172        -0.055826938752028474  0.569809967278764873
## Book173        -0.095995533608133773  0.979799592937037334
## Book174        -0.193888048301072868  1.978961141840571258
## Book175         0.077320738613641374 -0.789191177669722799
## Book176         0.246659941836061908 -2.517589116087460610
## Book177        -0.177191881083272024  1.808548027513930290
## Book178        -0.065972522934056879  0.673363110618109384
## Book179        -0.086766516348306136  0.885601592108155256
## Book18          0.058276734744155990 -0.594814350562503757
## Book180        -0.057048368106235529  0.582276755462252993
## Book181         0.211375084770603017 -2.157446437671755923
## Book182        -0.095953961458315098  0.979375277617988482
## Book183        -0.049078393098069745  0.500929447153140361
## Book184        -0.113826026628140370  1.161790453826302194
## Book185         0.184505618604227734 -1.883197303126404654
## Book186        -0.037733155449834972  0.385131776035523343
## Book187        -0.133762841905644109  1.365279957547383294
## Book188        -0.210134840375592075  2.144787609623205249
## Book189         0.137186613979246474 -1.400225442591699565
## Book19         -0.269099985828450183  2.746628375965786795
## Book190        -0.073485204294212750  0.750042950417683763
## Book191         0.065090608062115432 -0.664361651903776718
## Book192         0.024185592266357789 -0.246855583450921456
## Book193         0.032078361853430763 -0.327414877596086562
## Book194         0.061454034766039979 -0.627244164232679813
## Book195         0.008964246554042250 -0.091495560204829601
## Book196         0.195629138120094720 -1.996731959209092633
## Book197         0.268653588716518066 -2.742072125355776713
## Book198        -0.283466133030203238  2.893259626934300055
## Book199         0.132536472078059214 -1.352762743332358797
## Book2           0.118962175349050611 -1.214213688917161083
## Book20          0.048111354300308419 -0.491059152309326008
## Book200        -0.049193211416618178  0.502101365653370713
## Book201        -0.249345296159677765  2.544997777451967647
## Book202        -0.271578477808138430  2.771925651177661543
## Book203         0.068921184724012791 -0.703459277730436927
## Book204        -0.024273677039374084  0.247754640120556896
## Book205        -0.001802940249089774  0.018402107428867952
## Book206        -0.159078301519260334  1.623667781356854967
## Book207         0.426956375975073299 -4.357824449311690884
## Book208         0.045234957458067375 -0.461700573329410446
## Book209         0.047442240650840226 -0.484229696221775141
## Book21          0.292367530749009674 -2.984113706636169816
## Book210         0.134438892838826041 -1.372180220551697305
## Book211        -0.033629390374841077  0.343245792397969485
## Book212         0.022350478795774641 -0.228125092938615104
## Book213        -0.020924149539668160  0.213566948700034842
## Book214         0.012317733306111911 -0.125723662608116876
## Book215         0.204685927902100634 -2.089172082287630072
## Book216         0.044361942311867165 -0.452789951629380405
## Book217         0.065619168252671459 -0.669756518103114429
## Book218        -0.059602085880833988  0.608341839346692614
## Book219         0.260558897258895750 -2.659451871089517194
## Book22         -0.168837858595826118  1.723280853876459906
## Book220         0.068970675378559609 -0.703964415015019274
## Book221        -0.112820376527755520  1.151526064203593158
## Book222        -0.161295482842942428  1.646297931706136808
## Book223        -0.126879681671319577  1.295025464007695248
## Book224         0.275740650447574009 -2.814407784507944044
## Book225         0.162511971723771770 -1.658714293858087663
## Book226         0.288907144183119635 -2.948794507698184297
## Book227        -0.007240973370657248  0.073906592258756093
## Book228         0.055764589119376644 -0.569173581997112876
## Book229        -0.188069926952588617  1.919577202665090354
## Book23         -0.018285307839249944  0.186633028686114172
## Book230        -0.116253048327099470  1.186562386262212332
## Book231        -0.156562196642117568  1.597986601808698115
## Book232         0.230880341540462108 -2.356531144271281519
## Book233        -0.124989138667644550  1.275729219736656539
## Book234        -0.120396405925730907  1.228852479727430946
## Book235        -0.006621350375735286  0.067582273455787142
## Book236         0.137584518841800146 -1.404286746359740601
## Book237         0.192853702213128142 -1.968403860289724694
## Book238        -0.173143545541369986  1.767227797635108733
## Book239         0.235335945584945028 -2.402008249975951415
## Book24         -0.033601675608294697  0.342962915518604361
## Book240        -0.055623037255296763  0.567728801666286698
## Book241         0.049105126643602004 -0.501202308983735967
## Book242        -0.217514886781562777  2.220113681500099023
## Book243        -0.113580552981589547  1.159284972894774501
## Book244        -0.087118889808677505  0.889198169574379471
## Book245        -0.217388190705923912  2.218820530051569317
## Book246        -0.107819840792379162  1.100486992969410327
## Book247        -0.111917666988827935  1.142312360132813343
## Book248        -0.186692107130014884  1.905514180662323698
## Book249        -0.003483642877488500  0.035556569613278244
## Book25         -0.085881623445015071  0.876569737459826026
## Book250        -0.183154515143032187  1.869406967560389266
## Book251        -0.098206776053270661  1.002369126812169275
## Book252         0.046193096530087144 -0.471480031158921009
## Book253         0.034699386918212324 -0.354166948187557895
## Book254        -0.076137903377903784  0.777118308871287744
## Book255        -0.007722022532848975  0.078816526664895414
## Book256         0.435528157342523703 -4.445314227001322394
## Book257         0.051680620306200790 -0.527489653273392145
## Book258        -0.151678458851470632  1.548139654566129453
## Book259        -0.044218410821605755  0.451324965807170908
## Book26         -0.175182560508685276  1.788039453759893815
## Book260         0.008093211034024260 -0.082605143996183156
## Book261         0.224187225419595987 -2.288216377904388477
## Book262         0.190159009647925703 -1.940899886102203098
## Book263         0.139083095861467693 -1.419582303336888396
## Book264        -0.104676194415586885  1.068400672652750405
## Book265        -0.132086098529609564  1.348165906345739629
## Book266        -0.086051871296654953  0.878307409718788068
## Book267         0.131354302259344913 -1.340696666259577841
## Book268         0.246865822958975301 -2.519690487191322159
## Book269        -0.034866656738503081  0.355874224512524817
## Book27          0.116222372713357378 -1.186249288842692096
## Book270         0.256375947136627036 -2.616757667796632436
## Book271         0.087903820181861020 -0.897209734604774489
## Book272         0.254907064509687531 -2.601765193190233472
## Book273        -0.211888789172718417  2.162689674988798494
## Book274         0.045316122131523563 -0.462528998476124886
## Book275        -0.042605015483390796  0.434857490329792429
## Book276         0.142452419622992071 -1.453972049671242273
## Book277        -0.233690412313534324  2.385212751592935554
## Book278        -0.200769228909215586  2.049195429888875264
## Book279         0.006691635697267841 -0.068299656096815736
## Book28          0.031080630257773613 -0.317231309938909245
## Book280         0.208635282134909839 -2.129482037597287380
## Book281        -0.042737650437575256  0.436211258252472811
## Book282         0.167973760359521385 -1.714461244584576161
## Book283        -0.091070223667668343  0.929528330375420264
## Book284         0.118791927497410715 -1.212476016658198263
## Book285        -0.124092368007261783  1.266576132140027511
## Book286         0.108749283876838743 -1.109973558870784416
## Book287         0.063122859637347345 -0.644277393468790205
## Book288        -0.015499973801373874  0.158203902309829308
## Book289         0.008012046360568051 -0.081776718849467855
## Book29         -0.121572303877755111  1.240854541609103023
## Book290        -0.192876459322142868  1.968636135743712323
## Book291         0.043403803239847320 -0.443010493799870009
## Book292        -0.039259447236048434  0.400710209892036984
## Book293         0.043015796508203252 -0.439050217488745620
## Book294         0.276122718300673031 -2.818307444344918533
## Book295         0.114593140365687032 -1.169620169434247625
## Book296         0.025220936759470566 -0.257423055444380766
## Book297         0.025084342552922335 -0.256028876538933414
## Book298         0.053961149667702497 -0.550766379346938728
## Book299        -0.121596059391937281  1.241097007505703287
## Book3          -0.087006051116311253  0.888046456565532716
## Book30         -0.147513325364838827  1.505627300695692838
## Book300        -0.067944230611188830  0.693487780035863421
## Book31         -0.102326378137719942  1.044416754380788515
## Book32         -0.135077313690398965  1.378696403825885985
## Book33         -0.028086437065634948  0.286670416524766547
## Book34          0.165542779408198282 -1.689648901165899719
## Book35          0.005464267464515099 -0.055772251439178099
## Book36         -0.180725513817891065  1.844614829633096864
## Book37         -0.112028526055011790  1.143443867650277834
## Book38          0.014477505470520246 -0.147767853707282709
## Book39          0.024708213578369078 -0.252189833176109324
## Book4           0.195415338492453988 -1.994549766139698033
## Book40          0.139698759604025780 -1.425866211157090335
## Book41         -0.059724822704109101  0.609594579812456350
## Book42         -0.074146399438953722  0.756791584539700746
## Book43         -0.158278532541789196  1.615504762838007258
## Book44          0.325961787055160990 -3.327000895410546999
## Book45          0.037215491795355521 -0.379848127735715524
## Book46         -0.008254541975769143  0.084251803846999360
## Book47         -0.386458164767610857  3.944470521641178173
## Book48          0.104896931326940682 -1.070653672638908649
## Book49         -0.126921253821138807  1.295449779326743878
## Book5          -0.126044279422575428  1.286498746643948365
## Book50          0.117109245242830298 -1.195301348982404477
## Book51         -0.008414891696499996  0.085888448649045712
## Book52         -0.007563652438300434  0.077200087354233254
## Book53         -0.147471753215019402  1.505202985376644653
## Book54         -0.119553085172258836  1.220244940398151456
## Book55         -0.076460582445547154  0.780411803966763684
## Book56          0.082206456030470082 -0.839058330403674613
## Book57         -0.105858031246156767  1.080463351008572381
## Book58          0.067444383592345933 -0.688385981158505134
## Book59         -0.157508457957046155  1.607644826689909268
## Book6          -0.109431256504412794  1.116934262955405543
## Book60          0.004864440731411830 -0.049649987550042497
## Book61          0.186289261794082922 -1.901402450862746063
## Book62         -0.122067210423220385  1.245905914454924934
## Book63          0.040921352007795717 -0.417672807605228125
## Book64         -0.039095138262954299  0.399033154107225063
## Book65         -0.018461494569435254  0.188431317419226307
## Book66          0.080624734711164700 -0.822914142788428893
## Book67         -0.136320518932606577  1.391385452414590329
## Book68          0.168397400362439109 -1.718785219740599279
## Book69         -0.047765900939497882  0.487533206366021099
## Book7           0.285074587895040366 -2.909676676380140936
## Book70         -0.081868921174386863  0.835613206425902755
## Book71          0.128341644198699673 -1.309947307091174018
## Book72          0.167924269704974788 -1.713956107299993814
## Book73          0.098112752401709177 -1.001409453668384186
## Book74         -0.101138602428604396  1.032293459550817083
## Book75          0.023563989645254094 -0.240511059156569534
## Book76         -0.072143017742912111  0.736343627259815170
## Book77         -0.290731361117626819  2.967413780310961258
## Book78          0.099969641760293021 -1.020362204585907318
## Book79         -0.051592518349031669  0.526590421209914838
## Book8          -0.188388646767867762  1.922830286777800435
## Book80          0.129578910562361593 -1.322575739205728240
## Book81          0.052765455453859814 -0.538562262551433468
## Book82         -0.021997106930236019  0.224518325029776700
## Book83         -0.242444319289716159  2.474561434489829903
## Book84          0.011177468625361141 -0.114085299571343834
## Book85          0.447849350698415583 -4.571073205370900006
## Book86          0.152972153153392132 -1.561344030882028999
## Book87         -0.057396782314242695  0.585832921945711238
## Book88         -0.241454506198786695  2.464458688798186969
## Book89          0.268821856941975967 -2.743789592123356158
## Book9           0.067074193496338183 -0.684607554269830221
## Book90          0.081177050415903271 -0.828551474884365424
## Book91         -0.004008243815681067  0.040911024829849318
## Book92          0.411430167830751259 -4.199352780392572093
## Book93          0.034602385235301285 -0.353176879109776798
## Book94         -0.187163258161296864  1.910323087611545567
## Book95         -0.283529481068022560  2.893906202658564908
## Book96         -0.101293013270789253  1.033869487878712246
## Book97          0.198368940755787926 -2.024696359283562064
## Book98         -0.007233054865929929  0.073825770293223431
## Book99         -0.201737266112145125  2.059075915175302640
## Dogo            0.099369232675151034 -0.527917081754258444
## Ducksters      -0.021741882670640676  0.115507697325723510
## EIM             0.230294798366586673  0.653053348119588373
## Encyclopedia   -0.312234021290791475  1.658799901203920513
## Factmonster     0.151833365130241038 -0.806642306422207467
## GreenLine       0.017941569320019550 -0.549373755180027734
## History         0.202400503907516904 -1.075289407917243700
## HT              0.121927214498349479  0.086960875615531508
## JTT             0.247758334076155884 -0.021775499158273592
## NGL            -0.139591833587988712 -0.938609904491786384
## POC            -0.177482969817485542  0.508438391759810537
## Quatr          -0.019996065532907541  0.106232726956952850
## Revision       -0.349655979247276705  1.857610844048817711
## Science        -0.248739004374091216  1.321471100988788283
## Science_Tech   -0.615895267953887049  3.272055381442160460
## Solutions       0.359259508325638133 -1.851303174151808006
## Spoken.BNC2014  0.000000000001867724 -0.000000000004034576
## Teen            0.202780076659240832 -1.077305957044264684
## TeenVogue       0.397823480753262571 -2.113509437062586205
## TweenTribute    0.137740204861002857 -0.731769834916360828
## WhyFiles        0.162872297839301933 -0.865288639744527854
## World           0.022905454568807802 -0.121689384195500794
##                   RegisterInformative
## Access          0.5615235185719618105
## Achievers      -0.3756352752817902485
## BBC             0.6603687394464143878
## Book1          -0.0063899729766186564
## Book10          0.3644193533788371853
## Book100        -0.1186906861668776958
## Book101         0.4770310148889069790
## Book102         0.2590907925149980029
## Book103        -0.3618937320347312414
## Book104         0.5291321333638362434
## Book105         0.5105305138765009465
## Book106         0.5661902631225959048
## Book107        -0.1992884906617814200
## Book108        -0.5413800121920643305
## Book109        -0.1651740049972289792
## Book11          0.3277136317158632628
## Book110         0.4699552131225505636
## Book111         1.3979977485039027929
## Book112        -0.2577675046741591536
## Book113        -0.1333743568245996380
## Book114        -0.2637100725638726884
## Book115         0.5712967255301519831
## Book116         0.7467268576046225403
## Book117        -0.5412970926401147187
## Book118         0.1147762223095736278
## Book119        -0.0283152845045960173
## Book12         -0.2979005678177121808
## Book120        -0.1188081555321393173
## Book121        -0.2525090230880291386
## Book122         0.3804366468304138382
## Book123        -0.2161557095208407053
## Book124        -0.0941326788645035495
## Book125         0.6252497139986200603
## Book126        -0.1988877128273589812
## Book127        -0.1187252359801900109
## Book128        -0.3200953678895256393
## Book129        -0.4017849464850984376
## Book13          0.5297402100781325451
## Book130        -0.0032390300025379416
## Book131        -0.2696941002295611400
## Book132        -0.5741677850254250925
## Book133        -0.2317860450633191516
## Book134        -0.1669844152147932081
## Book135        -0.1278740265452835423
## Book136        -0.2893391240789273122
## Book137        -0.2582995717991687368
## Book138         0.0999889022119144349
## Book139        -0.3692873920835610391
## Book14          0.0728534788364440244
## Book140        -0.1209986136961384295
## Book141        -0.2660110901304712505
## Book142        -0.0149790565660533961
## Book143        -0.0984514055285395651
## Book144        -0.3977564382528852582
## Book145        -0.7797875439721724256
## Book146        -0.0983823059019151847
## Book147        -0.1732379314243169544
## Book148         0.1758326523950474729
## Book149         0.4529290651222553921
## Book15         -0.3275995873409546788
## Book150        -0.6004671029187380604
## Book151        -0.1130106968583375754
## Book152         0.9357557961988094419
## Book153        -0.7150757436382577659
## Book154        -0.2086584000320740317
## Book155        -0.6534250567638126839
## Book156        -0.4210913821640047683
## Book157        -0.0495841495796404685
## Book158         0.2248450175598587508
## Book159        -0.3534013879225710864
## Book16          0.2411041597046211238
## Book160         0.2049857848679559336
## Book161         0.6979287012823477410
## Book162        -0.1434490823864626452
## Book163        -0.2512444999207997243
## Book164        -0.6208031230343508122
## Book165        -0.2657830613626100957
## Book166         0.1524838885586039250
## Book167         0.1825284062149687414
## Book168        -0.0243696958243329598
## Book169         1.4148304175496493329
## Book17          1.3747802739580454734
## Book170        -0.7530252585804741994
## Book171        -0.3745113238563787528
## Book172        -0.1948661145578087783
## Book173        -0.3350761669417336996
## Book174        -0.6767738206002564816
## Book175         0.2698910641564190582
## Book176         0.8609761802656946683
## Book177        -0.6184951955050901340
## Book178        -0.2302796732029033511
## Book179        -0.3028619210093572711
## Book18          0.2034172233435778132
## Book180        -0.1991295615205452008
## Book181         0.7378130057700523770
## Book182        -0.3349310577258218791
## Book183        -0.1713100518414917561
## Book184        -0.3973142006424880690
## Book185         0.6440240825525170854
## Book186        -0.1317090558229474795
## Book187        -0.4669044346160975967
## Book188        -0.7334838841710443758
## Book189         0.4788552450317958287
## Book19         -0.9393040320350036776
## Book190        -0.2565029815069297392
## Book191         0.2272013148277564065
## Book192         0.0844207563333977673
## Book193         0.1119707774686158203
## Book194         0.2145077134168224542
## Book195         0.0312900534217623177
## Book196         0.6828511627528655037
## Book197         0.9377458654455970155
## Book198        -0.9894496310764576696
## Book199         0.4626237427376831413
## Book2           0.4152421287612120815
## Book20          0.1679345650718589988
## Book200        -0.1717108296759137787
## Book201        -0.8703495146263401372
## Book202        -0.9479553052884001074
## Book203         0.2405720925796119292
## Book204        -0.0847282196808992749
## Book205        -0.0062932334993443893
## Book206        -0.5552690371436035388
## Book207         1.4903079397116723026
## Book208         0.1578943893233080431
## Book209         0.1655989976919482187
## Book21          1.0205203081791753839
## Book210         0.4692642168563045946
## Book211        -0.1173847032236727955
## Book212         0.0780152209452996542
## Book213        -0.0730365628560209895
## Book214         0.0429955301719649741
## Book215         0.7144642419336086903
## Book216         0.1548470957891642519
## Book217         0.2290462748586329089
## Book218        -0.2080434133551151699
## Book219         0.9094910281188085532
## Book22         -0.5893351530695195573
## Book220         0.2407448416461731855
## Book221        -0.3938039396099601852
## Book222        -0.5630081953255563487
## Book223        -0.4428784944387330613
## Book224         0.9624835317771952559
## Book225         0.5672543973726142941
## Book226         1.0084416934451998493
## Book227        -0.0252749009331146822
## Book228         0.1946484807249193039
## Book229        -0.6564654403352936374
## Book23         -0.0638255826269653326
## Book230        -0.4057858148666613762
## Book231        -0.5464864745996201867
## Book232         0.8058968678832458821
## Book233        -0.4362794800960859143
## Book234        -0.4202483667191845296
## Book235        -0.0231120826197654290
## Book236         0.4802441475269499382
## Book237         0.6731633951001001481
## Book238        -0.6043643218603645950
## Book239         0.8214493281750971931
## Book24         -0.1172879637463989655
## Book240        -0.1941543884035759615
## Book241         0.1714033663284124376
## Book242        -0.7592442249766863105
## Book243        -0.3964573652723434871
## Book244        -0.3040918943632741067
## Book245        -0.7588019873662892323
## Book246        -0.3763493739245923897
## Book247        -0.3906529966358789907
## Book248        -0.6516561063222233718
## Book249        -0.0121597917997705411
## Book25         -0.2997731676992387850
## Book250        -0.6393080030444115991
## Book251        -0.3427945952356988291
## Book252         0.1612388112519374250
## Book253         0.1211195680337094072
## Book254        -0.2657623314746229148
## Book255        -0.0269540218600921484
## Book256         1.5202280780401131732
## Book257         0.1803932277522697081
## Book258        -0.5294395967113377788
## Book259        -0.1543460935051582106
## Book26         -0.6114815834026954278
## Book260         0.0282496698502808716
## Book261         0.7825342841214772971
## Book262         0.6637574652417366217
## Book263         0.4854749892624300456
## Book264        -0.3653763532166096617
## Book265        -0.4610516962409961783
## Book266        -0.3003674244882098554
## Book267         0.4584973327200473903
## Book268         0.8616948163825901563
## Book269        -0.1217034298877091719
## Book27          0.4056787404363708660
## Book270         0.8948902770130360285
## Book271         0.3068317245499167512
## Book272         0.8897630847174925472
## Book273        -0.7396061110899827540
## Book274         0.1581776977924686800
## Book275        -0.1487144739352552758
## Book276         0.4972357457139326420
## Book277        -0.8157055298916265906
## Book278        -0.7007928508149583458
## Book279         0.0233574162852608867
## Book28          0.1084881562867370114
## Book280         0.7282496174452113280
## Book281        -0.1491774414336400623
## Book282         0.5863189843583345162
## Book283        -0.3178841798375394712
## Book284         0.4146478719722406225
## Book285        -0.4331492670099929554
## Book286         0.3795936313855939881
## Book287         0.2203328119412739372
## Book288        -0.0541032651608876133
## Book289         0.0279663613811198843
## Book29         -0.4243528845406843719
## Book290        -0.6732428296797409173
## Book291         0.1515026738605349810
## Book292        -0.1370366370357019858
## Book293         0.1501483211786930339
## Book294         0.9638171545710493282
## Book295         0.3999918411651687267
## Book296         0.0880346668058628878
## Book297         0.0875578793821530643
## Book298         0.1883535047394208628
## Book299        -0.4244358040926342612
## Book3          -0.3036980264915144501
## Book30         -0.5149010352695266857
## Book300        -0.2371619960147110240
## Book31         -0.3571742275362724817
## Book32         -0.4714926498239693231
## Book33         -0.0980368077687921030
## Book34          0.5778335502088365327
## Book35          0.0190732394345373389
## Book36         -0.6308294788575763423
## Book37         -0.3910399545449769754
## Book38          0.0505342994367061066
## Book39          0.0862449864762862978
## Book4           0.6821048867853202191
## Book40          0.4876239876504543935
## Book41         -0.2084718310401875996
## Book42         -0.2588109090361902509
## Book43         -0.5524774122279708655
## Book44          1.1377823745610786688
## Book45          0.1299021305776928426
## Book46         -0.0288128018162931016
## Book47         -1.3489473485534706487
## Book48          0.3661468440444518024
## Book49         -0.4430236036546443823
## Book5          -0.4399624901951756928
## Book50          0.4087744037091518012
## Book51         -0.0293725087919520338
## Book52         -0.0264012248470957382
## Book53         -0.5147559260536156422
## Book54         -0.4173047226249779751
## Book55         -0.2668886553886033464
## Book56          0.2869448520073640818
## Book57         -0.3695016009260966849
## Book58          0.2354172604334186514
## Book59         -0.5497894367522749848
## Book6          -0.3819740835318325978
## Book60          0.0169795207478127923
## Book61          0.6502499589113912570
## Book62         -0.4260803752062984895
## Book63          0.1428375806818133198
## Book64         -0.1364631101347182907
## Book65         -0.0644405693039239863
## Book66          0.2814237918400605554
## Book67         -0.4758321063759926028
## Book68          0.5877977163681004091
## Book69         -0.1667287465962818405
## Book7           0.9950640057306819886
## Book70         -0.2857666733824367755
## Book71          0.4479815318559355886
## Book72          0.5861462352917730101
## Book73          0.3424664020002097797
## Book74         -0.3530282499387982775
## Book75          0.0822510280573860997
## Book76         -0.2518180268217836137
## Book77         -1.0148091940476759998
## Book78          0.3489479469775950138
## Book79         -0.1800857044228123538
## Book8          -0.6575779443239496702
## Book80          0.4523002585199716319
## Book81          0.1841798872912963347
## Book82         -0.0767817626190729907
## Book83         -0.8462613847850133375
## Book84          0.0390153916783894245
## Book85          1.5632356856512485965
## Book86          0.5339552873022317403
## Book87         -0.2003457149491376932
## Book88         -0.8428064034537846583
## Book89          0.9383332122719061363
## Book9           0.2341250974155389686
## Book90          0.2833516714228861422
## Book91         -0.0139909319053218885
## Book92          1.4361131025500182279
## Book93          0.1207809798632489551
## Book94         -0.6533006774358884883
## Book95         -0.9896707498816562643
## Book96         -0.3535672270264694772
## Book97          0.6924145510777067747
## Book98         -0.0252472610824649654
## Book99         -0.7041718225568998069
## Dogo            0.3443957167058526725
## Ducksters      -0.0753534173839083277
## EIM             0.6082591921844688887
## Encyclopedia   -1.0821464214575564622
## Factmonster     0.5262268732097243884
## GreenLine      -0.0002086143628867998
## History         0.7014833940877389651
## HT             -0.8570592554569849142
## JTT            -0.3625325679788663491
## NGL             0.0102362637763926956
## POC            -0.5429259138278393904
## Quatr          -0.0693027321949278019
## Revision       -1.2118441325498410244
## Science        -0.8620842224289650968
## Science_Tech   -2.1345811627242272657
## Solutions       0.9583426523761301441
## Spoken.BNC2014  0.0000000000003884903
## Teen            0.7027989243213272896
## TeenVogue       1.3787839463784812288
## TweenTribute    0.4773825387924300889
## WhyFiles        0.5644858094987162955
## World           0.0793861462983100619
## 
## with conditional variances for "Source"
## Plot predicted vs. observed values
dimensions_ref[, "predicted"] <- predict(md_final2)

dimensions_ref %>%
  ggplot(aes(x = Corpus, y = Dim2)) +
  geom_point(shape = "circle filled", fill = "grey", position = position_jitter(width = 0.2, height = 0)) +
  geom_point(aes(y = predicted), shape = "circle filled", fill = "red", position = position_jitter(width = 0.2, height = 0)) +
  facet_wrap(vars(Register))

## Compare means

comparisons <- emmeans(md_final2, "Corpus", by = "Register")
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 5033' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 5033)' or larger];
## but be warned that this may result in large computation time and memory use.
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'lmerTest.limit = 5033' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 5033)' or larger];
## but be warned that this may result in large computation time and memory use.
pairs(comparisons)
## Register = Conversation:
##  contrast             estimate    SE  df z.ratio p.value
##  Textbook - Reference  -1.1520 0.518 Inf -2.223  0.0262 
## 
## Register = Fiction:
##  contrast             estimate    SE  df z.ratio p.value
##  Textbook - Reference  -2.2559 0.562 Inf -4.017  0.0001 
## 
## Register = Informative:
##  contrast             estimate    SE  df z.ratio p.value
##  Textbook - Reference  -0.0027 0.487 Inf -0.006  0.9956 
## 
## Degrees-of-freedom method: asymptotic
# This is a warning that the degrees of freedom have been calculated according to the naive 'asymptotic' method (i.e. are assumed to be infinite), because we have a very large number of observations and so a more complex estimation method like Kenward-Roger might take a lot of computation.

visreg(md_final2, xvar = "Corpus", by="Register", type = "conditional", line=list(col="darkred"), ylab = "Dimension 2 (Biber 1988)")

emmeans(md_final2, ~ Corpus*Register)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 5033' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 5033)' or larger];
## but be warned that this may result in large computation time and memory use.
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'lmerTest.limit = 5033' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 5033)' or larger];
## but be warned that this may result in large computation time and memory use.
##  Corpus    Register     emmean    SE  df asymp.LCL asymp.UCL
##  Textbook  Conversation  -3.10 0.186 Inf     -3.47    -2.737
##  Reference Conversation  -1.95 0.484 Inf     -2.90    -1.002
##  Textbook  Fiction        2.65 0.551 Inf      1.56     3.726
##  Reference Fiction        4.90 0.106 Inf      4.69     5.110
##  Textbook  Informative   -1.73 0.388 Inf     -2.50    -0.973
##  Reference Informative   -1.73 0.293 Inf     -2.31    -1.157
## 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95
TxBzscores %>% filter(Register=="Fiction") %>% 
  #filter(Level %in% c("C", "D", "E")) %>% 
  select(Level, Past_tense, TPP3, Perfect_aspect, Public_verbs, Syn_negation, Present_part_clauses) %>% 
  group_by(Level) %>% 
  summarise_if(is.numeric, mean) %>% 
  mutate_if(is.numeric, round, 2)
## # A tibble: 5 × 7
##   Level Past_tense  TPP3 Perfect_aspect Public_verbs Syn_negation
##   <fct>      <dbl> <dbl>          <dbl>        <dbl>        <dbl>
## 1 A          -0.2   0.99          -1.24         1.14        -0.51
## 2 B           1.86  1.18          -1.24         1.59        -0.34
## 3 C           1.71  1.08          -0.47         0.99         0.17
## 4 D           1.34  1.04          -0.31         0.22         0.08
## 5 E           0.88  1.09          -0.53         0.21         0.12
## # … with 1 more variable: Present_part_clauses <dbl>
YFzscores %>% 
  select(Past_tense, TPP3, Perfect_aspect, Public_verbs, Syn_negation, Present_part_clauses) %>% 
  summarise_if(is.numeric, mean) %>% 
  round(2)
##   Past_tense TPP3 Perfect_aspect Public_verbs Syn_negation Present_part_clauses
## 1       1.49 1.18          -0.26         1.04         0.27                 1.19
TxBcounts %>% filter(Register=="Fiction") %>% 
  #filter(Level %in% c("C", "D", "E")) %>% 
  select(Level, Past_tense, TPP3, Perfect_aspect, Public_verbs, Syn_negation, Present_part_clauses) %>% 
  group_by(Level) %>% 
  summarise_if(is.numeric, mean) %>% 
  mutate_if(is.numeric, round, 2)
## # A tibble: 5 × 7
##   Level Past_tense  TPP3 Perfect_aspect Public_verbs Syn_negation
##   <chr>      <dbl> <dbl>          <dbl>        <dbl>        <dbl>
## 1 A           3.41  5.21           0.22         1.39         0.09
## 2 B           9.67  5.64           0.21         1.63         0.12
## 3 C           9.22  5.42           0.61         1.3          0.2 
## 4 D           8.08  5.33           0.7          0.89         0.18
## 5 E           6.68  5.45           0.58         0.88         0.19
## # … with 1 more variable: Present_part_clauses <dbl>
YFcounts %>% 
  select(Past_tense, TPP3, Perfect_aspect, Public_verbs, Syn_negation, Present_part_clauses) %>% 
  summarise_if(is.numeric, mean) %>% 
  round(2)
##   Past_tense TPP3 Perfect_aspect Public_verbs Syn_negation Present_part_clauses
## 1       8.54 5.64           0.72         1.33         0.21                  0.3
TxBFictioncounts <- TxBcounts %>%  filter(Register=="Fiction")

Fictioncounts <- merge(YFcounts, TxBFictioncounts, all = TRUE)
Fictioncounts$Level <- ifelse(is.na(Fictioncounts$Level), "Youth Fiction", Fictioncounts$Level)
Fictioncounts$Register <- ifelse(is.na(Fictioncounts$Register), "Youth Fiction", Fictioncounts$Register)

Fictioncounts %>% 
  select(Level, Past_tense, TPP3, Perfect_aspect, Public_verbs, Syn_negation, Present_part_clauses) %>% 
  group_by(Level) %>% 
  summarise_if(is.numeric, mean) %>% 
  mutate_if(is.numeric, round, 2)
## # A tibble: 6 × 7
##   Level         Past_tense  TPP3 Perfect_aspect Public_verbs Syn_negation
##   <chr>              <dbl> <dbl>          <dbl>        <dbl>        <dbl>
## 1 A                   3.41  5.21           0.22         1.39         0.09
## 2 B                   9.67  5.64           0.21         1.63         0.12
## 3 C                   9.22  5.42           0.61         1.3          0.2 
## 4 D                   8.08  5.33           0.7          0.89         0.18
## 5 E                   6.68  5.45           0.58         0.88         0.19
## 6 Youth Fiction       8.54  5.64           0.72         1.33         0.21
## # … with 1 more variable: Present_part_clauses <dbl>
Dim2Fiction <- Fictioncounts %>% 
  select(Level, Past_tense, TPP3, Perfect_aspect, Public_verbs, Syn_negation, Present_part_clauses)

london <- suffrager::suf_palette("london")
hanwell <- suffrager::suf_palette("hanwell")
colours <- c(london, hanwell[3:4])

Dim2FictionFeature <- Dim2Fiction %>% ggplot(aes(x = Level, y = Present_part_clauses, colour = Level, fill = Level)) +
  geom_jitter(size=0.7, alpha=.7) +
  geom_boxplot(outlier.shape = NA, fatten = 2, fill = "white", alpha = 0.3) +
  scale_colour_manual(values = colours) +
  theme_minimal() +
  theme(legend.position = "none") +
  xlab("")

Dim2FictionFeature

Ppc <- Dim2FictionFeature + ylab("Present participial clauses ")
past <- Dim2FictionFeature + aes(y = Past_tense) + ylab("Past tense verbs ")
TPP3 <- Dim2FictionFeature + aes(y = TPP3) + ylab("Third person pronouns ")
SynNeg <- Dim2FictionFeature + aes(y = Syn_negation) + ylim(c(-0.01,0.75)) + ylab("Synthetic negation ") # These y-axis limits remove three outliers that overextend the scale and make the real differences invisible
PerAsp <- Dim2FictionFeature + aes(y = Perfect_aspect) + ylab("Perfect aspect verbs")
public <- Dim2FictionFeature + aes(y = Public_verbs) + ylab("Public verbs")

grid.arrange(past, TPP3, PerAsp, public, SynNeg, Ppc, ncol=2, nrow=3)
## Warning: Removed 3 rows containing non-finite values (stat_boxplot).
## Warning: Removed 3 rows containing missing values (geom_point).

#ggsave(here("plots", "Dim2FictionFeatures.svg"), dpi = 300)
NarrativeTxBdim <- filter(TxBdimensions, Register == "Fiction")
summary(NarrativeTxBdim$Dim1)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -20.096  -0.172   5.381   5.027  10.467  27.151
summary(NarrativeTxBdim$Dim2)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -5.3971  0.4579  2.5474  2.5253  4.1941 10.6745
boxplot(NarrativeTxBdim$Dim2)

boxplot(NarrativeTxBdim$Dim2 ~ NarrativeTxBdim$Level) # We can see that the past tense is probably not taught until level B

boxplot(NarrativeTxBdim$Dim2 ~ NarrativeTxBdim$Series)

boxplot(NarrativeTxBdim$Dim2 ~ NarrativeTxBdim$Country)

options(contrasts=c("contr.treatment", "contr.poly")) # Standard option
options(contrasts=c("contr.sum", "contr.poly")) # Gries 2013: 5.2.1
lm <- lm(Dim2 ~ Series + Level, NarrativeTxBdim)
summary(lm)
## 
## Call:
## lm(formula = Dim2 ~ Series + Level, data = NarrativeTxBdim)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -6.6258 -1.6533  0.0481  1.3697  7.1756 
## 
## Coefficients:
##             Estimate Std. Error t value             Pr(>|t|)    
## (Intercept)  2.45785    0.26349   9.328 < 0.0000000000000002 ***
## Series1      0.50173    0.38853   1.291             0.197679    
## Series2      1.06356    0.50213   2.118             0.035071 *  
## Series3      1.22427    0.81102   1.510             0.132324    
## Series4     -0.46067    0.38206  -1.206             0.228958    
## Series5     -0.18670    0.60178  -0.310             0.756607    
## Series6      0.03592    0.50487   0.071             0.943330    
## Series7     -1.06412    0.38634  -2.754             0.006277 ** 
## Series8      0.45962    1.33908   0.343             0.731684    
## Level1      -2.42326    0.37193  -6.515        0.00000000035 ***
## Level2       0.62393    0.31491   1.981             0.048566 *  
## Level3       1.07940    0.31871   3.387             0.000812 ***
## Level4       0.49484    0.29039   1.704             0.089512 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.567 on 272 degrees of freedom
## Multiple R-squared:  0.2103, Adjusted R-squared:  0.1754 
## F-statistic: 6.035 on 12 and 272 DF,  p-value: 0.000000002342
TukeyHSD(aov(lm), ordered = TRUE)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
##     factor levels have been ordered
## 
## Fit: aov(formula = lm)
## 
## $Series
##                          diff        lwr      upr     p adj
## NGL-Solutions       0.4848200 -3.2423715 4.212012 0.9999790
## GreenLine-Solutions 1.0628021 -2.6583378 4.783942 0.9931995
## POC-Solutions       1.6051867 -4.2566203 7.466994 0.9948896
## HT-Solutions        1.7460756 -2.3115766 5.803728 0.9164965
## JTT-Solutions       1.8531129 -2.0438396 5.750065 0.8608883
## Access-Solutions    2.1468819 -1.5824525 5.876216 0.6821436
## Achievers-Solutions 2.6250771 -1.2718753 6.522030 0.4711284
## EIM-Solutions       3.0277867 -1.4492424 7.504816 0.4654428
## GreenLine-NGL       0.5779821 -0.8249622 1.980926 0.9341260
## POC-NGL             1.1203667 -3.6211681 5.861901 0.9981756
## HT-NGL              1.2612556 -0.8802186 3.402730 0.6542882
## JTT-NGL             1.3682929 -0.4503904 3.186976 0.3147804
## Access-NGL          1.6620619  0.2375248 3.086599 0.0094684
## Achievers-NGL       2.1402571  0.3215739 3.958940 0.0084802
## EIM-NGL             2.5429667 -0.3145077 5.400441 0.1253146
## POC-GreenLine       0.5423846 -4.1943946 5.279164 0.9999922
## HT-GreenLine        0.6832735 -1.4476505 2.814197 0.9854194
## JTT-GreenLine       0.7903108 -1.0159379 2.596559 0.9087775
## Access-GreenLine    1.0840798 -0.3245477 2.492707 0.2846289
## Achievers-GreenLine 1.5622751 -0.2439736 3.368524 0.1510745
## EIM-GreenLine       1.9649846 -0.8845917 4.814561 0.4374723
## HT-POC              0.1408889 -4.8645818 5.146360 1.0000000
## JTT-POC             0.2479262 -4.6281823 5.124035 1.0000000
## Access-POC          0.5416952 -4.2015242 5.284915 0.9999923
## Achievers-POC       1.0198905 -3.8562180 5.895999 0.9992433
## EIM-POC             1.4226000 -3.9284732 6.773673 0.9958294
## JTT-HT              0.1070373 -2.3178737 2.531948 1.0000000
## Access-HT           0.4008063 -1.7443954 2.546008 0.9996708
## Achievers-HT        0.8790016 -1.5459094 3.303913 0.9686381
## EIM-HT              1.2817111 -1.9951386 4.558561 0.9508669
## Access-JTT          0.2937690 -1.5293018 2.116840 0.9998917
## Achievers-JTT       0.7719643 -1.3732374 2.917166 0.9699916
## EIM-JTT             1.1746738 -1.9009467 4.250294 0.9572116
## Achievers-Access    0.4781952 -1.3448757 2.301266 0.9961996
## EIM-Access          0.8809048 -1.9793642 3.741174 0.9887762
## EIM-Achievers       0.4027095 -2.6729110 3.478330 0.9999779
## 
## $Level
##          diff        lwr      upr     p adj
## E-A 2.5476502  1.1087512 3.986549 0.0000193
## D-A 2.8549365  1.4056483 4.304225 0.0000014
## B-A 3.0196265  1.5084193 4.530834 0.0000009
## C-A 3.4452044  1.9227590 4.967650 0.0000000
## D-E 0.3072864 -0.8802712 1.494844 0.9539704
## B-E 0.4719763 -0.7904039 1.734357 0.8428572
## C-E 0.8975542 -0.3782579 2.173366 0.3029163
## B-D 0.1646899 -1.1095197 1.438900 0.9965865
## C-D 0.5902679 -0.6972503 1.877786 0.7165284
## C-B 0.4255779 -0.9312617 1.782418 0.9106869
par(mfrow = c(1,2))
car::crPlot(lm, var = "Series")
car::crPlot(lm, var = "Level")

par(mfrow = c(1,1))

car::influencePlot(lm, id.method = "identify") # six outliers are identified of which: 
## Warning in plot.window(...): "id.method" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "id.method" is not a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "id.method" is not
## a graphical parameter

## Warning in axis(side = side, at = at, labels = labels, ...): "id.method" is not
## a graphical parameter
## Warning in box(...): "id.method" is not a graphical parameter
## Warning in title(...): "id.method" is not a graphical parameter
## Warning in plot.xy(xy.coords(x, y), type = type, ...): "id.method" is not a
## graphical parameter

##        StudRes        Hat      CookD
## 100 -2.7858779 0.12017185 0.07956506
## 194  2.8953873 0.04254017 0.02789440
## 268  2.8510645 0.02699267 0.01690305
## 279  0.5957952 0.34666809 0.01452318
## 280 -0.9925064 0.34977239 0.04076311
## 284 -1.9685634 0.20967290 0.07825718
# 273 is odd because it is a second-person narrative account but it was decided not to remove it because it is still a well-formed narrative text
# The others were fine.

NarrativeTxBdim <- NarrativeTxBdim[-268,] # 268 (POC_4e_PB_cleaned_Narrative_maxed_0002) was identified as to be removed because it is a rhymed version of Cindrella 
InformativeTxBDim <- filter(TxBdimensions, Register == "Informative")
summary(InformativeTxBDim$Dim1)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## -23.5521 -10.1986  -5.5381  -5.2606  -0.8507  21.3275
summary(InformativeTxBDim$Dim2)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -6.9917 -3.5551 -1.6605 -1.5110  0.1062  9.3885
boxplot(InformativeTxBDim$Dim2)

boxplot(InformativeTxBDim$Dim2 ~ InformativeTxBDim$Level) # We can see that the past tense is probably not taught until level B

boxplot(InformativeTxBDim$Dim2 ~ InformativeTxBDim$Series)

boxplot(InformativeTxBDim$Dim2 ~ InformativeTxBDim$Country)

options(contrasts=c("contr.treatment", "contr.poly")) # Standard option
options(contrasts=c("contr.sum", "contr.poly")) # Gries 2013: 5.2.1
lm <- lm(Dim1 ~ Series + Level, InformativeTxBDim)
summary(lm)
## 
## Call:
## lm(formula = Dim1 ~ Series + Level, data = InformativeTxBDim)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -14.7425  -3.9219  -0.4992   3.1995  30.9337 
## 
## Coefficients:
##             Estimate Std. Error t value             Pr(>|t|)    
## (Intercept)  -5.6086     0.3990 -14.057 < 0.0000000000000002 ***
## Series1      -0.5151     1.0039  -0.513              0.60822    
## Series2       3.6624     0.7846   4.668      0.0000043396892 ***
## Series3       5.9228     0.9010   6.573      0.0000000001787 ***
## Series4       3.5027     1.0721   3.267              0.00119 ** 
## Series5      -7.2635     1.0421  -6.970      0.0000000000159 ***
## Series6      -5.4580     0.9502  -5.744      0.0000000200912 ***
## Series7       2.4136     1.1356   2.125              0.03425 *  
## Series8      -3.9570     1.6382  -2.415              0.01623 *  
## Level1        1.8786     0.9300   2.020              0.04416 *  
## Level2        1.4603     0.7283   2.005              0.04573 *  
## Level3        1.0231     0.6333   1.615              0.10713    
## Level4       -1.4437     0.6072  -2.378              0.01796 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.207 on 350 degrees of freedom
## Multiple R-squared:  0.3432, Adjusted R-squared:  0.3207 
## F-statistic: 15.24 on 12 and 350 DF,  p-value: < 0.00000000000000022
TukeyHSD(aov(lm), ordered = TRUE)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
##     factor levels have been ordered
## 
## Fit: aov(formula = lm)
## 
## $Series
##                           diff        lwr       upr     p adj
## JTT-HT               2.4126369 -2.1826794  7.007953 0.7827287
## POC-HT               4.5281635 -2.0304927 11.086820 0.4377118
## Access-HT            6.4473497  1.7083953 11.186304 0.0009244
## NGL-HT               8.9804284  3.9172494 14.043607 0.0000022
## Solutions-HT        10.1893773  6.1293673 14.249387 0.0000000
## GreenLine-HT        10.7380069  5.8140485 15.661965 0.0000000
## Achievers-HT        11.0074564  6.8014427 15.213470 0.0000000
## EIM-HT              13.3890380  8.9086228 17.869453 0.0000000
## POC-JTT              2.1155267 -4.2617491  8.492802 0.9821819
## Access-JTT           4.0347129 -0.4498566  8.519282 0.1166258
## NGL-JTT              6.5677915  1.7418765 11.393706 0.0009192
## Solutions-JTT        7.7767404  4.0167730 11.536708 0.0000000
## GreenLine-JTT        8.3253700  3.6457290 13.005011 0.0000020
## Achievers-JTT        8.5948195  4.6776489 12.511990 0.0000000
## EIM-JTT             10.9764011  6.7659624 15.186840 0.0000000
## Access-POC           1.9191862 -4.5623571  8.400729 0.9914950
## NGL-POC              4.4522648 -2.2699741 11.174504 0.4975122
## Solutions-POC        5.6612137 -0.3418184 11.664246 0.0821511
## GreenLine-POC        6.2098433 -0.4081685 12.827855 0.0854559
## Achievers-POC        6.4792929  0.3765668 12.582019 0.0279197
## EIM-POC              8.8608744  2.5658896 15.155859 0.0004986
## NGL-Access           2.5330786 -2.4298049  7.495962 0.8081843
## Solutions-Access     3.7420275 -0.1921957  7.676251 0.0767468
## GreenLine-Access     4.2906571 -0.5301102  9.111424 0.1256594
## Achievers-Access     4.5601067  0.4753811  8.644832 0.0160566
## EIM-Access           6.9416883  2.5749329 11.308444 0.0000382
## Solutions-NGL        1.2089489 -3.1103340  5.528232 0.9941766
## GreenLine-NGL        1.7575785 -3.3822551  6.897412 0.9784273
## Achievers-NGL        2.0270280 -2.4297729  6.483829 0.8897887
## EIM-NGL              4.4086096 -0.3080252  9.125244 0.0880629
## GreenLine-Solutions  0.5486296 -3.6065827  4.703842 0.9999770
## Achievers-Solutions  0.8180791 -2.4546834  4.090842 0.9973363
## EIM-Solutions        3.1996607 -0.4189776  6.818299 0.1313614
## Achievers-GreenLine  0.2694495 -4.0285337  4.567433 0.9999999
## EIM-GreenLine        2.6510311 -1.9158309  7.217893 0.6743085
## EIM-Achievers        2.3815816 -1.4001394  6.163303 0.5684244
## 
## $Level
##          diff        lwr      upr     p adj
## D-E 1.1097074 -1.3993469 3.618762 0.7439926
## C-E 3.4127499  0.8245059 6.000994 0.0031498
## B-E 3.8653419  0.9879449 6.742739 0.0024593
## A-E 4.2130541  0.6884706 7.737638 0.0100774
## C-D 2.3030425 -0.1982833 4.804368 0.0875163
## B-D 2.7556345 -0.0438364 5.555105 0.0560855
## A-D 3.1033467 -0.3579122 6.564606 0.1026567
## B-C 0.4525920 -2.4180684 3.323252 0.9927083
## A-C 0.8003041 -2.7187819 4.319390 0.9712428
## A-B 0.3477122 -3.3891813 4.084606 0.9990635
par(mfrow = c(1,2))
car::crPlot(lm, var = "Series")
car::crPlot(lm, var = "Level") # Higher levels have lower scores on Dim1

par(mfrow = c(1,1))

car::influencePlot(lm, id.method = "identify")
## Warning in plot.window(...): "id.method" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "id.method" is not a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "id.method" is not
## a graphical parameter

## Warning in axis(side = side, at = at, labels = labels, ...): "id.method" is not
## a graphical parameter
## Warning in box(...): "id.method" is not a graphical parameter
## Warning in title(...): "id.method" is not a graphical parameter
## Warning in plot.xy(xy.coords(x, y), type = type, ...): "id.method" is not a
## graphical parameter

##        StudRes        Hat        CookD
## 218  5.2635436 0.03525890 0.0723665396
## 283 -0.3669127 0.10822991 0.0012599455
## 284  0.2753486 0.10822991 0.0007096842
## 286  3.1332706 0.04000724 0.0306985365
colours <- suf_palette(name = "london", n = 6, type = "continuous") # Very nice, similar to OrRd palette
colours2 <- suf_palette(name = "classic", n = 5, type = "continuous") # Just green and purple
colours <- c(colours, colours2[c(2:4)]) # Nine colours range
#scales::show_col(colours)

# Plot all registers on one dimension
p2 <- ggplot(TxBdimensions,aes(x=Register,y=Dim1))+
  geom_flat_violin(position = position_nudge(x = .2, y = 0),adjust =2)+
  geom_point(position = position_jitter(width = .15), size = .25)+
  ylab('Dimension 1 (Biber 1988)')+xlab('Textbook Registers')+theme_cowplot()+
  ggtitle('Dimension 1')

p2

# Plot with coordinate flip

p3 <- ggplot(TxBdimensions,aes(x=Register,y=Dim1))+
  geom_flat_violin(position = position_nudge(x = .2, y = 0),adjust = 2)+
  geom_point(position = position_jitter(width = .15), size = .25)+
  ylab('Dimension 1 (Biber 1988)')+xlab('Textbook Registers')+coord_flip()+theme_cowplot()+guides(fill = "none")+
  ggtitle('Dimension 1')

p3

# Comparing textbook series

london <- suf_palette(name = "london", n = 5, type = "continuous") # 
hanwell <- suf_palette(name = "hanwell", n = 5, type = "discrete") # 
colours <- c(hanwell, london) # Better for a discrete palette

Fiction <- dimensions_ref %>% filter(Register=="Fiction")

p8 <- ggplot(Fiction,aes(x=Corpus,y=Dim2, fill = Corpus))+
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .45, aes(x=Corpus,y=Dim2, fill = Corpus, colour = Level))+
# note that here we need to set the x-variable to a numeric variable and bump it to get the boxplots to line up with the rainclouds. 
  geom_boxplot(aes(x = as.numeric(Corpus)+0.25, y = Dim2), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Score on Biber\'s (1988) Dimension 2')+ theme_cowplot()+
  guides(fill = "none", colour = "none") +
  scale_colour_manual(values = colours)+
  scale_fill_manual(values = colours[c(10,2)])+
  ggtitle("Dimension 2: Narrative vs. Non-narrative Concerns")

p8

# Comparing textbook series without Level A

Fiction.B.E <- Fiction %>% filter(!Level=="A")
summary(Fiction.B.E$Level)
##              A              B              C              D              E 
##              0             55             53             69             72 
##     Info Teens Spoken BNC2014  Youth Fiction 
##              0              0           1191
london <- suf_palette(name = "london", n = 5, type = "continuous") # 
hanwell <- suf_palette(name = "hanwell", n = 5, type = "discrete") # 
colours <- c(hanwell, london) # Better for a discrete palette

p8a <- ggplot(Fiction.B.E,aes(x=Corpus,y=Dim2, fill = Corpus))+
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .45, aes(x=Corpus,y=Dim2, fill = Corpus, colour = Level))+
# note that here we need to set the x-variable to a numeric variable and bump it to get the boxplots to line up with the rainclouds. 
  geom_boxplot(aes(x = as.numeric(Corpus)+0.25, y = Dim2), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Score on Biber\'s (1988) Dimension 2')+ theme_cowplot()+
  guides(fill = "none", colour = "none") +
  scale_colour_manual(values = colours)+
  scale_fill_manual(values = colours[c(10,2)])+
  ggtitle("Dimension 2: Narrative vs. Non-narrative Concerns")

p8a

Dimension 3: Explicit vs. Situation-Dependent Reference

# Rainplots for all textbook registers and the three ref. corpora on Dimension 3 

Dimensions[Dimensions$Dim3>20,] # Remove four Info Teens outliers with very high Dim 3 scores
##                 Corpus
## 3691 Informative.Teens
## 3960 Informative.Teens
## 4314 Informative.Teens
## 4578 Informative.Teens
##                                                                 Filename
## 3691         Revision_World_GCSE_10529068_wjec-level-law-past-papers.txt
## 3960  Teen_Kids_News_10405570_how-to-become-a-conservation-scientist.txt
## 4314 Revision_World_GCSE_10526584_unit-10-investigating-ict-business.txt
## 4578     Revision_World_GCSE_10528474_wjec-level-history-past-papers.txt
##           Level     Dim1    Dim2    Dim3    Dim4    Dim5    Dim6
## 3691 Info Teens -18.9903 -7.3784 32.1621 -9.2659 -3.9201 -3.0246
## 3960 Info Teens -17.9705 -6.1316 24.4966  3.2431 -1.5149 -2.4668
## 4314 Info Teens -16.2157 -0.3315 23.1731 -3.7492  1.6543 -3.1060
## 4578 Info Teens -26.6036 -7.3784 27.1940 -9.2659 -3.9201 -3.0653
##                TextType   Register     Series    Country
## 3691 Learned exposition Info Teens Info Teens Info Teens
## 3960 Learned exposition Info Teens Info Teens Info Teens
## 4314 Learned exposition Info Teens Info Teens Info Teens
## 4578 Learned exposition Info Teens Info Teens Info Teens
Dimensions3 <- Dimensions[Dimensions$Dim3<20,] 

colours <- suf_palette(name = "london", n = 6, type = "continuous") # Very nice, similar to OrRd palette
colours2 <- suf_palette(name = "classic", n = 5, type = "continuous") # Just green and purple
colours <- c(colours, colours2[c(2:4)]) # Nine colours range
#scales::show_col(colours)

p3 <- ggplot(Dimensions3,aes(x=Register,y=Dim3, fill = Register, colour = Register))+ #Or leave out "colour = Register" to keep the dots in black
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .25)+
#note that here we need to set the x-variable to a numeric variable and bump it to get the boxplots to line up with the rainclouds. 
  geom_boxplot(aes(x = as.numeric(Register)+0.25, y = Dim3), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Dimension 3 (Biber 1988)')+ 
  theme_cowplot()+ 
  guides(fill = "none", colour = "none") +
  scale_colour_manual(values = colours)+
  scale_fill_manual(values = colours)+
  annotate(geom = "text", x = 8.3, y = -15, label = "Reference Corpora", size = 5) +
  annotate(geom = "segment", x = 7, xend = 9.5, y = -13, yend = -13) +
  annotate(geom = "text", x = 3.8, y = -15, label = "Textbook Corpus", size = 5) +
  annotate(geom = "segment", x = 1, xend = 6.5, y = -13, yend = -13) +
  ggtitle("Dimension 3: Explicit vs. Situation-Dependent Reference ")

p3 + scale_y_continuous(sec.axis = dup_axis(name=NULL), breaks = seq(from = -10, to = 20, by = 5))

#ggsave(here("plots", "Dim3.svg"), width = 13, height = 8)
london <- suf_palette(name = "london", n = 6, type = "continuous") # Very nice, similar to OrRd palette
#scales::show_col(london)
classic <- suf_palette(name = "classic", n = 5, type = "continuous") # Just green and purple
#scales::show_col(classic)
colours <- c(london[c(6,1)], classic[4], london[2], classic[2], london[3])
#scales::show_col(colours)

dimensions_ref[dimensions_ref$Dim3>20,] # Remove four Info Teens outliers with very high Dim 3 scores
##                                                                 Filename
## 2875 Revision_World_GCSE_10526584_unit-10-investigating-ict-business.txt
## 2920     Revision_World_GCSE_10528474_wjec-level-history-past-papers.txt
## 2939         Revision_World_GCSE_10529068_wjec-level-law-past-papers.txt
## 4706  Teen_Kids_News_10405570_how-to-become-a-conservation-scientist.txt
##               Corpus.x      Level     Dim1    Dim2    Dim3    Dim4    Dim5
## 2875 Informative.Teens Info Teens -16.2157 -0.3315 23.1731 -3.7492  1.6543
## 2920 Informative.Teens Info Teens -26.6036 -7.3784 27.1940 -9.2659 -3.9201
## 2939 Informative.Teens Info Teens -18.9903 -7.3784 32.1621 -9.2659 -3.9201
## 4706 Informative.Teens Info Teens -17.9705 -6.1316 24.4966  3.2431 -1.5149
##         Dim6           TextType             Subcorpus    Register     Series
## 2875 -3.1060 Learned exposition Reference_Informative Informative Info Teens
## 2920 -3.0653 Learned exposition Reference_Informative Informative Info Teens
## 2939 -3.0246 Learned exposition Reference_Informative Informative Info Teens
## 4706 -2.4668 Learned exposition Reference_Informative Informative Info Teens
##         Country Corpus.y Dim1nopunct    Corpus   Source  predicted
## 2875 Info Teens     <NA>    -16.2157 Reference Revision -3.2931047
## 2920 Info Teens     <NA>    -26.6036 Reference Revision -3.2931047
## 2939 Info Teens     <NA>    -18.9903 Reference Revision -3.2931047
## 4706 Info Teens     <NA>    -17.9705 Reference     Teen -0.8260256
Dimensions3 <- dimensions_ref[dimensions_ref$Dim3<20,] 

ggplot(Dimensions3,aes(x=Subcorpus,y=Dim3, fill = Subcorpus, colour = Subcorpus))+ # Or leave out "colour = Register" to keep the dots in black
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .25)+
# note that here we need to set the x-variable to a numeric variable and bump it to get the boxplots to line up with the rainclouds. 
  geom_boxplot(aes(x = as.numeric(Subcorpus)+0.25, y = Dim3), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Dimension 3 (Biber 1988)')+ 
  theme_cowplot()+
  theme(axis.title.x=element_blank())+
  guides(fill = "none", colour = "none") +
  scale_colour_manual(values = colours3Reg)+
  scale_fill_manual(values = colours3Reg) +
  annotate(geom = "text", x = 1.5, y = -14, label = "Conversation", size = 5) +
  annotate(geom = "segment", x = 0.7, xend = 2.5, y = -12, yend = -12) +
  annotate(geom = "text", x = 3.5, y = -14, label = "Fiction", size = 5) +
  annotate(geom = "segment", x = 2.7, xend = 4.5, y = -12, yend = -12) +
  annotate(geom = "text", x = 5.7, y = -14, label = "Informative", size = 5) +
  annotate(geom = "segment", x = 4.7, xend = 6.5, y = -12, yend = -12) +
  scale_x_discrete(labels=rep(c("Reference", "Textbook"), 3))+
  scale_y_continuous(sec.axis = dup_axis(name=NULL), breaks = seq(from = -10, to = 20, by = 2))

#ggsave(here("plots", "Dim3_3RegComparison.svg"), width = 13, height = 8)

Singularity

# Mixed effect model

# Check  distribution of the outcome variable. 

ggplot(dimensions_ref, aes(x = Dim3)) +
  geom_histogram(bins = 20) +
  facet_grid(rows = vars(Register), cols = vars(Corpus), scales = "free_y")

# Compute model with maximal random effect structure
md_maximal <- lmer(Dim3 ~ 1 + Corpus + Register + Corpus*Register + (Register|Source), dimensions_ref, REML = FALSE) 

# Model failed to converge!

# Calculate variance-covariance matrix for the random effect estimates.

VarCorr(md_maximal)

md_max_ranefs <- tidy(md_maximal, effects = "ran_vals")

head(md_max_ranefs)

# To look at the association between intercepts and slopes, we need the values in the `term` column as separate columns.

md_max_ranefs %>%
  pivot_wider(
    id_cols = c(group, level),
    names_from = term,
    values_from = estimate
  ) ->
  md_final_ranefs

head(md_final_ranefs)

# Now we can plot a matrix of correlations among the estimated random effects.

md_final_ranefs %>%
  select(`(Intercept)`, starts_with("Register")) %>%
  ggpairs(
    lower = list(continuous = wrap("smooth_lm", shape = "circle filled", fill = "grey", se = FALSE)),
    diag = "blank",
    upper = list(continuous = wrap("cor", stars = FALSE))
  )

fig_ranef_cor <- ggplot(md_final_ranefs, 
                        aes(x = RegisterFiction, y = RegisterInformative, label = level)) +
  geom_point(shape = "bullet") +
  geom_text(hjust = "inward")

fig_ranef_cor
# Mixed effect model with simplified random effect structure, otherwise the model did not converge (see chunk above)

md0 <- lmer(Dim3 ~ 1 + (Register|Source), dimensions_ref, REML = FALSE) 
md_corpus <- update(md0, .~. + Corpus)
md_register <- update(md0, . ~ . + Register)
md_both <- update(md_corpus, .~. + Register)
## boundary (singular) fit: see ?isSingular
md_interaction <- update(md_both, . ~ . + Corpus:Register) 
## boundary (singular) fit: see ?isSingular
anova(md0, md_corpus, md_both, md_interaction)
## Data: dimensions_ref
## Models:
## md0: Dim3 ~ 1 + (Register | Source)
## md_corpus: Dim3 ~ (Register | Source) + Corpus
## md_both: Dim3 ~ (Register | Source) + Corpus + Register
## md_interaction: Dim3 ~ (Register | Source) + Corpus + Register + Corpus:Register
##                npar   AIC   BIC logLik deviance   Chisq Df         Pr(>Chisq)
## md0               8 23239 23291 -11612    23223                              
## md_corpus         9 23241 23300 -11612    23223  0.2221  1             0.6375
## md_both          11 23188 23260 -11583    23166 57.2586  2 0.0000000000003685
## md_interaction   13 23191 23276 -11582    23165  1.0821  2             0.5821
##                   
## md0               
## md_corpus         
## md_both        ***
## md_interaction    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(md0, md_register)
## Data: dimensions_ref
## Models:
## md0: Dim3 ~ 1 + (Register | Source)
## md_register: Dim3 ~ (Register | Source) + Register
##             npar   AIC   BIC logLik deviance  Chisq Df        Pr(>Chisq)    
## md0            8 23239 23291 -11612    23223                                
## md_register   10 23190 23255 -11585    23170 53.507  2 0.000000000002405 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
md_final3 <- lmer(Dim3 ~ 1 + Corpus + Register + Corpus:Register + (1|Source), dimensions_ref)

tab_model(md_final3)
  Dim 3
Predictors Estimates CI p
(Intercept) 0.75 0.27 – 1.22 0.002
Corpus1 0.08 -0.40 – 0.55 0.751
Register1 -1.54 -2.20 – -0.87 <0.001
Register2 -1.47 -1.83 – -1.11 <0.001
Corpus1 * Register1 0.31 -0.35 – 0.98 0.358
Corpus1 * Register2 0.18 -0.18 – 0.54 0.323
Random Effects
σ2 5.65
τ00 Source 0.99
ICC 0.15
N Source 325
Observations 5033
Marginal R2 / Conditional R2 0.459 / 0.539
# Diagnostic plots (in new window)
residplot(md_final3) # Oh dear, oh dear...

# We can access the estimated deviation between each series average Dim3 and the overall average:
ranef(md_final3) %>% head()
## $Source
##                          (Intercept)
## Access         -0.512929877373465737
## Achievers      -0.844371056651336827
## BBC            -0.254229409098271852
## Book1          -0.269611763742281130
## Book10          0.544690150441830001
## Book100         0.428512666342395376
## Book101        -0.548380120311670272
## Book102         0.231482072182613796
## Book103         0.041827009818413578
## Book104        -0.348263529584699805
## Book105        -0.390500535934290849
## Book106         1.134568107604746912
## Book107        -0.078033096851199801
## Book108        -0.999223645467507193
## Book109         0.379373314337525525
## Book11          0.146596593274473580
## Book110        -0.098452107470765757
## Book111         1.357366773100555202
## Book112         0.462530635168040050
## Book113        -0.434599426879418771
## Book114        -0.233083851041989670
## Book115         0.390616628497316765
## Book116         0.322734990674386935
## Book117         1.396908675781467934
## Book118        -0.262328811843715426
## Book119        -0.723736731914562448
## Book12          0.072429809109702606
## Book120        -0.116762353769419402
## Book121        -0.103482281875283508
## Book122        -0.014759880568605230
## Book123        -0.424631657967398990
## Book124        -0.212952866768694543
## Book125         0.638607312636609525
## Book126        -0.355608201414609360
## Book127        -0.266680067003451593
## Book128        -0.306067669856004865
## Book129        -0.700334591280047158
## Book13          1.274219738925264744
## Book130        -0.147015406783093716
## Book131         0.068922059678331288
## Book132        -0.812407699945120743
## Book133         0.410984205840762895
## Book134        -0.338244327396560240
## Book135         0.060054962875275446
## Book136        -0.100735744930485482
## Book137        -0.371603950287871188
## Book138        -0.625128854937655909
## Book139         0.046795464291587492
## Book14          0.922272117092604926
## Book140         0.104009840647268106
## Book141         0.061135061673791596
## Book142        -0.482103200703678625
## Book143        -0.180693915986347542
## Book144        -0.599443076843421019
## Book145        -0.144351163080087386
## Book146         0.124737450923552887
## Book147        -0.059259951067467918
## Book148        -0.045023220237503533
## Book149         0.399288278851117395
## Book15          1.381663852739554832
## Book150        -0.673321834661921192
## Book151         0.252940034979799999
## Book152         0.905329995938738419
## Book153        -0.435514939194351469
## Book154        -0.180570476123660034
## Book155        -0.240726835873393774
## Book156        -0.262627124845210502
## Book157        -0.068497367458586381
## Book158        -0.266422900622852898
## Book159         1.886594611062988314
## Book16          0.946569196731604778
## Book160        -0.121391348620202594
## Book161        -0.259685141451157175
## Book162        -0.386097847498434787
## Book163        -0.233330730767364602
## Book164        -0.116032001248517980
## Book165        -0.127460475202340523
## Book166         0.002789153243475054
## Book167         0.258258235730588759
## Book168        -0.421319354985283168
## Book169         0.004229284974829861
## Book17          2.240928736907606744
## Book170        -0.381221972922276220
## Book171         0.091696714344184693
## Book172         0.083374810267998894
## Book173         0.174998048347834584
## Book174        -0.261042979940720177
## Book175         0.421846913757267516
## Book176         0.069631838888784700
## Book177        -1.207734146857231350
## Book178        -0.104058334567825386
## Book179        -0.130803638150128521
## Book18         -0.273849865694553718
## Book180         0.178341211295622498
## Book181         0.011923703082353933
## Book182        -0.255992232225754568
## Book183        -0.625087708316759971
## Book184        -0.041474324185236340
## Book185         1.010284739188829661
## Book186        -0.377889096629712318
## Book187         0.055528834576731821
## Book188         0.042711662167674372
## Book189         0.251448469972325395
## Book19         -0.356935179938500380
## Book190         0.209602356521245176
## Book191        -0.902673099535393320
## Book192        -0.301551828212685280
## Book193        -0.068127047870523705
## Book194         0.253413221120102283
## Book195        -0.153526859539862059
## Book196         0.494933599123522472
## Book197         0.385535020816679175
## Book198        -0.011396144310369441
## Book199        -0.021651939568660274
## Book2           0.891288711558029245
## Book20          0.345890251583526986
## Book200        -0.726133522581745683
## Book201         0.872783018810120326
## Book202        -0.091241162158767861
## Book203         0.421733760549803938
## Book204        -0.420609575774829492
## Book205         0.187012861649423046
## Book206        -0.256959177816807049
## Book207        -0.148527545101016151
## Book208        -0.054075476834590651
## Book209        -0.391961240976093306
## Book21          0.209540636589901408
## Book210         0.762551221430135873
## Book211         0.446833199296272909
## Book212        -0.168895122444462253
## Book213        -0.337637414738346520
## Book214        -0.475848914327509365
## Book215        -0.090623962845330169
## Book216        -0.765233099088027835
## Book217         0.321850338325126106
## Book218        -0.206966033428348239
## Book219        -1.049833989169403736
## Book22         -0.705776231893523454
## Book220        -0.390150789656675989
## Book221         0.314073626975810316
## Book222        -0.656945479545372413
## Book223        -0.696127349293446440
## Book224        -0.294330596245463538
## Book225        -0.143353357523362923
## Book226         0.053286343737907985
## Book227        -0.168555662822071545
## Book228         0.005391677015137698
## Book229        -0.702762241912902375
## Book23         -0.496093051808267849
## Book230        -0.777124472526928955
## Book231        -0.111279566535047142
## Book232        -0.230172727613608186
## Book233         0.023167017242145205
## Book234        -0.429435525956989472
## Book235        -0.231777445828546369
## Book236        -0.190106205516273413
## Book237         0.126105576068339997
## Book238        -0.060494349694343377
## Book239        -0.051380646165033503
## Book24         -0.379246935119275541
## Book240         0.909465231338771440
## Book241         0.779719648998929649
## Book242         0.545327923065715758
## Book243        -0.308896500042594557
## Book244        -0.490425104779864340
## Book245        -1.157720429158324515
## Book246        -0.535768681007092074
## Book247        -0.450049983025810840
## Book248        -0.603640032174797780
## Book249        -0.114530149585819419
## Book25         -0.937904893677465878
## Book250        -0.704397820093512483
## Book251        -0.049374475397239624
## Book252         0.669086672065211108
## Book253        -0.053499424142048765
## Book254         0.132874195205707452
## Book255        -0.316518911563551164
## Book256         1.837928445198420579
## Book257        -0.654342955773710044
## Book258        -0.443322510509339351
## Book259         0.315133152463878463
## Book26         -0.195342113025270436
## Book260        -0.170283820899697319
## Book261        -0.326208940784523838
## Book262         0.630626934607492529
## Book263         0.502370850850447526
## Book264        -0.053180537830105921
## Book265         0.461676842784451036
## Book266        -0.333605045890553009
## Book267         0.073252370940800962
## Book268         0.602326279661693054
## Book269        -0.630261895894413282
## Book27          1.096137163688022387
## Book270        -0.432439229282386706
## Book271        -0.144474602942774810
## Book272        -0.080604760657190494
## Book273         0.043894627518430013
## Book274         0.188638153174809114
## Book275        -0.595719307652346486
## Book276        -0.048911575912161456
## Book277        -0.620026673946570406
## Book278        -0.838597524145329731
## Book279         0.661968306650228766
## Book28         -0.177895945765429636
## Book280        -0.652830817455787527
## Book281         0.009897232003233312
## Book282        -0.058642751754030158
## Book283         0.381389498761422252
## Book284         1.088720485271545302
## Book285        -0.254109774319769333
## Book286        -0.771837131741811788
## Book287         0.428204066685676454
## Book288        -0.000482003117745031
## Book289        -1.170815341258429010
## Book29          0.485006976832398573
## Book290         0.717032772064101209
## Book291        -0.152971380157768067
## Book292        -0.229915561233008992
## Book293        -0.737129957016161574
## Book294        -0.348489835999627129
## Book295        -0.144814062565165685
## Book296         0.660137282020363370
## Book297         1.227981223693552337
## Book298        -0.420877028810652698
## Book299         0.188926179521080123
## Book3           1.502676064794252087
## Book30         -0.497101144020216212
## Book300        -0.186547022808782270
## Book31          0.331375781062515529
## Book32         -0.563069463971489048
## Book33         -1.127477662799874381
## Book34          0.105717425414445815
## Book35         -0.181959174578894961
## Book36         -0.358725057947470005
## Book37         -0.374309340611773456
## Book38         -0.064351845403329430
## Book39          1.478605291570179503
## Book4           0.209921242833187999
## Book40          0.744395274959841813
## Book41          0.172138358195572994
## Book42          0.158364526850686943
## Book43         -0.187904861298345383
## Book44         -0.162023636754855177
## Book45          0.182363293488191913
## Book46          0.009989811900249087
## Book47         -0.232703244798702913
## Book48          0.918990674076160863
## Book49         -0.133827914785973445
## Book5           1.221942957077086112
## Book50          0.060919041914088305
## Book51          0.182291286901624189
## Book52         -0.440689126772004780
## Book53         -0.995880482519719612
## Book54          0.119552976690675716
## Book55         -0.130237872112810515
## Book56         -0.135494352932255480
## Book57         -0.133179855506863870
## Book58          0.246140555876760703
## Book59         -0.395294117268657264
## Book6           1.268603225172981075
## Book60          0.030799715418325518
## Book61          0.248033300437969811
## Book62          0.250327224552913452
## Book63         -1.000540337336174534
## Book64          0.016408684760001749
## Book65          0.333391965486412201
## Book66         -0.747797218483410964
## Book67          0.173917949549318551
## Book68          0.299332850039871756
## Book69         -0.432305502764475269
## Book7           1.096075443756678869
## Book70         -0.029696103953799079
## Book71         -0.391148595213400396
## Book72          0.650807285732229235
## Book73         -0.637946027346713573
## Book74         -0.353190837436977934
## Book75         -0.063086586810782011
## Book76          0.867382524817540079
## Book77          0.911450555796996187
## Book78          0.154219004795429965
## Book79          0.679116160908574629
## Book8           0.786858587724359904
## Book80         -0.140339367542741955
## Book81          0.211669974221261631
## Book82         -0.461612183497544848
## Book83         -0.491268610508229397
## Book84         -0.631835754143679429
## Book85          1.090366350107379256
## Book86         -0.041392030943444645
## Book87         -0.014194114531287286
## Book88          0.319268387863911485
## Book89          0.319587274175854363
## Book9           0.549977491226946835
## Book90         -0.006540843044659026
## Book91         -0.524679666675660128
## Book92          1.521315484060072665
## Book93          0.175090628244850305
## Book94         -0.982692990522599397
## Book95         -0.416001154234494297
## Book96         -0.161046404508578822
## Book97          0.786529414757192957
## Book98         -0.255436752843660464
## Book99         -0.184818864731156551
## Dogo           -1.916247803659451021
## Ducksters      -0.215161608057834186
## EIM            -1.765756592381979351
## Encyclopedia    1.707249833406061290
## Factmonster     0.952040853348859906
## GreenLine      -0.727711917576328693
## History         0.292077550984963352
## HT              1.739707903731532168
## JTT             1.316860861544931538
## NGL            -0.017553948579113889
## POC             1.206735107461293532
## Quatr          -3.064597873168775077
## Revision        3.588216470124832469
## Science         0.359863302474250302
## Science_Tech    1.713372533358479055
## Solutions      -0.394980480175962823
## Spoken.BNC2014 -0.000000000005700134
## Teen           -0.283416517460975848
## TeenVogue      -0.659273488848748701
## TweenTribute    0.075701187157177219
## WhyFiles       -1.322429145969230113
## World          -0.973165884592979258
## Plot predicted vs. observed values
dimensions_ref[, "predicted"] <- predict(md_final3)

dimensions_ref %>%
  ggplot(aes(x = Corpus, y = Dim3)) +
  geom_point(shape = "circle filled", fill = "grey", position = position_jitter(width = 0.2, height = 0)) +
  geom_point(aes(y = predicted), shape = "circle filled", fill = "red", position = position_jitter(width = 0.2, height = 0)) +
  facet_wrap(vars(Register))

## Compare means

comparisons <- emmeans(md_final3, "Corpus", by = "Register")
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 5033' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 5033)' or larger];
## but be warned that this may result in large computation time and memory use.
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'lmerTest.limit = 5033' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 5033)' or larger];
## but be warned that this may result in large computation time and memory use.
pairs(comparisons)
## Register = Conversation:
##  contrast             estimate    SE  df z.ratio p.value
##  Textbook - Reference    0.777 1.056 Inf  0.736  0.4618 
## 
## Register = Fiction:
##  contrast             estimate    SE  df z.ratio p.value
##  Textbook - Reference    0.517 0.376 Inf  1.377  0.1684 
## 
## Register = Informative:
##  contrast             estimate    SE  df z.ratio p.value
##  Textbook - Reference   -0.832 0.444 Inf -1.876  0.0606 
## 
## Degrees-of-freedom method: asymptotic
# This is a warning that the degrees of freedom have been calculated according to the naive 'asymptotic' method (i.e. are assumed to be infinite), because we have a very large number of observations and so a more complex estimation method like Kenward-Roger might take a lot of computation.

visreg(md_final3, xvar = "Corpus", by="Register", type = "conditional", line=list(col="darkred"), ylab = "Dimension 2 (Biber 1988)")

emmeans(md_final3, ~ Corpus*Register)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 5033' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 5033)' or larger];
## but be warned that this may result in large computation time and memory use.
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'lmerTest.limit = 5033' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 5033)' or larger];
## but be warned that this may result in large computation time and memory use.
##  Corpus    Register     emmean     SE  df asymp.LCL asymp.UCL
##  Textbook  Conversation -0.403 0.3493 Inf     -1.09     0.281
##  Reference Conversation -1.180 0.9963 Inf     -3.13     0.772
##  Textbook  Fiction      -0.467 0.3647 Inf     -1.18     0.248
##  Reference Fiction      -0.984 0.0898 Inf     -1.16    -0.808
##  Textbook  Informative   3.341 0.3558 Inf      2.64     4.038
##  Reference Informative   4.173 0.2650 Inf      3.65     4.692
## 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95

Dimension 4 (not discussed in PhD thesis)

# Means and SD

Dimensions %>% select(Register, Dim3) %>% group_by(Register) %>% summarise_if(is.numeric, c(mean = mean, sd = sd))
## # A tibble: 9 × 3
##   Register         mean    sd
##   <fct>           <dbl> <dbl>
## 1 Conversation   -0.445  2.37
## 2 Fiction        -0.649  2.74
## 3 Informative     3.12   3.07
## 4 Instructional   3.52   2.82
## 5 Personal       -0.829  2.96
## 6 Poetry          0.919  3.77
## 7 Info Teens      4.18   3.82
## 8 Spoken BNC2014 -1.18   1.29
## 9 Youth Fiction  -0.985  1.62
# Rainplots for all textbook registers and the three ref. corpora on Dimension 3 

colours <- suf_palette(name = "london", n = 6, type = "continuous") # Very nice, similar to OrRd palette
colours2 <- suf_palette(name = "classic", n = 5, type = "continuous") # Just green and purple
colours <- c(colours, colours2[c(2:4)]) # Nine colours range
#scales::show_col(colours)

p4 <- ggplot(Dimensions,aes(x=Register,y=Dim4, fill = Register, colour = Register))+ #Or leave out "colour = Register" to keep the dots in black
  geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust = 2, trim = FALSE)+
  geom_point(position = position_jitter(width = .15), size = .25)+
#note that here we need to set the x-variable to a numeric variable and bump it to get the boxplots to line up with the rainclouds. 
  geom_boxplot(aes(x = as.numeric(Register)+0.25, y = Dim4), outlier.shape = NA, alpha = 0.3, width = .15, colour = "BLACK") +
  ylab('Dimension 4 (Biber 1988)')+ 
  theme_cowplot()+ 
  guides(fill = "none", colour = "none") +
  scale_colour_manual(values = colours)+
  scale_fill_manual(values = colours)+
  annotate(geom = "text", x = 8.3, y = -15, label = "Reference Corpora", size = 5) +
  annotate(geom = "segment", x = 7, xend = 9.5, y = -13, yend = -13) +
  annotate(geom = "text", x = 3.8, y = -15, label = "Textbook Corpus", size = 5) +
  annotate(geom = "segment", x = 1, xend = 6.5, y = -13, yend = -13) 
  
p4 + scale_y_continuous(sec.axis = dup_axis(name=NULL), breaks = seq(from = -10, to = 25, by = 5))

#ggsave(here("plots", "Dim4.svg"), width = 13, height = 8)
# Check  distribution of the outcome variable. 
ggplot(dimensions_ref, aes(x = Dim4)) +
  geom_histogram(bins = 20) +
  facet_grid(rows = vars(Register), cols = vars(Corpus), scales = "free_y")

md0 <- lmer(Dim4 ~ 1 + (1|Source), dimensions_ref, REML = FALSE) # Random effect had to be simplified otherwise the model did not converge
md_corpus <- update(md0, .~. + Corpus)
md_register <- update(md0, . ~ . + Register)
md_both <- update(md_corpus, .~. + Register)
md_interaction <- update(md_both, . ~ . + Corpus:Register) 

anova(md0, md_corpus, md_both, md_interaction)
## Data: dimensions_ref
## Models:
## md0: Dim4 ~ 1 + (1 | Source)
## md_corpus: Dim4 ~ (1 | Source) + Corpus
## md_both: Dim4 ~ (1 | Source) + Corpus + Register
## md_interaction: Dim4 ~ (1 | Source) + Corpus + Register + Corpus:Register
##                npar   AIC   BIC logLik deviance  Chisq Df    Pr(>Chisq)    
## md0               3 24864 24884 -12429    24858                            
## md_corpus         4 24854 24880 -12423    24846 11.825  1     0.0005843 ***
## md_both           6 24826 24865 -12407    24814 32.533  2 0.00000008621 ***
## md_interaction    8 24806 24858 -12395    24790 24.134  2 0.00000574729 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(md0, md_register)
## Data: dimensions_ref
## Models:
## md0: Dim4 ~ 1 + (1 | Source)
## md_register: Dim4 ~ (1 | Source) + Register
##             npar   AIC   BIC logLik deviance  Chisq Df    Pr(>Chisq)    
## md0            3 24864 24884 -12429    24858                            
## md_register    5 24832 24865 -12411    24822 35.998  2 0.00000001525 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
md_final4 <- lmer(Dim4 ~ 1 + Corpus + Register + Corpus:Register + (1|Source), dimensions_ref)

tab_model(md_final4)
  Dim 4
Predictors Estimates CI p
(Intercept) -0.99 -1.44 – -0.55 <0.001
Corpus1 -0.54 -0.98 – -0.09 0.019
Register1 0.56 -0.07 – 1.18 0.080
Register2 0.34 -0.01 – 0.69 0.055
Corpus1 * Register1 -0.35 -0.97 – 0.28 0.275
Corpus1 * Register2 -0.27 -0.61 – 0.08 0.133
Random Effects
σ2 7.80
τ00 Source 0.86
ICC 0.10
N Source 325
Observations 5033
Marginal R2 / Conditional R2 0.113 / 0.201
# Diagnostic plots (in new window)
residplot(md_final4) # Oh dear, oh dear...

## Plot predicted vs. observed values
dimensions_ref[, "predicted"] <- predict(md_final4)

dimensions_ref %>%
  ggplot(aes(x = Corpus, y = Dim4)) +
  geom_point(shape = "circle filled", fill = "grey", position = position_jitter(width = 0.2, height = 0)) +
  geom_point(aes(y = predicted), shape = "circle filled", fill = "red", position = position_jitter(width = 0.2, height = 0)) +
  facet_wrap(vars(Register))

## Compare means

comparisons <- emmeans(md_final4, "Corpus", by = "Register")
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 5033' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 5033)' or larger];
## but be warned that this may result in large computation time and memory use.
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'lmerTest.limit = 5033' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 5033)' or larger];
## but be warned that this may result in large computation time and memory use.
pairs(comparisons)
## Register = Conversation:
##  contrast             estimate    SE  df z.ratio p.value
##  Textbook - Reference   -1.765 0.987 Inf -1.787  0.0739 
## 
## Register = Fiction:
##  contrast             estimate    SE  df z.ratio p.value
##  Textbook - Reference   -1.602 0.369 Inf -4.337  <.0001 
## 
## Register = Informative:
##  contrast             estimate    SE  df z.ratio p.value
##  Textbook - Reference    0.156 0.426 Inf  0.365  0.7149 
## 
## Degrees-of-freedom method: asymptotic
# This is a warning that the degrees of freedom have been calculated according to the naive 'asymptotic' method (i.e. are assumed to be infinite), because we have a very large number of observations and so a more complex estimation method like Kenward-Roger might take a lot of computation.

visreg(md_final4, xvar = "Corpus", by="Register", type = "conditional", line=list(col="darkred"), ylab = "Dimension 4 (Biber 1988)")

emmeans(md_final4, ~ Corpus*Register)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 5033' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 5033)' or larger];
## but be warned that this may result in large computation time and memory use.
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'lmerTest.limit = 5033' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 5033)' or larger];
## but be warned that this may result in large computation time and memory use.
##  Corpus    Register     emmean     SE  df asymp.LCL asymp.UCL
##  Textbook  Conversation -1.317 0.3347 Inf   -1.9730    -0.661
##  Reference Conversation  0.448 0.9288 Inf   -1.3727     2.268
##  Textbook  Fiction      -1.453 0.3564 Inf   -2.1519    -0.755
##  Reference Fiction       0.149 0.0971 Inf   -0.0416     0.339
##  Textbook  Informative  -1.811 0.3440 Inf   -2.4848    -1.137
##  Reference Informative  -1.966 0.2511 Inf   -2.4585    -1.474
## 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95
dimensions_refUpper <- dimensions_ref %>% filter(!(Level %in% c("A", "B"))) %>% droplevels()
summary(dimensions_refUpper$Level) # Check that the subsetting has worked
##              C              D              E     Info Teens Spoken BNC2014 
##            262            285            233           1414           1251 
##  Youth Fiction 
##           1191
md_final4Upper <- lmer(Dim4 ~ 1 + Corpus + Register + Corpus:Register + (1|Source), dimensions_refUpper)

tab_model(md_final4Upper, wrap.labels = 100)
  Dim 4
Predictors Estimates CI p
(Intercept) -0.49 -0.97 – -0.01 0.043
Corpus1 -0.04 -0.52 – 0.44 0.873
Register1 0.85 0.18 – 1.52 0.013
Register2 0.28 -0.09 – 0.65 0.142
Corpus1 * Register1 -0.05 -0.72 – 0.62 0.879
Corpus1 * Register2 -0.32 -0.70 – 0.05 0.088
Random Effects
σ2 6.59
τ00 Source 0.99
ICC 0.13
N Source 325
Observations 4636
Marginal R2 / Conditional R2 0.125 / 0.239
residplot(md_final4Upper) # Oh dear, oh dear...

comparisons <- emmeans(md_final4Upper, "Corpus", by = "Register")
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 4636' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 4636)' or larger];
## but be warned that this may result in large computation time and memory use.
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'lmerTest.limit = 4636' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 4636)' or larger];
## but be warned that this may result in large computation time and memory use.
pairs(comparisons)
## Register = Conversation:
##  contrast             estimate    SE  df z.ratio p.value
##  Textbook - Reference   -0.183 1.063 Inf -0.172  0.8637 
## 
## Register = Fiction:
##  contrast             estimate    SE  df z.ratio p.value
##  Textbook - Reference   -0.728 0.397 Inf -1.835  0.0665 
## 
## Register = Informative:
##  contrast             estimate    SE  df z.ratio p.value
##  Textbook - Reference    0.675 0.456 Inf  1.482  0.1385 
## 
## Degrees-of-freedom method: asymptotic
visreg(md_final4Upper, xvar = "Corpus", by="Register", type = "conditional", line=list(col="darkred"), ylab = "Dimension 4 (Biber 1988)")

emmeans(md_final4Upper, ~ Corpus*Register)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 4636' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 4636)' or larger];
## but be warned that this may result in large computation time and memory use.
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'lmerTest.limit = 4636' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 4636)' or larger];
## but be warned that this may result in large computation time and memory use.
##  Corpus    Register     emmean     SE  df asymp.LCL asymp.UCL
##  Textbook  Conversation  0.265 0.3657 Inf   -0.4516     0.982
##  Reference Conversation  0.448 0.9980 Inf   -1.5084     2.404
##  Textbook  Fiction      -0.579 0.3854 Inf   -1.3345     0.176
##  Reference Fiction       0.149 0.0941 Inf   -0.0358     0.333
##  Textbook  Informative  -1.288 0.3693 Inf   -2.0117    -0.564
##  Reference Informative  -1.963 0.2667 Inf   -2.4855    -1.440
## 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95

Dimension 5 (not discussed in PhD thesis)

# Mixed effect model

dimensions_refUpper <- dimensions_ref %>% filter(!(Level %in% c("A", "B"))) %>% droplevels()

# Check  distribution of the outcome variable. 

ggplot(dimensions_refUpper, aes(x = Dim5)) +
  geom_histogram(bins = 20) +
  facet_grid(rows = vars(Register), cols = vars(Corpus), scales = "free_y")

md0 <- lmer(Dim5 ~ 1 + (1|Source), dimensions_refUpper, REML = FALSE) # Random effect had to be simplified otherwise the model did not converge
md_corpus <- update(md0, .~. + Corpus)
md_register <- update(md0, . ~ . + Register)
md_both <- update(md_corpus, .~. + Register)
md_interaction <- update(md_both, . ~ . + Corpus:Register) 

anova(md0, md_corpus, md_both, md_interaction)
## Data: dimensions_refUpper
## Models:
## md0: Dim5 ~ 1 + (1 | Source)
## md_corpus: Dim5 ~ (1 | Source) + Corpus
## md_both: Dim5 ~ (1 | Source) + Corpus + Register
## md_interaction: Dim5 ~ (1 | Source) + Corpus + Register + Corpus:Register
##                npar   AIC   BIC  logLik deviance    Chisq Df
## md0               3 18469 18489 -9231.7    18463            
## md_corpus         4 18471 18497 -9231.7    18463   0.0564  1
## md_both           6 18160 18199 -9074.2    18148 315.0133  2
## md_interaction    8 18149 18201 -9066.7    18133  15.0138  2
##                           Pr(>Chisq)    
## md0                                     
## md_corpus                  0.8122418    
## md_both        < 0.00000000000000022 ***
## md_interaction             0.0005493 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(md0, md_register, md_both)
## Data: dimensions_refUpper
## Models:
## md0: Dim5 ~ 1 + (1 | Source)
## md_register: Dim5 ~ (1 | Source) + Register
## md_both: Dim5 ~ (1 | Source) + Corpus + Register
##             npar   AIC   BIC  logLik deviance    Chisq Df          Pr(>Chisq)
## md0            3 18469 18489 -9231.7    18463                                
## md_register    5 18160 18192 -9075.1    18150 313.2896  2 <0.0000000000000002
## md_both        6 18160 18199 -9074.2    18148   1.7802  1              0.1821
##                
## md0            
## md_register ***
## md_both        
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
md_final5 <- lmer(Dim5 ~ 1 + Corpus + Register + Corpus:Register + (1|Source), dimensions_refUpper, REML = FALSE)

tab_model(md_final5)
  Dim 5
Predictors Estimates CI p
(Intercept) -0.74 -1.06 – -0.42 <0.001
Corpus1 -0.16 -0.49 – 0.16 0.327
Register1 -1.08 -1.53 – -0.63 <0.001
Register2 -0.47 -0.72 – -0.22 <0.001
Corpus1 * Register1 0.22 -0.23 – 0.68 0.331
Corpus1 * Register2 0.13 -0.12 – 0.38 0.313
Random Effects
σ2 2.79
τ00 Source 0.45
ICC 0.14
N Source 325
Observations 4636
Marginal R2 / Conditional R2 0.359 / 0.448
# Diagnostic plots (in new window)
residplot(md_final5) # ??

## Plot predicted vs. observed values
dimensions_refUpper[, "predicted"] <- predict(md_final5)

dimensions_refUpper %>%
  ggplot(aes(x = Corpus, y = Dim5)) +
  geom_point(shape = "circle filled", fill = "grey", position = position_jitter(width = 0.2, height = 0)) +
  geom_point(aes(y = predicted), shape = "circle filled", fill = "red", position = position_jitter(width = 0.2, height = 0)) +
  facet_wrap(vars(Register))

## Compare means

comparisons <- emmeans(md_final5, "Corpus", by = "Register")
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 4636' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 4636)' or larger];
## but be warned that this may result in large computation time and memory use.
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'lmerTest.limit = 4636' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 4636)' or larger];
## but be warned that this may result in large computation time and memory use.
pairs(comparisons)
## Register = Conversation:
##  contrast             estimate    SE  df z.ratio p.value
##  Textbook - Reference   0.1252 0.718 Inf  0.174  0.8616 
## 
## Register = Fiction:
##  contrast             estimate    SE  df z.ratio p.value
##  Textbook - Reference  -0.0665 0.265 Inf -0.251  0.8022 
## 
## Register = Informative:
##  contrast             estimate    SE  df z.ratio p.value
##  Textbook - Reference  -1.0312 0.306 Inf -3.366  0.0008 
## 
## Degrees-of-freedom method: asymptotic
emmeans(md_final5, ~ Corpus*Register)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 4636' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 4636)' or larger];
## but be warned that this may result in large computation time and memory use.
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'lmerTest.limit = 4636' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 4636)' or larger];
## but be warned that this may result in large computation time and memory use.
##  Corpus    Register     emmean     SE  df asymp.LCL asymp.UCL
##  Textbook  Conversation -1.760 0.2457 Inf    -2.241    -1.278
##  Reference Conversation -1.885 0.6747 Inf    -3.207    -0.562
##  Textbook  Fiction      -1.243 0.2581 Inf    -1.748    -0.737
##  Reference Fiction      -1.176 0.0621 Inf    -1.298    -1.054
##  Textbook  Informative   0.294 0.2479 Inf    -0.192     0.780
##  Reference Informative   1.325 0.1799 Inf     0.972     1.677
## 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95
visreg(md_final5, xvar = "Corpus", by="Register", type = "conditional", line=list(col="darkred"), ylab = "Dimension 5 (Biber 1988)")

v <- visreg::visreg(md_final5, xvar = "Corpus", by="Source", type = "conditional", line=list(col="darkred"), ylab = "Dimension 5 (Biber 1988)")

v1 <- subset(v, Source %in% c("HT", "JTT", "NGL", "Access", "POC", "GreenLine", "Solutions", "EiM"))
plot(v1)

Package used in this script

#packages.bib <- sapply(1:length(loadedNamespaces()), function(i) toBibtex(citation(loadedNamespaces()[i])))

knitr::write_bib(c(.packages(), "knitr"), "packages.bib")
## Warning in utils::citation(..., lib.loc = lib.loc): no date field in DESCRIPTION
## file of package 'suffrager'
sessionInfo()
## R version 4.0.3 (2020-10-10)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Big Sur 10.16
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
## 
## attached base packages:
## [1] parallel  stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] merTools_0.5.2     arm_1.11-2         MASS_7.3-53.1      predictmeans_1.0.4
##  [5] nlme_3.1-152       visreg_2.7.0       forcats_0.5.1      stringr_1.4.0     
##  [9] dplyr_1.0.7        purrr_0.3.4        readr_2.0.2        tidyr_1.1.4       
## [13] tibble_3.1.6       tidyverse_1.3.0    suffrager_0.1.0    sjPlot_2.8.9      
## [17] scales_1.1.1       lme4_1.1-27.1      Matrix_1.3-2       here_1.0.1        
## [21] gridExtra_2.3      GGally_2.1.1       ggplot2_3.3.5      emmeans_1.5.4     
## [25] cowplot_1.1.1      car_3.0-10         carData_3.0-4      broom.mixed_0.2.6 
## 
## loaded via a namespace (and not attached):
##   [1] readxl_1.3.1        backports_1.4.1     Hmisc_4.5-0        
##   [4] blme_1.0-5          plyr_1.8.6          TMB_1.7.19         
##   [7] splines_4.0.3       TH.data_1.0-10      digest_0.6.29      
##  [10] foreach_1.5.1       htmltools_0.5.2     fansi_0.5.0        
##  [13] magrittr_2.0.1      checkmate_2.0.0     cluster_2.1.1      
##  [16] tzdb_0.1.2          openxlsx_4.2.3      modelr_0.1.8       
##  [19] sandwich_3.0-0      jpeg_0.1-8.1        colorspace_2.0-2   
##  [22] rvest_1.0.0         haven_2.3.1         xfun_0.29          
##  [25] crayon_1.4.2        jsonlite_1.7.2      survival_3.2-7     
##  [28] zoo_1.8-9           iterators_1.0.13    glue_1.6.0         
##  [31] gtable_0.3.0        sjstats_0.18.1      sjmisc_2.8.6       
##  [34] abind_1.4-5         mvtnorm_1.1-1       DBI_1.1.1          
##  [37] ggeffects_1.0.1     Rcpp_1.0.7          xtable_1.8-4       
##  [40] performance_0.7.2   htmlTable_2.1.0     foreign_0.8-81     
##  [43] Formula_1.2-4       datawizard_0.2.1    htmlwidgets_1.5.4  
##  [46] httr_1.4.2          RColorBrewer_1.1-2  ellipsis_0.3.2     
##  [49] pkgconfig_2.0.3     reshape_0.8.8       farver_2.1.0       
##  [52] nnet_7.3-15         sass_0.4.0          dbplyr_2.1.0       
##  [55] utf8_1.2.2          later_1.3.0         tidyselect_1.1.1   
##  [58] labeling_0.4.2      rlang_0.4.12        reshape2_1.4.4     
##  [61] effectsize_0.4.4-2  munsell_0.5.0       cellranger_1.1.0   
##  [64] tools_4.0.3         cli_3.1.0           generics_0.1.1     
##  [67] sjlabelled_1.1.7    broom_0.7.9         evaluate_0.14      
##  [70] fastmap_1.1.0       yaml_2.2.1          knitr_1.37         
##  [73] fs_1.5.2            zip_2.1.1           mime_0.12          
##  [76] xml2_1.3.3          compiler_4.0.3      pbkrtest_0.5.1     
##  [79] rstudioapi_0.13     curl_4.3.2          png_0.1-7          
##  [82] reprex_1.0.0        bslib_0.3.1         stringi_1.7.6      
##  [85] highr_0.9           parameters_0.13.0.1 lattice_0.20-41    
##  [88] nloptr_1.2.2.3      vctrs_0.3.8         pillar_1.6.4       
##  [91] lifecycle_1.0.1     jquerylib_0.1.4     estimability_1.3   
##  [94] data.table_1.14.2   insight_0.14.5      httpuv_1.6.4       
##  [97] R6_2.5.1            latticeExtra_0.6-29 promises_1.2.0.1   
## [100] rio_0.5.26          codetools_0.2-18    boot_1.3-27        
## [103] assertthat_0.2.1    rprojroot_2.0.2     withr_2.4.3        
## [106] multcomp_1.4-16     mgcv_1.8-34         bayestestR_0.9.0   
## [109] hms_1.0.0           grid_4.0.3          rpart_4.1-15       
## [112] coda_0.19-4         minqa_1.2.4         rmarkdown_2.11     
## [115] snakecase_0.11.0    numDeriv_2016.8-1.1 shiny_1.7.1        
## [118] lubridate_1.7.10    base64enc_0.1-3
Alburez-Gutierrez, Diego. 2020. Suffrager: A Feminist Colour Palette for r.
Auguie, Baptiste. 2017. gridExtra: Miscellaneous Functions for "Grid" Graphics. https://CRAN.R-project.org/package=gridExtra.
Bates, Douglas, Martin Mächler, Ben Bolker, and Steve Walker. 2015. “Fitting Linear Mixed-Effects Models Using lme4.” Journal of Statistical Software 67 (1): 1–48. https://doi.org/10.18637/jss.v067.i01.
Bates, Douglas, and Martin Maechler. 2021. Matrix: Sparse and Dense Matrix Classes and Methods. http://Matrix.R-forge.R-project.org/.
Bates, Douglas, Martin Maechler, Ben Bolker, and Steven Walker. 2021. Lme4: Linear Mixed-Effects Models Using Eigen and S4. https://github.com/lme4/lme4/.
Bolker, Ben, and David Robinson. 2020. Broom.mixed: Tidying Methods for Mixed Models. http://github.com/bbolker/broom.mixed.
Breheny, Patrick, and Woodrow Burchett. 2017. “Visualization of Regression Models Using Visreg.” The R Journal 9 (2): 56–71.
———. 2020. Visreg: Visualization of Regression Models. http://pbreheny.github.io/visreg.
Fox, John, and Sanford Weisberg. 2019. An R Companion to Applied Regression. Third. Thousand Oaks CA: Sage. https://socialsciences.mcmaster.ca/jfox/Books/Companion/.
Fox, John, Sanford Weisberg, and Brad Price. 2020a. Car: Companion to Applied Regression. https://CRAN.R-project.org/package=car.
———. 2020b. carData: Companion to Applied Regression Data Sets. https://CRAN.R-project.org/package=carData.
Gelman, Andrew, and Yu-Sung Su. 2020. Arm: Data Analysis Using Regression and Multilevel/Hierarchical Models. https://CRAN.R-project.org/package=arm.
Henry, Lionel, and Hadley Wickham. 2020. Purrr: Functional Programming Tools. https://CRAN.R-project.org/package=purrr.
Knowles, Jared E., and Carl Frederick. 2020. merTools: Tools for Analyzing Mixed Effect Regression Models. https://CRAN.R-project.org/package=merTools.
Lenth, Russell V. 2021. Emmeans: Estimated Marginal Means, Aka Least-Squares Means. https://github.com/rvlenth/emmeans.
Lüdecke, Daniel. 2021. sjPlot: Data Visualization for Statistics in Social Science. https://strengejacke.github.io/sjPlot/.
Luo, Dongwen, Siva Ganesh, and John Koolaard. 2020. Predictmeans: Calculate Predicted Means for Linear Models. https://CRAN.R-project.org/package=predictmeans.
Müller, Kirill. 2020. Here: A Simpler Way to Find Your Files. https://CRAN.R-project.org/package=here.
Müller, Kirill, and Hadley Wickham. 2021. Tibble: Simple Data Frames. https://CRAN.R-project.org/package=tibble.
Pinheiro, José, Douglas Bates, and R-core. 2021. Nlme: Linear and Nonlinear Mixed Effects Models. https://svn.r-project.org/R-packages/trunk/nlme/.
R Core Team. 2020. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.
Ripley, Brian. 2021. MASS: Support Functions and Datasets for Venables and Ripley’s MASS. http://www.stats.ox.ac.uk/pub/MASS4/.
Schloerke, Barret, Di Cook, Joseph Larmarange, Francois Briatte, Moritz Marbach, Edwin Thoen, Amos Elberg, and Jason Crowley. 2021. GGally: Extension to Ggplot2. https://CRAN.R-project.org/package=GGally.
Venables, W. N., and B. D. Ripley. 2002. Modern Applied Statistics with s. Fourth. New York: Springer. https://www.stats.ox.ac.uk/pub/MASS4/.
Wickham, Hadley. 2016. Ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York. https://ggplot2.tidyverse.org.
———. 2019a. Stringr: Simple, Consistent Wrappers for Common String Operations. https://CRAN.R-project.org/package=stringr.
———. 2019b. Tidyverse: Easily Install and Load the Tidyverse. https://CRAN.R-project.org/package=tidyverse.
———. 2021a. Forcats: Tools for Working with Categorical Variables (Factors). https://CRAN.R-project.org/package=forcats.
———. 2021b. Tidyr: Tidy Messy Data. https://CRAN.R-project.org/package=tidyr.
Wickham, Hadley, Mara Averick, Jennifer Bryan, Winston Chang, Lucy D’Agostino McGowan, Romain François, Garrett Grolemund, et al. 2019. “Welcome to the tidyverse.” Journal of Open Source Software 4 (43): 1686. https://doi.org/10.21105/joss.01686.
Wickham, Hadley, Winston Chang, Lionel Henry, Thomas Lin Pedersen, Kohske Takahashi, Claus Wilke, Kara Woo, Hiroaki Yutani, and Dewey Dunnington. 2021. Ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics. https://CRAN.R-project.org/package=ggplot2.
Wickham, Hadley, Romain François, Lionel Henry, and Kirill Müller. 2021. Dplyr: A Grammar of Data Manipulation. https://CRAN.R-project.org/package=dplyr.
Wickham, Hadley, and Jim Hester. 2021. Readr: Read Rectangular Text Data. https://CRAN.R-project.org/package=readr.
Wickham, Hadley, and Dana Seidel. 2020. Scales: Scale Functions for Visualization. https://CRAN.R-project.org/package=scales.
Wilke, Claus O. 2020. Cowplot: Streamlined Plot Theme and Plot Annotations for Ggplot2. https://wilkelab.org/cowplot/.
Xie, Yihui. 2014. “Knitr: A Comprehensive Tool for Reproducible Research in R.” In Implementing Reproducible Computational Research, edited by Victoria Stodden, Friedrich Leisch, and Roger D. Peng. Chapman; Hall/CRC. http://www.crcpress.com/product/isbn/9781466561595.
———. 2015. Dynamic Documents with R and Knitr. 2nd ed. Boca Raton, Florida: Chapman; Hall/CRC. https://yihui.org/knitr/.
———. 2021. Knitr: A General-Purpose Package for Dynamic Report Generation in r. https://yihui.org/knitr/.