![]() 75) + theme_bw()+ theme(legend.position="none") ggplot(DATA, aes(x = vits,y=MultinomWB, fill=vits)) + geom_jitter(alpha =. 75) + theme_bw()+ theme(legend.position="none") ggplot(DATA, aes(x = Caf, y = MultinomWB, fill=Caf)) + geom_jitter(alpha =. ![]() 75) + theme_bw()+ theme(legend.position="none") ggplot(DATA, aes(x = mincrAO, y = MultinomWB, fill=mincrAO)) + geom_jitter(alpha =. 75) + theme_bw()+ theme(legend.position="none") ggplot(DATA, aes(x = TT, y = MultinomWB, fill=TT)) + geom_jitter(alpha =. 75) + theme_bw()+ theme(legend.position="none") ggplot(DATA, aes(x = urs,y=MultinomWS, fill=urs)) + geom_jitter(alpha =. 75) + theme_bw()+ theme(legend.position="none") ggplot(DATA, aes(x = ascBCAA,y=MultinomWS, fill=ascBCAA)) + geom_jitter(alpha =. 75) + theme_bw()+ theme(legend.position="none") ggplot(DATA, aes(x = bredol,y=MultinomWS, fill=bredol)) + geom_jitter(alpha =. 75) + theme_bw()+ theme(legend.position="none") ggplot(DATA, aes(x = carn,y=MultinomWS, fill=carn)) + geom_jitter(alpha =. 75) + theme_bw()+ theme(legend.position="none") ggplot(DATA, aes(x = vits,y=MultinomWS, fill=vits)) + geom_jitter(alpha =. 75) + theme_bw()+ theme(legend.position="none") ggplot(DATA, aes(x = Caf, y = MultinomWS, fill=Caf)) + geom_jitter(alpha =. 75) + theme_bw()+ theme(legend.position="none") ggplot(DATA, aes(x = mincrAO, y = MultinomWS, fill=mincrAO)) + geom_jitter(alpha =. ggplot(DATA, aes(x = TT, y = MultinomWS, fill=TT)) + geom_jitter(alpha =. Not an easy task, but I have always preferred graphics above statistical inferencing, especially when it comes to this kind of data. What I am looking for are differences between predictor levels (which are mostly binary as well) in the shape of the violin. One needs to be careful for multiple testing here, hence, why I prefer to stick to the original scale.īelow you will see a lot of plots in which I will show, on the Y axis, the multinomial/binary data and on the x-axis the predictor of interest. DATA <- read.csv("DATA.csv") DATA$TT<-as.factor(DATA$TT) DATA$mincrAO<-as.factor(DATA$mincrAO) DATA$Caf<-as.factor(DATA$Caf) DATA$vits<-as.factor(DATA$vits) DATA$carn<-as.factor(DATA$carn) DATA$bredol<-as.factor(DATA$bredol) DATA$ascBCAA<-as.factor(DATA$ascBCAA) DATA$urs<-as.factor(DATA$urs) colnames(DATA)<-"BLOCK" DATA$BLOCK<-as.factor(DATA$BLOCK) DATA$Caf_order=factor(DATA$Caf, ordered=TRUE) DATA$urs_order=factor(DATA$urs, ordered=TRUE) DATA$BOX_cat<-as.factor(DATA$BOX) DATAcompl<-DATA class(DATAcompl$mincrAO) class(DATAcompl$Caf) class(DATAcompl$vits) class(DATAcompl$carn) class(DATAcompl$bredol) class(DATAcompl$ascBCAA) class(DATAcompl$urs) class(DATAcompl$MultinomWS) class(DATAcompl$MultinomWB) skimr::skim(DATAcompl)Īs you can see the data is already transformed to a degree to be multinomial, ordinal, or even binary (for instance severe WB vs non-severe WB). Now, plotting multinomial or ordinal data is a skill on its own, and I have found that several distinct plots, like violins, can help give you a decent glimpse of the data. Both WB and WS are things you do not wish to have to a large extent. It is slaughter data and what has been done is see if we can find markers, nutritional markers, that explain the level of wooden breast (WB) of white striping (WS) we see when slaughtering chickens. rm(list = ls()) # LIBRARIES # library(foreign) library(lme4) library(ggplot2) library(rms) library(plyr) library(dplyr) library(Hmisc) library(data.table) library(reshape2) library(lubridate) library(boot) library(sjPlot) library(sjstats) library(sjmisc) library(psych) library(interval) library(data.table) library(effects) library(AICcmodavg) library(piecewiseSEM) require(parallel) library(scales) library(gridExtra) library(coefplot) library(coda) library(aods3) library(plotMCMC) library(bbmle) library(nlme) library(MCMCglmm) library(merTools) library(RLRsim) library(pbkrtest) library(blme) library(MASS) library(multcomp) library(glmmLasso) library(MASS) library(CCA) As I mentioned before, multinomial/ordinal data can be analyzed via a multitude of ways. I probably did not use them all, but all can be used if you would like. Let me show you around and explain as much as I can about what I did. That is why, unfortunately, I cannot share the data but what I can do is show you how I analyzed it. ![]() ![]() This particular project is actually quite old, containing analyses I did in 2017 on commercial data. However, it is my first post showcasing R for this type of analysis. This is not my first post on ordinal / multinomial data, and there are many ways to analyze such a dataset using the poisson or negative binomial distribution, the binary, binomial or beta distribution, or just going full-out following the multinomial itself. Applying Generalized Linear Mixed Models to Slaughter Data
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |