0% found this document useful (0 votes)
12 views8 pages

BA Viva Questions

The document contains a comprehensive set of questions and answers related to R programming and Excel, covering topics such as data analysis, statistical modeling, data structures, and visualization techniques. It includes practical instructions for importing data, performing regression analysis, and utilizing Excel features like Pivot Tables and conditional formatting. The content serves as a guide for individuals looking to enhance their skills in R and Excel for data manipulation and analysis.

Uploaded by

Vandana Das
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)
12 views8 pages

BA Viva Questions

The document contains a comprehensive set of questions and answers related to R programming and Excel, covering topics such as data analysis, statistical modeling, data structures, and visualization techniques. It includes practical instructions for importing data, performing regression analysis, and utilizing Excel features like Pivot Tables and conditional formatting. The content serves as a guide for individuals looking to enhance their skills in R and Excel for data manipulation and analysis.

Uploaded by

Vandana Das
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
You are on page 1/ 8

Viva Questions

1. What is R?
Answer: R is a programming language and software environment used for statistical
computing, data analysis, and graphical representation.

2. What are the key advantages of R?


Answer: Open-source, large community, powerful packages for data analysis, strong
visualization tools, and great for statistical modeling.

3. What is CRAN in R?
Answer: CRAN (Comprehensive R Archive Network) is the official repository where R
packages are stored and shared.

4. How do you install R and RStudio?


Answer:

o Download R from CRAN

o Download RStudio from rstudio.com

o Install R first, then RStudio.

5. What is the difference between R and RStudio?


Answer: R is the core language, and RStudio is an integrated development
environment (IDE) to use R more efficiently.

6. What are R packages and how do you install them?


Answer: Packages are collections of R functions, data, and documentation. Install
using:

CopyEdit

install.packages("package_name")

7–10: Data Import & Syntax

7. How do you import a CSV file into R?


Answer:

CopyEdit

data <- read.csv("file.csv")


8. What function is used to import Excel files in R?
Answer: Use readxl or openxlsx packages.

CopyEdit

library(readxl)

data <- read_excel("file.xlsx")

9. How do you view the structure of a dataset in R?


Answer:

CopyEdit

str(data)

summary(data)

10. What is the assignment operator in R?


Answer: <- is commonly used to assign values. Example:

CopyEdit

x <- 10

11–16: Data Structures

11. What is a vector in R?


Answer: A sequence of elements of the same type.

CopyEdit

v <- c(1, 2, 3)

12. How do matrices differ from arrays in R?


Answer: A matrix is 2D; an array can be multi-dimensional.

13. What is a list in R?


Answer: A list can contain elements of different types.

CopyEdit
lst <- list(name="John", age=25)

14. What is a factor in R and why is it used?


Answer: Factor is used for categorical data (like gender or regions).

15. How do you create a data frame?


Answer:

CopyEdit

df <- data.frame(Name=c("A","B"), Age=c(25, 30))

16. What are attributes of a data frame?


Answer: Rows, columns, column names, row names, and data types.

17–20: Control Flow, Loops, Functions

17. What are conditionals in R?


Answer:

CopyEdit

if (x > 5) print("High") else print("Low")

18. What loop types are available in R?


Answer: for, while, and repeat loops.

19. What is the use of the apply() family?


Answer: For applying functions over matrices, lists, and data frames.
Example: apply(matrix, 1, sum)

20. How do you define a function in R?


Answer:

CopyEdit

my_function <- function(x) {

return(x^2)

}
21–26: Regression Models

21. How do you perform simple linear regression in R?


Answer:

CopyEdit

model <- lm(y ~ x, data = df)

summary(model)

22. What does the summary() of a regression model show?


Answer: Coefficients, R-squared, p-values, and residual statistics.

23. What are confidence and prediction intervals?


Answer:

• Confidence interval predicts the mean value.

• Prediction interval predicts individual values.

24. How do you detect multicollinearity?


Answer: Use Variance Inflation Factor (VIF) from the car package.

CopyEdit

vif(model)

25. What is heteroscedasticity and how do you detect it?


Answer: It's non-constant variance of residuals. Use plot(model) or statistical tests
like Breusch-Pagan.

26. How is multiple linear regression different from simple linear regression?
Answer: Multiple regression includes more than one independent variable.

27–30: Textual Data Analysis

27. What is textual data analysis?


Answer: Analyzing and extracting insights from text data (e.g., tweets, reviews).

28. What are common challenges in textual analysis?


Answer: Noise in data, unstructured format, stopwords, spelling errors, and context
interpretation.
29. What is text mining in R?
Answer: The process of extracting meaningful information from text using tools like
tm, tidytext, or text.

30. What is sentiment analysis and how is it done in R?


Answer: Sentiment analysis detects the emotional tone (positive/negative). Use
packages like syuzhet, textdata, or sentimentr.

31. What are the basic plotting functions in R?


