Input data and packages

library(readxl)
## Warning: package 'readxl' was built under R version 4.0.3
Data <- read_excel("C:/Users/Admin/Desktop/R/Data.xlsx",col_types = c("text", "text", "text", "numeric", "numeric", "numeric","numeric", "numeric","numeric"))
attach(Data)
require(ggplot2)
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 4.0.3

Visualiation data

First comments

1. Body weight of Female lower than male (Not sure is it significant or not?)

2. No outliers

ttest=ggplot(Data,aes(x=Gender,y=`Body Weight (g)`))
ttest+geom_boxplot()+theme_bw()+theme_bw()

Assumption 1: All samples are indepentdent (no repeated measured in 1 individual)

Assumption 2: Denpendent variable is continuous (all denpendent variables are already continous)

Assumption 3: Homogeneity of variances (bartlett.test)

Ho variences of samples are the same if p value > 0.05 => false to reject Ho => accept Ho => variences of samples are the same. In this case, p=0.9288

var.test(`Body Weight (g)`~Gender)
## 
##  F test to compare two variances
## 
## data:  Body Weight (g) by Gender
## F = 0.92886, num df = 11, denom df = 11, p-value = 0.9048
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
##  0.267399 3.226593
## sample estimates:
## ratio of variances 
##          0.9288637

Assumption 4: Test normal distribution

male=subset(Data,Gender=="Male", select = `Body Weight (g)`)
female=subset(Data, Gender=="Female", select = `Body Weight (g)`)
shapiro.test(male$`Body Weight (g)`)
## 
##  Shapiro-Wilk normality test
## 
## data:  male$`Body Weight (g)`
## W = 0.92639, p-value = 0.3434
shapiro.test(female$`Body Weight (g)`)
## 
##  Shapiro-Wilk normality test
## 
## data:  female$`Body Weight (g)`
## W = 0.88494, p-value = 0.1014
qqnorm(male$`Body Weight (g)`)
qqline(male$`Body Weight (g)`)

qqnorm(female$`Body Weight (g)`)
qqline(female$`Body Weight (g)`)

Run t-test. p=0.75=> fail to reject Ho (Ho= no sig. different)=> No sig body weight betbween 2 genders

t.test(`Body Weight (g)`~Gender)
## 
##  Welch Two Sample t-test
## 
## data:  Body Weight (g) by Gender
## t = -0.318, df = 21.97, p-value = 0.7535
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -562.9118  413.2452
## sample estimates:
## mean in group Female   mean in group Male 
##             1850.917             1925.750