Professional Documents
Culture Documents
Chapter2 3
Chapter2 3
variables
E X P E R I M E N TA L D E S I G N I N P Y T H O N
Luke Hayden
Instructor
Obvious conclusion?
print(p9.ggplot(df)+ p9.aes(x= 'Team', y= 'Weight')+ p9.geom_boxplot())
Example
Luke Hayden
Instructor
Making comparisons
Compare apples with apples
import pandas as pd
from scipy import stats
seed= 1916
subset_A = df[df.Sample == "A"].sample(n= 30, random_state= seed)
subset_B = df[df.Sample == "B"].sample(n= 30, random_state= seed)
ttest = stats.ttest_rel(yields2018,yields2019)
print(ttest[1])
p-value:
0.007894143467973484
Full Name
Instructor
Factors
Independent variables (Factors)
Experimentally manipulated/examined
Dependent variables
Approaches
t-test: one dependent variable, one discrete independent variable with two levels
Use
Approach
Partition variation
Example:
print(anova[1])
0.00
Example
sum_sq df F PR(>F)
Luke Hayden
Instructor
Additive model
sum_sq df F PR(>F)
7 variables, 7 p-values
Complex!