Answered step by step
Verified Expert Solution
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
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 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 x2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started