[英]How do you test for departure from linear trend across ordered categorical variables with logistic regression using R?
[英]Test for trend across ordered groups
如何测试有序组的趋势。 我正在使用prop.trend.test
但它没有按组排列,也没有给出sum of ranks
和z value
的预期输出...我正在使用此命令prop.trend.test (birthweight2$lbw2 ,birthweight2$gestwkgp )
我有这个数据集
lbw2 gestwkgp
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 4
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 4
low birth weight 2
normal birth weight 4
normal birth weight 4
normal birth weight 3
normal birth weight 4
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 2
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 4
normal birth weight 3
normal birth weight 4
normal birth weight 4
normal birth weight 3
normal birth weight 3
normal birth weight 3
low birth weight 3
low birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 3
low birth weight 1
normal birth weight 3
normal birth weight 4
normal birth weight 3
normal birth weight 4
normal birth weight 3
normal birth weight 3
normal birth weight 4
normal birth weight 3
low birth weight 1
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 4
normal birth weight 3
normal birth weight 4
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 4
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 2
normal birth weight 3
low birth weight 2
normal birth weight 3
low birth weight 2
low birth weight 2
normal birth weight 4
normal birth weight 2
normal birth weight 3
low birth weight 1
normal birth weight 3
normal birth weight 3
low birth weight 1
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 3
low birth weight 2
normal birth weight 4
low birth weight 2
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 2
normal birth weight 3
normal birth weight 3
low birth weight 1
normal birth weight 4
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 2
normal birth weight 3
normal birth weight 3
normal birth weight 2
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 3
normal birth weight 4
我认为这不是prop.trend.test的工作方式。 您需要一个附加的限定符,用于将数据分类到之前/之后的场景中。 然后,您想看看这两种情况下的低体重/正常体重之间是否有任何区别。 考虑将问题表述为2x2列联表,其中列是之前/之后,行是权重类别。
BEFORE AFTER
low-weigh freq freq
normal-weight freq freq
这样,问题就变成了处理方式是否会对权重产生影响,因此该函数的语法将变为:
prop.trend.test(c(low-weight-after, normal-weight-after),c(rowSums(contingency_table) ))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.