Data Science With R Exam Questions: PG Program in Analytics
Data Science With R Exam Questions: PG Program in Analytics
Data Science With R Exam Questions: PG Program in Analytics
Marks
Q1. Write an R program to create a sequence of numbers from 20 [3]
to 50 and find the mean of numbers from 20 to 60 and the
sum of numbers from 51 to 91.
Q2. A student scored 70 marks in English, 95 marks in Science, 80 [5]
marks in Maths and 74 marks in History. Write an R program
to plot a simple bar chart displaying the scores of the given
subjects.
Q3. Write a R program to create a data frame to store the [3]
following details of 5 employees.
Name Gender Age Designation SSN
Anastasia S M 23 Clerk 123-34-
2346
Dima R M 22 Manager 123-44-779
[1,] 1 4 7 10
[2,] 2 5 8 11
[3,] 3 6 9 12
d = data.frame(x1=rnorm(5),
x2=rnorm(5),
x3=rnorm(5))
Q.10 Write an R program to rotate a given matrix 90 degrees [8]
clockwise.
[,1] [,2] [,3]
[1,] 1 4 7
[2,] 2 5 8
[3,] 3 6 9
Q.11 Check for missing values in the ‘mtcars’ data set. [3]
Q.12 Check which attributes are important to determine the mpg of [8]
a car in the ‘mtcars’ data set.
Q.13 Build a simple linear model to predict the mpg of a car in the [8]
‘mtcars’ data set.
Q.14 Build a logistic regression model using the glm function to [8]
know the effect of admission into graduate school. The target
variable, admit/don't admit, is a binary variable
Use the given “binary.csv” dataset
Q.15 Use the given variables from the titanic dataset and build the [5]
decision tree on train data.
Variables from dataset: survived, embarked, sex, sibsp, parch,
fare
Q.16 Create a plot to display the result of decision tree. [5]
Q.17 Create the confusion matrix for the above model. [3]
Q.18 Perform k-means clustering on USArrest dataset. Scale the data [8]
before performing clustering.
Use the below code to load the data
PG Program in Analytics
data("USArrests")
Q.19 Print the cluster number for each observation and cluster size [3]
for the above k-means model.
Q.20 Plot the result of the k-means cluster. [5]