You are on page 1of 2

Analysis of variance is ANOVA which is a group of statistical models and their associated

estimation techniques used to examine the differences among group means from a sample.
ANOVA is used to test general differences than exact differences among means.

ANOVA is comparing the ratio of systematic variance to unsystematic variance in an


investigational study. Variance in the ANOVA is partitioned in to total variance, variance due to
individual differences, and variance due to groups.

The examples uses the “PlantGrowth”. This dataset is available in R. If you need means please
download it from https://vincentarelbundock.github.io/Rdatasets/csv/datasets/PlantGrowth.csv .

import pandas as pd //Pandas is imported

datafile = "PlantGrowth.csv" //declaring the CSV file to a variable datafile

data = pd.read_csv(datafile) //reading the file

#Create a boxplot

data.boxplot('weight', by='group', figsize=(12, 8))

ctrl = data['weight'][data.group == 'ctrl']

grps = pd.unique(data.group.values)

d_data = {grp:data['weight'][data.group == grp] for grp in grps}

c = len(pd.unique(data.group)) # number of conditions

p = len(data.values) # conditions times participants

pc = data.groupby('group').size()[0] #Participants in each condition

You might also like