I chose these five questions because they use clear, easy-to-understand variables from the dataset such as Age, Female Deaths, Male Deaths, Female Population, and Male Population. These variables are simple to work with and allow me to make basic visualizations that show patterns or trends without needing complex statistical analysis.
Question 1: Age Trend
I chose this question because age is one of the most basic and understandable variables in the dataset. Plotting the first five age values helps show how the data is structured and gives an easy starting point for creating a simple trend graph.
library(plotly)
plot_ly(
x = 1:5,
y = Analysis$Age[1:5],
type = 'scatter',
mode = 'lines+markers',
name = 'Age'
) %>% layout(title = "Question 1: Age Trend")
Question 2: Female Deaths
I selected Female Deaths because it helps show how many deaths occurred for females in the first few rows. It is a clear numeric variable, making it easy to plot and visually compare the values.
# Question 2: Female Deaths
plot_ly(
x = 1:5,
y = Analysis$Female_Deaths[1:5],
type = 'scatter',
mode = 'lines+markers',
name = 'Female Deaths'
) %>% layout(title = "Question 2: Female Deaths Trend")
Question 3: Male Deaths
I chose Male Deaths so I could compare it with the Female Deaths trend. It allows me to see if male deaths are higher or lower in the same rows and also gives practice interpreting simple line graphs.
# Question 3: Male Deaths
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.4.2
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(plotly)
library(magrittr)
plot_ly(
x = 1:5,
y = Analysis$Male_Deaths[1:5],
type = 'scatter',
mode = 'lines+markers',
name = 'Male Deaths'
) %>% layout(title = "Question 3: Male Deaths Trend")
plot_ly(
x = 1:5,
y = Analysis$Male_Deaths[1:5],
type = 'scatter',
mode = 'lines+markers',
name = 'Male Deaths'
) %>% layout(title = "Question 3: Male Deaths Trend")
Question 4: Female Population
I used the Female Population variable because population data is easy to visualize and understand. It shows how many females are in the dataset for the first few age groups, making a smooth and simple graph.
# Question 4: Female Population
plot_ly(
x = 1:5,
y = Analysis$Female_Pop[1:5],
type = 'scatter',
mode = 'lines+markers',
name = 'Female Pop'
) %>% layout(title = "Question 4: Female Population Trend")
Question 5: Male Population
I picked Male Population to match the Female Population graph and see how the two compare. It is a simple numeric variable that creates a clean and understandable visualization.
# Question 5: Male Population
plot_ly(
x = 1:5,
y = Analysis$Male_Pop[1:5],
type = 'scatter',
mode = 'lines+markers',
name = 'Male Pop'
) %>% layout(title = "Question 5: Male Population Trend")