R 帮助中的单向方差分析
我是 R(统计数据包)编程新手,我想做一个单向方差分析。
我的数据框架是这样的,
q1 sex
1 N M
2 Y F
3 U F
...
1000 Y M
你能帮我吗?
I am new in R (statistic packet) programming and I would like to make an 1way anova.
My frame of data is like that
q1 sex
1 N M
2 Y F
3 U F
...
1000 Y M
Could you help me please ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
跟进@Thilo 和 @DWin 的评论:如果你真的想分析两个分类变量之间的关系,你可以尝试这样的事情:
从回答你的问题的角度来看,获得更多背景信息将非常有帮助: 你想回答什么问题?另外,一如既往,有一个可重现的示例是很好的(只是为了节省我自己生成一些假数据来使用的方法的时间)。
一个小问题是,皮尔逊卡方检验正在检验关联性;它不像方差分析框架那样区分响应变量和预测变量。
当然,如果您确实有一个连续响应变量而忽略了告诉我们,那么这不会太有用......
Following up on @Thilo's and @DWin's comments above: if you really want to analyze the relationship between two categorical variables, you might try something like this:
It would be really helpful from the point of view of answering your questions to have some more context: what question are you trying to answer? Also, as always, it's nice to have a reproducible example (just to save the time of coming up with my own way of generating some fake data to play with).
One small point is that the Pearson chi-square test is testing for association; it doesn't distinguish between response and predictor variables as the ANOVA framework does.
Of course, if you really have a continuous response variable that you're neglecting to tell us about, then this won't be too useful ...