An R SAFAQ

Using simulation to check a function

simulation
CECPfuns package
p values
Reliability

Illustrates using simulation to check my function based on a 1969 paper.

Bug in facetted ggplot with coord.fixed()

graphics
R graphics
R markdown
R tricks

I think this is a bug, others disagree!

Percentage of possible score range

Psychometrics
Correlation
Transformations
Standardising

This explains why this transform can be misleading.

Convergent validity issues (1)

Psychometrics
Correlation
n=1

This expands the glossary entry about convergent validity

Dispersion

R tricks
Distributions
Gaussian distribution

Post that will link closely to glossary entries and shiny apps all about dispersion, scatter, variance

Anonymising ODT and DOCX documents

Geeky stuff

Anonymising Libre/OpenOffice ODT and M$oft Wurd DOCX documents

CSC by gender and age

RCSC paradigm
CECPfuns package

CSC matching lookup with lookupCSCgenderAndAge()

Hedges's g

Effect sizes

A bit about Hedges's g!

Correlation coefficients (2)

Correlation
Null hypothesis tests (NHSTs)

Significance testing and confidence intervals for correlation coefficients ... and back to why!

Correlation coefficients (1)

Correlation
Null hypothesis tests (NHSTs)

Exploration of the differences between different correlation coefficients.

Bonferroni correction

Multiple tests problem
Simulation
Null hypothesis tests (NHSTs)

A simple explanation of the Bonferroni correction for the multiple tests problem.

Confidence interval around Spearman correlation coefficient

CECPfuns package
Correlation
Confidence intervals
Non-parametric statistics
Rank methods

Explores four methods of estimating a CI around an observed Spearman correlation.

Explore distributions with plots

R tricks
R graphics
Distributions
Null hypothesis tests (NHSTs)
Gaussian distribution
Plots and graphs

Graphical exploration of fit between distributions and against theoretical distributions.

Tests of fit to Gaussian distribution

R tricks
Distributions
Distribution tests
Null hypothesis tests (NHSTs)
Gaussian distribution

Introduction to four tests of fit to Gaussian distribution available in R

Kolmogorov-Smirnov test

R tricks
Distributions
Distribution tests
Null hypothesis tests (NHSTs)
Gaussian distribution

First post about using R to test fit to univariate Gaussian (a.k.a. 'Normal') distribution: Kolmogorov-Test

Using tryCatch() (within simulations)

R tricks
R programming
Simulation

I had previously found the structure of tryCatch() difficult: cracked it!

Background on plotJacobson() function

RCSC paradigm
Jacobson plot
CECPfuns package
Plots and graphs

1.xi.23 This is very early work in progress and will evolve a lot over the next week and then get into CECPfuns R package on github.

Confidence intervals for quantiles

Confidence intervals
ECDFs
Quantiles (quartiles, [per]centiles, deciles)

A general coverage of quantiles, the ECDF (Empirical Cumulative Distribution Function) and confidence intervals (CIs) around quantiles

Mapping individual scores to referential data using quantiles

Confidence intervals
ECDFs
Quantiles (quartiles, [per]centiles, deciles)
Mapping to referential data

Exploring the use of quantiles and their confidence intervals, and ECDFs to map individuals' scores to referential data.

Making a working shiny server

Geeky stuff
Shiny
R packages
R tricks
R programming

This is very much work in progress and will probably always be that way.

What is an empirical cumulative distribution function?

Distributions
ECDFs

A general introduction to the ECDF and quantiles and why they're useful.

Wisdom of years!

R style
Wise practices

I've learned a lot about data analysis from my errors, here's what I wish I'd known earlier!

R things I, and perhaps others, forget

Distill package
R graphics
R tricks

This is a developing miscellany of the things that I seem to keep forgetting about R. What I used to call in my student days "teflon coated facts"!

Jacobson #1

RCSC paradigm
R graphics
Jacobson plot
Granularity of scores

The Jacobson plot and RCSC (Reliable and Clinical Change) methods for those who have never met them before or don't feel confident they understand them.

