When learning linear regression, many people struggle with model diagnostics - especially interpreting residual plots. We often teach that visual diagnostics are better than test-based diagnostics ( and they are! ), but it can take a long time to develop a feel for what residual plots “should” look like. And that’s the problem. Residual plots are essential for checking assumptions like…
The tidyplots package is a relatively new addition to the R ecosystem, designed to streamline the creation of publication-ready plots for scientific papers. Built on top of ggplot2 and its extensions, it aims to provide a more consistent syntax and handy convenience functions for generating common plot types - especially those that typically require multiple steps in ggplot2. I’ve been meaning to…
I’ve been playing around with making diagrams using Mermaid lately, and wanted to see if it was possible to easily export path diagrams for factor analysis models to Mermaid code. I thought that this could be useful as Mermaid can be used with Quarto , which I use for writing reports to clients. A path diagram Here’s an example of a exploratory factor analysis model using the attitudes data (taken…
R has some great packages for creating nice-looking tables. Packages like gt and flextable allow the user to create a wide range of tables, with lots of flexibility in how these are presented and formatted. The downside to these Swiss army knife-style packages is that simple tasks, like creating a frequency table, require a lot of typing. Enter ivo.table , a package for creating great-looking…
A new version of the boot.pval package is now available on CRAN . It can be used to compute bootstrap p-values and confidence intervals for regression coefficients with a single line of code. It works for linear models, GLMs, Cox regression, mixed models, and more. News in version 0.6 Now works also when there’s missing data (previously, an error inherited from car::Boot would appear if the data…
Introduction TabPFN is a foundational model for tabular data, which can be used instead of models like XGBoost and random forest for predictive modelling using tabular data. It was recently introduced in a paper in Nature by Hollmann et al. The results in that paper indicate that it can yield better results than current state-of-the-art machine learning models in a wide range of settings. TabPFN…