Study 2.3: Lexical decision

Table 15 presents the results of the informative prior model, Table 16 those of the weakly-informative prior model, and Table 17 those of the diffuse prior model.

Code

# Rename effects in plain language and specify the random slopes
# (if any) for each effect, in the footnote. For this purpose, 
# superscripts are added to the names of the appropriate effects.
# 
# In the interactions below, word-level variables are presented 
# first for the sake of consistency (the order does not affect 
# the results in any way). Also in the interactions, double 
# colons are used to inform the 'bayesian_model_table' function 
# that the two terms in the interaction must be split into two 
# lines.

rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed) == 
    'z_vocabulary_age'] = 'Vocabulary age <sup>a</sup>'

rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed) == 
    'z_recoded_participant_gender'] = 'Gender <sup>a</sup>'

rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed) == 
    'z_orthographic_Levenshtein_distance'] = 'Orthographic Levenshtein distance <sup>b</sup>'

rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed) == 
    'z_word_concreteness'] = 'Word concreteness <sup>b</sup>'

rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed) == 
    'z_word_frequency'] = 'Word frequency <sup>b</sup>'

rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed) == 
    'z_visual_rating'] = 'Visual strength <sup>b</sup>'

rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed) == 
    'z_word_concreteness:z_vocabulary_age'] = 
  'Word concreteness : Vocabulary age'

rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed) == 
    'z_word_concreteness:z_recoded_participant_gender'] = 
  'Word concreteness : Gender'

rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed) == 
    'z_vocabulary_age:z_word_frequency'] = 
  'Word frequency : Vocabulary age'

rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed) == 
    'z_vocabulary_age:z_visual_rating'] = 
  'Visual strength : Vocabulary age'

rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed) == 
    'z_recoded_participant_gender:z_word_frequency'] = 
  'Word frequency : Gender'

rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_informativepriors_exgaussian$fixed) == 
    'z_recoded_participant_gender:z_visual_rating'] = 
  'Visual strength : Gender'


# Create table (using custom function from the 'R_functions' folder)
bayesian_model_table(
  lexicaldecision_summary_informativepriors_exgaussian, 
  order_effects = c('(Intercept)',
                    'Vocabulary age <sup>a</sup>',
                    'Gender <sup>a</sup>',
                    'Orthographic Levenshtein distance <sup>b</sup>',
                    'Word concreteness <sup>b</sup>',
                    'Word frequency <sup>b</sup>',
                    'Visual strength <sup>b</sup>',
                    'Word concreteness : Vocabulary age',
                    'Word concreteness : Gender',
                    'Word frequency : Vocabulary age',
                    'Visual strength : Vocabulary age',
                    'Word frequency : Gender',
                    'Visual strength : Gender'),
  interaction_symbol_x = TRUE,
  caption = 'Informative prior model for the lexical decision study.') %>%
  
  # Group predictors under headings
  pack_rows('Individual differences', 2, 3) %>% 
  pack_rows('Lexicosemantic covariates', 4, 5) %>% 
  pack_rows('Semantic variables', 6, 7) %>% 
  pack_rows('Interactions', 8, 13) %>%
  
  # Apply white background to override default shading in HTML output
  row_spec(1:13, background = 'white') %>%
  
  # Highlight covariates
  row_spec(c(4:5, 8:9), background = '#FFFFF1') %>%
  
  # Format
  kable_classic(full_width = FALSE, html_font = 'Cambria') %>%
  
  # Footnote describing abbreviations, random slopes, etc. 
  footnote(escape = FALSE, threeparttable = TRUE, 
           # The <p> below is used to enter a margin above the footnote 
           general_title = '<p style="margin-top: 10px;"></p>', 
           general = paste('*Note*. &beta; = Estimate based on $z$-scored predictors; *SE* = standard error;',
                           'CrI = credible interval. Yellow rows contain covariates. <br>', 
                           '<sup>a</sup> By-word random slopes were included for this effect.',
                           '<sup>b</sup> By-participant random slopes were included for this effect.'))