Answer: plot(), hist(), boxplot(), barplot(), pie()

11. What is ggplot2 and how does it differ from base R plotting?
Answer: ggplot2 is an advanced plotting system based on the grammar of graphics. It
allows more control and customization than base R plots.

12. How would you plot a histogram and a boxplot in R?


Answer:

hist(data$Age)

boxplot(data$Age)

14. What is the use of facet_wrap() in ggplot2?


Answer: It creates multiple plots (facets) based on a factor variable, allowing
comparison between groups.

Statistics & Modelling

15. How do you perform linear regression in R?


Answer:

CopyEdit

model <- lm(y ~ x, data = df)

summary(model)

16. What function is used to summarize a model in R?


Answer: summary(model) gives detailed output including coefficients, R-squared, p-
values, etc.

17. How do you test for correlation in R?


Answer:

R
CopyEdit

cor(x, y)

cor.test(x, y)

Miscellaneous

18. What are R packages, and how do you install and load them?
Answer: Packages extend R's functionality.

CopyEdit

install.packages("dplyr")

library(dplyr)

19. How do you write a function in R? Give an example.


Answer:

CopyEdit

add <- function(a, b) {

return(a + b)

20. What is the use of the str() function in R?


Answer: It displays the structure of an R object including its type, size, and
components.

Questions based on Excel


1. What is data cleaning in Excel?
Answer: Data cleaning in Excel involves identifying and correcting errors or
inconsistencies in data, such as removing duplicates, correcting formatting, and filling
in missing values.
2. How can you remove duplicates from a dataset in Excel?
Answer: Select the data → Go to Data tab → Click Remove Duplicates → Choose
columns → Click OK.
3. How do you use the Text to Columns feature in Excel?
Answer: Select the column → Go to Data tab → Click Text to Columns → Choose
Delimited or Fixed width → Set delimiter (e.g., comma, space) → Finish.

4. What is Data Validation in Excel and why is it used?


Answer: Data Validation restricts the type of data entered into a cell. It ensures data
accuracy by allowing only predefined values or ranges.

5. How can you identify missing values in a dataset?


Answer: Use filters, conditional formatting (e.g., highlight cells with ="" or blanks),
or functions like ISBLANK().

Sort, Filter, and Conditional Formatting

6. What is the difference between sorting and filtering?


Answer: Sorting arranges data in a specific order (ascending/descending), while
filtering hides non-relevant data based on conditions.

7. How do you apply conditional formatting to highlight values above a certain


threshold?
Answer: Select the cells → Go to Home > Conditional Formatting > Highlight
Cell Rules > Greater Than → Enter threshold value → Choose formatting style.

8. Can you use formulas in conditional formatting? Give an example.


Answer: Yes.
Example: Use =A2>100 to format cells where values in A2 are greater than 100.

9. How do you filter data using more than one condition?


Answer: Use the Filter dropdown and apply filters on multiple columns, or use
Advanced Filter under the Data tab.

10. How do you create custom sorting in Excel (e.g., sort by days of the week)?
Answer: Go to Sort > Custom List, enter your custom order like “Monday, Tuesday,
...” → Use it for sorting.

Summarisation & Visualisation

11. What is a Pivot Table and what is it used for?


Answer: A Pivot Table summarizes large datasets dynamically by aggregating data
using rows, columns, values, and filters.

12. How do you create a Pivot Chart in Excel?


Answer: First create a Pivot Table → Select it → Go to Insert tab → Choose a chart
type → This chart will be linked to the Pivot Table.
13. Name three chart types used for data visualization in Excel.
Answer: Line Chart, Histogram, and Scatter Plot.

14. How do you insert a histogram in Excel?


Answer: Select data → Go to Insert > Insert Statistic Chart > Histogram.

15. What is a moving average, and how can you calculate it in Excel?
Answer: A moving average smooths out short-term fluctuations.
Go to Insert > Chart > Trendline > Moving Average, or use formulas like
=AVERAGE(A2:A6) in a sliding window.

Statistical Analysis

16. How do you find the correlation between two columns in Excel?
Answer: Use the CORREL(array1, array2) function.

17. How do you create a covariance matrix in Excel?


Answer: Go to Data Analysis Toolpak → Choose Covariance → Select input range
→ Output to a new range.
18. How do you identify outliers in Excel?
Answer: Use:

• Boxplots via charts


• Formulas: =IF(OR(A2>Q3+1.5*IQR, A2<Q1-1.5*IQR),"Outlier","")

• Z-Score: (value - mean) / stdev

Dashboards and Interactivity

19. What elements can be included in an interactive dashboard in Excel?


Answer: Pivot tables, pivot charts, slicers, drop-down lists (data validation),
conditional formatting, and dynamic charts.

20. How do slicers enhance dashboard interactivity in Excel?


Answer: Slicers provide visual filters for PivotTables or PivotCharts, allowing users
to interactively control what data is displayed.

You might also like