R Programming
R Programming
1 1 70 Average
2 2 54 Below Average
3 3 90 Excellent
4 4 53 Below Average
5 5 42 Below Average
6 6 81 Excellent
7 7 89 Excellent
8 8 93 Excellent
9 9 82 Excellent
10 10 76 Excellent
11 11 91 Excellent
12 12 53 Below Average
13 13 93 Excellent
14 14 64 Average
15 15 65 Average
16 16 66 Average
17 17 44 Below Average
18 18 90 Excellent
19 19 66 Average
20 20 96 Excellent
21 21 67 Average
22 22 96 Excellent
23 23 48 Below Average
24 24 68 Average
25 25 74 Average
26 26 47 Below Average
27 27 65 Average
28 28 46 Below Average
29 29 81 Excellent
30 30 48 Below Average
31 31 58 Below Average
32 32 75 Average
33 33 53 Below Average
34 34 56 Below Average
35 35 82 Excellent
36 36 78 Excellent
37 37 92 Excellent
38 38 51 Below Average
39 39 54 Below Average
40 40 71 Average
41 41 81 Excellent
42 42 84 Excellent
43 43 46 Below Average
44 44 48 Below Average
45 45 80 Excellent
46 46 49 Below Average
47 47 62 Average
48 48 66 Average
49 49 99 Excellent
50 50 92 Excellent
51 51 70 Average
52 52 54 Below Average
53 53 90 Excellent
54 54 53 Below Average
55 55 42 Below Average
56 56 81 Excellent
57 57 89 Excellent
58 58 93 Excellent
59 59 82 Excellent
60 60 76 Excellent
61 61 91 Excellent
62 62 53 Below Average
63 63 93 Excellent
64 64 64 Average
65 65 65 Average
66 66 66 Average
67 67 44 Below Average
68 68 90 Excellent
69 69 66 Average
70 70 96 Excellent
71 71 67 Average
72 72 96 Excellent
73 73 48 Below Average
74 74 68 Average
75 75 74 Average
76 76 47 Below Average
77 77 65 Average
78 78 46 Below Average
79 79 81 Excellent
80 80 48 Below Average
81 81 58 Below Average
82 82 75 Average
83 83 53 Below Average
84 84 56 Below Average
85 85 82 Excellent
86 86 78 Excellent
87 87 92 Excellent
88 88 51 Below Average
89 89 54 Below Average
90 90 71 Average
91 91 81 Excellent
92 92 84 Excellent
93 93 46 Below Average
94 94 48 Below Average
95 95 80 Excellent
96 96 49 Below Average
97 97 62 Average
98 98 66 Average
99 99 99 Excellent
R Global Environment
Data
O data 101 obs. of 4 variables
Ostudent marks 100 obs. of 3 variables
Osummary_stats 1 obs. of 14 variables
$ Mean :num 69.7
$ Median num
$ Mode num 48
$ Standard_Deviation num 17
S Variance num 287
$ Min num 42
$ Max num 99
S Range num 57
S IQR num 29
$ el071::skewness Marks, rm = TRUE): num 0.0404
na.
$ e1071::kurtosis(Marks, na.rm = TRUE): num -1.33
S Coefficient_of_Variation : num 0.243
S Quantile_25 Named num 53
..- attr(*, "names")= chr "2596"
S Quantile_75 : Named num 82
attr(*, "names")= chr "7 5%"
2 install.packages ("e1071")
3 install.packages ("dplyr")
4 # Load necessary libraries
5 1ibrary(readxl)
6 1ibrary(ggplot2)
7 1ibrary (dplyr)
8
# Read the Excel file
10 data <- read excel("data.xlsx", sheet = "Sheet1")
11
12 # Convert Category column to a factor
1: datasCategory <- as.factor (dataSCategory)
14
15 # Summary statistics
16 summary_stats <- data %>% summarize(
17 Mean = mean (Marks, na. rm = TRUE),
18 Median = median(Marks, na. rm = TRUE),
19 Mode as.numeric(names(sort(table(Marks), decreasing = TRUE) [1])),
20 Standard_Deviation = sd(Marks, na. rm = TRUE),
21 Variance = var(Marks, na. rm = TRUE),
22 Min = min (Marks, na. rm = TRUE),
23 Max max (Marks,na. rm TRUE),
24 Range = max (Marks, na. rm = TRUE) min (Marks, na. rm = TRUE),
25 IQR = IQR (Marks, na. rm = TRUE),
26 el071: :skewness (Marks, na. rm TRUE),
27 el071::kurtosis (Marks, na. rm = TRUE),
28 Coefficient _of_Variation = sd(Marks, na.rm = TRUE) / mean (Marks, na. rm = TRUE),
20 Quanti le_25 = quantile(Marks, 0.25, na. rm = TRUE),
30 Quantile_75 = quantile(Marks, 0.75, na. rm = TRUE)
31 )
32 print(summary_stats)
33
34 # Create a bar chart
35 ggplot(data, aes (X = Category)) +
36 geom_bar (fill = "skyblue', color "black) +
37 labs(title = "Distribution of Student Marks",
38 X = "Category",
39 y "Number of Students") +
40 theme_minimal ()
41
42
> # Read the Excel file
> data <- read_excel("data.xlsx", sheet = "Sheet1")
New names:
-> 1
R R 44.1 ~
Warning message:
package dplyr' was built under R version 4.4.2
install.packages("dplyr")
library(readxl)
library(ggplot2)
library(dplyr)
# Summary statistics
print(summary_stats)
x = "Category",
y = "Number of Students") +
theme_minimal()