BA01 Introduction to Data Analytics and R

WARNING - Clicking on the "SUBMIT ASSIGNMENT" button will submit the

Assignment. Be sure that you have reviewed your answers before clicking it. Attempt all the questions. All questions are compulsory. Each question carries 4 marks. There is No Negative Marking for wrong answer/s.

Please note: There are 25 questions out of which Q.No.21-25 are based on the Case Study.

Subject Code: BA01

Subject Name:

INTRODUCTION TO

DATA ANALYTICS AND R

Component name: TERM

END

Question 1:- What is the difference between a bar chart and histogram?

a)            The vertical bars in histograms have the same height as in a vertical bar chart.                       

b)            Histogram and bar chart both show distribution of categorical variables.                       

c)            A histogram represents the frequency distribution of continuous variables while bar chart shows categoricalvariables.                       

d)            Histogram is used to represent time-series data and bar chart plots continuous variables.                       

Question 2:- Which are the data objects in R?

a)         Vector, dataframe, glm                       

b)         Vector, List, dataframe, matrix                        

c)         Vector, list, dimname                       

d)         dataframe, vector, list, type                       

Question 3:- Which data object in R is used to store and process categorical data? a)           numeric                       

b)         string                        

c)         list                       

d)         factor                       

Question 4:- Type of variable which can take fixed integer values is classified as: a)           flowchart variable                       

b)         discrete variable                       

c)         continuous variable                       

d)         measuring variables                       

Question 5:- What is a data frame in R? Pick the correct one(s): I. A data frame stores data tables; II. Data Frame contains vectors of equal lengths; III. Data frame contains only numeric values a)           I & II                       

b)         I & III                        

c)         II & III                       

d)         I, II, III                       

Question 6:- > k= c(5,4,6,7,8,10) > k <- as.character(k) > class(k) What is the output of class(k) once you

execute the above lines of code?                                                                                                                                   /

  character                          numeric                       

  dataframe                       

  Table                        

Question 7:- > x[(!is.na(x))] What will this line of code do?

  Shows all NA values                       

  Removes NA values                       

  Adds NA wherever values are missing                       

  Edits NA values                       

Question 8:- In dataframe named ‘iris’, I would like to find the unique values of the variable ‘Species’. Which function can I use?

  head(iris)                       

  unique(iris$Species)                       

  mean(iris$Sepal.Length)                          unique(iris$Sepal.Length)                       

Question 9:- > A <- c(5,9.2,3,8.51,NA) > mean(A) What will be the output of mean(A)?

  NA                       

  6.427                       

  Undefined A                       

  Object A not found                       

Question 10:- If there is a very strong correlation between two variables then the correlation coefficient must be:

  any value larger than 1                       

  much smaller than 0, if the correlation is negative                       

  much larger than 0, regardless of whether the correlation is negative or positive                       

  None of these alternatives is correct                       

Question 11:- You would want to report dispersion or spread of the variable called employee salary (in INR) but would like to use the measure that is least affected by outliers. Which measure of dispersion or spread should you include in your report?

  Range                        

  Standard Deviation                       

  Median                       

  Chi square value                       

Question 12:- > x <- c(5, 9, 3, 8.51, 3) > mode(x) What is the output of mode(x)?

  3                       

  8.51                          numeric                          NA                       

Question 13:- I want to remove an object named ‘ab’ from my R workspace. Which function can I use?

  ls(ab)                       

  rm(ab)                       

  ab==NULL                       

  glm(ab)                       

Question 14:- The function that loads an already installed package in R is

  scan()                       

  Data.frame()                          Log10                          library()                       

Question 15:- If we want to compare the durability of carpets (durability is measured in months) corresponding to 3 different types - Premium, Super premium and Regular - then what visualisation plot will be more suited for comparing the performance of carpets across groups?

  Scatter plot                       

  Heatmap                       

  Boxplot                       

  Residual plot                        

Question 16:- The function to draw a boxplot in R is :

  Barplot()                          boxplot()                          plotbox()                       

  plot(box)                       

Question 17:- In dataset named ‘mileage’, there is a variable named ‘mpg’ and its unit is miles per gallon. What kind of variable is it?

  discrete                          categorical                       

  ordinal                       

  Continuous                       

Question 18:- In dataset named ‘mileage’, there is a variable named ‘mpg’ and its unit is miles per gallon. For plotting the distribution of the variable ‘mpg’, which chart will you use?

  Bar chart                       

  Pie chart                       

  Scatter plot                          Histogram                       

Question 19:- For drawing a scatter plot, how many variables are needed? What kind of variable(s) should it be?

  1, continuous variable                       

  2, continuous variables                       

  2, categorical variables                       

  2, factor variables                       

Question 20:- Lists are a special type of vector that can contain elements of different classes. Lists can be explicitly created in R using the function :

a)         listing()                       

b)         matrix()                        

c)         list()                       

d)         vectorlist()                       

Case Study

‘diamonds’ dataset in R has many variables like carat, cut, colour, clarity, depth, price etc.

Question 21:- Read it as a dataframe named ‘Df’. What shall you write in R?

a)         Df <- as.data.frame(diamonds)                       

b)         Df <- as.table(diamonds)                        

c)         df<- data.frame(diamonds)                       

d)         df<- diamonds                       

Question 22:- You want to see the status of all the variables and their data types. Which function can you use? a)           head(Df)                        

b)         tail(Df)                       

c)         str(Df)                       

d)         dim(Df)                       

Question 23:- You want to see the last 10 rows of the dataframe Df. Which function can you use? a)           tail(Df)                       

b)         tail(Df, n=10)                       

c)         tail(10, Df)                       

d)         Df(10)                       

Question 24:- The variable ‘cut’ has many records with values as Premium, Very Good etc. How can you see all the unique values for ‘cut’?

a)         print(cut)                       

b)         View(Df)                       

c)         unique(cut$Df)                       

d)         unique(Df$cut)                       

Question 25:- Print the descriptive summary for the variable ‘price’. Which is the correct answer? a)           View(Df$price)                       

b)         mean(Df$Price)                       

c)         summary(Df$price)                        

d)         sum(Df$price)                       

hihi


Want latest solution of this assignment

Want to order fresh copy of the Sample Template Answers? online or do you need the old solutions for Sample Template, contact our customer support or talk to us to get the answers of it.