Performing analysis of covariance with python/scip

2019-05-16 16:36发布

Could anyone please help in providing an example showing how ANCOVA (analysis of covariance) can be done in scipy/statsmodel, with python?

I am not sure if I am asking too much, but a quick search showed me this which is not informative enough for me.

Thanks!

1条回答
放我归山
2楼-- · 2019-05-16 17:05

Statsmodels uses the linear model, OLS, to estimate ANOVA. So, having additional continuous regressors as in ANCOVA does not change the analysis.

Here are a few links to the relevant documentation

Anova helper functions and examples for ANCOVA interactions http://statsmodels.sourceforge.net/devel/examples/generated/example_interactions.html

using formulas to create the design matrix http://statsmodels.sourceforge.net/devel/example_formulas.html

the core OLS model http://statsmodels.sourceforge.net/devel/generated/statsmodels.regression.linear_model.OLS.html

查看更多
登录 后发表回答