Table 15: Informative prior model for the lexical decision study.
β SE 95% CrI \(\widehat{R}\)
(Intercept) 0.00 0.01 [-0.01, 0.01] 1.00
Individual differences
Vocabulary age a 0.00 0.01 [-0.01, 0.02] 1.00
Gender a 0.00 0.01 [-0.01, 0.01] 1.00
Lexicosemantic covariates
Orthographic Levenshtein distance b 0.15 0.01 [0.13, 0.17] 1.00
Word concreteness b -0.03 0.01 [-0.05, -0.02] 1.00
Semantic variables
Word frequency b -0.14 0.01 [-0.16, -0.12] 1.00
Visual strength b -0.01 0.01 [-0.02, 0.01] 1.00
Interactions
Word concreteness × Vocabulary age 0.01 0.01 [-0.01, 0.03] 1.00
Word concreteness × Gender 0.01 0.01 [-0.01, 0.03] 1.00
Word frequency × Vocabulary age 0.00 0.01 [-0.02, 0.02] 1.00
Visual strength × Vocabulary age 0.00 0.01 [-0.02, 0.01] 1.00
Word frequency × Gender -0.01 0.01 [-0.03, 0.01] 1.00
Visual strength × Gender -0.01 0.01 [-0.02, 0.01] 1.00

Note. β = Estimate based on \(z\)-scored predictors; SE = standard error; CrI = credible interval. Yellow rows contain covariates.
a By-word random slopes were included for this effect. b By-participant random slopes were included for this effect.
Code

rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed) == 
    'z_vocabulary_age'] = 'Vocabulary age <sup>a</sup>'

rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed) == 
    'z_recoded_participant_gender'] = 'Gender <sup>a</sup>'

rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed) == 
    'z_orthographic_Levenshtein_distance'] = 'Orthographic Levenshtein distance <sup>b</sup>'

rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed) == 
    'z_word_concreteness'] = 'Word concreteness <sup>b</sup>'

rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed) == 
    'z_word_frequency'] = 'Word frequency <sup>b</sup>'

rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed) == 
    'z_visual_rating'] = 'Visual strength <sup>b</sup>'

rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed) == 
    'z_word_concreteness:z_vocabulary_age'] = 
  'Word concreteness : Vocabulary age'

rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed) == 
    'z_word_concreteness:z_recoded_participant_gender'] = 
  'Word concreteness : Gender'

rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed) == 
    'z_vocabulary_age:z_word_frequency'] = 
  'Word frequency : Vocabulary age'

rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed) == 
    'z_vocabulary_age:z_visual_rating'] = 
  'Visual strength : Vocabulary age'

rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed) == 
    'z_recoded_participant_gender:z_word_frequency'] = 
  'Word frequency : Gender'

rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_weaklyinformativepriors_exgaussian$fixed) == 
    'z_recoded_participant_gender:z_visual_rating'] = 
  'Visual strength : Gender'


# Create table (using custom function from the 'R_functions' folder)
bayesian_model_table(
  lexicaldecision_summary_weaklyinformativepriors_exgaussian, 
  order_effects = c('(Intercept)',
                    'Vocabulary age <sup>a</sup>',
                    'Gender <sup>a</sup>',
                    'Orthographic Levenshtein distance <sup>b</sup>',
                    'Word concreteness <sup>b</sup>',
                    'Word frequency <sup>b</sup>',
                    'Visual strength <sup>b</sup>',
                    'Word concreteness : Vocabulary age',
                    'Word concreteness : Gender',
                    'Word frequency : Vocabulary age',
                    'Visual strength : Vocabulary age',
                    'Word frequency : Gender',
                    'Visual strength : Gender'),
  interaction_symbol_x = TRUE,
  caption = 'Weakly-informative prior model for the lexical decision study.') %>%
  
  # Group predictors under headings
  pack_rows('Individual differences', 2, 3) %>% 
  pack_rows('Lexicosemantic covariates', 4, 5) %>% 
  pack_rows('Semantic variables', 6, 7) %>% 
  pack_rows('Interactions', 8, 13) %>% 
  
  # Apply white background to override default shading in HTML output
  row_spec(1:13, background = 'white') %>%
  
  # Highlight covariates
  row_spec(c(4:5, 8:9), background = '#FFFFF1') %>%
  
  # Format
  kable_classic(full_width = FALSE, html_font = 'Cambria') %>%
  
  # Footnote describing abbreviations, random slopes, etc. 
  footnote(escape = FALSE, threeparttable = TRUE, 
           # The <p> below is used to enter a margin above the footnote 
           general_title = '<p style="margin-top: 10px;"></p>', 
           general = paste('*Note*. &beta; = Estimate based on $z$-scored predictors; *SE* = standard error;',
                           'CrI = credible interval. Yellow rows contain covariates. <br>', 
                           '<sup>a</sup> By-word random slopes were included for this effect.',
                           '<sup>b</sup> By-participant random slopes were included for this effect.'))
