Highlights
The assignment involves manipulating some large, real-life data files. These files contain publicly- available data on adverse drug reactions compiled by the US FDA (Food and Drug Administration). Four data files will be used, containing data submitted to the FDA in the 1st quarter of 2014. The files are included in this repository.
Information on the content of each of the data files can be found on the following web pages:
* Demographics:
* Drug information
* Adverse reaction description
* Outcomes
Your solution needs to be submitted as an Rmd (R Markdown) file which will be used to create an HTML (web) document combining the descriptions of the assignment tasks with your R code solutions, and the output created by that R code.
All data manipulation and table and chart preparation must be done by R code contained in your solution file. Do not manipulate data using other means—marks will be deducted if you do. The goal is to create a 100% reproducible analysis.
Use the Rmd file provided as a template for your solution (feel free to add relevant text or commentary).
You must use GitHub and git to collaborate on this project. *You must name your main solution file `Assignment3_solution.Rmd` in your repository.Your repository as it existed at the due date will be what is used for marking.
Here are some GitHub/git-related things that will cause loss of marks:
* Not using GitHub (we will have no files to mark)
* Not committing regularly and only committing a final solution just before the deadline
* Having no commit history for a user (so it looks like that user contributed nothing)
* Not resolving conflicts properly (having >>>>>, =====, <<<<<, and so on left in files)
File submissions will not be accepted. **You must use GitHub for this assignment.**
Your solution should _only_ rely on the four data files supplied. You may use any additional R packages or libraries which you like—the lecturers will install these additional packages on their own system as required in order to run and thus mark your solution. The use of the _dplyr_ and _ggplot2_ packages is recommended.
Task (a) in Section 1 below has been done for you in the template file to show you how to include your R code in this file. You may use any additional _knitr_ directives or options that you wish, but please leave the value of echo at the default of TRUE so that your code is visible in the output HTML document.
# Section 1 ## Value - 7 marks
## Tasks
a. Read the demographics file for qtr1 2014 into a data frame in R, but do not automatically convert strings to factors
```{r}
demographics <- read.csv('demo2014q1.csv', .)
summary(demographics)
```
b. Convert the `i_f_code` column into a factor with appropriate labels.
```{r}
# your solution code here
```
c. Convert the `event_dt` variable into a date variable using `as.Date()` and name the new column `event_date`.
```{r}
# your solution code here
```
d. Write a function to create a numeric `age_yrs` column in the demography data frame which has age in years. Create a column called `agr_grp` which contains the 5 year age group, from 0-4 through to 85+, for each record
```{r}
# your solution code here
```
e. Convert `sex` to a factor with appropriate labels
```{r}
# your solution code here
```
f. Convert the `wtstr` colum to a numeric weight in kilograms and store in a column called `weight`
```{r}
# your solution code here
```
g. Convert `occp_code` to a factor and store as a column named `occupation`
```{r}
# your solution code here
```
h. Remove all columns except the following from the demographics data frame:
* `primaryid`
* `caseid`
* `caseversion`
* `i_f_code`
* `event_date`
* `age_yrs`
* `age_grp`
* `sex`
* `weight`
* `occupation`
```{r}
# your solution code here
```
i. keep only the initial report for each case in the demographics data frame
```{r}
# your solution code here
```
j. demonstrate that all of the above steps in Section 1 have been executed correctly.
# Section 3 ## Value - 2 marks
## Tasks
a. read the `outc2014q1.csv` data file into a data frame, do not convert strings into factor automatically
```{r}
# your solution code here
```
b. convert the outc_code column to a factor with appropriate labels
```{r}
# your solution code here
```
# Section 5 ## Value - 6 marks
## Task
Present tables which show the number of missing values in each variable in each of the 4 data frames.
```{r}
# your solution code here
```
# Section 7 ## Value - 6 marks
## Task
For each of the top 10 drugs, show the relative frequency of each type of outcome, in a table and in a chart. Draw a chart showing the missing category for outcome, and a second chart with the missing category excluded.
```{r}
# your solution code here
```
# Section 9 ## Value - 9 marks
## Task
Present some interesting or informative aspect of the data that involves data items from more than one of the four data frames, in the form of at least one table and one chart (but no more than 6 tables and/or charts in total). Each group must present a different analysis for this section - marks will be deducted from all groups that present the same analysis as any other group. You will need to confer amongst groups to ensure there is no overlap. The lecturers are happy to advise via email on whether any proposed analyses are too similar, or to suggest some suitable analyses.
```{r}
# your solution code here
```
This Computer Science Assignment has been solved by our Computer Science Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.