# Replicate the exploratory analyses that were conducted
# in Case study 1 of Chapter 5 in Van der Elst (2023)
# ------------------------------------------------------
library(NormData) # load the NormData package
data(Personality) # load the Personality dataset
Explore_Openness <- ExploreData(Dataset=Personality,
Model=Openness~LE)
summary(Explore_Openness)
plot(Explore_Openness,
main="Mean Openness scale scores and 99pc CIs")
# Replicate the exploratory analyses that were conducted
# in Case study 1 of Chapter 7 in Van der Elst (2023)
# ------------------------------------------------------
library(NormData) # load the NormData package
data(Substitution) # load the Substitution dataset
head(Substitution) # have a look at the first datalines in
# the Substitution dataset
# First make a new variable Age_Group, that discretizes the
# quantitative variable Age into 6 groups with a span of 10 years
Substitution$Age_Group <- cut(Substitution$Age,
breaks=seq(from=20, to=80, by=10))
# Compute descriptives of the LDST score for different Age Group
# by LE combinations
Explore.LDST.Age.LE <- ExploreData(Dataset=Substitution,
Model=LDST~Age_Group+LE)
summary(Explore.LDST.Age.LE)
# Make a plot of the results.
plot(Explore.LDST.Age.LE,
main="Mean (99pc CI) LDST scores by Age group and LE")
# Compute descriptives of the LDST score for different
# Age Group by Gender combinations
Explore.LDST.Age.Gender <- ExploreData(Dataset=Substitution,
Model=LDST~Age_Group+Gender)
# Plot the results
plot(Explore.LDST.Age.Gender,
main="Mean (99pc CI) LDST scores by Age group and Gender")
# Compute descriptives of the LDST score for different
# LE by Gender combinations
Explore.LDST.LE.Gender <-
ExploreData(Dataset=Substitution, Model=LDST~LE+Gender)
# Plot the results
plot(Explore.LDST.LE.Gender,
main="Mean (99pc CI) LDST scores by LE and Gender")
# Compute summary statistics of the LDST score in the
# Age Group by LE by Gender combinations
Explore.LDST <- ExploreData(Dataset=Substitution,
Model=LDST~Age_Group+LE+Gender)
# Plot the results
plot(Explore.LDST)
Run the code above in your browser using DataLab