Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In R, Consider the following dataset, which is loaded in memory and assigned to a variable named dd, which is a data.table. Provide code to

image text in transcribedIn R, Consider the following dataset, which is loaded in memory and assigned to a variable named dd, which is a data.table. Provide code to answer the following questions

Consider the following dataset, which is loaded in memory and assigned to a variable named dd, which is a data.table. Provide code to answer the following questions. Y X1 X2 X3 1 A C O A D 2 1 AD 3 1 A C 2 1 B D 2 0 B C 2 (a) (4 points) Write code to compute the median of Y. (b) (4 points) Write code to display the row which contains the largest value of X3. (c) (4 points) Write code to compute the number of rows where X2 is C. (d) (4 points) Write code to compute the average value of Y for each value of X1. Display this column with header mean-by-xl. (e) (4 points) For the rows where Y is 1, compute the maximum value of x3 for every value of x2. Consider the following dataset, which is loaded in memory and assigned to a variable named dd, which is a data.table. Provide code to answer the following questions. Y X1 X2 X3 1 A C O A D 2 1 AD 3 1 A C 2 1 B D 2 0 B C 2 (a) (4 points) Write code to compute the median of Y. (b) (4 points) Write code to display the row which contains the largest value of X3. (c) (4 points) Write code to compute the number of rows where X2 is C. (d) (4 points) Write code to compute the average value of Y for each value of X1. Display this column with header mean-by-xl. (e) (4 points) For the rows where Y is 1, compute the maximum value of x3 for every value of x2

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_2

Step: 3

blur-text-image_step3

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

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

ISBN: 1583474013, 978-1583474013

Students also viewed these Databases questions