Professional Documents
Culture Documents
library(dplyr)
write.csv(sp,"sp.csv")
counts=table(iris$Species)
barplot(counts, main="Species Distribution",
xlab="Number of Species")
2. Mean: Used to represent the continuous variable measure and also used for comparing two
or more than two variables collected under the same characteristics. Eg., "Sepal.Length"
"Sepal.Width" "Petal.Length" "Petal.Width" these variables means can be compared for
further analysis.
3. Median: Is used to represent the ordinal data measure and also used for comparing two or
more than two variables collected under the same characteristics.
4. Mode: Is used to count highest number of times occurring observations in the
categorical/specifically nominal variable.
5. Range: Is used for understanding the spread of the data distribution in a simplest way with
minimum and maximum of the values in the variable.
6. Quartiles and other positional measures: These are positional values of the ordinal data
observations. Genrally for any quartile Qn = n(n+1)/4, if it is decile, Dn=n(n+1)/10 and
percentile is Pn =n(n+1)/100
7. Standard deviation: It is one of mostly used statistical measure to understand the deviations
between the values of the variable and there by best measure for representing the variation
among all values. It is used for numerical measures which suits for mathematical operations.
( x− x́ )2
Formula for Standard deviation (Std)=
√ n
8. Skewness: Skewness is a measure of symmetry, or more precisely, the lack of symmetry.
A distribution, or data set, is symmetric if it looks the same to the left and right of the centre
point.
Examples of skewness:
9. Kurtosis: Kurtosis is a parameter that describes the shape of a random variable’s probability
distribution. For normal probability distribution values, value of kurtosis is almost equal to
one. If it is positive value, the peak is higher and for negative value flatter is more.
#Mean
mean(iris$Sepal.Length)
mean(iris$Sepal.Width)
mean(iris$Petal.Length)
mean(iris$Petal.Width)
summary(iris$Sepal.Length)
summary(iris$Sepal.Width)
summary(iris$Petal.Length)
summary.data.frame(iris)
irisn=iris[,-5]
irist=summary.data.frame(irisn)
irisst=as.data.frame(irist)
irisst
write.csv(irist,"irist.csv")
sd(irisn$Sepal.Length)
var(irisn$Sepal.Length)
boxplot(irisn)
library(ggplot2)
geom_boxplot() +
theme_classic()
quantile(iris$Sepal.Length)
quantile(irisn$Sepal.Length,c(0.30,0.45))
library(e1071)
kurtosis(iris$Sepal.Length)