library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(ggplot2)
library(ggpubr)
## Loading required package: magrittr
library(rstatix)
##
## Attaching package: 'rstatix'
## The following object is masked from 'package:stats':
##
## filter
library(jmv)
Data <- iris3
View(Data)
Data <- as.data.frame(Data)
names(Data)
## [1] "Sepal L..Setosa" "Sepal W..Setosa" "Petal L..Setosa"
## [4] "Petal W..Setosa" "Sepal L..Versicolor" "Sepal W..Versicolor"
## [7] "Petal L..Versicolor" "Petal W..Versicolor" "Sepal L..Virginica"
## [10] "Sepal W..Virginica" "Petal L..Virginica" "Petal W..Virginica"
Data_1 <- Data %>%
rename(Sepal_Length_Setosa = "Sepal L..Setosa",
Sepal_Width_Setosa = "Sepal W..Setosa",
Petal_Length_Setosa = "Petal L..Setosa",
Petal_Width_Setosa = "Petal W..Setosa",
Sepal_Length_Versicolor = "Sepal L..Versicolor",
Sepal_Width_Versicolor = "Sepal W..Versicolor",
Petal_Length_Versicolor = "Petal L..Versicolor",
Petal_Width_Versicolor = "Petal W..Versicolor",
Sepal_Length_Virginica = "Sepal L..Virginica",
Sepal_Width_Virginica = "Sepal W..Virginica",
Petal_Length_Virginica = "Petal L..Virginica",
Petal_Width_Virginica = "Petal W..Virginica")
Data_1 %>% select (Sepal_Length_Setosa, Sepal_Width_Setosa, Petal_Length_Setosa) %>%
descriptives(hist = TRUE,
violin = TRUE,
dot = TRUE, dotType = "jitter",
qq = FALSE,
n = TRUE,
missing = TRUE,
mean = TRUE,
median = TRUE,
mode = TRUE,
sum = TRUE,
sd = TRUE,
variance = TRUE,
range = FALSE,
min = TRUE,
max = TRUE,
se = FALSE,
skew = TRUE, kurt = TRUE)
##
## DESCRIPTIVES
##
## Descriptives
## -------------------------------------------------------------------------------------------
## Sepal_Length_Setosa Sepal_Width_Setosa Petal_Length_Setosa
## -------------------------------------------------------------------------------------------
## N 50 50 50
## Missing 0 0 0
## Mean 5.01 3.43 1.46
## Median 5.00 3.40 1.50
## Mode 5.00 3.40 1.40
## Sum 250 171 73.1
## Standard deviation 0.352 0.379 0.174
## Variance 0.124 0.144 0.0302
## Minimum 4.30 2.30 1.00
## Maximum 5.80 4.40 1.90
## Skewness 0.120 0.0412 0.106
## Std. error skewness 0.337 0.337 0.337
## Kurtosis -0.253 0.955 1.02
## Std. error kurtosis 0.662 0.662 0.662
## -------------------------------------------------------------------------------------------
The function “descriptives()” is from package “jmv”
cor_mat(Data_1)
## # A tibble: 12 x 13
## rowname Sepal_Length_Se~ Sepal_Width_Set~ Petal_Length_Se~ Petal_Width_Set~
## * <chr> <dbl> <dbl> <dbl> <dbl>
## 1 Sepal_~ 1 0.74 0.27 0.28
## 2 Sepal_~ 0.74 1 0.18 0.23
## 3 Petal_~ 0.27 0.18 1 0.33
## 4 Petal_~ 0.28 0.23 0.33 1
## 5 Sepal_~ -0.081 -0.052 -0.13 -0.091
## 6 Sepal_~ -0.078 -0.14 -0.17 -0.025
## 7 Petal_~ -0.077 -0.06 -0.19 -0.04
## 8 Petal_~ 0.083 0.031 -0.15 -0.18
## 9 Sepal_~ 0.13 -0.076 0.15 0.075
## 10 Sepal_~ 0.26 0.0061 0.13 0.096
## 11 Petal_~ 0.17 0.056 0.1 0.011
## 12 Petal_~ 0.28 0.1 -0.013 0.078
## # ... with 8 more variables: Sepal_Length_Versicolor <dbl>,
## # Sepal_Width_Versicolor <dbl>, Petal_Length_Versicolor <dbl>,
## # Petal_Width_Versicolor <dbl>, Sepal_Length_Virginica <dbl>,
## # Sepal_Width_Virginica <dbl>, Petal_Length_Virginica <dbl>,
## # Petal_Width_Virginica <dbl>
cor_plot(cor_mat(Data_1))
The End