Statistics Assignment - Data Analysis - R Studio

Download Solution Order New Solution

Assessment :   For this assignment, create a file called YOURNAME_assignment_02.R, where you will write your solutions.Upload this on FASER.   Do not forget to add relevant comments for each block of code or function that you write. There are 10 points for commenting your code and 10 points for style (indentation, variable names, spacing, line wrapping).   Before submitting the assignment, save your file, close (without saving the workspace) and reopen R. Then test that everything works correctly, by running source("YOURNAME_assignment_02.R"). We will mark your solution not your answers. Description    In the previous assignment you had to mark a multiple-choice exam for 27 students. marks_assignment1.tsv  contains the marks of the students. a) [10 points]   Read the marks from the marks_assignment1.tsv into a data.frame called marks.   b) [10 points]   Write a function called getDegree, which takes as input a mark and returns the degree the student achieved: • "1st" for marks higher or equal to 70 • "2:1" for marks higher or equal to 60 and lower than 70 • "2:2" for marks higher or equal to 50 and lower than 60 • "3rd" for marks higher or equal to 40 and lower than 50 • "failed" for marks lower than 40   Hint: One of the many ways to do this would be with if statements.   c) [10 points]   Compute the degree for each student and add a new column to the data.frame called degree.   d) [20 points]   Create a plot and save it to a pdf file called degree_statistics.pdf. The plot comprises of two panels on one row. The first panel is a bar graph with the number of students that obtain each degree and the second panel is a pie chart of the same information. Add titles, labels, a letter to identify each panel ("A" and"B") in the top left corner of the panel (outside the plot). Change the colour of the bar plot to black. Used a different colour for each degree: blue for"1st", green for "2:1", yellow for "2:2" orange for "3rd" f and red for "failed"

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.