0% found this document useful (0 votes)
85 views

r Programming Cat Questions

Good night
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views

r Programming Cat Questions

Good night
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

~~ ~ ~,.

-~·--~
I

-[ Reg.
No.
t!! I
1AI RAM ENI GINto EERING COLLEGE 6J
(1 An AutonomOUS lnstltutfon Amllated Anna Unive(Sity
Acc:redied by NBA 11C1#AAC 'A+'I BIS£OMS ISO 21001
Sal Leo Nagar, West Tambaram, Chennal • 600114
: 2018 n ~I
&Approved by AJCTE, New Dell/ ............... ..

4. www.salram.edu.ln il l
:2015 Cet1flJd 8fld NIRFtried ilstMxl
• I

'~
CONTINUOUS ASSESSMENT TEST - I
I Question Paper Code I 24NUS1F204

l Analysis using R Programming with Laboratory


Course Code - Name : 20IT PW5 01- Statistica
Degree & Program : BE - IT
Year / Semester : III/ V
Date of Exam : 21.08.2024
Max. Marks : 50
Duration : 1 ½ Hours

Answer ALL Questions


K-
co
PAR T-A (tOx 1 == 10 Marks) Level
K2 COl
k the data type of vector.
1 In R using the function, _ _ _ one can chec

a) typeofO b) castofO c) functionO d) C() K2 COl


for the R environment?
2 Which of the following is the default prompt

a)> b) >> c) < d) << K2 COI


3 What is the output of the following snippet?
fun1 = function(fruit = "Apple", veg= "Car
rot")
{
paste(fruit, veg)
)
funl(veg = "Beans", fruit="Banana")

a) Banana Beans b) Beans Banana c) Apple Carrot d) Error


K2 COl
4 What is the meaning of"<-"?

a) Functions b) Loops c) Addition d) Assignmentlooping. Kl COl


5 R has _ _ _ statements that provide explicit
K2 CO2
a) 2 b) 3 c) ·4 d) 5 datasets in R?
6 How do you create a QQ plot com pa~ g two
2)
a) qqnorm(datal, data2) b) qqplot(datal, data
2) K2 CO2
c) qqline(datal, data2) d) qq(datal, data
in R?
7 Which function is used to create a histogram

a) histO b) boxplotO c) barplotQ d) plotO

; K6 - Create Page 1 of3


ly; K4-Analyze; KS -Evaluate
Kl __ Remember; K2 - Understand; K3 -App
~ r W " = " ~ • • _,._. --~...---- -•- Jcair' . . . . . . . .-
-- --
11

8 How do you specify the number of bins in a histogr~rn in R? K2 CO2, . I


a) h~st(data, bins=IO) b) hist(data, breaks=l0)
c) hist(data, n_bins= I0) d) hist(data, segmertts=10)
9 What argument is used to add a title to a histogram in R? K2 CO2
a) title b) main c) heading d) label
10 , How can you add color to the bars of a histogram in R? K2 CO2
a) hist(data, color="blue") b) hist(data, col="blue") I
c) hist(data, fill="blue") d) hist(data, barcolor-"blue")
\
PART- B (10 x 2=20Ma rks) K-
Level
co
11 Write different types of line drawing functions. Kl COl
12 Write an R Program to Find median and mode of following numbers
K2 COl
12,13,l l,10,9,l l,7,l l,10,l5,l 6,l l
13 Give the difference between list and factor. K2 CO1
14 Differentiate between Vector, List, Matrix and Dataframe.
K2 cot
15 What is Conditional Indexing and how can it be used with Data Frames? K2 COl
16 \\7hat is Combinatorics? Kl CO2
17 Illustrate the five different components of the box plot. K2 CO2
18 Draw a Q-Q Plot using R for normal distribution. K2 CO2
19 Write an R Program to generate Random numbers. K2 CO2
20 sampleO, prodO, combnO fu11:ctions in R is used in sampling process give Kl CO2
examples

PART-C (2 x 10 = 20 Marks) Mark


Split up K-Level co 1
I
21. a) . What is Recursion? What is Recursive Function in R? Find ·sum of 10 K2 COi ,\
Series 12+22+32+.....+n2 using the Recursive function. 11

(Or)
b) i) Consider A=matrix(c(2, 0, 1,3 ), nco1=2) and B=matrix(c(S,2,4,-1), s K2 COl ~
ncol==2). 'l
a) Find A+ B
b) Find A-B
ii) Find the transpose of A and B using R 5 K2 COI

Kl - Remember; K2- Understand; K3 -Apply; K4 - Analyze; K5- Evaluate; K6-Create


Page 2 of3
,~

.~ 22. a) i) Explain Normal Distribution its properties and applications. 5 K2 CO2


ii) Given that p(x 2)=9p(x-4) + 90 p(x=46) for a Poisson variate X.
5 K3. CO2
Find: i. P(x<2) ii. p(x>4) iii. p(~)
(Or)
b) i) Write about scatter plot and histograms with examples? Explain its 5 CO2
K2
importance?
5 K3 CO2 1
ii) How to plot multiple curves in the same graph? Explain with an
example?
j
,I
Course Outcomes

COl Reiterate a11 the basic programming constructs available in R programming (K2)
.Demonstrate the basics of probability, distributions and graphical representations such
CO2 as \
Histograms, Q-Plots and Box plots (K3)
I
I
/ COJ I Solve problems using the Group Statistics and Sample Tests(K.3)
Interpret various regression and correlation techniques for data analytics(K3)-
\
C04
cos Illustrate different graphical representation and variance tests in data analytics.(YJ)

C06 I Demonstrate Polynomial Regression and Two-Way ANOVA With Replication (K3)

Distribution of COs (Percentage wise)

1
CONo. COl CO2 C03 C04 cos \ C06 I

I
! % 50 50 - -- -- \ - \

. K -Analyze; KS-Evaluate; K6-Create Page 3 ofJ


Kl -Remember; K2- Understand; K3 -App1Y, 4
-------- -------- -- I

~
I ~e:.- I I I I I I I I I I I I J
~~_!~i!~!!t~!Sb~L!~
trild

kad8d byMBA nl M4C 'A+ 'I &OMS ISO Pf001 :2018 n1 ~: 2015 Cdtd n, MRf irslllaln 61
Sal Leo Hagar, Wtst Tambaram, Chtnnal - 600 044. www.ulram.edu.ln ~;...._.=.;.J

CONTINUOUS ASSESSMENT TEST - II


I Question Paper Code I 24NU52F202 I
Statistical Tables- z table, t table, Spearman's Correlation tables are allowed
Course Code - Name : 20ITPW501 / Statistical Analysis using R Program with Laboratory

Degree & Program : B. Tech/ Information Technology

DateofExam : 03/10/2024 Year / Semester :IIIN


I
Duration : 1 ½ Hours Max. Marks : 50

Answer ALL Questions


K-
PART-A (tOx 1 = 10 Marks) co
Level

1 What does a boxplot display? Kl C03

A) Mean and mode B) Mewan, quartiles, and outliers


C) Frequency distribution D) Variance only
2 Which of the following describes a two-sample T Test? Kl C03

A) Tests for the mean of one group


B) Compares the means of two independent groups
C) Compares the medians of two related groups
D) Analyzes the variance within one group
3 What is the primary purpose of using parallel boxplots? Kl C03

A) To show frequency distributions B) To compare distributions of multiple groups


C) To display categorical data D) To summarize a single dataset
Kl C03
4 ln a bar plot, what do the heights of the bars represent?
A) The mode B) The median
C) The frequency or count of each category D) The variance
Kl C03
5 What type of chart is used to display the distribution of a dataset by showing
frequency counts in bins?
A) Pie Chart B) Histogram C) Bar Plot D) Dot Chart
C) The outliers D) The total number of data points
When interpreting a Pearson correlation coefficient of (r = -0.8), what does this Kl C04
6

Page 1 of 4
Kl - Remember; K2- Unders~nd; K3 -Apply; K4 -Analyze; K5 - Evaluate; K6 - Create
- .-
-- ----
'
i
indicate?
A) A strong negative linear relationship. B) No linear relationship.
C) A weak negative linear relationship. D) A strong positive linear relation
ship.
7 What does the slope coefficient in a simple linear regression indicate? Kl C04
A) The predicted value when (x = 0).
B) The rate of change in (y) for a one-unit change in (x).
C) The total variance explained by the model.
D) The correlation between (x) and (y).
8 Which of the following is a key assumption of Pearson correlation? '-

ll
Kl 'CO4
A) The variables are nominal. B) The relationship between variables is linear.
C) There are outliers in the data. D) The sample size is small.
9 Wh~ch of the following is a purpose of a prediction interval in linear regress
I
ion? Kl CO4
/
.A) To estimate the slope of the regression line.
/ B) To provide a range where a new observation is likely to fall.
, C) To measure the correlation between two variables.
'., D) To
determine the significance of the intercept.
l O What is the difference between prediction intervals and confidence
intervals in Kl C04
regression?
A) Prediction intervals are wider because they account for individual variatio
n.
B) Confidence intervals are narrower because they ignore individual data
points.
C) Prediction intervals are always more accurate than confidence interva
ls.
D) Confidence intervals provide a range for individual observations.

PART -B (10 x 2 =20Marks) K-


Level
co
--
11 Compare and contrast frequency and relative frequency.
K2 CO3
12 How will you construct a pie chart using R.
Kl CO3

13 Which test is used for comparing two treatments which falls in normal
distribution Kl CO3
14 Define Quartiles
Kl CO3
15 Define Wilcoxon signed rank test?
16 What is Correlation and How can it be used in Statistical Analysis?
Kl CO3
~
Kl C04

17 Give the Mathematical Formula for Kendall Tau with brief explana
tion about Kl CO4
Concordance and Discordance pairs I
Kl _ Remember; K2 - Understand; K3 - Apply; K4 - A n a l ~ : • Page 2 of 4
; K6- Create

.,
18 What is Spearman rho used for? Kl CO4

19 List the four conditions for regression? Kl CO4

20 What is prediction confidence? Kl CO4

PART-C (2 x 10 = 20 Marks) Mark K-


co
Split up Level
21. a) a) Write R CODE to create data table and draw a pie chart for the 05 K3 CO3
following data
Section I, II, Ill , IV, V
No. of workers 220,370, 190, 70,250
c~
b) What is a parallel box plot? Explain the importance ofboxplot with 05 K2 CO3

I .
examples?
(Or) r~
·)

b) The table below shows the hours of relief provided by two analgesic 10 K3 CO3
drugs in 12 patients suffering from arthritis. Is there any evidence that
one drug provides longer relief than the other?

Case Drug A DrugB Case DrugA DrugB


1 2.0 3.5 7 14.9 16.7 ., I
...
')
3.6 5.7 8 6.6 6.0 I
3 2.6 2.9 9 2.3 3.8
4 2.6 2.4 10 2.0 4.0
5 7.3 ,9.9 11 6.8 9.1
6 3.4 tr' 3.3 12 8.5 20.9

I
22. a) Implement a Linear Regression for GDP vs
..
4wheeler_passenger_vehicle_sale. Also predict the
4wheelff..J,assenger_vehicle_sale in the year 2023 if GDP is 7.5
...
year GDP 4wheeler_passenger_vehicle_sale
(in lakhs)
2017 6.2 26.3
2018 6.5 26.65
2019 5.48 25.03
2020 6.54 26.01
2021 7.18 27.9
2022 7.93 30.47 10 K3 CO4

Kl - Remember; K2 - Understand; K3 - Apply; K4 -Analyze; KS - Evaluate; K6 - Create Page 3 of 4


(Or)
b) What is a correlation test in statistics? Explain in detail how
correlation
tests work and types of correlation tests with appropriate R examp 10 K2 C04
les.

Course Outcomes
Reiterate all the basic programming constructs available in R progra
cot mming (K.2)
Demonstrate the basics of probability, distnoutions and graphical representations such
as
CO2 Histograms, Q-Plots and Box plots (K3) ..
CO3 Solve problems using the Group Statistics and Sample Tests(K3)

CO4 Interpret various regression and correlation techniques for data


analytics(K3)
cos Illustrate different graphical representation and variance tests in
data analytics.(K3)
.;. CO6 Demonstrate Polynomial Regression and Two-Way ANOVA With
Replication (K3)

Distribution of COs (Percentage wise)


CO No.
-
cot CO2 CO3 CO4 cos CO6
'
: o¼·
··- ~ ..0 ..~- . '.,.. ----
,. -- 50 50 - -

. K2 _ Understand; K3 - Apply; K4 - Analyze; KS - Evaluate; K6 Page 4 of 4