Table 16: Weakly-informative prior model for the lexical decision study.
β SE 95% CrI \(\widehat{R}\)
(Intercept) 0.00 0.01 [-0.01, 0.01] 1.00
Individual differences
Vocabulary age a 0.00 0.01 [-0.01, 0.02] 1.00
Gender a 0.00 0.01 [-0.01, 0.01] 1.00
Lexicosemantic covariates
Orthographic Levenshtein distance b 0.15 0.01 [0.13, 0.17] 1.00
Word concreteness b -0.03 0.01 [-0.05, -0.02] 1.00
Semantic variables
Word frequency b -0.14 0.01 [-0.16, -0.12] 1.00
Visual strength b -0.01 0.01 [-0.02, 0.01] 1.00
Interactions
Word concreteness × Vocabulary age 0.01 0.01 [-0.01, 0.03] 1.00
Word concreteness × Gender 0.01 0.01 [-0.01, 0.03] 1.00
Word frequency × Vocabulary age 0.00 0.01 [-0.02, 0.02] 1.00
Visual strength × Vocabulary age 0.00 0.01 [-0.02, 0.01] 1.00
Word frequency × Gender -0.01 0.01 [-0.03, 0.01] 1.00
Visual strength × Gender -0.01 0.01 [-0.02, 0.01] 1.00

Note. β = Estimate based on \(z\)-scored predictors; SE = standard error; CrI = credible interval. Yellow rows contain covariates.
a By-word random slopes were included for this effect. b By-participant random slopes were included for this effect.
Code

rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed) == 
    'z_vocabulary_age'] = 'Vocabulary age <sup>a</sup>'

rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed) == 
    'z_recoded_participant_gender'] = 'Gender <sup>a</sup>'

rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed) == 
    'z_orthographic_Levenshtein_distance'] = 'Orthographic Levenshtein distance <sup>b</sup>'

rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed) == 
    'z_word_concreteness'] = 'Word concreteness <sup>b</sup>'

rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed) == 
    'z_word_frequency'] = 'Word frequency <sup>b</sup>'

rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed) == 
    'z_visual_rating'] = 'Visual strength <sup>b</sup>'

rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed) == 
    'z_word_concreteness:z_vocabulary_age'] = 
  'Word concreteness : Vocabulary age'

rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed) == 
    'z_word_concreteness:z_recoded_participant_gender'] = 
  'Word concreteness : Gender'

rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed) == 
    'z_vocabulary_age:z_word_frequency'] = 
  'Word frequency : Vocabulary age'

rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed) == 
    'z_vocabulary_age:z_visual_rating'] = 
  'Visual strength : Vocabulary age'

rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed) == 
    'z_recoded_participant_gender:z_word_frequency'] = 
  'Word frequency : Gender'

rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed)[
  rownames(lexicaldecision_summary_diffusepriors_exgaussian$fixed) == 
    'z_recoded_participant_gender:z_visual_rating'] = 
  'Visual strength : Gender'


