0% found this document useful (0 votes)
8 views7 pages

Exit Computing II Model Questions

The document contains a series of model questions related to the R programming language, covering topics such as commands, functions, data structures, and statistical methods. Each question presents multiple-choice answers to test knowledge on R's functionalities and usage. It serves as a study guide for individuals looking to enhance their understanding of R programming.

Uploaded by

tameemerga4
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views7 pages

Exit Computing II Model Questions

The document contains a series of model questions related to the R programming language, covering topics such as commands, functions, data structures, and statistical methods. Each question presents multiple-choice answers to test knowledge on R's functionalities and usage. It serves as a study guide for individuals looking to enhance their understanding of R programming.

Uploaded by

tameemerga4
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Computing II: Model Questions

1. R
A. Is based on S high level programming language
B. It is free and an open source
C. It is similar in many aspect to the commercial software S-PLUS
D. All of the above
2. [Link] is
A. The R built-in memory source
B. The R main page on the web
C. The R ‘GNU S’ environment for statistical computing
D. The R packages
3. Authors of R language are:
A. Robert Gentleman and Richard Brent
B. Ross Ihaka and Richard Brent
C. Ross Thomas and Robert Gentleman
D. Robert Gentleman and Ross Ihaka
4. Which one of the following command can be used to install packages, when you are
connected with internet? Example, installation of urca package.
A. [Link]()
B. [Link]()
C. [Link]()
D. utils:::menuInstallLocal()
E. C and D
5. Which one of the following correctly explains the command “rnorm(n, m, d)”.
A. n random normal deviates with mean m and standard deviation d.
B. n random normal deviates with mean m and variance d.
C. n random normal deviates with mean m and standard deviation square root of d.
D. n random normal deviates with mean d and variance m.
E. A and C.
6. Which one of the following R command plots a scatter plot of waiting data with heading
“Scatter plot of waiting data”?
A. plot(eruptions, main=“Scatter plot of waiting data ”)
B. plot(waiting, title=“Scatter plot of waiting data”)
C. plot(waiting, sub=“Scatter plot of waiting data”)
D. plot(waiting, main=“Scatter plot of waiting data”)
7. Which one of the following are all correctly matched?
A. droot returns cumulative probability, qroot returns quantile, proot returns density and rroot
returns random deviation.
B. droot returns density, qroot returns quantile, proot returns cumulative probability and rroot
returns random generation.
C. proot returns probability mass or density function, droot returns cumulative density
function, qroot returns quartile function, and rroot returns randomly generated observations
from different functions.
D. qroot returns cumulative probability, droot returns quantile, rroot returns density and proot
returns random deviation.
8. To get help on the given function, say hist, we can use the command
A. ?hist B. help(hist) C. help(help) D. help(“hist”) E. A and B
9. ??function is
A. Help function similar to ?function
B. Help function that comes with different alternatives
C. Help function similar to [Link](“function”)
D. Help function similar to [Link]()
E. B and C
10. Which one of the following is NOT correctly matched?
A. tsdiag( ): is an R command that produces a diagnostic plot of a fitted regression
model.
B. predict(AR, 4): Forecasts four observations for about 4 periods ahead from the model
WW. Where WW is a time series model.
C. ndiffs(x, alpha=0.05, test=c("kpss","adf", "pp")): is used to specify the number of
differences needed for the stationarity of time series data named x.
D. L<-lm(DD~1+x1+x2): fits a multiple linear regression model without constant.
11. Which one of the following is not correctly explains the corresponding
A. [Link]() function is used to check missing values in an object.
B. The meaning of greater than sign (the prompt >) on Console window of R is Go ahead or do
something.
C. The function q() is used to keep R not to be closed.
D. 2->X, X=2 and X<-2 are the same and the signs are used as assignment operators.

12. Which one of the following R command can be used for prediction using seasonal (additive
and multiplicative) and non-seasonal exponential smoothing methods.
A. [Link] ( ) C. forecast( )
B. HoltWinters( ) D. estimate( )
13. Object names in R
A. Can start with numbers
B. Can contain strange symbols at the end
C. Are case sensitive
D. All are correct
14. R uses the concatenation function c for
A. Data frames B. Matrices C. Vectors D. Lists
15. What differs data frame from matrix?
A. Elements of columns of data frame and matrices must have the same mode
B. Length of columns may differ in data frame but are equal in matrices
C. Data frame may be a combination of single object, matrices, and vectors like lists.
D. The columns of data frame may be of different mode or data type.
16. Defining the variable V<-c(21, 25, 24, 23, 20, 22, “twenty”). Then, the command mode(V) will
result in
A. Numeric B. Character C. Complex D. Logical
17. Let Z<-3:12. Then the result of Z[-5]; Z[5] will respectively be
A. [1] 3 4 5 6 8 9 10 11 12, [1] 7
B. [1] 7, [1] 3 4 5 6 8 9 10 11 12
C. [1] 3 4 5 6 8 9 10 11 12, [1] 8
D. [1] 8, [1] 3 4 5 6 8 9 10 11 12
18. Let we define the variables IQ = c(110, 95, 140, 89, 102); CS = c(59, 40, 62, 40, 55); WQ = c(2, 4,
5, 1, 3). The command that creates data frame from these variables and named “My_Data” will
be:
A. My_Data<-list(IQ, CS, WQ)
B. My_Data<-c(IQ, CS, WQ)
C. My_Data<-[Link](IQ, CS, WQ)
D. My_Data<-matrix(IQ, CS, WQ)
19. If we want to create a matrix MAT of dimension 3 by 3 from the vector W<-
c(1,2,40,2,3,9,200,4,6000), assuming that the observations are arranged by row. Then what will
be the command that creates matrix MAT, give the transpose of MAT, and provide the inverse
of MAT, respectively.
A. MAT<-c(W, 3,3, byrow=TRUE); transpose(MAT); solve(MAT)
B. MAT<-matrix(W, 3,3, byrow=FALSE); t(MAT); solve(MAT)
C. MAT<-matrix(W, 3, 3, byrow=TRUE); t(MAT); solve(MAT)
D. MAT<-c(W, 3, 3, byrow=TRUE); t(MAT); solve(MAT)
20. We can import data from excel to R by
A. Converting the data to csv format only
B. Possible to import from clipboard
C. Needs to be saved in SPSS format
21. Importing data from other software like SPSS, SAS, MINITAB, and others need a package called
A. distrEx and haven B. foreign and haven C. Formula and haven D. future and haven
22. Reading data from STATA, SPSS, SAS, Epiinfo, and MINITAB can be done using the function,
respectively:
A. [Link], [Link], [Link], [Link], [Link]
B. [Link], [Link], [Link], [Link], [Link]
C. [Link], [Link], [Link], [Link] [Link]
D. [Link], [Link], [Link], [Link] [Link]
23. The built-in function for correlation and standard deviation in R is, respectively
A. correlation(), sd() B. cor(), standv() C. cor(), sd() D. cor(), var
24. If a random variable Y is distributed normally with mean 2 and variance 9. Then, which one of
the following is the R commands that calculates the probability of Y below 2.8 and it’s
standardized format, respectively.
A. pnorm(2.8, 2, 9) and pnorm(0.8/3, 0, 1)
B. pnorm(2.8, 2, 3) and pnorm(0.8/3, 0, 1)
C. pnorm(2.8, 2, 9) and pnorm(0.8/3)
D. pnorm(2.8, 2, 3) and pnorm(0.8/3, 2, 3)
25. Which one of the following is a built-in function for Negative Binomial distribution
A. nbinom
B. binom
C. negative
D. binomial
26. Assume that a fair coin is tossed 20 times. The probability of getting tail in each tosses is 0.5.
Then, what is the R command that will calculate the probability of getting at least 7 tails.
A. 1-pbinom(6, 20, 0.5)
B. pbinom(7, 20, 0.5)
C. 1-dbinom(7, 20, 0.5)
D. 1-pbinom(7, 20, 0.5)
27. Which of the following R command is used as simple random sample selection of size n
elements from N with replacement (considering equal probabilities)
A. srswor(n,N)
B. srswr(n,N)
C. UPsystematic(n, N)
D. None of the above
28. The functions abs and sqrt are used find, respectively.
A. The absence of an observation and square root
B. The absolute value and square root of observation
C. The absolute value and square of observation
D. The exponentiation and square of observation
29. R command for the logarithm of 100 base 10, is written as
A. log(100, 10) B. log(10, 100) C. log(100, 2) D. log100(10)
30. The command that will extract the INCOME column from the EXP data frame is
A. INCOME$ EXP B. EXP$INCOME C. INCOME$GDP D. EXPENDITURE$INCOME
31. Which one of the following command can be used to edit data from Console window
A. Using menu with the procedure edit Data Editor  Specify name of the data
B. Using the command fix(name of the data)
C. Using the command edit(name of the data)
D. All of the above
32. One of the following is not correctly matched
A. rbind(object, object, ...) # combine objects as rows
B. rm(object) # delete an object
C. rank(object) #returns the ranks of the values in a vector object
D. seq() #generates regular sequences of values from complex numbers
33. Given the univariate set of data we can examine its distribution (name vs command)
A. Summary statistics summary()
B. Tukey's five number summaryfivenum()
C. Stem and leaf plotstem()
D. Histogram hist()
E. All
34. Which of the following is correct
A. The R name (root) for geometric distribution is geom
B. The R name (root) for chi-square distribution is chisq
C. The R name (root) for Poisson distribution is pois
D. The R name (root) for Exponential distribution is exp
35. How we use the scan function for data entry? Assuming that we are going to enter the data
“80.02 79.94 79.98 79.97 79.97 80.03 79.95 79.97” as a vector named Y. Then which of
the following is correct?
A. Y<-scan() 80.02 79.94 79.98 79.97 79.97 80.03 79.95 79.97
B. Y<-scan(80.02 79.94 79.98 79.97 79.97 80.03 79.95 79.97)
C. Y<-scan(80.02, 79.94, 79.98, 79.97, 79.97, 80.03, 79.95, 79.97)
D. Y<-scan() 80.02, 79.94, 79.98, 79.97, 79.97, 80.03, 79.95, 79.97
36. One of the following is not correct
A. [Link] performs chi-squared contingency table tests and goodness-of-fit tests.
B. [Link] can be used for testing the null that the proportions (probabilities of success)
in several groups are the same, or that they equal certain given values.
C. [Link] performs one- and two-sample Wilcoxon tests on vectors of data
D. All are correct

37. Among the following, one can be a user defined function for Arithmetic mean ( ̅ = )

A. Name<-function(x) {s<-sum(x); n<-length (x); xb<-s/n; return(xb)}


B. Name<-function(mean) {s<-sum(x); n<-length (x); xb<-s/n; return(xb)}
C. Name<-function(x, n) {s<-sum(x); n<-length (x); xb<-s/n; return(xb)}
D. Name<-function(x) [s<-sum(x); n<-length (x); xb<-s/n; return(xb)]
38. The output for the user defined function: You<- function(name) { x <- paste('Hello', name);
return(x); }; You("Abebe")
A. “Abebe” B. “Hello Abebe” C. “Hello” D. “Abebe Hello”
39. All are types of repetitive execution, except
A. for B. repeat C. ifelse D. while
40. The output for the function, for(i in 1:4) {print(i*i-i)}
A. 0, 2, 6, 12 B. 1, 2, 3, 4 C. 1, 2, 6, 12 D. 0, 2, 4, 6
41. The pairs(x), produces
A. Pairwise scatter plot matrix of the variables defined by the columns of X
B. Time series plot of vectors against its index
C. a scatter plot of y against x
D. Normal score of x against the expected normal order scores
42. _________plots the quantiles of x against those of y to compare their respective
distributions.
A. plot(x, y) B. qqline(x) C. qqnorm(x) D. qqplot(x, y)
43. The command, abline(a,b)
A. Adds straight line y=ax+b, to the plot C. Adds lines to the plot
B. Adds text at x,y point to the plot D. horizontal line (height=y) to the plot
44. We can add sub-titles to our plots below the X-axis in a smaller font using the syntax
A. main B. sub C. xlab D. ylab
45. The R command, par(mfrow=c(2,2)), will
A. Set the graphical region a 2x2 appearing from left to right
B. Set the graphical region a 2x2 appearing from right to left
C. Set the graphical region a 2x2 appearing from first left column to right
D. Set the graphical region a 2x2 appearing from right column to left.
46. Let the linear regression model be defined as: obj<-lm(y~x1+x2+x3+x4), then the syntax
deviance(obj) will produce:
A. Model residuals C. Model residual sum of squares
B. Model fitted values D. Model coefficients
47. R command for ARIMA model, developed from the AirPassengers data can be
A. ar(AP, order=1) C. arma(AP, order=c(1, 1))
B. arima(AP, order=c(1, 1, 1)) D. arima(AP, order=c(1, 1))
48. R function that can be used to plot the decomposition of AirPassengers time series data set in
to it’s observed, trend, seasonal and irregular.
A. plot(decompose(AirPassengers), c(observed, trend, seasonal, random))
B. decompose ( plot (AirPassengers), c(observed, trend, seasonal, random))
C. plot(decompose(AirPassengers))
D. plot(decompose(AirPassengers), c(O, T, S, E))
49.

You might also like