##Importin the dataset
library(readxl)
## Warning: package 'readxl' was built under R version 4.1.2
beam1 <- read_excel("C:/Users/user/Downloads/Beam-Deflection.xlsx")
beam1
## # A tibble: 200 x 1
## Deflection
## <chr>
## 1 -213
## 2 -564
## 3 -35
## 4 -15
## 5 141
## 6 115
## 7 -420
## 8 -360
## 9 203
## 10 -338
## # ... with 190 more rows
##Covert character to numeric
beam <- as.numeric(unlist(beam1))
beam
## [1] -213 -564 -35 -15 141 115 -420 -360 203 -338 -431 194 -220 -513 154
## [16] -125 -559 92 -21 -579 -52 99 -543 -175 162 -457 -346 204 -300 -474
## [31] 164 -107 -572 -8 83 -541 -224 180 -420 -374 201 -236 -531 83 27
## [46] -564 -112 131 -507 -254 199 -311 -495 143 -46 -579 -90 136 -472 -338
## [61] 202 -287 -477 169 -124 -568 17 48 -568 -135 162 -430 -422 172 -74
## [76] -577 -13 92 -534 -243 194 -355 -465 156 -81 -578 -64 139 -449 -384
## [91] 193 -198 -538 110 -44 -577 -6 66 -552 -164 161 -460 -344 205 -281
## [106] -504 134 -28 -576 -118 156 -437 -381 200 -220 -540 83 11 -568 -160
## [121] 172 -414 -408 188 -125 -572 -32 139 -492 -321 205 -262 -504 142 -83
## [136] -574 0 48 -571 -106 137 -501 -266 190 -391 -406 194 -186 -553 83
## [151] -13 -577 -49 103 -515 -280 201 300 -506 131 -45 -578 -80 138 -462
## [166] -361 201 -211 -554 32 74 -533 -235 187 -372 -442 182 -147 -566 25
## [181] 68 -535 -244 194 -351 -463 174 -125 -570 15 72 -550 -190 172 -424
## [196] -385 198 -218 -536 96
##Run the Shapiro Test
ks.test(beam, "pnorm", mean=mean(beam), sd=sd(beam))
## Warning in ks.test(beam, "pnorm", mean = mean(beam), sd = sd(beam)): ties should
## not be present for the Kolmogorov-Smirnov test
##
## One-sample Kolmogorov-Smirnov test
##
## data: beam
## D = 0.10997, p-value = 0.01586
## alternative hypothesis: two-sided
shapiro.test(beam)
##
## Shapiro-Wilk normality test
##
## data: beam
## W = 0.90384, p-value = 4.441e-10
##Creating Histogram
hist(beam)

##Creating Normal Probability Plot
qqnorm(beam,
ylab="Ordered Response Values",
xlab="Normal N(0,1) Order Statistic Median",
main="Normal Probability Plot")
qqline(beam)
#Creating a Sequence Plot
library(qicharts)
## Warning: package 'qicharts' was built under R version 4.1.3
## qicharts will no longer be maintained. Please consider moving to qicharts2: https://anhoej.github.io/qicharts2/.

qic(beam)

#Creating Lag Plot
library(graphics)
lag.plot(beam,lags=1)
