t-tests: examine if the difference in means is significant or not
normdis <- rnorm(n=1000, m=30, sd=3)
hist(normdis)

data("ToothGrowth")
head(ToothGrowth)
## len supp dose
## 1 4.2 VC 0.5
## 2 11.5 VC 0.5
## 3 7.3 VC 0.5
## 4 5.8 VC 0.5
## 5 6.4 VC 0.5
## 6 10.0 VC 0.5
str(ToothGrowth)
## 'data.frame': 60 obs. of 3 variables:
## $ len : num 4.2 11.5 7.3 5.8 6.4 10 11.2 11.2 5.2 7 ...
## $ supp: Factor w/ 2 levels "OJ","VC": 2 2 2 2 2 2 2 2 2 2 ...
## $ dose: num 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 ...
hist(ToothGrowth$len)

qqplot
examining distribution of quantitative numerical variable
qqnorm(ToothGrowth$len)
qqline(ToothGrowth$len)

Shapiro-Wilk normality test
H0: data are normarlly distributed
shapiro.test(ToothGrowth$len) #data are normally distributed
##
## Shapiro-Wilk normality test
##
## data: ToothGrowth$len
## W = 0.96743, p-value = 0.1091