Data Analysis in R for Consumer Science
1
Introduction to the book
2
Introduction to R
2.1
How to get started - understanding R (and RStudio)
2.1.1
Organise and save scripts
2.2
How to import data
2.2.1
Import data from R-package
2.2.2
Importing a csv file
2.2.3
Importing an Excel file/sheet
2.2.4
Clipboard import
2.2.5
Looking at the imported elements
2.2.6
Numbers and factors - changing categorisation
2.3
How to edit and merge datasets
2.4
How to save the data
2.5
How to export data / results
2.6
How to load your RData
2.7
How to clear your environment
3
Libraries
4
Descriptive statistics
4.1
Descriptives for a continuous variable
4.1.1
Mean / median
4.1.2
Variance
4.1.3
Standard deviation
4.1.4
Calculations
4.2
Distributions of count data
4.3
Aggregate
4.4
Tidyverse
5
Inferential statistics
5.1
Intro
5.2
Hypothesis testing
5.2.1
Power
5.3
Confidence intervals
5.4
T-test
5.5
F-test
5.6
Analysis of Variance (ANOVA)
5.6.1
One-way ANOVA
5.6.2
Two-way ANOVA
5.6.3
Post hoc test - Tukey’s Honest Significant Difference
5.7
Introduction to linear and mixed models
5.8
Normal and Mixed models
5.8.1
Normal model
5.8.2
Mixed model
6
Plotting data
6.1
Histograms and boxplots
6.2
Scatter plots
6.3
How to export plots
7
Introduction to PCA and multivariate data
7.1
A bit of math
7.2
Interpreting model output
7.2.1
Biplot
8
Buffet and survey data
8.1
Buffet data
8.1.1
Introduction to buffet data
8.1.2
Plotting buffet data
8.1.3
Mixed model for buffet data
8.2
Survey data
8.2.1
Plotting survey data
8.2.2
Linear model for buffet data
8.2.3
Post-hoc test for survey data
8.3
Combining consumption and survey data
9
MST exercises
9.1
Exercise 1
9.2
Exercise 2
9.3
Exercise 3
10
Intro to large survey data
10.0.1
Looking at the data and checking formating
10.1
Descriptive statistics
10.1.1
Numeric values
10.2
Plots
10.2.1
Within groups of data
10.3
Categorical / Ordinal variables
10.3.1
Tables
10.4
Table 1
10.5
The tidyverse way
11
Consumer segmentation
11.1
Segmentation
11.1.1
K-means
11.1.2
Internal characterization of clusters
11.1.3
Vizualization
11.1.4
K-means splits variation
11.2
Selecting the number of clusters
11.3
Segmentation - example 2
11.3.1
Cluster analysis
11.3.2
Plot the model using PCA
11.3.3
Add to dataset
11.3.4
Comments
12
Profiling segments
12.1
Table 1 as a profiling tool
12.2
Visualization of Consumer Segments
12.3
Creating the contingency table
12.4
Plot the numbers
12.5
Contingency table
12.5.1
Pearson Chi-square test
12.6
Correspondence Analysis
13
Logistic Regression
13.1
Segmentation/Clustering
13.2
Fitting the logistic regression-model
13.3
Probabilities of segment membership:
13.4
Odds ratios
13.5
ORs and Probs
13.6
Effect of Age
13.7
Multivariate analysis
13.7.1
Descriptives
13.7.2
Two nested models
13.7.3
Coefficients
13.7.4
Re-level
13.7.5
All pairwise comparisons
13.8
Segment 2 and 3
13.9
A new set of data
13.10
Logistic regression for demographic characterization
13.10.1
Age
13.10.2
Gender
13.11
TASK
13.12
The tidyverse way
13.13
Comment
14
CATA data (Check-All-That-Apply)
14.1
Importing and looking at the beer data
14.2
Two versions of the data
14.3
Cochran’s Q test
14.3.1
Post hoc test
14.3.2
For all attributes in one run (nice to know)
14.4
PCA on CATA data
15
CATA and Hedonics
15.1
Individual attributes and liking
15.1.1
An example with Refreshing
15.1.2
All attributes
15.2
PCA on CATA and Liking
15.2.1
A beer centric model
16
Preference Mapping
16.1
Example of Preference Mapping
16.2
PCA
16.3
Analysis by PLS
16.4
L-PLS [For the future…]
17
Hedonic rating (e.g. liking scores)
17.1
Plotting liking scores
17.2
Simple mixed models
17.2.1
Post hoc test
17.3
Multivariable models
17.3.1
Additive models
17.3.2
Effect modification and Interactions
18
Projective mapping
18.1
Example from mapping of XX
18.2
A Collated version of the data
18.3
PCA on Collated data
18.4
19
TFIH Exercises
19.1
Exercise 1: Descriptive statistics and plots
19.1.1
CATA counts
19.1.2
Hedonics
19.2
Exercise 2: Consumer background and PCA
19.2.1
Demographics
19.2.2
PCA on
Interests
19.3
Exercise 3: PCA on CATA counts
19.4
Exercise 4: Cochran’s Q test on CATA binary data
19.5
Exercise 5: Hedonic ratings and consumer characteristics
19.5.1
PCA on joint data
19.5.2
All demographics
19.6
Exercise 6: PCA on CATA counts and hedonic ratings
19.7
Exercise 7: Mixed modelling on hedonic ratings
20
Latent Factor Models
21
LPLS
22
Consumer Segmentation
22.1
Kmeans
23
More PCA
24
Logistic Regression
25
Confirmatory Factor Analysis using lavaan
25.1
Example - Food Neophobia
26
Structured Equation Modelling
26.1
Example - Theory of Planned Behaviour
26.1.1
PLSDA (CATA??)on CATA and liking??
27
PCA on survey answers
27.1
Bi-plot
27.1.1
Extract the components and run all associations.
28
Linear models
28.1
Example
28.2
Run a bunch of models at once
28.2.1
A plot
29
Mixed models
29.1
With several variables
Published with bookdown
Data Analysis in R for Sensory and Consumer Science
Chapter 24
Logistic Regression