logo

Visual Analytics Assignment 2022

   

Added on  2022-10-11

10 Pages4553 Words9 Views
 | 
 | 
 | 
Visual Analytics
Student Name:
Instructor Name:
Course Number:
25th September 2019
Visual Analytics Assignment 2022_1

Task 1:
Part 1:
In this section, we sought to analyze the trends in the disease proportions for the various health
conditions. There were a total of nine health conditions and the aim was to present a trend
analysis visualization plot that shows how the different health conditions compared in both 2001
and 2018. To perform analysis, ggplot function was used in r. The codes used to generate the plot
are presented below;
From the plot, it was observed that in 2001, three health
conditions (Arthritis, Asthma and back problems) had
proportions greater than 10% with back problems being the
condition with the highest proportion followed by arthritis and
asthma at the third place. In 2018, four health conditions
(arthritis, asthma, back problems and mental behavioural
problems) had proportions greater than 10% with mental
behavioural problems being the condition with the highest proportion followed by back
problems, arthritis and asthma in that order.
#task 1
##part 1
#Import data into R
health_data<-
read.csv("C:\\Users\\
Downloads\\
aushealth.csv")
#Attach the data
attach(health_data)
#check the ctructure
of the imported data
str(raw_data)
#check the dimensions
of data
dim(health_data)
Visual Analytics Assignment 2022_2

Figure 1: bar chart on Disease proportions in 2001 and 2008
Apart from visualizing on the trend of the disease conditions, we also sought to check on how the
diseases compare in terms of the change in proportions from 2001 to 2018. A chart showing
changes in the disease proportions was constructed. The code used to generate the plot is
provided below;
##part 2
#call the tidyverse library
library(tidyverse)
#converting the data to dide format
health_data_wide = health_data %>%
spread(year, prop_population)
#checking the structure of the dataframe
str(health_data_wide)
#changing the column names
colnames(health_data_wide)<- c("Disease","Year2001","Year2018")
#Computing the new variable on the percentage change
health_data_wide_new<-health_data_wide %>%
mutate(prop_change = ((Year2018-Year2001)/Year2001)*100)
#structure of the new dataframe
Visual Analytics Assignment 2022_3

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents