当前位置:网站首页>ANOVA example
ANOVA example
2022-07-03 16:52:00 【Changsha has fat fish】
One way ANOVA
# Sipping, sipping, sipping 3 Different user ratings in different cities from scipy.stats import f_oneway a = [10,9,9,8,8,7,7,8,8,9] b = [10,8,9,8,7,7,7,8,9,9] c = [9,9,8,8,8,7,6,9,8,9] f,p = f_oneway(a,b,c) print (f)
0.101503759398 0.903820890369
among p The value is 0.903820890369
It cannot be considered that the factors tested have a significant impact on the observed value
Multivariate analysis of variance
# # Sipping, sipping, sipping 2 One factor : Environmental grade , Food grade from scipy import stats import pandas as pd import numpy as np from statsmodels.formula.api import ols from statsmodels.stats.anova import anova_lm environmental = [5,5,5,5,5,4,4,4,4,4,3,3,3,3,3,2,2,2,2,2,1,1,1,1,1] ingredients = [5,4,3,2,1,5,4,3,2,1,5,4,3,2,1,5,4,3,2,1,5,4,3,2,1] score = [5,5,4,3,2,5,4,4,3,2,4,4,3,3,2,4,3,2,2,2,3,3,3,2,1] data = {'E':environmental, 'I':ingredients, 'S':score} df = pd.DataFrame(data) df.head()
Symbolic meaning :
- (~) Isolate dependent and independent variables ( Left dependent variable , Right argument )
- (+) Separate the arguments
- (:) Indicates the interaction of two independent variables
formula = 'S~E+I+E:I' model = ols(formula,df).fit() results = anova_lm(model) print (results)
df sum_sq mean_sq F PR(>F) E 1.0 7.22 7.220000 54.539568 2.896351e-07 I 1.0 18.00 18.000000 135.971223 1.233581e-10 E:I 1.0 0.64 0.640000 4.834532 3.924030e-02 Residual 21.0 2.78 0.132381 NaN NaN
explain : E Of F value 2.896351e-07,I Of F value 1.233581e-10 Very small ,E and I Have a significant impact on the results , There is no interaction
边栏推荐
- JSON 与 BSON 区别
- CC2530 common registers for port interrupts
- Simulink oscilloscope data is imported into Matlab and drawn
- PHP CI (CodeIgniter) log level setting
- [Jianzhi offer] 57 - ii Continuous positive sequence with sum s
- Zebras are recognized as dogs, and Stanford found the reason why AI made mistakes
- Atom QT 16_ audiorecorder
- RF analyze demo build step by step
- Mysql database DDL and DML
- Golang decorator mode and its use in NSQ
猜你喜欢
线程池执行定时任务
Thread pool executes scheduled tasks
Le zèbre a été identifié comme un chien, et la cause de l'erreur d'AI a été trouvée par Stanford
What is the maximum number of concurrent TCP connections for a server? 65535?
Basis of target detection (IOU)
Mysql 单表字段重复数据取最新一条sql语句
Data driving of appium framework for mobile terminal automated testing
Idea configuration plug-in
Zebras are recognized as dogs, and Stanford found the reason why AI made mistakes
Explore Netease's large-scale automated testing solutions see here see here
随机推荐
PyTorch 1.12发布,正式支持苹果M1芯片GPU加速,修复众多Bug
斑馬識別成狗,AI犯錯的原因被斯坦福找到了
[combinatorial mathematics] recursive equation (example of recursive equation 2 Hanoi Tower | example of recursive equation 3 insertion sequencing)
What kind of material is 14Cr1MoR? Analysis of chemical composition and mechanical properties of 14Cr1MoR
Visual SLAM algorithms: a survey from 2010 to 2016
匯編實例解析--實模式下屏幕顯示
数据分析必备的能力
面试之 top k问题
Web crawler knowledge day03
How to allow remote connection to MySQL server on Linux system?
Two sides of the evening: tell me about the bloom filter and cuckoo filter? Application scenario? I'm confused..
[JDBC] API parsing
为抵制 7-Zip,列出 “三宗罪” ?网友:“第3个才是重点吧?”
Processing strategy of message queue message loss and repeated message sending
Add color to the interface automation test framework and realize the enterprise wechat test report
香港理工大学|数据高效的强化学习和网络流量动态的自适应最优周界控制
Hands on in-depth learning notes (XIV) 3.7 Simple implementation of softmax regression
[combinatorics] polynomial theorem (polynomial coefficients | full arrangement of multiple sets | number of schemes corresponding to the ball sub model | polynomial coefficient correlation identity)
Register in PHP_ Globals parameter settings
Google Earth engine (GEE) - daymet v4: daily surface weather data set (1000m resolution) including data acquisition methods for each day