Graph linear model plots with sjPlots in R

This blog post will look at the plot_model() function from the sjPlot package which can help visualise the coefficients in a model in a plot. Packages we need: We can look at variables that are related to the extent to which citizens’ access to state public services is equally distributed across socio-economic groups. The variable measures equal access access to basic public services, such as … Continue reading Graph linear model plots with sjPlots in R

Create a correlation matrix with GGally package in R

We can create very informative correlation matrix graphs with one function. Packages we will need: First, choose some nice hex colors. Next, we can go create a dichotomous factor variable and divide the continuous “freedom from torture scale” variable into either above the median or below the median score. It’s a crude measurement but it serves to highlight trends. Blue means the country enjoys high … Continue reading Create a correlation matrix with GGally package in R

Analyse Pseudo-R2, VIF scores and robust standard errors for generalised linear models in R

This blog post will introduce a simple function from the jtools package that can give us two different pseudo R2 scores, VIF score and robust standard errors for our GLM models in R Packages we need: From the Varieties of Democracy dataset, we can examine the v2regendtype variable, which codes how a country’s governing regime ends. It turns out that 1994 was a very coup-prone … Continue reading Analyse Pseudo-R2, VIF scores and robust standard errors for generalised linear models in R