# Create table (using custom function from the 'R_functions' folder)
bayesian_model_table(
  lexicaldecision_summary_diffusepriors_exgaussian, 
  order_effects = c('(Intercept)',
                    'Vocabulary age <sup>a</sup>',
                    'Gender <sup>a</sup>',
                    'Orthographic Levenshtein distance <sup>b</sup>',
                    'Word concreteness <sup>b</sup>',
                    'Word frequency <sup>b</sup>',
                    'Visual strength <sup>b</sup>',
                    'Word concreteness : Vocabulary age',
                    'Word concreteness : Gender',
                    'Word frequency : Vocabulary age',
                    'Visual strength : Vocabulary age',
                    'Word frequency : Gender',
                    'Visual strength : Gender'),
  interaction_symbol_x = TRUE,
  caption = 'Diffuse prior model for the lexical decision study.') %>%
  
  # Group predictors under headings
  pack_rows('Individual differences', 2, 3) %>% 
  pack_rows('Lexicosemantic covariates', 4, 5) %>% 
  pack_rows('Semantic variables', 6, 7) %>% 
  pack_rows('Interactions', 8, 13) %>% 
  
  # Apply white background to override default shading in HTML output
  row_spec(1:13, background = 'white') %>%
  
  # Highlight covariates
  row_spec(c(4:5, 8:9), background = '#FFFFF1') %>%
  
  # Format
  kable_classic(full_width = FALSE, html_font = 'Cambria') %>%
  
  # Footnote describing abbreviations, random slopes, etc. 
  footnote(escape = FALSE, threeparttable = TRUE, 
           # The <p> below is used to enter a margin above the footnote 
           general_title = '<p style="margin-top: 10px;"></p>', 
           general = paste('*Note*. &beta; = Estimate based on $z$-scored predictors; *SE* = standard error;',
                           'CrI = credible interval. Yellow rows contain covariates. <br>', 
                           '<sup>a</sup> By-word random slopes were included for this effect.',
                           '<sup>b</sup> By-participant random slopes were included for this effect.'))
Table 17: Diffuse prior model for the lexical decision study.
β SE 95% CrI \(\widehat{R}\)
(Intercept) 0.00 0.01 [-0.01, 0.01] 1.00
Individual differences
Vocabulary age a 0.00 0.01 [-0.01, 0.02] 1.00
Gender a 0.00 0.01 [-0.01, 0.01] 1.00
Lexicosemantic covariates
Orthographic Levenshtein distance b 0.15 0.01 [0.13, 0.17] 1.00
Word concreteness b -0.03 0.01 [-0.05, -0.02] 1.00
Semantic variables
Word frequency b -0.14 0.01 [-0.16, -0.12] 1.00
Visual strength b -0.01 0.01 [-0.02, 0.01] 1.00
Interactions
Word concreteness × Vocabulary age 0.01 0.01 [-0.01, 0.03] 1.00
Word concreteness × Gender 0.01 0.01 [-0.01, 0.03] 1.00
Word frequency × Vocabulary age 0.00 0.01 [-0.02, 0.02] 1.00
Visual strength × Vocabulary age 0.00 0.01 [-0.02, 0.01] 1.00
Word frequency × Gender -0.01 0.01 [-0.03, 0.01] 1.00
Visual strength × Gender -0.01 0.01 [-0.02, 0.01] 1.00

Note. β = Estimate based on \(z\)-scored predictors; SE = standard error; CrI = credible interval. Yellow rows contain covariates.
a By-word random slopes were included for this effect. b By-participant random slopes were included for this effect.

Figure 69 presents the posterior distribution of each effect in each model. The frequentist estimates are also shown to facilitate the comparison.

Code

# Run plot through source() rather than directly in this R Markdown document
# to preserve the format.

source('lexicaldecision/frequentist_bayesian_plots/lexicaldecision_frequentist_bayesian_plots.R',
       local = TRUE)

include_graphics(
  paste0(
    getwd(),  # Circumvent illegal characters in file path
    '/lexicaldecision/frequentist_bayesian_plots/plots/lexicaldecision_frequentist_bayesian_plot_allpriors_exgaussian.pdf'
  ))

Figure 69: Estimates from the frequentist analysis (in red) and from the Bayesian analysis (in blue) for the lexical decision study, in each model. The frequentist means (represented by points) are flanked by 95% confidence intervals. The Bayesian means (represented by vertical lines) are flanked by 95% credible intervals in light blue (in some cases, the interval is occluded by the bar of the mean).




Pablo Bernabeu, 2022. Licence: CC BY 4.0.
Thesis: https://doi.org/10.17635/lancaster/thesis/1795.

Online book created using the R package bookdown.