Você está na página 1de 3

htt

://

itf

ea

tur
e.c

om

Statistics MCQs on Basic Statistics


Q1: The R language is a dialect of which of the following
programming languages?
A) S
B) C
C) Lisp D) Matlab and Mathematica
E) SAS
Q 2: The denition of free software consists of four freedoms
(freedoms 0 through 3). Which of the following is NOT
one of the freedoms that are part of the denition?
A) The freedom to study how the program works, and
adapt it to your needs.
B) The freedom to improve the program, and release your
improvements to the public, so that the whole community
benets.
C) The freedom to run the program, for any purpose.
D) The freedom to sell the software for any price.
Q 3: In R the following are all atomic data types EXCEPT
A) integer
B) logical
C) data frame
D) character
Q 4: If I execute the expression x <- 4 in R, what is the class
of the object `x' as determined by the `class()' function?
A) Numeric
B) Integer
C) Real
D) Complex
Q 5: What is the class of the object dened by the expression
x <- c(4, "a", TRUE)?
A) Numeric
B) Character
C) Integer
D) Logical
Q 6: If I have two vectors x <- c(1,3, 5) and y <- c(3, 2, 10),
1

Muhammad Imdadullah

Statistics MCQs on Basic Statistics

htt
p

://

itf

ea

tur
e.c

om

what is produced by the expression rbind(x, y)?


A) A vector of length 2
B) a 2 by 2 matrix
C) a vector of length 3
D) a 2 by 3 matrix
Q 7: A key property of vectors in R is that
A) a vector cannot have have attributes like dimensions
B) elements of a vector can be of dierent classes
C) elements of a vector can only be character or numeric
D) elements of a vector all must be of the same class
Q 8: Suppose I have a list dened as x <- list(2, "a", "b",
TRUE). What does x[[2]] give me?
A) a list containing a character vector with the elements
"a" and "b".
B) a character vector of length 1.
C) a character vector with the elements "a" and "b".
D) a list containing the number 2 and the letter "a".
Q 9: Suppose I have a vector x <- 1:4 and y <- 2:3. What is
produced by the expression x + y?
A) a numeric vector with the values 3, 5, 3, 4.
B) an integer vector with the values 3, 5, 5, 7.
C) a numeric vector with the values 1, 2, 5, 7.
D) an error.
Q 10: Suppose I have a vector x <- c(3, 5, 1, 10, 12, 6) and I
want to set all elements of this vector that are less than 6
to be equal to zero. What R code achieves this?
A) x[x < 6] == 0
B) x[x == 6] <- 0
C) x[x < 6] <- 0
D) x[x == 0]
Q 11: - is function in R to get number of observation in a
data frame
A) n()
B) ncols()
2

Muhammad Imdadullah

Statistics MCQs on Basic Statistics

tur
e.c

om

C) nobs()
D) nrows()
Q 12: what function is used to test the missing observation in
data frame
A) missing()
B) NA.miss()
C) na()
D) is.na()
Answers

htt
p

://

itf

ea

1) A 2) D 3) C 4) B 5) B
6) D 7) D 8) B 9) B 10) C
11) D 12) D

Muhammad Imdadullah

Você também pode gostar