Publications by Very statisticious on Very statisticious

Analysis essentials: Using the help page for a function in R

27.04.2020

Since I tend to work with relatively new R users, I think a lot about what folks need to know when they are getting started. Learning how to get help tops my list of essential skills. Some of this involves learning about useful help forums like Stack Overflow and the RStudio Community. Some of this is about learning good search terms (this is a h...

7891 sym R (166 sym/3 pcs) 16 img

Controlling legend appearance in ggplot2 with override.aes

08.07.2020

In ggplot2, aesthetics and their scale_*() functions change both the plot appearance and the plot legend appearance simultaneously. The override.aes argument in guide_legend() allows the user to change only the legend appearance without affecting the rest of the plot. This is useful for making the legend more readable or for creating certain type...

8567 sym R (8581 sym/16 pcs) 22 img

Simulate! Simulate! – Part 4: A binomial generalized linear mixed model

19.08.2020

A post about simulating data from a generalized linear mixed model (GLMM), the fourth post in my simulations series involving linear models, is long overdue. I settled on a binomial example based on a binomial GLMM with a logit link. I find binomial models the most difficult to grok, primarily because the model is on the scale of log odds, infere...

14961 sym R (8811 sym/24 pcs) 2 img

Handling errors using purrr’s possibly() and safely()

30.08.2020

One topic I haven’t discussed in my previous posts about automating tasks with loops or doing simulations is how to deal with errors. If we have unanticipated errors a map() or lapply() loop will come to a screeching halt with no output to show for the time spent. When your task is time-consuming, this can feel pretty frustrating, since the who...

9766 sym R (7372 sym/27 pcs)