Aim

  1. To create the statistical summary of a data

  2. To study normality of the data

Packages used and syntax of R methods

For statistical summary of a given dataset, the rbase package will be used. To calculate skewness and kurtosis of dataset, the ACSWR is used.

Note: The functions skewness and kurtosis from the e1071 package are more generic functions. Another resouse is moments package.

Algorithm

R code

#loading package
library(ACSWR)
#loading data
data(yb)
#view structure of data
str(yb)
## 'data.frame':    8 obs. of  2 variables:
##  $ Preparation_1: int  31 20 18 17 9 8 10 7
##  $ Preparation_2: int  18 17 14 11 10 7 5 6
# creating statistical summary

summary(yb)
##  Preparation_1   Preparation_2  
##  Min.   : 7.00   Min.   : 5.00  
##  1st Qu.: 8.75   1st Qu.: 6.75  
##  Median :13.50   Median :10.50  
##  Mean   :15.00   Mean   :11.00  
##  3rd Qu.:18.50   3rd Qu.:14.75  
##  Max.   :31.00   Max.   :18.00
range(yb$Preparation_1); range(yb$Preparation_2) # list out ranges of data
## [1]  7 31
## [1]  5 18
#skewness and kurtosis of preparation_1
skewcoeff(yb$Preparation_1); kurtcoeff(yb$Preparation_1)
## [1] 0.8548652
## [1] 2.727591
#skewness and kurtosis of preparation_2
skewcoeff(yb$Preparation_2); kurtcoeff(yb$Preparation_2)
## [1] 0.2256965
## [1] 1.6106

Problems

A=1,4,8,12   B=4,8,12,16

Find 1.Summary
   2.Skewness and kurtosis ?

A=c(1,4,8,12)
summary(A)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    1.00    3.25    6.00    6.25    9.00   12.00
B=c(4,8,12,16)
summary(B)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##       4       7      10      10      13      16
skewcoeff(A)
## [1] 0.138147
kurtcoeff(A)
## [1] 1.597633
skewcoeff(B)
## [1] 0
kurtcoeff(B)
## [1] 1.64

Results & discussions

A distribution is normal then mean=median=mode and the skewness is 0 and kurtosis is 2. In this experiment statistical summaries of two variables are created. From the skewness and kurtosis measures, both the variables are positively skewed and preparation_1 is lepto-kurtic and preparation_2 is meso-kurtic. Based on the statistical summary and skewness and kurtosis measures, both the variables are different from a normal distribution.