[RkWard-devel] Help for bonnett test

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Wed Feb 21 13:13:15 UTC 2007


Hi,

On Wednesday 21 February 2007 00:00, Stefan Roediger wrote:
> this will become the plug-in for the bonett.test (moments package). I try
> to follow the guidelines (regarding the new technologies) but get into
> trouble. Basically it's working but I can't get 'z' (transformation) in the
> output. What do I need to consider, add or change?

Well, the rk.result function is not really designed to work well with multiple 
values per cell. But the problem is even more basic, here: The $statistic of 
the test is actually a vector of two values: tau and z. You can't put those 
into a single cell of the data.frame. Therefore you get a warning "number of 
items to replace is not a multiple of replacement length", and the z drops 
out.

I suggest to do the following (inside the for-loop):

try ({
	rk.temp.t <- bonett.test (...)
	rk.temp.results$'kurtosis estimator (tau)'[i] <- rk.temp.t$statistic["tau"]
	rk.temp.results$'transformation (z)'[i] <- rk.temp.t$statistic["z"]
	rk.temp.results$'p-value'[i] <- rk.temp.t$p.value
})

Note that storing the test in a temporary variable, and fetching the values 
from there is better than calculating the test several times, as it is both 
more efficient and easier to read.

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20070221/97939498/attachment.sig>


More information about the Rkward-devel mailing list