Kl -Reme mher, - Create
[~e:,· \4_\ t I~ Isl~[ 2-IJ~I SI J J G \ _ l
~Al RAM ENGINE
I-
ERING COLLEGE t!'Ji
An Auh>nomous lnstlMIOn lo Anna UnNet3ity &Approved by AICTE, New Do/hi
Acetded by NBA and NMC 'A+'I 8ISrfOMS ISO 21001 :2018 and 9001 :2015 Ce,tt,ed alW1 NIRF med m/MJn
Sal Leo Nagar, West Tambaram, Chennai • 600 044. www.salram.edu.in
u
CONTINUOUS ASSESSMENT TEST - III

Question Paper Code I 24NU53F202

Course Code - Name 20ITPW501- - Statistical Analysis using R Programming with Laboratory

Degree & Program : B. Tech, Information Techno_logy

Date of Exam : l 8/l 1/2024 Year / Semester : 1ll/V

• Duration : 1 ½ Hours Max. Marks : 50

Usage of Statistical Tables is allowed


Answer ALL Questions
K- co
PART - A (t0x 1 ;;:: 10 Marks) Level
In a One-Way ANOVA, what does the null hypothesis state? Kl cos
A) All group means are equal
8) At least one group mean is different
C) The variances of the groups are equal
D) The sample sizes are equal
'2 To conduct a One-Way ANOV A and to find a p-value of 0.03. What does this imply? Kl cos ...
_-.:,

A) There is no significant difference between the group means


B) At least one group mean is significantly different at the 0.05 level
C) The data is not normally distributed
D) The sample sizes are too small
3 Which of the following assumptions must be met for a One-Way ANOV A to be valid? Kl cos
A) The data must be normally distributed
8) The groups must have equal sample sizes
C) The groups must have equal variances
D) Both A and C
4 What is the primary purpose of Bartlett's Test? Kl cos
A) To compare means across groups
B) To test for equal variances ~ong groups
C) To assess normality of data
D) To analyze correlation between variables
5 To perform Bartlett's Test and to obtain a p-value of 0.07. What does this indicate? Kl cos
A) The variances are significantly different
B) The variances are not significantly different al the 0.05 level
C) The sample sizes are too small
D) The data is normally distributed
6 What is polynomial regression? Kl C06
A) A type of regression model that involves linear relationships only
B) A regression technique that models non-linear relationships by using polynomial tenns of
the independent variable
C) A regression method that uses only quadratic terms
D) A technique that only models binary outcomes

Page f of 4___.,.,.,..,-,
Kl - Remember; K2 - Understand; K3 -Apply; K4 - Analyze; KS - Evaluate; K6 - Create
l~ 'C U- ~' '1A- ·

In polynomial regression, what effect does increasin


7 g the degree of the polynomial KI C06
have on the model?
A) It always improves the model's predictive
accuracy . .
B) It increases the model's flexibility to fit more
complex relat1onsh1ps
C) 1l reduces the model's likelihood of over-fitti
ng
D) lt always leads to a simpler model

8 Which of the following is a potential drawback


of using high-degree polynomial K1 C06
regression?
A) lt may lead to under fitting
B) lt simplifies the model interpretation
C) lt can cause ovcrtitting and make the
mode\ sensitive to noise
D) \t can only be used with binary varia
bles
9 When fitting a polynomial regression mode\,
how should the polynomial terms be K 1 C06
e,onstructed?
A) Each polynomial term should be an independ
ent variable in the data
B) Polynomial terms are created by raisi
. . ng the original independent variable to
mcreasmg powers
C) Polynomial terms should only include even
powers of the original variable
D) Polynomial terms are only added if they
pass a significance test
l O Which function in R is commonly used to
fit a polynomial regression model? Kl C06
A) 'lm()'
B) 'g\m ()'
C) 'polynomial()'
D) 'polytit()'

PAR T- B (10 x 2 = 20 Marks) K-


Level
co
1l Differentiate Pearson and Kendall Correlation
Test K2 cos
12 Define the usage of Bartlett Test.
Kl .cos
\3 List the advantages of Kruskal Wallis Test
Kl cos
14 What is multivariate analysis and how can
the same be visualized in R?
15 What is Correlation and How can it be used in
Kl cos
Statistical Analysis? Kl cos
16 What is polynomial regression, and why is it used
? Kl C06
17 How does polynomial regression differ from linea
r regression? K2 C06
18 How can polynomial regression be used to mod
el non-linear relationships? K2 C06
19 Give a situation where polynomial regression wou
ld be more appropriate than simple K2 C06
linear regression.
:0 In R, what does 'l(x" 2)' do when specifying a poly
nomial regression model in 'Im()'? Kl C06

KI _ Remember; K2 - Understand; K3 - Apply;


K4 •- Analyze; KS - Evaluate: K6 - Create Page 2 l)f 4
~~----··-------- - -

I
I

Mark
PART - C (2 x 10 = 20 Marks ) K- co
Split Level
up
to 10 K3 C05
I 21. a) To analyze whether or not three different exam prep programs lead
are
different mean scores on a certain exam. To analyze this, 30 students
recruited to participate in a study and split them into three groups .
The students in each group are randomly assigned to use one of the three
At
exam prep programs for the next three weeks to prepare for an exam.
the end of the three weeks, all of the studen ts take the same exam.
The exam scores for each group are shown below:
: Group_l_ --G;o ~2
. 91
r
j
Gro~p
79
3~
8S
86
88
92
93
I 78
88
7':, 85 94
78 87 92
94 84 85
98 82 83
79 88 8S
71 95 82
80 96 81

is
Perform a one-way ANOV A determine if the mean exam score
different between the three groups: Write R program for implan ting one-
way ANOV A
(Or)
in median 10 KJ cos
b) A researcher wants to investigate whether there is a difference
monthly sales performance among three sales teams (A, B, and C) within
a company. The data on monthly sales (in thousands) collected from each
team over six months is as follows:
Team Month ly Sales (in thousa nds)

A 55.60 ,53.58 , 57,61


B 48,52 ,49,50 ,51,53
C 62,65 ,60,63 ,67,64
Since the data is not normally distributed, the researcher decides to use
the Kruskal-Wall is test.
and IO
22. a) ~iven The weight of the cookies for different oven temperatures K3 C06
for
d~ffer~nt sugar types. Is there difference in weight of the cookies
levels? Use two-w ay
d1ffermg sugar- type and operating temperature
ANOVA to test the significance level.
/(1. 24),0.05 = 4.26 (for Sugar), /(2. 24),o.os = 3.403
(for tempe rature) /ci.
24),0.05 = 3.403 (for interaction)

ze; K5 - Evaluat e· K6 - Create


KI - Remem ber; K2 - Underst and·• K3 - Apply; K4 -Analy , Page J of.J I

J
OVEN TEMPERATURE
325 350 400
TYPE OF WHITE SUGAR 10.75 8.75 4.00
SUGAR 9.50 8.25 5.50
10.00 9.00 4.75
10.00 8.00 4.00
9.25 8.25 5.00
WHITE ANO BROWN 12.00 10.25 7.00
SUGAR 10.00 9.00 7.25
10.50 8.50 6.50
11.25 10.50 5.00
11.00 9.75 8.00

(Or)
b) Fit polynomial regression for the below data set using R Write R code l 0 K3 C06
for data Visualization, Regression Fit and Draw the graphical
representation
Position -: : ~
Level Salary
• •- -- . -• , •- - • ~ - 1I
Business Analyst I ·-· _4500:> I
\ 1
I . --2 j
Junior Consultant 50000 I
-----,------
Senior Consultant 3 60000
-------·- - - - - ------
Manager 4 60000
Country Manager 5 11000:>
- - - - - - --·-- ----- - - - -
Region Manager 6 150000

Partner 7 200000
- - · - - - , ------ -- - - --
Senior Partner 8 300000
·~-~leve; \ 9 500000
----- ··-- -- - - -- ----- ·-- -,--- --- ---
CEO I 10 1
1000000

Course Outcomes
Upon the completion of this course the students will be able to
CO I Reiterate all the basic programming constructs available in R programming (K2)
CO2 Demonstrate the basics of probability, distributions and graphical representations such as Histograms, Q-
Plots and Box plots (K3)
CO3 Solve problems using the Group Statistics and Sample Tests(K3)
CO4 interpret various regression and correlation techniques for data analytics(K3)
~

cos Illustrate different graphical representation and variance tests in data analytics.(K3)
CO6 Demonstrate Polynomial Regression and Two-Way ANOVA With Replication (K3)

Distribution of COs (Percentage wise)

CO No. COl CO2 C03 C04 cos C06


,__
----
% ---- ---- ---- ---- 50 50

K J - Remember; K2 - Understand; K3 - Apply; K4 - Analyze; KS - Evaluate; K6 - Create Page 4 of 4

You might also like