Skip to content
Back to formatted view

Raw Message

Message-ID: <a695fbee1001051132g5286a0b6uaa3fa47c23faa7d3@mail.gmail.com>
Date: 2010-01-05T19:32:00Z
From: Armin Goralczyk
Subject: Usage of weights in kruskal_test from package coin

With this email I will be following up on this (some months old) post:

http://tolstoy.newcastle.edu.au/R/e7/help/09/06/0799.html

>From this I would assume that the following is also valid:

set.seed(29)
x <- gl(3, 10)
y <- rnorm(length(x), mean = c(0, 0, 1)[x])
d <- data.frame(y = y, x = x)
# w <- rep(2, nrow(d)) ### double each obs
w <- rep(c(1,5), nrow(d)/2)

kruskal_test(y ~ x, data = d[rep(1:nrow(d), w),]) # should be the same as
kruskal_test(y ~ x, data = d, weights = ~ w)

But the tests are not the same. Am I wrong somewhere here?

-- 
Armin Goralczyk
--
http://www.gwdg.de/~agoralc