s

Table joins with conditional "fuzzy" string matching in R

Post

Here’s an example of fuzzy-matching strings in R that I shared on StackOverflow. In stringdist_join, the max_dist argument is used to constrain the degree of fuzziness. library(fuzzyjoin) library(dplyr) #> #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #> #> filter, lag #> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union library(knitr) small_tab = data.frame(Food.Name = c('Corn', 'Squash', 'Peppers'), Food.Code = c(NA, NA, NA)) large_tab = data.

A new function to plot convergence diagnostics from lme4::allFit()

Post

When a model has struggled to find enough information in the data to account for every predictor---especially for every random effect---, convergence warnings appear (Brauer & Curtin, 2018; Singmann & Kellen, 2019). In this article, I review the issue of convergence before presenting a new plotting function in R that facilitates the visualisation of the fixed effects fitted by different optimization algorithms (also dubbed optimizers).

Assigning participant-specific parameters automatically in OpenSesame

Post

Python inline script for OpenSesame that automatically loads participant-specific parameters from a CSV file, enabling complex counterbalancing schemes beyond the standard interface options.

Pronominal object clitics in preverbal position are a hard nut to crack for Google Translate

Post

Analysis of how Google Translate handles pronominal object clitics in preverbal position in Romance languages, which serve to emphasize the agent and require marked translations to preserve this focus in English.

Specifying version number in OSF download links

Post

How to append version numbers to OSF download links using the '?version=X' parameter to document and preserve the exact versions of files used in research projects.

Covariates are necessary to validate the variables of interest and to prevent bogus theories

Post

Covariates serve two essential purposes: statistically accounting for satellite variables that may affect variables of interest, and academically preventing the development of redundant theories by enabling direct comparisons between related theoretical constructs.

Cannot open plots created with brms::mcmc_plot due to lack of discrete_range function

Post

I would like to ask for advice regarding some plots that were created using brms::mcmc_plot(), and cannot be opened in R now. The plots were created last year using brms 2.17.0, and were saved in RDS objects. The problem I have is that I cannot open the plots in R now because I get an error related to a missing function. I would be very grateful if someone could please advise me if they can think of a possible reason or solution.

A table of results for Bayesian mixed-effects models: Grouping variables and specifying random slopes

Post

Here I share the format applied to tables presenting the results of Bayesian models in Bernabeu (2022). The sample table presents a mixed-effects model that was fitted using the R package 'brms' (Bürkner et al., 2022).

A table of results for frequentist mixed-effects models: Grouping variables and specifying random slopes

Post

Here I share the format applied to tables presenting the results of frequentist models in Bernabeu (2022). The sample table presents a mixed-effects model that was fitted using the R package 'lmerTest' (Kuznetsova et al., 2022).

Plotting two-way interactions from mixed-effects models using alias variables

Post

Whereas the direction of main effects can be interpreted from the sign of the estimate, the interpretation of interaction effects often requires plots. This task is facilitated by the R package sjPlot (Lüdecke, 2022). In Bernabeu (2022), the sjPlot function called plot_model served as the basis for the creation of some custom functions. One of these functions is alias_interaction_plot, which allows the plotting of interactions between a continuous variable and a categorical variable.