How to do ANCOVA in R?

可紊 提交于 2019-12-02 05:26:13

You could use the function lm, which runs a linear regression (in the end, ANOVA and ANCOVA are just restricted versions of the linear model).

mod <- lm(output ~ input + category, data=data)

You can view the output with the summary function

summary(mod)

If you really need to have the output 'ANOVA style', then you can apply the function anova on the model created (I personally find the lm output more informative, but maybe you have specific restrictions).

anova(mod)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!