简体   繁体   English

测试有序组的趋势

[英]Test for trend across ordered groups

How can I test for trend across ordered groups. 如何测试有序组的趋势。 I am using prop.trend.test but it doesn't order into groups and doesn't give the expected output of sum of ranks , z value ... I am using this command prop.trend.test (birthweight2$lbw2 ,birthweight2$gestwkgp ) 我正在使用prop.trend.test但它没有按组排列,也没有给出sum of ranksz value的预期输出...我正在使用此命令prop.trend.test (birthweight2$lbw2 ,birthweight2$gestwkgp )

I have this data set 我有这个数据集

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

I don't think this is how prop.trend.test is meant to work. 我认为这不是prop.trend.test的工作方式。 You need an additional qualifier that bins your data into a before/after scenario. 您需要一个附加的限定符,用于将数据分类到之前/之后的场景中。 Then you want to see if there is any difference between the low/normal weight across these two scenarios. 然后,您想看看这两种情况下的低体重/正常体重之间是否有任何区别。 Think about formulating your problem as a 2x2 contingency table where the columns are the before/after and the rows are weigh categories. 考虑将问题表述为2x2列联表,其中列是之前/之后,行是权重类别。

                 BEFORE    AFTER
low-weigh         freq     freq
normal-weight     freq     freq

The question then becomes like if the treatment has any effect on the weight, so the syntax of the function will become: 这样,问题就变成了处理方式是否会对权重产生影响,因此该函数的语法将变为:

 prop.trend.test(c(low-weight-after, normal-weight-after),c(rowSums(contingency_table) ))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM