[英]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.