测试有序组之间的趋势

时间:2014-01-15 06:25:34

标签: r math statistics

如何测试有序组之间的趋势。我正在使用prop.trend.test,但它没有按顺序排列,也没有给出sum of ranksz 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

1 个答案:

答案 0 :(得分:0)

我认为这不是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) ))