Matt,
Some time back I didn't like the uniroot restriction either so I wrote a short
function "manyroots" that breaks an interval into many shorter intervals and
looks for a single root in each of them. This function is NOT guaranteed to
find all roots in an interval even if you specify many
Bob,
This is I think exactly what one wants to have happen. The first four
observations are still women. Both the labels and the underlying integers
should change. (If you want to give all the people sex changes, try Relevel in
the Epi package.
mydata$afterthechange <- Relevel(mydata$gende
Horace,
Last year I found another Jonckheere-Terpstra function at
http://www.biostat.wustl.edu/archives/html/s-news/2000-10/msg00126.html
Using that and the version in SAGx and wanting a few other options, I
created the version below.
Hope it is useful,
Chris
--
Christopher Andrews, PhD
SUNY Bu
nkpartitions <- function(n, k, exact=FALSE, print=FALSE) {
# n objects
# k subgroups
# exactly k or at most k?
# print results as they are found?
if (n != floor(n) | n<=0) stop("n must be positive integer")
if (k != floor(k) | k<=0) stop("k must be positive integer")
if (print) {
p