In ANOVA our interest lies in knowing if one continuous dependent variable is affected by one or more categorical independent variables. MANOVA is an extension of ANOVA where we are now able to understand how several dependent variables are affected by independent variables. For example consider an investigation where a medical investigator has developed 3 […]

## One way MANOVA in R solutions

These are solutions to exercises found here #################### # # # Exercise 1 # # # #################### # Read in SPSS data library(foreign) koro.data = read.spss(“C:/Users/INVESTS/Downloads/koro.sav”,to.data.frame = TRUE) View(koro.data) attach(koro.data) #################### # # # Exercise 2 # # # #################### #Check number of observations in each group table(therapy) ## therapy ## Abreaction Behavioral Cognitive Control […]

## Repeated measures ANOVA in R Exercises

One way, two way and n way ANOVA are used to test difference in means when we have one, two and n factor variables. A key assumption when performing these ANOVAs is that the measurements are independent. When we have repeated measures this assumption is violated, so we have to use repeated measures ANOVA. Repeated […]

## Repeated measures ANOVA in R Solutions

Solutions to exercises found here #################### # # # Exercise 1 # # # #################### #load the data setwd(“H:/data analysis”) library(foreign) exercise = read.csv(“exer.csv”) attach(exercise) head(exercise) ## id diet exertype pulse time ## 1 1 1 1 85 1 ## 2 1 1 1 85 2 ## 3 1 1 1 88 3 ## 4 […]

## Two Way ANOVA in R Exercises

One way analysis of variance helps us understand the relationship between one continuous dependent variable and one categorical independent variable. When we have one continuous dependent variable and more than one independent categorical variable we cannot use one way ANOVA. When we have two independent categorical variable we need to use two way ANOVA. When […]

## Two Way ANOVA in R Solutions

Solutions to exercises found here #################### # # # Exercise 1 # # # #################### #Read in the moth experiment data setwd(“H:/datasets”) moth.experiment = read.csv(“moth trap experiment.csv”, header = TRUE) #Inspect structure of the data head(moth.experiment) ## number.of.moths location type.of.lure ## 1 32 Top Chemical ## 2 29 Top Chemical ## 3 16 Top Chemical […]

## One Way Analysis of Variance Exercises

When we are interested in finding if there is a statistical difference in the mean of two groups we use the t test. When we have more than two groups we cannot use the t test, instead we have to use analysis of variance (ANOVA). In one way ANOVA we have one continuous dependent variable […]

## One Way Analysis of Variance Solutions

These are the solutions to the exercises One Way Analysis of Variance here #################### # # # Exercise 1 # # # #################### #Read in the cancer survival.csv data setwd(“H:/datasets”) cancer.survival = read.csv(“cancer survival.csv”, header = TRUE) #Inspect structure of the data head(cancer.survival) ## Survival Organ ## 1 124 Stomach ## 2 42 Stomach ## […]

## Paired t-test in R Exercises

The paired samples t test is used to check if there are any differences in the mean of the same sample at two different time points. For example a medical researcher collects data on the same patients before and after a therapy. A paired t test will show if the therapy improves patient outcomes. There […]

## Paired t test in R Solutions

Â Solutions to exercises on paired t-test found here #################### # # # Exercise 1 # # # #################### #Load package MASS library(MASS) #attach anorexia data so that variables are easily accessible attach(anorexia) #Inspect structure of the data head(anorexia) ## Treat Prewt Postwt ## 1 Cont 80.7 80.2 ## 2 Cont 89.4 80.1 ## 3 Cont […]