250+ TOP MCQs on Predictive Analytics and Answers

R Programming Language Multiple Choice Questions on “Predictive Analytics”.

1. The IBM _________ analytics appliances combine high-capacity storage for Big Data with a massively-parallel processing platform for high-performance computing.
a) Watson
b) Netezza
c) InfoSight
d) LityxEQ

Answer: a
Clarification: IBM Watson is a system based on cognitive computing. With the addition of Revolution R Enterprise for IBM Netezza, you can use the power of the R language to build predictive models on Big Data.

2. ______ is an integrated hosted analytics platform for marketing insights, predictive models, and marketing optimization”
a) LityxEQ
b) WatSon
c) LityxIQ
d) InfoSight

Answer: c
Clarification: LityxIQ allows marketers to automate the loading and managing multiple data sources, automatically build and manage predictive models, and optimize marketing budget and media decisions.

3. ________ is rapidly being adopted for computing descriptive and query types of analytics on Big data.
a) EDR
b) Hadoop
c) Azure
d) InfoSight

Answer: b
Clarification: However, it has a reputation for not being a suitable environment for high performance complex iterative algorithms such as logistic regression, generalized linear models, and decision trees.

4. _________ involves predicting a response with meaningful magnitude, such as quantity sold, stock price, or return on investment.
a) Regression
b) Summarization
c) Clustering
d) Classification

Answer: a
Clarification: Regression and classification are two common types predictive models.

5. Which of the following involves predicting a categorical response?
a) Regression
b) Summarization
c) Clustering
d) Classification

Answer: d
Clarification: Classification techniques are widely used in data mining to classify data.

6. Which of the following contains pre-built predictive tools?
a) alteryx
b) fossilx
c) paleoTS
d) ssas

Answer: a
Clarification: Alteryx Analytics, with deep integration of the R statistics and predictive language, offers a way to bridge these two worlds of ease of use and sophisticated predictive analytics.

7. __________ is proprietary tool for predictive analytics.
a) R
b) SAS
c) SSAS
d) EDR

Answer: b
Clarification: SAS (Statistical Analysis System) is a software suite developed by SAS Institute for advanced analytics.

8. Which of the following is preferred for text analytics?
a) R
b) Python
c) S
d) EDR

Answer: b
Clarification: pandas is an open source, BSD-licensed library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming.

9. ______ is simplest class of analytics.
a) Descriptive
b) Predictive
c) Prescriptive
d) Summarization

Answer: a
Clarification: Descriptive is the simplest class of analytics. Predictive analytics can only forecast what might happen in the future because all predictive analytics are probabilistic in nature.

10._________ is a JavaScript charting library and feature-rich API set that lets you build interactive Flash or HTML5 charts.
a) InstantAtlas
b) Alterian
c) ZingChart
d) paleoTS

Answer: c
Clarification: ZingChart lets you create HTML5 Canvas charts and more.

250+ TOP MCQs on Install and Configure and Answers

R Programming Language Multiple Choice Questions on “Install and Configure”.

1. Which language is best for the statistical environment?
a) C
b) R
c) Java
d) Python

Answer: b
Clarification: R is a popular programming language and environment for statistical computing, graphics and also predictive analysis. Dundas BI integrates with an existing R system at the data cube level via many transforms which you can use to perform data generation or data processing.

2. In order to use the R-related functionality in Dundas BI, you must have access to an existing _________
a) Console
b) Terminal
c) Packages
d) R server

Answer: d
Clarification: In order to use the R-related functionality in Dundas BI, we must have access to an existing R server. There are configuration settings in Dundas BI that allow administrators to specify the details for connecting to the external R server.

3. The open source _________ software is available for Unix, Linux, and Windows platforms.
a) Rserve
b) BServe
c) CServe
d) Dserve

Answer: a
Clarification: The open source Rserve (Binary R Server) software is available for Unix, Linux, and Windows platforms. However, due to limitations with the Windows version, it is not recommended for use outside of evaluation purposes.

4. Modification in Dundas BI is done ______________
a) Directly
b) Indirectly
c) Need access to Server
d) Not known

Answer: a
Clarification: We can view or modify configuration settings in Dundas BI through an administration screen, so there’s no need to access the Dundas BI server directly.

5. R has many functions regarding ________________
a) Statistics, Biotechnology
b) Probability, Microbiology
c) Distributions, Physics
d) Statistics, Probability, Distributions

Answer: d
Clarification: R has many functions for all types of mathematical objects. For example, Statistics, Probability, Distributions like Multivariate, Continuous, Simple, Discrete etc.

6. ___________ hosts many add-on packages that can be used to extend the functionality of R.
a) CRAN
b) GNU
c) R studio
d) 450

Answer: a
Clarification: The primary R system is available from the Comprehensive R Archive Network, also known as CRAN. CRAN also hosts many add-on packages that can be used to extend the functionality of R.

7. Which function is used to automatically vectorize?
a) lapply()
b) kapply()
c) mapply()
d) happly()

Answer: c
Clarification: The mapply() function can be used to automatically “vectorize” a function. What this means is that it can be used to take a function that typically only takes single arguments and create a new function that can take vector arguments.

8. Which is simpler for statistical programming?
a) C
b) Java
c) R
d) No language

Answer: c
Clarification: R (www.r-project.org) is a commonly used free Statistics software. R allows you to carry out statistical analyses in an interactive mode, as well as allowing simple programming.

9. A _______________ is a variable that holds one value at a time.
a) Scalar variable
b) Duplex
c) High
d) Vector

Answer: a
Clarification: A scalar variable was a variable which holds one value at a time. It is a single component which assumes a range of number or string values. A scalar value is associated with every point in space.

250+ TOP MCQs on Subsetting and Answers

R Programming Questions and Answers for experienced focuses on “Subsetting”.

1. Which of the following extracts first element from the following R list?

 > x <- list(foo = 1:4, bar = 0.6)

a) x[[1]]
b) x[1]
c) x[[0]]
d) x[0]

Answer: a
Clarification: The [[ operator can also use named indices so that you don’t have to remember the exact ordering of every element of the list.

2. Point out the correct statement?
a) You can also use the $ operator to extract elements by name
b) $ operator can be used with computed indices
c) The [[ operator can only be used with literal names
d) $ operator semantics are similar to that of [[

Answer: a
Clarification: You don’t need the quotes when you use the $ operator.

3. What will be the output of the following R code?

> x <- list(foo = 1:4, bar = 0.6, baz = "hello")
> name <- "foo"
> x$name

a) 1
b) 2
c) 3
d) NULL

Answer: d
Clarification: Element “name” doesn’t exist.

4. What will be the output of the following R code?

> x <- list(foo = 1:4, bar = 0.6, baz = "hello")
> name <- "foo"
> x[[name]]

a) 1 2 3 4
b) 0 1 2 3
c) 1 2 3 4 5
d) All of the mentioned

Answer: a
Clarification: One thing that differentiates the [[ operator from the $ is that the [[ operator can be used with computed indices.

5. What will be the output of the following R code?

> x <- list(a = list(10, 12, 14), b = c(3.14, 2.81))
> x[[c(1, 3)]]

a) 13
b) 14
c) 15
d) 18

Answer: b
Clarification: The [[ operator can take an integer sequence if you want to extract a nested element of a list.

6. What will be the output of the following R code?

> x <- list(aardvark = 1:5)
> x$a

a) 1 2 3 4 5
b) 2 3 5
c) 1 3 3 5
d) 1 2 3

Answer: a
Clarification: Partial matching of names is allowed with [[ and $.

7. Which of the following code extracts 1st element of the 2nd element?

 > x <- list(a = list(10, 12, 14), b = c(3.14, 2.81))

a) x[[c(2, 1)]]
b) x[[c(1, 2)]]
c) x[[c(2, 1,1)]]
d) x[[(2, 2,1)]]

Answer: a
Clarification: [ operator always returns an object of the same class as the original.

8. What will be the output of the following R code?

> x <- list(aardvark = 1:5)
> x[["a", exact = FALSE]]

a) 1 2 3 4 5
b) 2 3 5
c) 1 3 3 5
d) 1 2 3

Answer: a
Clarification: This is often very useful during interactive work if the object you’re working with has very long element names.

9. What will be the output of the following R code?

> x <- c(1, 2, NA, 4, NA, 5)
> bad <- is.na(x)
> print(bad)

a) FALSE FALSE FALSE FALSE TRUE FALSE
b) FALSE TRUE TRUE FALSE TRUE FALSE
c) FALSE FALSE TRUE FALSE TRUE FALSE
d) FALSE TRUE TRUE TRUE TRUE FALSE

Answer: c
Clarification: A common task in data analysis is removing missing values (NAs).

250+ TOP MCQs on Dates and Times and Answers

R Programming Language Multiple Choice Questions on “Dates and Times”.

1. _________ is an indication that a fatal problem has occurred and execution of the function stops.
a) message
b) error
c) warning
d) message & warning

Answer: b
Clarification: Errors are produced by the stop() function.

2. Point out the correct statement?
a) R has a number of ways to indicate to you that something’s not right
b) Executing any function in R may result in the condition
c) “condition” is a generic concept for indicating that something unexpected has occurred
d) All of the mentioned

Answer: d
Clarification: Programmers can create their own custom conditions if they want.

3. What would be the value of following R expression?

a) Warning in log(-1): NaNs produced
b) 1
c) Null
d) 0

Answer: a
Clarification: This warning lets you know that taking the log of a negative number results in a NaN value because you can’t take the log of negative numbers.

4. Warnings are generated by the _________ function.
a) warning()
b) error()
c) run()
d) message()

Answer: a
Clarification: warning is an indication that something is wrong but not necessarily fatal; execution of the function continues.

5. Point out the correct statement?
a) POSIX represents a portable operating system interface, primarily for UNIX systems
b) There are different levels of indication that can be used, ranging from mere notification to fatal error
c) The default input format for POSIX dates consists of the month, followed by the year and day, separated by slashes or dashes
d) R don’t have any way to indicate to you that something’s not right

Answer: a
Clarification: Dates stored in the POSIX format are date/time values (like dates with the chron library), but also allow modification of time zones.

6. What will be the output of the following R code?

> printmessage <- function(x) {
+ if(x > 0)
+         print("x is greater than zero")
+ else
+         print("x is less than or equal to zero")
+ invisible(x)
+ }
> printmessage(1)

a) Error
b) Warning
c) Messages
d) 0

Answer: a
Clarification: The function seems to work fine. No errors, warnings, or messages.

7. To get the current date, the _______ function will return a Date object which can be converted to a different class if necessary.
a) Sys.Time
b) Sys.Date
c) Sys.DateTime
d) DateTime

Answer: b
Clarification: The POSIXlt class stores date/time values as a list of components (hour, min, sec, mon, etc.) making it easy to extract these parts.

8. What will be the output of the following R code?

> printmessage <- function(x) {
+ if(x > 0)
+         print("x is greater than zero")
+ else
+         print("x is less than or equal to zero")
+ invisible(x)
+ }
> printmessage(NA)

a) Error
b) Warning
c) Messages
d) Null

Answer: a
Clarification: You can’t do that test if x is a NA or NaN value.

250+ TOP MCQs on Exploratory Data Analysis and Answers

R Programming Language Multiple Choice Questions on “Exploratory Data Analysis”.

1. Which of the following is a principle of analytic graphics?
a) Don’t plot more than two variables at at time
b) Make judicious use of color in your scatterplots
c) Show box plots (univariate summaries)
d) Show causality, mechanism, explanation

Answer: d
Clarification: Only do what your tools allow you to do.

2. What is the role of exploratory graphs in data analysis?
a) They are made for formal presentations
b) They are typically made very quickly
c) Axes, legends, and other details are clean and exactly detailed
d) They are used in place of formal modeling

Answer: b
Clarification: EDA is used to summarize main characteristic of data.

3. Which of the following is true about the base plotting system?
a) Margins and spacings are adjusted automatically depending on the type of plot and the data
b) Plots are typically created with a single function call
c) Plots are created and annotated with separate functions
d) The system is most useful for conditioning plots

Answer: c
Clarification: Functions like ‘plot’ or ‘hist’ typically create the plot on the graphics device and functions like ‘lines’, ‘text’, or ‘points’ will annotate or add data
to the plot.

4. Which of the following is an example of a valid graphics device in R?
a) A socket connection
b) A Microsoft Word document
c) A PDF file
d) A file folder

Answer: c
Clarification: PNG file is also valid graphics device.

5. Which of the following is an example of a vector graphics device in R?
a) JPEG
b) PNG
c) GIF
d) SVG

Answer: d
Clarification: SVG stands for scalable vector graphics.

6. Bitmapped file formats can be most useful for ____________
a) Plots that may need to be resized
b) Plots that require animation or interactivity
c) Plots that are not scaled to a specific resolution
d) Scatterplots with many many points

Answer: d
Clarification: Scatterplots would be used frequently for particular dimension.

7. Which of the following functions is typically used to add elements to a plot in the base graphics system?
a) lines()
b) hist()
c) plot()
d) boxplot()

Answer: d
Clarification: text() also can be used to add elements to a plot. boxplot() used to add elements to a plot in the base graphics system.

8. Which function opens the screen graphics device for the Mac?
a) bitmap()
b) quartz()
c) pdf()
d) png()

Answer: b
Clarification: quartz starts a graphics device driver for the Mac.

9. What does the ‘pch’ option to par() control?
a) the size of the plotting symbol in a scatterplot
b) the line width in the base graphics system
c) the orientation of the axis labels on the plot
d) the plotting symbol/character in the base graphics system

Answer: d
Clarification: R makes it easy to combine multiple plots into one overall graph, using either the par ( ) or layout( ) function.

10. If I want to save a plot to a PDF file, which of the following is a correct way of doing that?
a) Construct the plot on the screen device and then copy it to a PDF file with dev.copy2pdf()
b) Construct the plot on the PNG device with png(), then copy it to a PDF with dev.copy2pdf()
c) Open the PostScript device with postscript(), construct the plot, then close the device with dev.off()
d) Open the screen device with quartz(), construct the plot, and then close the device with dev.off()

Answer: a
Clarification: With the par( ) function, you can include the option mfrow=c(nrows, ncols) to create a matrix of nrows x ncols plots that are filled in by row.

250+ TOP MCQs on Distribution and Answers

R Programming Language Multiple Choice Questions on “Distribution ”.

1. The _______ and ________ of a discrete random variable is easy to compute at the console.
a) Mean, Variance
b) Variance, Packages
c) Packages, Functions
d) Median, Mode

Answer: a
Clarification: The mean and variance of a discrete random variable are easy to compute at the console. To calculate the mean µ, we need to multiply the corresponding values of x and f and add them.

2. Which of the following simple the square root of σ square?
a) Variance
b) Standard deviation
c) Mean
d) Median

Answer: b
Clarification: Standard deviation is the measure of dispersion of a set of data from its mean. The standard deviation σ is simply the square root of σ square.

3. The abbreviation of Cumulative Distributive Function is ________
a) CDFN
b) CMDF
c) CMD
d) CDF

Answer: d
Clarification: A cumulative distributive function P(x) is the probability of getting some value less than a certain value x. If p(x) will be the density function for a probability distribution, then that will be the cumulative distributive function P(x) is calculated as the integral of p(x) over the interval −∞ to x.

4. Which function is used to simulate discrete uniform random variables?
a) Sample
b) Simple
c) Function
d) Variance

Answer: a
Clarification: One can choose an integer at random with the sample function. The general syntax of the simulation of the discrete uniform random variable is a sample (x, size, replace = TRUE).

5. The binomial distribution is based on _______ trial.
a) Einstein
b) Bernoulli
c) Bohr
d) Kepler

Answer: b
Clarification: The binomial distribution is the distribution based on the Bernoulli trial, which is a random experiment in which there are only two possible outcomes: success (S) and failure (F).

6. The corresponding R function for the PMF is __________
a) Trinom
b) Dbinorm
c) Dbinom
d) Fnorm

Answer: c
Clarification: dnorm is the height of the density of a normal curve while dbinom returns the probability of an outcome of a binomial distribution.

7. The corresponding R function for the CDF is __________
a) Dbinom
b) Pbinom
c) Cbinorm
d) Hbinorm

Answer: b
Clarification: The function pbinom is very useful for summing consecutive binomial probabilities. The pbinom function returns the probability that the value of a variable that follows the binomial distribution.

8. Random variables defined via the _______ package.
a) Distri
b) Diestr
c) Distr
d) Diftr

Answer: c
Clarification: Random variables defined via the distr package may be plotted, which will return graphs of the PMF, CDF, and quantile function.

9. MGF means _____________
a) Moment Generating Formulas
b) Movement Generating Formulas
c) Moment Generating Functions
d) Moment Graphic Functions

Answer: c
Clarification: The moment generating function, if it exists in a neighbourhood of zero, determines a probability distribution uniquely.

10. The empirical cumulative distribution function can be called as __________
a) EMCDF
b) EDFC
c) ECDF
d) EGDF

Answer: c
Clarification: The empirical cumulative distribution function is the probability distribution that places into the probability mass. ECDF refers to the empirical cumulative distribution function.