################ ### EXERCISE 2.1 ################ ### Consider you want to buy apples for producing pies. ### You can decide between apples from three different ### plantations, A, B & C. ### Compare the apple characteristics from a sample ### of each plantation using descriptive statistics ### and graphical representations. ### The study data is available as EXCEL file. ### To import the data start as follows: ### Store the study data at a new folder on your PC. ### Install the R-package "xlsx". ### Setting, Packages & Data Import setwd("C:\\...\\DataExamples") library(xlsx) X = read.xlsx("Apples.xlsx", sheetIndex=1) ################ ### EXERCISE 2.2 ################ ### Determine absolute and relative frequencies ### for the qualitative apple characteristics ### using the R-functions, table, prop.table. ### To obtain separate results per plantation, ### you can employ the function tapply. ### Summarize your results in one table in WORD document. ### Example: t(round(100 * prop.table(table(X$Plantation, X$Condition), 1), 1)) ################ ### EXERCISE 2.3 ################ ### Summarize the metric data per plantation ### using the R-functions mean, sd, min, max, median. ### Add the results to your summary table in WORD. ### Example: round(tapply(X$Weight, X$Plantation, mean), 1) ################ ### EXERCISE 2.4 ################ ### Illustrate the data using the R-functions ### barplot and boxplot. ### Add the figures to your WORD report. ### Examples: barplot(table(X$Condition, X$Plantation), cex.lab=1.5, cex.axis=1.5, main="Condition", cex.main=1.5, ylim=c(0, 180), xlab="Plantation", ylab="Absolute Frequency", col=c("lightgrey", "grey"), cex.names=1.5) boxplot(X$Weight ~ X$Plantation, cex.axis=1.5, cex.lab=1.5, xlab="Plantation", ylab="Weight (g)") ################ ### EXERCISE 2.5 ################ ### Compare your analysis code and WORD-report ### with the archetype analysis provided during ### the course by your tutor. ################ ### EXERCISE 2.6 ################ ### Based on the statistical analysis, ### discuss within the group from which plantation ### you would buy the apples for your production.