**R-exercises**, and kindly contributed to R-bloggers)

In this set of exercises we shall follow the practice of conducting an experimental study. Researcher wants to see if there is any influence of working-out on body mass. Three groups of subjects with similar food and sport habits were included in the experiment. Each group was subjected to a different set of exercises. Body mass was measured before and after workout. The focus of the research is the difference in body mass between groups, measured after working-out. In order to examine these effects, we shall use paired t test, t test for independent samples, one-way and two-ways analysis of variance and analysis of covariance.

You can download the dataset here. The data is fictious.

Answers to the exercises are available here.

If you have different solution, feel free to post it.

**Exercise 1**

Load the data. Calculate descriptive statistics and test for the normality of both initial and final measurements for whole sample and for each group.

**Exercise 2**

Is there effect of exercises and what is the size of that effect for each group? (Tip: *You should use paired t test.*)

**Exercise 3**

Is the variance of the body mass on final measurement the same for each of the three groups? (Tip: *Use Levene’s test for homogeneity of variances*)

**Exercise 4**

Is there a difference between groups on final measurement and what is the effect size? (Tip: *Use one-way ANOVA*)

**Learn more**about statistics for your experimental design in the online course Learn By Example: Statistics and Data Science in R. In this course you will learn how to:

- Work thru regression problems
- use different statistical tests and interpret them
- And much more

**Exercise 5**

Between which groups does the difference of body mass appear after the working-out? (Tip: *Conduct post-hoc test.*)

**Exercise 6**

What is the impact of age and working-out program on body mass on final measurement? (Tip: *Use two-way between groups ANOVA.*)

**Exercise 7**

What is the origin of effect of working-out program between subjects of different age? (Tip: *You should conduct post-hoc test.*)

**Exercise 8**

Is there a linear relationship between initial and final measurement of body mass for each group?

**Exercise 9**

Is there a significant difference in body mass on final measurement between groups, while controlling for initial measurement?

**Exercise 10**

How much of the variance is explained by independent variable? How much of the variance is explained by covariate?

**leave a comment**for the author, please follow the link and comment on their blog:

**R-exercises**.

R-bloggers.com offers

**daily e-mail updates**about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...