Relations among Categorical Variables In the notes on Healy’s Chapter 5, we looked at several ways to visualize the relations
—
title: "Assignment 1"
output: word_document
—
## Relations among Categorical Variables
In the notes on Healy's Chapter 5, we looked at several ways to visualize the relationship between two categorical variables.
For this assignment you need to select a pair of cateogrical variables from a dataset which interests you. You could use one of the datasets I used in class, but you are free to pick anything.
## Problem 1
Identify the dataset you've chosen and the two categorical variables. Feel free to create a new categorical variable from an existing quantitative variable. Do a summary of the dataset and produce simple tables for each of the two variables. Make sure that you don't have too many values. Collapse if necessary.
Don't forget to include library commands for all of the packages you need.
“`{r}
# Place your code in this chunk.
glimpse(organdata)
## Problem 2
Select the visualization of the relationship that you feel is the best and produce it.
“`{r}
# Place your code here.
“`
library(ggplot2)
p <- ggplot(data = organdata,
mapping = aes(x = reorder(country, donors, na.rm=TRUE),
y = donors))
p + geom_bar() +
labs(x=NULL) +
coord_flip()
## Problem 3
What is your second-choice visualization? Don't forget to explain why you prefer the first choice over the second choice.
“`{r}
# Place your code in this chunk.
“`
library(ggplot2)
p <- ggplot(data = organdata,
mapping = aes(x = reorder(country, donors, na.rm=TRUE),
y = donors))
p + geom_boxplot() +
labs(x=NULL) +
coord_flip()
I prefer the first visualization to the second one because it is easier to read and interpret the relationship between data
## Problem 4
Based on your visualizations describe what you see. Assume that you are speaking to a blind person.
Just write your comments here.
With the selected visualization, we can tell the level of organ donations in different countries. Since the visualization for every country is placed side by side, comparison of how organs have been donated across different countries becomes easiert.
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.