Grouped scatter plot ggplot29/12/2023 ![]() X = "Victims per 100,000 women", y = "Defendants per 100,000 people", #Add names of axesĬaption = "Source: Census INEGI 2013, 20") + #Add name of source Subtitle="Femicide victims vs Defendants rate", #Add subtitle Labs(title ="Justice for femicide victims", #Add title Geom_point(aes(x = vict_rate, y = defendant_rate), color ="steelblue4", size = 3) + #Add a size of the point Then I uploaded the database and corrected and changed some of the variable names. Using the data from these databases, I will explore the relationship between victims and defendants’ rate in femicides, the crime of murdering a girl or woman.įirstly, I needed to install the tidyverse package which includes the ggplot2 package. In order to show how to make scatter plot visualization, I will use a dataset which gathers information from 2013 to 2015 of three Mexican censuses the National Census of Federal Justice Procuration, the National Census of State Justice Procuration and the National Census of Government, Public Security and State Penitentiary System which were conducted by the National Institute of Geography and Statistics in Mexico (INEGI, n.d.). ![]() To go deep in the understanding of this package you can review the cheat sheet for further information (RStudio, n.d.) To work with a scatter plot, I will use the ggplot2 package of R. ![]() Even though a scatterplot can be used to compare one continuous and one categorical variable or two categorical variables, there are better graphics to depict these kinds of variables for instance geom_jitter, geom_count, or geom_bin2d. A specific variation of scatterplot is a bubble chart, also called a weighted scatterplot, which is used to plot three variables in which one of them is depicted by the size of the bubble. It takes a data set and deals with outliers, formatting the graphs for clarity, using bubbles to show a third variable, adding regression models and trend to the plots and splitting the data into separate graphs to change the focus from the whole data set to portions of it.Ī scatter plot is a type of visualization mainly used to display the relationship between continuous variables. This blog looks at the ways in which scatter plots can be used to visualise multiple sets of data and the relationships between several variables. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |