Select Page
Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

1. Which of the following code create n samples of size “size” with probability prob from the binomial ?
a) z <- rinom(n,size,prob)
b) z <- rbinom(n,size,prob)
c) z <- binom(n,size,prob)
d) all of the mentioned

Answer: b [Reason:] To use the rbinom() function, you need to define three parameters.

2. Which of the following code create a n item vector of random normal deviates ?
a) x1 <- c(snorm(n))
b) x1 <- c(pnorm(n))
c) x1 <- c(rnorm(n))
d) all of the mentioned

Answer: c [Reason:] rnorm generates random deviates.

3. Which of the following statement can read csv files ?
d) none of the mentioned

Answer: a [Reason:] Each row of the table appears as one line of the file.

4. Which of the following statement read a tab or space delimited file ?

Answer: a [Reason:] read.csv and read.csv2 are identical to read.table except for the defaults.

5. which of the following statement chose those objects meeting a logical criterion ?
a) sub(dataset,logical)
b) subset(dataset,logical)
c) subsetcon(dataset,logical)
d) none of the mentioned

Answer: b [Reason:] R’s subsetting operators are powerful and fast.

6. Which of the following statement is another way to get a subset ?
a) subsetcon(dataset,logical)
b) data.df[data.df=logical].
c) sub(dataset,logical)
d) none of the mentioned

Answer: b [Reason:] subset(data.df,select=variables,logical) get those objects from a data frame that meet a criterion.

7. Which of the following sort a dataframe by the order of the elements in B
a) x[rev(order(x\$B)),].
b) x[ordersort(x\$B),].
c) x[order(x\$B),].
d) all of the mentioned

Answer: a [Reason:] x[rev(order(x\$B)),] sort the dataframe in reverse order.

8. Which of the following is Mac menu command ?
a) browse.workspace
b) browse.works
c) browser.workspace
d) a statistical transformation

Answer: a [Reason:] It is a Mac menu command that creates a window with information about all variables in the workspace.

9. _____ list the variables in the workspace
a) rm(x)
b) rm(list=ls())
c) ls()
d) attach(mat)

Answer: c [Reason:] rm(x) removes x from the workspace.

10. ___________ remove all the variables from the workspace
a) rm(x)
b) rm(list=ls())
c) ls()
d) attach(mat)