library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(readr)
library(agricolae)
library(ggplot2)
library(stats)
library(stats4)
library(ggplot2)
library(ggdendro)
library(readxl)
df <- read_excel("C:/Users/leefo/Desktop/Cluster22.xlsx")
tibble(df)
## # A tibble: 228 × 12
##    SAMPLE COLOR DRYNESS AROMA SPREADABILITY VISCOCITY PARTICLES SWEETNESS
##    <chr>  <dbl>   <dbl> <dbl>         <dbl>     <dbl>     <dbl>     <dbl>
##  1 A          7       7     4             7         6         0         1
##  2 B          3       7     5             8         4         1         4
##  3 C          4       6     5             9         4         0         4
##  4 D          1       7     4             9         2         0         3
##  5 E          6       6     5             7         7         1         4
##  6 F          8       6     6             7         6         2         1
##  7 G          2       7     5             8         5         0         8
##  8 H          7       6     7             7         7         0         3
##  9 Z          6       6     6             8         7         0         1
## 10 J          1       6     3             8         6         1         4
## # ℹ 218 more rows
## # ℹ 4 more variables: SALTINESS <dbl>, BITTERNESS <dbl>, P.FLAVOR <dbl>,
## #   STICKNESS <dbl>
attach(df)
str(df)
## tibble [228 × 12] (S3: tbl_df/tbl/data.frame)
##  $ SAMPLE       : chr [1:228] "A" "B" "C" "D" ...
##  $ COLOR        : num [1:228] 7 3 4 1 6 8 2 7 6 1 ...
##  $ DRYNESS      : num [1:228] 7 7 6 7 6 6 7 6 6 6 ...
##  $ AROMA        : num [1:228] 4 5 5 4 5 6 5 7 6 3 ...
##  $ SPREADABILITY: num [1:228] 7 8 9 9 7 7 8 7 8 8 ...
##  $ VISCOCITY    : num [1:228] 6 4 4 2 7 6 5 7 7 6 ...
##  $ PARTICLES    : num [1:228] 0 1 0 0 1 2 0 0 0 1 ...
##  $ SWEETNESS    : num [1:228] 1 4 4 3 4 1 8 3 1 4 ...
##  $ SALTINESS    : num [1:228] 4 6 6 1 6 6 1 2 6 0 ...
##  $ BITTERNESS   : num [1:228] 2 0 0 0 0 1 0 1 0 0 ...
##  $ P.FLAVOR     : num [1:228] 7 5 4 4 6 7 5 7 6 3 ...
##  $ STICKNESS    : num [1:228] 6 7 7 7 7 7 7 7 6 6 ...
#models
model1<-aov(COLOR~SAMPLE)
summary.aov(model1)
##              Df Sum Sq Mean Sq F value Pr(>F)    
## SAMPLE       18  546.0  30.332   24.22 <2e-16 ***
## Residuals   209  261.7   1.252                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model2<-aov(DRYNESS~SAMPLE)
summary.aov(model2)
##              Df Sum Sq Mean Sq F value Pr(>F)    
## SAMPLE       18  228.2  12.680   10.01 <2e-16 ***
## Residuals   209  264.8   1.267                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model3<-aov(AROMA~SAMPLE)
summary.aov(model3)
##              Df Sum Sq Mean Sq F value Pr(>F)    
## SAMPLE       18  215.8  11.987   10.85 <2e-16 ***
## Residuals   209  230.9   1.105                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model4<-aov(SPREADABILITY~SAMPLE)
summary.aov(model4)
##              Df Sum Sq Mean Sq F value Pr(>F)    
## SAMPLE       18  236.7  13.147   12.23 <2e-16 ***
## Residuals   209  224.7   1.075                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model5<-aov(VISCOCITY~SAMPLE)
summary.aov(model5)
##              Df Sum Sq Mean Sq F value Pr(>F)    
## SAMPLE       18  536.6  29.813   17.04 <2e-16 ***
## Residuals   209  365.6   1.749                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model6<-aov(PARTICLES~SAMPLE)
summary.aov(model6)
##              Df Sum Sq Mean Sq F value Pr(>F)    
## SAMPLE       18  364.5  20.249   11.35 <2e-16 ***
## Residuals   209  372.8   1.784                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model7<-aov(SWEETNESS~SAMPLE)
summary.aov(model7)
##              Df Sum Sq Mean Sq F value  Pr(>F)   
## SAMPLE       18   95.9   5.328   2.455 0.00126 **
## Residuals   209  453.7   2.171                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model8<-aov(SALTINESS~SAMPLE)
summary.aov(model8)
##              Df Sum Sq Mean Sq F value   Pr(>F)    
## SAMPLE       18    248  13.778   2.836 0.000187 ***
## Residuals   209   1016   4.859                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model9<-aov(BITTERNESS~SAMPLE)
summary.aov(model9)
##              Df Sum Sq Mean Sq F value   Pr(>F)    
## SAMPLE       18  165.1   9.174    5.59 1.06e-10 ***
## Residuals   209  343.0   1.641                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model10<-aov(P.FLAVOR~SAMPLE)
summary.aov(model10)
##              Df Sum Sq Mean Sq F value Pr(>F)    
## SAMPLE       18  231.8  12.880   11.52 <2e-16 ***
## Residuals   209  233.8   1.118                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model11<-aov(STICKNESS~SAMPLE)
summary.aov(model11)
##              Df Sum Sq Mean Sq F value   Pr(>F)    
## SAMPLE       18   72.5   4.027   2.604 0.000604 ***
## Residuals   209  323.3   1.547                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1