Academic Writing Experts For Your Research Projects

Order custom papers, masters thesis and dissertation in 3 guided steps; human written!

Posted: November 19th, 2022

Assignment #2

Assignment #2
Due Date: November 15th, 11:59pm
This assignment is worth 10% of your final grade and has 4 sections. Please save all your code for this assignment as a .R file and name that file:
“assignment_2_lastname_firstname.R”. If your .R file is not correctly named, you will lose 0.5 mark. Be sure to save while you write your code for this assignment. Please number each part in your assignment in the form of a comment. At the top of your code, please comment your name, student number, and “Assignment #2”.
Section 1.
Part 1.1. We have created three lines of code that you will need to run at the beginning of your R code. Each line of code will produce 20 numbers and you will need to create a vector with these numbers and assign it the appropriate name (please see below). Please only run these lines of code once. Please note that each student will receive a
random set of numbers (i.e. your numbers will not be the same as any of your classmates). (0.75 mark)
• sample(160:200, 20, replace=TRUE) o assign the above 20 numbers to the name ‘height’.
• sample(50:113, 20, replace=TRUE) o assign the above 20 numbers to the name ‘weight’.
• sample(0:1260, 20, replace=TRUE) o assign the above 20 numbers to the name ‘exercise_minutes’.
Part 1.2. Using the three vectors produced in Part 1.1, create a dataframe and name this dataframe ‘df’. Once you create this dataframe, it will appear in your Global
Environment and this dataframe should contain 20 observations and 3 variables (0.25 mark).
Section 2.
Part 2.1. Last week, you learned about covariance and correlation in the online lecture. You will now apply what you learned in this assignment. In the next parts, you will be calculating the correlation coefficient of the ‘weight’ and ‘exercise_minutes’ variables. (There are no marks for this part, this is just a description.)
Part 2.2. Plot a histogram of each variable in the ‘df’ dataframe, comment the shape, and any other relevant commentary about each histogram. (2.25 marks)
Part 2.3. Calculate the mean, median, and standard deviation of each of the variables, provide these values as comments, and comment how they relate to the histogram. (3 marks)
Part 2.4. Create a new variable (i.e. column) in the ‘df’ dataframe and name this column ‘new_variable1’. This variable should contain the values calculated using the following calculation: (???? - ??¯), where ???? is each value in the ‘weight’ variable (i.e. ??1 is the first value of the ‘weight’ variable) and ??¯ is the mean of all the values in the ‘weight’ variable. (0.25 mark)
Part 2.5. Create a new variable (i.e. column) in the ‘df’ dataframe and name this column ‘new_variable2’. This variable should contain the values calculated using the following calculation: (???? - ??¯), where ???? is each value in the ‘exericse_minutes’ variable (i.e. ??3is the third value of the y variable) and ??¯ is the mean of all the values in the ‘exericse_minutes’ variable. (0.25 mark)
Part 2.6. Create a new variable (i.e. column) in the ‘df’ dataframe and name this column ‘product_2_variables’. This variable should contain the values of the product between the ‘new_variable1’ and ‘new_variable2’ columns you created in Part 2.4 and Part 2.5. (Here is the equation: (???? - ??¯)(???? - ??¯) ). (0.25 mark)
Part 2.7. In this part you will need to calculate the correlation coefficient of the ‘weight’ and ‘exercise_minutes’ variables. We have walked you through the first steps of how to calculate this coefficient in Parts 2.3-2.6. Now using those parts, the knowledge that you gained from Lecture 7, as well as the equation presented in Lecture 7 Slide 21, calculate the correlation coefficient and comment this value. Please be sure to use R to calculate the coefficient and show all your steps in this component. (1.5 marks)
Section 3.
Part 3.1. Using two built-in R functions, calculate both the covariance and correlation of the ‘weight’ and ‘exericse_minutes’ variables. Provide both values as comments. (1.0 mark)
Section 4.
Part 4.1. Please describe the direction and effect size of your correlation coefficient calculated in Part 2.7 as comments in your code. (0.5 mark)

Tags: top uk dissertation writing services, top rated dissertation writing services, someone to write my paper, service writing my essay write custom, research paper writing service cheap, quick essay writing service

Why choose Homework Ace Tutors

You Want Quality and That’s What We Deliver

Top Academic Writers

We’ve put together our writing team with care, choosing talented writers who shine in their fields. Each one goes through a tough selection process, where we look for folks with deep expertise in specific subjects and a solid history of academic writing. They bring their own mix of know-how and flair to the table, making sure our content hits the mark—packed with info, easy to read, and perfect for college students like you.

College Prices

We don’t do AI-written essays or copycat work—everything’s original. Competitive pricing is a big deal for us; we keep costs fair while delivering top-notch quality. Our writers are some of the best out there, and we charge rates that stack up well against other services. This means you get stellar content without draining your wallet. Our pricing is straightforward and honest, built to give you real value for your money. That’s why students turn to us for high-quality writing services that won’t break the bank.

100% Plagiarism-Free

Academic integrity is at the heart of what we do. Every paper starts from scratch, with original research and writing tailored just for you. We write 100% authentic—no plagiarism research essays. Our strict quality control process includes scanning every draft with top tools like SafeAssign and Turnitin, so you get a similarity score and proof of originality. We’re obsessive about proper citation and referencing too, crediting every source to keep things legit. It’s all about giving you peace of mind with content that meets the highest standards.

How it works

When you decide to place an order with Dissertation Writer, here is what happens:

Complete the Order Form

You will complete our order form, filling in all of the fields and giving us as much detail as possible.

Assignment of Writer

We analyze your order and match it with a writer who has the unique qualifications to complete it, and he begins from scratch.

Order in Production and Delivered

You and your writer communicate directly during the process, and, once you receive the final draft, you either approve it or ask for revisions.

Giving us Feedback (and other options)

We want to know how your experience went and the marking criteria grade you scored. You can leave a review recommending a writer for your class and course mates.