Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bodymass pregnant
- 28.5 yes
- 33.3 no
- 23.4 yes
- 26.6 no
- 34.1 no
- 26.4 yes
- 45.6 no
- 25.3 yes
- 25.5 no
- 24 yes
- dfd<- data.frame(matrix(nrow = 10, ncol = 2))
- dfd[,1]<- mother$bodymass
- dfd[,2]<- mother$pregnant
- header<- c('bodymass', 'pregnant')
- colnames(dfd)<- header
- dfd
- chisq.test(dfd)
- df <- read.table(text = "
- bodymass pregnant
- 28.5 yes
- 33.3 no
- 23.4 yes
- 26.6 no
- 34.1 no
- 26.4 yes
- 45.6 no
- 25.3 yes
- 25.5 no
- 24 yes", header = T, stringsAsFactors = F)
- wilcox.test(bodymass ~ pregnant, data = df, alternative = "two.sided", paired = FALSE)
- Wilcoxon rank sum test
- data: bodymass by pregnant
- W = 22, p-value = 0.05556
- alternative hypothesis: true location shift is not equal to 0
- library(ggbeeswarm)
- ggplot(df, aes(pregnant, bodymass, color = pregnant)) + geom_boxplot() + geom_beeswarm()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement