Exercise on experiments
Introduction
This exercise asks you to conduct a complete experimental analysis from start to finish. The scenario is as follows:
A company wants to test whether different work environments affect employee creativity. They randomly assigned 75 employees to three conditions:
- Open office (25 employees)
- Private office (25 employees)
- Flexible workspace (25 employees)
After 4 weeks, they measured creativity scores on a standardized test (scale: 0-100). You can download the data here
You now need to go through the following steps:
- Data exploration
- Assumptions checking
- Statistical Analysis
- Interpretation and visualization
- Bonus: conduct an ANCOVA
Complete each step below. A possible solution is available here.
Step 1: Data Exploration
- Get basic descriptive statistics for the dataset
- Calculate mean and SD of creativity_score by work_environment
- Create a visualization comparing creativity scores across environments
Step 2: Assumption Checking
- Check normality of creativity scores within each group
- Test equality of variances across groups
- Create histograms or Q-Q plots to visually inspect assumptions
Step 3: Statistical Analysis
- Conduct one-way ANOVA using both aov() and lm()
- Verify that both approaches give identical F-statistics and p-values
- If significant, perform post-hoc comparison
- Calculate effect size (eta-squared)
Step 4: Interpretation and Visualization
- Create a professional publication-ready plot
- Write a 2-3 sentence interpretation of your results
- Delineate a practical recommendation to the company
Step 5: ANCOVA
- Add years_experience as a covariate
- Does this change your conclusions?