Shapiro-Wilk Normality Test in R (Example) | Apply shapiro.test Function | plot & density Functions

Statistics Globe
Statistics Globe
14.3 هزار بار بازدید - 3 سال پیش - How to use the Shapiro-Wilk
How to use the Shapiro-Wilk normality test in the R programming language. More details: https://statisticsglobe.com/shapiro-w...
R code of this video:

set.seed(946322)                       # Set random seed
x1 <- rnorm(100)                       # Create normally distributed vector
x2 <- runif(100)                       # Create uniformly distributed vector

plot(density(x1), ylim = c(0, 1.1), col = 2) # Draw data to density plot
lines(density(x2), col = 3)
legend("topleft", c("x1", "x2"), col = 2:3, lty = 1)

shapiro.test(x1)                       # Apply shapiro.test function

shapiro.test(x2)                       # Apply shapiro.test function

Follow me on Social Media:
Facebook: Facebook: statisticsglobecom
LinkedIn: LinkedIn: statisticsglobe
Patreon: Patreon: statisticsglobe
Pinterest: https://www.pinterest.de/JoachimSchork
Reddit: Reddit: JoachimSchork
Twitter: Twitter: JoachimSchork
3 سال پیش در تاریخ 1400/02/07 منتشر شده است.
14,333 بـار بازدید شده
... بیشتر