And some labelling and adjusting the look of the plot
my_plot + ggtitle("Scatterplot of average GDP and life expectancy, 1952-2007") +
xlab("Average GDP per capita (logged)") +
ylab("Average life expectancy (logged)") +
ggthemes::theme_fivethirtyeight() + xlim(7.5, 10.1) +
scale_fill_manual(values = pal_hash) +
theme(legend.position = "none",
plot.title = element_text(size = 25),
text = element_text(family = "Arial"))
This blog post will look at the plot_model() function from the sjPlot package. This plot can help simply visualise the coefficients in a model.
Packages we need:
We can look at variables that are related to citizens’ access to public services.
This dependent variable measures equal access access to basic public services, such as access to security, primary education, clean water, and healthcare and whether they are distributed equally or unequally according to socioeconomic position.
Higher scores indicate a more equal society.
I will throw some variables into the model and see what relationships are statistically significant.
The variables in the model are
level of judicial constraint on the executive branch,
freedom of information (such as freedom of speech and uncensored media),
level of democracy,
level of regime corruption and
strength of civil society.
So first, we run a simple linear regression model with the lm() function: