Data
The data is given in three tables, giving averages over storage conditions for six cultivars for two storage times. Three cultivars were replicated. Since no data cultivar*storage condition is available, I will ignore the storage condition. Significant differences were indicated in the data tables. These I added when entering the data. The top left part of the data table:
library(xlsReadWrite)
datain <- read.xls('condensed.xls')
datain[1:5,1:5]
Products CLiking CFreshness CCrispness CJuiciness
1 Ariwa_W1 4.19ab 4.25a 4.39ab 4.14cd
2 Elstar_W1 4.25a 4.01ab 3.84d 4.32bcd
3 Jonagold_W1 4.31a 4.14a 4.35ab 4.56a
4 Gala_W1 4.19ab 4.08a 4.24bc 4.36abcd
5 Topaz_W1 4.35a 4.11a 4.59b 4.37abc
In this table the final part of the product name is the storage duration. The first character of the variables indicates the source. 'C' indicates this is consumer data. 'S' is used for sensory data and 'A' for analytical chemical data. To make the data ready storage condition (bag/net) and the significant differences are removed.
datain <- datain[-grep('bag|net',datain$Products,ignore.case=TRUE),]
#convert strings into numbers
vars <- names(datain)[-1]
for (descriptor in vars) {
datain[,descriptor] <- as.numeric(gsub('[[:alpha:]]','',datain[,descriptor]))
}
Main driver of liking
Random forests are my preferred way to get a quick view of the most important effects. They do not worry about more variables than objects and do not imply a linear relation.
#remove missing data and names
data2 <- datain[-1,-1]
rf1 <- randomForest(CLiking ~ .,data=data2,importance=TRUE)
varImpPlot(rf1)
The plot shows CJuiciness (consumer score for juiciness) is the main driver of liking. Indeed the effect is clear when plotting Cliking against CJuiciness.
plot(CLiking ~ CJuiciness,data=datain)
The plot gives rise to two questions;
- Is the relation linear or slightly curved?
- The variation in liking around CJuiciness is large. Are more explanatory variables needed
- So, what drives CJuiciness?
A very interesting study. Can you please join us apples dataset (condensed). I searched on Peneau website but don't find it. Thank you in advance
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteWhere can i find data please ?
ReplyDeleteDear Raed, since it is from a paper I do not think I can just publish the data on the internet.
DeleteThank you for the response. Ok no problem. I want just to know if Cliking is average liking for all consumers or you have Cliking for each consumer so many columns ?
Delete