---
title: "06 Worksheet. Crash Course in Statistics (Summer 2025)"
subtitle: "Neuroscience Center Zurich, University of Zurich"
author: "Zofia Baranczuk"
date: "2025-08-25"
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## 1. Anorexia example (Paired design).
Anorexia is an eating disorder characterized by low weight, food restriction, fear of gaining weight, and a strong desire to be thin. The dataset `MASS::anorexia` lists pre- and post-treatment weights for patients assigned to several treatments.

Focus on the CBT (cognitive behavioral therapy) group and test whether the treatment was effective.

a) State the hypotheses for a two-sided test at alpha= 0.05.  
b) Create an exploratory plot of weight change (histogram and Q–Q plot), if useful other plots.  
c) Run a paired t-test; also run a Wilcoxon signed-rank test as a robustness check.  
d) Report the mean change, a 95% CI for the mean change, p-values, and the paired effect size. 
e) Interpret the results.

```{r}

```

## 2. T-test vs. Wilcoxon test.
To get more intuition about t-test vs. the Wilcoxon test: Construct (simulate or choose) two independent samples for which the two-sample t-test is significant at alpha = 0.05 while the Wilcoxon rank-sum test is not. Then run two permutation tests using (i) the difference in means and (ii) the difference in medians as the test statistic.
```{r}

```
