FYUG Even Semester Exam, 2025 STATISTICS (2nd Semester) Course No.: STASEC-151

Paper Name: Statistical Data Analysis Using R

Course No: STASEC-151

Year: 2025

Subject: Statistics (Skill Enhancement Course)


UNIT-I

Question 1 [1 x 3 = 3]

Question 2(a) [2]

R-code for min and max of: 2, 4, 7, 9, 5, 1, 15, 20

data <- c(2, 4, 7, 9, 5, 1, 15, 20)
min_val <- min(data)
max_val <- max(data)

Question 3(b) [5]

Define R. Mention three advantages and disadvantages.

Definition: R is a programming language and free software environment designed specifically for statistical computing and graphics.

Advantages:

  1. Open-source and free to use.
  2. Strong graphical capabilities for data visualization.
  3. Large community support and over 15,000+ packages.

Disadvantages:

  1. High memory consumption as it stores all objects in RAM.
  2. Steeper learning curve compared to some other tools.
  3. Slower execution speed for some complex computations compared to C++ or Python.

UNIT-II

Question 4 [1 x 3 = 3]

Question 6(b) [5]

How to draw various diagrams in R:

UNIT-III

Question 7(d) [1]

R-code to compute square root of 29:

sqrt(29)

Question 8(a) [2]

Relationship between mean, median, and mode:

Question 9(b) [5]

R-code for mean, median, variance, and SD of: 31, 27, 29, 45, 27, 19, 25

x <- c(31, 27, 29, 45, 27, 19, 25)
mean_val <- mean(x)
median_val <- median(x)
var_val <- var(x)
sd_val <- sd(x)

UNIT-IV

Question 10 [1 x 3 = 3]

Question 11(a) [2]

Note on Kurtosis:

Kurtosis measures the "peakedness" of a distribution relative to a normal distribution.

  • Leptokurtic: Sharply peaked with heavy tails.
  • Mesokurtic: Normal distribution.
  • Platykurtic: Flat-topped with thin tails.

Question 12(b) [5]

R-code for Spearman's rank correlation:

X <- c(10, 15, 17, 21, 37, 41, 45)
Y <- c(9, 12, 21, 11, 17, 23, 41)
cor(X, Y, method = "spearman")

UNIT-V

Question 13 [1 x 3 = 3]

  • (a) R²: The coefficient of determination, representing the proportion of variance in the dependent variable predictable from the independent variable.
  • (c) Polynomial degree 2: model <- lm(y ~ poly(x, 2)).
  • (d) summary() command: It provides a comprehensive statistical summary of an object, such as coefficients and p-values of a regression model.

Question 15(a) [5]

Simple Linear Regression Equation and R-code:

Equation: Y = β₀ + β₁X + ε

R-code for provided data:

matches <- 1:10
runs <- c(7, 11, 23, 27, 31, 45, 55, 67, 69, 71)
fit <- lm(runs ~ matches)
summary(fit)