library(knitr)
opts_chunk$set(echo = FALSE, comment = NA)
## Data

dfr <- params$dfr
colnames(dfr)[2:4] <- c("Appe", "Tast", "Text")

## Count number of men and women

tmp <- dfr[dfr$Sex == "M" | dfr$Sex == "Male", ]
nm <- length(unique(tmp$PanelNo))
tmp <- dfr[dfr$Sex == "F" | dfr$Sex == "Female", ]
nw <- length(unique(tmp$PanelNo))

## Aggregate data for principal components

adg <- docomp(dfr, "sum", c("Appe", "Tast", "Text"), "INSTN")
tmp <- docomp(dfr, "sum", c("Appe", "Tast", "Text"), c("INSTN", "Sex"))
adm <- tmp[tmp$Sex == "M" | tmp$Sex == "Male", ]
adf <- tmp[tmp$Sex == "F" | tmp$Sex == "Female", ]
colnames(adm)[3:5] <- c("Appe-M", "Tast-M", "Text-M")
colnames(adf)[3:5] <- c("Appe-F", "Tast-F", "Text-F")
ads <- cbind(adm[, c(1, 3:5)], adf[, 3:5])

rownames(ads) <- ads$INSTN
rownames(adg) <- adg$INSTN

ads <- ads[, -1]
adg <- adg[, -1]

1. Gathering of data

Samples of all genotypes are boiled and presented on plates. Each genotype is evaluated about appearance and taste with the options:

and about texture with:

For the graphs below, the following abbreviations are used:

2. Results

A principal components analysis is shown to see the associations among the genotypes and the attributes, first with all the panelists together and then with panelists opinions differentiated by gender.

princip <- prcomp(adg, center = TRUE, scale. = TRUE)
summary(princip)
factoextra::fviz_pca(princip, repel = TRUE,
                     title = "Biplot of genotypes and attributes")
princip <- prcomp(ads, center = TRUE, scale. = TRUE)
summary(princip)
factoextra::fviz_pca(princip, repel = TRUE,
                     title = "Biplot of genotypes and attributes by gender")

3. Friedman test for genotypes

3.1. Analysis for appearance

friedman.t(dfr, 'Appe', 'INSTN', 'PanelNo')

3.2. Analysis for taste

friedman.t(dfr, 'Tast', 'INSTN', 'PanelNo')

3.3. Analysis for texture

friedman.t(dfr, 'Text', 'INSTN', 'PanelNo')


reyzaguirre/pepa documentation built on March 29, 2025, 9:56 p.m.