This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.
Try executing this chunk by clicking the Run button within the chunk or by placing your cursor inside it and pressing Ctrl+Shift+Enter.
#Q1 We have two tables of marks of B.Sc DS and B.Sc. Analytics students. Apply statistical tools and explain its analysis and future predictions.
library(readxl)
B_Sc_EA_R_file <- read_excel("C:/Users/malavika manchiraju/Downloads/B.Sc EA R file.xlsx")
View(B_Sc_EA_R_file)
library(readxl)
MId_sem_results_DS <- read_excel("MId sem results DS.xlsx")
View(MId_sem_results_DS)
data=read.csv("MId sem results DS.csv")
head(data)
data2=read.csv("MId sem results EA.csv")
head(data2)
summary(data)
Roll Name CIA.I
Min. :20112001 Length:35 Min. : 7.00
1st Qu.:20112012 Class :character 1st Qu.: 9.00
Median :20112022 Mode :character Median :11.00
Mean :20112023 Mean :10.91
3rd Qu.:20112036 3rd Qu.:12.50
Max. :20112047 Max. :14.00
Mid.Term
Min. :20.00
1st Qu.:34.50
Median :39.00
Mean :37.26
3rd Qu.:41.00
Max. :47.00
summary(data2)
Roll.No CIA.I Mid.sem
Min. :20112301 Min. : 7.00 Min. :24.00
1st Qu.:20112313 1st Qu.:10.00 1st Qu.:33.00
Median :20112328 Median :11.00 Median :37.00
Mean :20112331 Mean :11.64 Mean :36.58
3rd Qu.:20112349 3rd Qu.:13.00 3rd Qu.:40.25
Max. :20112369 Max. :17.00 Max. :48.00
str(data)
'data.frame': 35 obs. of 4 variables:
$ Roll : int 20112001 20112002 20112003 20112004 20112005 20112006 20112007 20112009 20112010 20112013 ...
$ Name : chr "ABHIJITH PRAKASH" "AKASH VARUGHESE JOSEPH" "AKSHITHA MASUNA" "ANIRUDH PRASHANTH" ...
$ CIA.I : int 14 9 9 9 13 13 9 12 11 9 ...
$ Mid.Term: int 41 42 29 38 40 43 30 35 40 38 ...
str(data2)
'data.frame': 36 obs. of 3 variables:
$ Roll.No: int 20112301 20112302 20112303 20112305 20112307 20112308 20112309 20112310 20112311 20112314 ...
$ CIA.I : int 13 13 12 14 9 13 11 11 15 11 ...
$ Mid.sem: int 40 24 38 43 35 32 38 32 41 35 ...
mean(data$CIA.I)
[1] 10.91429
mean(data2$CIA.I)
[1] 11.63889
mean(data$Mid.sem)
argument is not numeric or logical: returning NA
[1] NA
mean(data2$Mid.sem)
[1] 36.58333
median(data$CIA.I)
[1] 11
median(data2$CIA.I)
[1] 11
median(data$Mid.sem)
NULL
median(data2$Mid.sem)
[1] 37
sd(data$CIA.I)
[1] 1.738347
sd(data2$CIA.I)
[1] 2.016401
IQR(data$CIA.I)
[1] 3.5
IQR(data2$CIA.I)
[1] 3
IQR(data$Mid.sem)
[1] NA
IQR(data2$Mid.Term)
[1] NA
hist(data$Mid.Term)
hist(data2$Mid.sem)
hist(data$CIA.I)
hist(data2$CIA.I)
boxplot(data$CIA.I)
boxplot(data2$CIA.I)
boxplot(data$Mid.Term)
boxplot(data2$Mid.Term)
no non-missing arguments to min; returning Infno non-missing arguments to max; returning -InfError in plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs) :
need finite 'ylim' values
#Q2 Draw a sequence from 1 to 50
sequence(1:50)
[1] 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4
[20] 5 6 1 2 3 4 5 6 7 1 2 3 4 5 6 7 8 1 2
[39] 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 10 1 2
[58] 3 4 5 6 7 8 9 10 11 1 2 3 4 5 6 7 8 9 10
[77] 11 12 1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 3 4
[96] 5 6 7 8 9 10 11 12 13 14 1 2 3 4 5 6 7 8 9
[115] 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13
[134] 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
[153] 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[172] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
[191] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
[210] 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[229] 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
[248] 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13
[267] 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9
[286] 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 2 3 4
[305] 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
[324] 24 25 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
[343] 18 19 20 21 22 23 24 25 26 1 2 3 4 5 6 7 8 9 10
[362] 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 2
[381] 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
[400] 22 23 24 25 26 27 28 1 2 3 4 5 6 7 8 9 10 11 12
[419] 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 2
[438] 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
[457] 22 23 24 25 26 27 28 29 30 1 2 3 4 5 6 7 8 9 10
[476] 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
[495] 30 31 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
[514] 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 1 2 3 4
[533] 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
[552] 24 25 26 27 28 29 30 31 32 33 1 2 3 4 5 6 7 8 9
[571] 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
[590] 29 30 31 32 33 34 1 2 3 4 5 6 7 8 9 10 11 12 13
[609] 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
[628] 33 34 35 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
[647] 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
[666] 36 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[685] 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
[704] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
[723] 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
[742] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
[761] 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
[780] 39 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[799] 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
[818] 38 39 40 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
[837] 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
[856] 36 37 38 39 40 41 1 2 3 4 5 6 7 8 9 10 11 12 13
[875] 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
[894] 33 34 35 36 37 38 39 40 41 42 1 2 3 4 5 6 7 8 9
[913] 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
[932] 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 1 2 3 4
[951] 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
[970] 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
[989] 43 44 1 2 3 4 5 6 7 8 9 10
[ reached getOption("max.print") -- omitted 275 entries ]
#Q3 Replicate 5 time of sequence 1:3
rep(1:3,5)
[1] 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
#Q4 Take a random sample of size 20 out of 200 numbers from 1 to 200 inclusively.
sample(1:200,20)
[1] 131 117 122 104 162 75 87 115 142 116 73 139 101 159 70
[16] 69 80 25 155 3
#Q5 Generate data uniformly within the range of 100 numbers with min 0 and max 15.
runif(n=100,min=0,max=15)
[1] 11.42605592 9.60871891 13.63373482 12.63142923
[5] 11.16414738 2.44556410 13.85095725 14.69007740
[9] 8.68983903 7.51904777 10.46294990 14.85343826
[13] 11.73752692 8.41948430 10.52350241 4.81137455
[17] 9.68776887 4.79010686 12.71537954 4.64633932
[21] 14.13553428 5.60396107 11.44641979 10.95917999
[25] 12.60926780 8.26167030 12.32648063 6.59591832
[29] 5.14841207 3.28299000 5.67062826 1.40590295
[33] 3.31650578 14.73470099 1.55657342 9.71403031
[37] 7.83617379 6.17023610 13.66194576 14.09483408
[41] 0.84686672 6.48710736 2.39015104 13.50812543
[45] 5.39466946 2.37237546 13.29446961 0.11092302
[49] 7.16974778 7.26054453 10.49107916 7.32255651
[53] 11.35495650 1.70262392 10.86117241 13.92878557
[57] 13.78456448 12.89595539 8.26589746 5.53347039
[61] 6.85228319 8.71993948 8.80155476 12.32363912
[65] 7.53562676 0.07252575 12.16714001 9.91982473
[69] 1.39950914 2.86851457 4.47038838 11.00320814
[73] 7.52941947 8.32813245 14.70913855 9.86478493
[77] 8.06569580 9.46060661 5.67535752 10.94510835
[81] 10.70626662 0.98598127 14.54373335 4.84283227
[85] 0.80991813 12.81353827 1.69169434 6.32708549
[89] 12.92487811 7.12919251 1.44298315 9.49933179
[93] 9.99610155 6.08495393 2.47654705 9.99158902
[97] 4.25607304 1.00401909 1.62593293 7.74334653
#Q6 sum(sample(1:6,1)+sample(1:6,1))
sum(sample(1:6,1)+sample(1:6,1))
[1] 10