Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Hello, I feel difficult when I kept trying to do these R questions. Could you please give me help to solve these R questions? Thank

image text in transcribedimage text in transcribed

Hello, I feel difficult when I kept trying to do these R questions.

Could you please give me help to solve these R questions?

Thank you so much.

Note: Complete Parts 1 and 2 below, copying and pasting the required R commands, R outputs, and analysis

into your Word documents.

image text in transcribedimage text in transcribedimage text in transcribed
Part 1 We wish to compare the midterm scores of two sections of a particular stats class. Both sections wrote exams out of 50 possible points. Collections of students from each of the two sections were randomly sampled and their exam scores are summarized below. Morning Section Marks: 38 36 40 37 42 38 37 41 43 39 ) 36 37 34 41 36 39 37 40 38 35 34 38 42 39 41 40 41 37 41 37 41 35 38 41 36 Afternoon Section Marks: 37 39 27 33 29 32 39 40 40 50 39 40 33 39 38 29 24 31 27 36 30 36 40 39 30 41 41 34 32 40 31 32 38 39 33 32 39(a) [2 marks] Create a histogram of the marks from the morning section of the class. The title and I-axis for the histogram should have appropriate labels. Copy and paste the relevant command from the R Console Window and the resulting histogram into your Word document. (You do not need to include the code for how you stored the data into R, just include the one line of code for the histogram.) [2 marks] Create one side-byside boxplot of the two sets of marks (i.e. both boxplots on the same axes). The picture should have an appropriate title, the :1:- and y-axes for the boxplot should have appropriate labels, and the two groups should be labelled. (The code to change the title and axes for a boxplot is the same as how to change the title and axes for a histogram.) Copy and paste this boxplot and the line of code used to create it into your Word document. The boxplots themselves may be either horizontal or vertical (your choice). [2 marks] Use R to calculate the mean and standard deviation of the marks for both the morning and afternoon sections. Copy and paste the relevant commands and output from the R. Console Window into your document. Write a short statement summarizing the values of your R output. [1 mark] Answer the following question: Which class appears to have performed better on the test? Write a few sentences explaining your opinion. You should make reference to the some of the relevant features of the two data sets (e.g. the mean or median, the spread of the data, minimum /maximum values, etc.). Use your results from both parts (b) and (c) to support your statement. You may Wish to run the summary command in R for each class section to gather information about the maximum and minimum values. Part 2 We are interested in analyzing the relationship between the speed at which a car is travelling, and the distance required for the car to stop. There is a built in data set in R that we will access for this purpose. Use the command attach(cars) to import the cars data set. This data set contains the speed (measured in mph) and stopping distance (measured in ft) measurements for 50 cars (i.e. this is a bivariate data list). The speed measurements are already stored in a vector called speed and the distance measurements are already stored in a vector called dist (i.e. using the cars command will also store the data lists of speed and dist for you). (a) [2 marks] Create a scatterplot to compare the stopping distance to speed. (Hint: here the speed is the value that can be controlled so it is your variable 1:) Your plot should have an appropriate title and the x- and y-axes should be labelled appropriately. Copy and paste the relevant commands and output from the R Console Window into your Word document. (b) [1 mark] Describe the relationship (if any) between speed and stopping distance that this scatterplot shows. (e.g. Is it linear or not? Positive or negative?) (c) [2 marks] Use the cor function to compute the correlation coeicient. (Copy and paste the relevant commands and output from the R. Console Window into your Word docu- ment.) Does this value agree with your answer about the relationship between speed and stopping distance? Explain

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Mathematics questions

Question

=+b) What might you consider doing next?

Answered: 1 week ago