You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm a bit of a stats noob so I'm not sure if this is expected behavior or not, but when using GLM's ftest to do ANOVA calculations, and HypothesisTests OneWayANOVATest, I get different results with different sample sizes (see below)
MWE:
using GLM, StatsKit
# This set of data results in the same F-score and p-value
#=
g1 = [51, 87, 50, 48, 79, 61, 53, 54]
g2 = [82, 91, 92, 80, 52, 79, 73, 74]
g3 = [79, 84, 74, 98, 63, 83, 85, 58]
g4 = [85, 80, 65, 71, 67, 51, 63, 93]
=#
# This set of data results in a different F-score and p-value
g1 = [51, 87, 50, 48, 79, 61, 53]
g2 = [82, 91, 92, 80, 52, 79, 73, 74]
g3 = [79, 84, 74, 98, 63, 83, 85, 58]
g4 = [85, 80, 65, 71, 67, 51]
groups = [g1, g2, g3, g4]
println(OneWayANOVATest(groups...))
df1 = DataFrame(method = 0, scores=g1)
df2 = DataFrame(method = 1, scores=g2)
df3 = DataFrame(method = 2, scores=g3)
df4 = DataFrame(method = 3, scores=g4)
df = vcat(df1, df2, df3, df4)
df.method = categorical(df.method)
nullModel = lm(@formula(scores ~ 1), df)
methodModel = lm(@formula(scores ~ method), df)
println(nullModel)
println(methodModel)
ftest(nullModel.model, methodModel.model)
The text was updated successfully, but these errors were encountered:
I'm a bit of a stats noob so I'm not sure if this is expected behavior or not, but when using GLM's ftest to do ANOVA calculations, and HypothesisTests OneWayANOVATest, I get different results with different sample sizes (see below)
MWE:
The text was updated successfully, but these errors were encountered: