Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

R PROGRAMMING LANGUAGE 4. Basic operations with the iris data Run the following code to load iris data. data(iris) a. Inspect the data types of

R PROGRAMMING LANGUAGEimage text in transcribed

4. Basic operations with the iris data Run the following code to load iris data. data(iris) a. Inspect the data types of the variables in the iris data. - Hint: use str. b. (1 pt) Print the first few rows and the last few rows. c. (2 pts) Compute the maximum, minimum, mean, and standard deviation of the Petal. Length variable. d. (1 pt) What is the 130th value of the petal.Length variable? e. (1 pt) Change the 130th value of the Petal. Length variable to 0 . And then compute the mean of the Petal. Lenth variable. What is the difference between the current mean and the previous mean? 5. Working with two vectors. The sample correlation coefficient (r) is used to measure how strong a relationship is between two variables. Mathematically, the sample correlation coefficient of the data pairs (xi,yi),i=1,2,,n, is defined by: r=i=1n(xix)2i=1n(yiy)2i=1n(xix)(yiy) where x is the mean of xi 's and y is the mean of yi 's. Let's calculate the sample correlation coefficient between two variables, Sepal. Length and Sepal.Width, in the iris data using the above formula. You can directly work with iris\$5epal. Length and iris\$5epal. Width variables for the computation, but their names are too long. To make it simple, let's define new vectors x and y as follows: x

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

Students also viewed these Databases questions

Question

Describe the two primary areas of international tax research.

Answered: 1 week ago

Question

Make efficient use of your practice time?

Answered: 1 week ago