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

Add weights to survey data with survey package in R: Part 2

Click here to read why need to add pspwght and pweight to the ESS data in Part 1. Packages we will need: Click here to learn how to access and download ESS round data for the thirty-ish European countries (depending on the year). So with the essurvey package, I have downloaded and cleaned up the most recent round of the ESS survey, conducted in 2018. … Continue reading Add weights to survey data with survey package in R: Part 2

Add weights to survey data with survey package in R: Part 1

With the European Social Survey (ESS), we will examine the different variables that are related to levels of trust in politicians across Europe in the latest round 9 (conducted in 2018). Click here for Part 2. Click here to learn about downloading ESS data into R with the essurvey package. Packages we will need: The survey package was created by Thomas Lumley, a professor from … Continue reading Add weights to survey data with survey package in R: Part 1

Interpret multicollinearity tests from the mctest package in R

Packages we will need : The mctest package’s functions have many multicollinearity diagnostic tests for overall and individual multicollinearity. Additionally, the package can show which regressors may be the reason of for the collinearity problem in your model. Click here to read the CRAN PDF for all the function arguments available. So – as always – we first fit a model. Given the amount of … Continue reading Interpret multicollinearity tests from the mctest package in R

Choose model variables by AIC in a stepwise algorithm with the MASS package in R

Running a regression model with too many variables – especially irrelevant ones – will lead to a needlessly complex model. Stepwise can help to choose the best variables to add. Packages you need: First, choose a model and throw every variable you think has an impact on your dependent variable! I hear the voice of my undergrad professor in my ear: try not to go … Continue reading Choose model variables by AIC in a stepwise algorithm with the MASS package in R