[SOLVED] MTHM501 Formative Coursework 1- Data wrangling P0

100.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon MTH501-elkjep.zip (354.3 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (2 votes)

Question
Load in the file “indicator hiv estimated prevalence% 15-49.csv”. This file contains the estimated HIV prevalence in people of aged 15-49 in different countries over time. Prevalence is defined here to be the estimated number of people living with HIV per 100 population. :
1. Produce a tidy data set called gp_hiv using the tools in tidyverse that we introduced in the week 3 practical. The dataset needs to run from 1991 onwards (there is too much missing data prior to that), and we want to end up with three variables (i.e. columns): Country, year and prevalence. [Note that a couple of the years have no values in the data set, and by default R reads these columns in as character columns. Hence when you gather() the data to create a prevalence column, all the
numbers will be converted into characters. One way to deal with this is to convert the column back into numbers using .numeric]

2. Once you have this tidy dataset, run the following code
gp_hiv %>%
group_by(Country) %>%
summarise(MeanPrevalence = mean(prevalence)) %>%
mutate(MeanPrevalence=round(MeanPrevalence,1)) %>% head()
and produce a table of the output.
1

  • MTH501-elkjep.zip