Rquiz1—Rquiz6
学期一共12个Rquiz(算final成绩)和12个Lquiz(不算final成绩),和final挂钩的考试一定要认真对待。这些quiz都是送分题,希望这篇博客能助你一臂之力。
文章目录
前言
创作不易,拒绝抄袭,可以引用,标明出处。
小编会尽力去完善每一个知识点,如果有错误,漏掉的内容欢迎留言私信补充。
RQuiz 1
Question 1
To calculate log(4), which would work in R code?
- > log(4)
- > In(4)
- >Ine(4)
- LOG(4)
讲解: 把这四个选项每个放在rstudio里运行一下,只有log(4)能运行出结果。
Question 2
Which code is correct?
- getwd()
- setwd(x=c(1,2,3))
- help[getwd]
- setwd(’…’)
讲解: 放在Rstudio里运行,R语言的语法,其余都有不同的程序错误。
Question 3
What is the answer to the following R code?
x=c(1,2,3,4,5)
sum(x) + sort(x)[2]
- 17
- 16
- 15
- 14
讲解: 放在rstudio里运行
x=c(1,2,3,4,5)
sum(x)+sort(x)[2]
#outpot:17
Question 4
x=c(-1,2,3,-4,5)
Which commands sorts the data?
- sort(x)
- Sort(x)
- SORT(x)
- sort(x)
讲解: 放在Rstudio里运行一下,只有sort(x)没有出错。
Question 5
“Simpson’s Paradox occurs when relationships between percentages in subgroups are the same, when the subgroups are combined, because of a confounding or lurking variable”.
- True
- False
讲解: 理论题。
题目翻译:当子组中的百分比之间的关系相同时,或者由于混淆或潜伏变量而将子组合并时,就会发生“辛普森悖论”。
RQuiz 2
Question 1
In the sleep dataset, how many levels does the group variable have?
- 4
- 2
- 6
- 8
讲解: 问在sleep数据集中,group变量有多少个级别?答案是两个。
Question 2
What is the length of the depth variable in quakes?
- 10
- 100
- 1000
- 10000
讲解: 问地震中深度变量的长度是多少?
Question 3
Which command would isolate a variable in the sleep dataset?
- sleep$extras
- sleep$age
- sleep$time
- sleep$group
解释: 问哪个命令将隔离睡眠数据集中的变量?
Question 4
What is the result of the following code?
dim(mtcars^2)
- 1024 121
- 32 11
- NULL
- 123904
讲解: 带入Rstudio里运行。
Question 5
In the Australian road fatality dataset (L4), what type of variable is BusInvolvement?
- Quantitative - continuou
- Quantitative - discrete
- Qualitative - binary
- Qualitative - ordinal
讲解: 在澳大利亚道路死亡数据集(L4)中,涉及公共汽车的变量类型是什么?
总结
更新中ing