Drawing a PSYCTC.org logo (and other circular things)

R graphics
R tricks

As title says: very simple stuff about circles in ggplot, does open up somne ideas about drawing therapy groups.

Derangements #2

Rigorous idiography
Method of derangements

Follows on from 'Scores from matching things'

Scores from matching things

Rigorous idiography
Method of derangements

Mostly about the method of derangements but some huxtable!

Reading data into R from M$oft Access mdb

R tricks
R programming
Data import in R
Database handling

Work in progress about reading data from M$ mdb file into R

Exact confidence intervals for difference between proportions

Confidence intervals
Proportions
Exact confidence intervals

This describes the ExactCIdiff package, unpacks the arguments to the functions, looks at timings and notes an oddity, a typo I think, in the original paper about the package.

Pre/post analyses

Change scores
Pre/post change

Teaching myself about pre/post therapy change analyses using R. Probably the first of a series of posts.

Chance corrected agreement

Agreement
Cohen's kappa

Simple plotting of raw agreement and Cohen's kappa for various prevalences of the rated quality and only chance agreement

Data ellipses and confidence ellipses

R graphics
Distributions
Correlation
Regression

This just clarifies the distinction between a data ellipse and a confidence ellipse, i.e. an ellipse describing the joint confidence intervals on two parameters of a model

Compiling packages reporting missing headers in windows

R geeky
R packages
Reminder (for CE!)

For anyone else who hits this and doesn't want to wait for someone to put the compiled package into CRAN

For OMbook glossary

OMbook & glossary

Code used for entries in the glossary for the OMbook

Subscale/total correlations

Correlation
Psychometrics
Regression
Reliability

A look at subscale/total correlations in the null model

Spearman-Brown formula

Correlation
Psychometrics
Regression
Reliability

How does internal reliability relate to number of items?

Compiling R on a Raspberry Pi 4

Raspberry pi
Geeky stuff

I thought I should document this process as it turned out to be fairly easy

Where to store different settings in Rmarkdown files

R tricks
Rmarkdown
R programming

This may be of use to others but it's partly for me as I keep forgetting these and searching around for the .Rmd files in which I used the one I want!

Making the CECPfuns package: my own usable package

R packages
R tricks
R programming

This is very much work in progress so look for later posts about CECPfuns as well as this.

More piping, and rowwise()

R packages
Tidyverse
Piping
R tricks
R programming

This extends https://www.psyctc.org/Rblog/posts/2021-02-07-why-pipe-why-the-tidyverse/ and introduces rowwise()

Why pipe? Why the tidyverse?

R packages
R programming
Piping
Tidyverse

A short description of the post.

How I have done this

Distill package
R graphics
R tricks

Just documenting how I have created these pages with the Distill package.

Bootstrap_Spearman

Confidence intervals
Bootstrapping
Correlation

A quick exploration of bootstrapping a Spearman and why you might, or might not, want it.

Handling overprinting

Graphics
Overprinting
Jittering
R tricks
R graphics

This is the first of my blog posts here, about the issue of overprinting and some ways to handle it using R and ggplot(). There's a small spin off topic on the impact on bivariate correlations and on linear regression of discretising continuous variables.

Nudging groupings on plot axes

Graphics
Nudging
Jittering
R tricks
R graphics

How to nudge categories on an axis of a ggplot plot.

More articles »

An R SAFAQ

Using this “Rblog”

At the top you should find a search box and a menu. Probably the best way to find if I have something you want here is to use that search. However, you may also find things using the “CATEGORIES” menu on the right of this main page.

Going back to the top right of the menu bar “Welcome” gives you a bit more than this introduction, “About” gives you some geeky background and you can guess what “Copyright/permissions” gives you. I hope it’s all useful, do please contact me if you have suggestions, comments, corrections or requests.

What follows below is the full list of posts in reverse chronological order of creation. Code used in the posts is in them and revealed by hitting the “Show code”, buttons. Inside code blocks there is a “copy to clipboard” button if you hover your cursor inside the block.