This is cross-posted after having first posted on stats.stackexchange.com, as I thought it involves more the use of R and statistics than coding, but now I see that I might find a more lively community of R users here. This is cross-posted after having first posted