题目
题目

ECON3310001.1251 Quiz 3: Dataframes

单项选择题

Suppose you want to calculate how far each student was from the mean in exam 1 and store it in a column called deviation. Which of the following is a correct way to do so?

选项
A.grades$deviation <- mean(grades$exam1)
B.grades$exam1 <- mean(grades$exam1)
C.grades$exam1 <- mean(grades$exam1) - grades$exam1
D.grades$deviation <- grades$exam1 - mean(grades$exam1)
查看解析

查看解析

标准答案
Please login to view
思路分析
We start by restating the scenario and the available options to compare them clearly. Question: Suppose you want to calculate how far each student was from the mean in exam 1 and store it in a column called deviation. Which of the following is a correct way to do so? Answer options: 1) grades$deviation <- mean(grades$exam1) 2) grades$exam1 <- mean(grades$exam1) 3) grades$exam1 <- mean(grades$exam1) - grades$exam1 4) grades$deviation <- grades$exam1 - mean(grades$exam1) Now, evaluate each option step by step: Option 1: grades$deviation <- mean(grades$exam1) - This assigns the scalar mean va......Login to view full explanation

登录即可查看完整答案

我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!