Re: [R] Jonckheere-Terpstra test using coin package?

2010-05-05 Thread Dale Steele
afo = rank, xtrafo = function(data) trafo(data, factor_trafo = ff), alternative="greater", distribution=approximate(B=50)) On Wed, Apr 21, 2010 at 8:23 PM, Dale Steele wrote: > Is it possible to implement the Jonckheere-Terpstra test for ordered > alte

[R] Jonckheere-Terpstra test using coin package?

2010-04-21 Thread Dale Steele
Is it possible to implement the Jonckheere-Terpstra test for ordered alternatives using the coin package: Conditional Inference Procedures in a Permutation Test Framework? I found jonckheere.test{clinfun}, but it uses a normal approximation when ties are present in the data. To make this concrete

[R] possible arrangements of across sample ties for runs test

2010-02-26 Thread Dale Steele
I'm trying to implement the two-sample Wald-Wolfowitz runs test. Daniel (1990) suggests a method to deal with ties across samples. His suggestion is to prepare ordered arrangements, one resulting in the fewest number of runs, and one resulting in the largest number of runs. Then take the mean of

[R] behavior of seq_along

2010-02-25 Thread Dale Steele
I'm trying to understand the behavior of seq_along in the following example: x <- 1:5; sum(x) y <- 6:10; sum(y) data <- c(x,y) S <- sum( data[seq_along(x)] ) S T <- sum( data[seq_along(y)] ) T Why is T != sum(y) ? __ R-help@r-project.org mailing list

Re: [R] How to use a 'hidden' function directly?

2010-02-24 Thread Dale Steele
, 5) Error in .C("R_qansari", as.integer(length(p)), q = as.double(p), as.integer(m), : C symbol name "R_qansari" not in load table --Dale On Wed, Feb 24, 2010 at 8:47 PM, Sharpie wrote: > > > Dale Steele wrote: >> >> I would like to be able to use two

[R] How to use a 'hidden' function directly?

2010-02-24 Thread Dale Steele
I would like to be able to use two functions; qansari and pansari which are found in the function ansari.test. How can I evaluate these functions independently? Thanks. --Dale For example, when I load the function ... qansari <- function(p, m, n) { .C(R_qansari, as.integer(leng

Re: [R] Code find exact distribution for runs test?

2010-02-12 Thread Dale Steele
tistical Data Center > Intermountain Healthcare > greg.s...@imail.org > 801.408.8111 > > >> -Original Message- >> From: Dale Steele [mailto:dale.w.ste...@gmail.com] >> Sent: Thursday, February 11, 2010 5:28 PM >> To: Greg Snow >> Cc: R-help@r-project.org &

Re: [R] Code find exact distribution for runs test?

2010-02-11 Thread Dale Steele
> greg.s...@imail.org > 801.408.8111 > > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- >> project.org] On Behalf Of Greg Snow >> Sent: Thursday, February 11, 2010 12:19 PM >> To: Dale Steele; R-help@r-project

[R] Code find exact distribution for runs test?

2010-02-10 Thread Dale Steele
I've been attempting to understand the one-sample run test for randomness. I've found run.test{tseries} and run.test{lawstat}. Both use a large sample approximation for distribution of the total number of runs in a sample of n1 observations of one type and n2 observations of another type. I've b

[R] Wilcoxon signed-ranks test using package coin ?

2010-02-08 Thread Dale Steele
Given the following data, and hypothesized median M.0 I've found a method to implement the Wilcoxon signed-rank test. Data: (with one zero difference and tied ranks) x <- c(136, 103, 91, 122, 96, 145, 140, 138, 126, 120, 99, 125, 91,142, 119, 137) M.0 <- 119 > library(exactRankTests) Package ‘

[R] How to Reshuffle a distance object

2009-04-15 Thread Dale Steele
I would like to randomly shuffle a distance object, such as the one created by ade4{dist.binary} below. My first attempt, using sample(jc.dist) creates a shuffled vector, losing the lower triangular structure of the distance object. How can I Ishuffle the lower triangular part of a distance matrix

[R] code to find all distinct subsets of size r from a set of size n

2009-03-13 Thread Dale Steele
I'm doing a permutation test and need to efficiently generate all distinct subsets of size r from a set of size n. P 138 of MASS (4th ed) notes that "The code to generate this efficiently is in the scripts". I was unable to find this code on quick inspection of the \library\MASS\scripts file for

[R] Efficent way to create an nxn upper triangular matrix of one's

2009-02-11 Thread Dale Steele
The code below create an nxn upper triangular matrix of one's. I'm stuck on finding a more efficient vectorized way - Thanks. --Dale n <- 9 data <- matrix(data=NA, nrow=n, ncol=n) data for (i in 1:n) { data[,i] <- c(rep(1,i), rep(0,n-i)) } data __

[R] Finding the distance between ordered integers

2009-01-22 Thread Dale Steele
I'm stuck on how best to of find the distance between ordered integers (presented below as a birthday problem). Given the vector x, how do I most efficiently generate the vector x[i+1] - x[i]? Thanks. --Dale For example... set.seed(555) x <- sample(1:365, 10, replace=TRUE) x <- sort(x) x

Re: [R] Beautify R scripts in microsoft word

2008-09-13 Thread Dale Steele
Open script in Tinn-R, select script to copy. Then use menu Edit:Copy formatted (to export) --> RTF Paste into MS word. --Dale On Sat, Sep 13, 2008 at 1:30 PM, Daren Tan <[EMAIL PROTECTED]> wrote: > > I am generating a report containing several R scripts in the appendix. Is > there any way to

Re: [R] Configuring emacs/ess on Ubuntu

2008-05-25 Thread Dale Steele
$ sudo apt-get install Installs installs ESS version 5.3.0. Is there a repository for more recent version? Thanks. --Dale On Sun, May 25, 2008 at 11:24 AM, Roland Rau <[EMAIL PROTECTED]> wrote: > Hi Wade, > > Wade Wall wrote: >> >> Hi all, >> >> I don't know if this is the proper place to a

Re: [R] Finding Interaction and main effects contrasts for two-wayANOVA

2008-03-08 Thread Dale Steele
Thanks to those who have replied to my original query. However, I'm still confused on how obtain estimates, standard error and F-tests for main effect and interaction contrasts which agree with the SAS code with output appended below. for example, ## Given the dataset (from Montgomery) twoway <-

[R] Finding Interaction and main effects contrasts for two-way ANOVA

2008-03-06 Thread Dale Steele
I've tried without success to calculate interaction and main effects contrasts using R. I've found the functions C(), contrasts(), se.contrasts() and fit.contrasts() in package gmodels. Given the url for a small dataset and the two-way anova model below, I'd like to reproduce the results from ap

Re: [R] help.start() on linux (fedora 8) when firefox alreading running - a way to open a new tab?

2008-03-03 Thread Dale Steele
t; Patrick Connolly wrote: > > On Sun, 02-Mar-2008 at 05:32PM -0500, Dale Steele wrote: > > > > |> Using linux fedora 8 (x86_64) I get the following when firefox is > > |> already running. Is there a way to adjust settings in either R or > > |> firef

[R] help.start() on linux (fedora 8) when firefox alreading running - a way to open a new tab?

2008-03-02 Thread Dale Steele
Using linux fedora 8 (x86_64) I get the following when firefox is already running. Is there a way to adjust settings in either R or firefox to open a new tab when help.start() is invoked? Thanks. --Dale > help.start() Making links in per-session dir ... If '/usr/bin/firefox' is already running,

[R] problem applying a conditional formula to each element of a matrix

2007-12-12 Thread Dale Steele
I'm applying a function (Cov.f) defined below to each element of a distance matrix. When I run the code below, I get a warning message (below) and elements of returned matrix [2,3] and [3,2] are not zero as I would expect. Clearly, there is an error... What am I doing wrong? Thanks. --Dale Warni

[R] Function to find boundary of an irregular sample?

2007-12-02 Thread Dale Steele
Given a set of coordinates that form an irregular sampling area, is there an R function to determine boundary points (coordinates defining the limits of the area), either with or without user interaction ? # for example, given the following irregular sampling area, how could I define the boundary

Re: [R] R as a programming language

2007-11-07 Thread Dale Steele
I'm anxiously awaiting my copy of the soon to be published "A First Course in Statistical Programming with R" by W. John Braun University of Western Ontario Duncan J. Murdoch University of Western Ontario Paperback (ISBN-13: 9780521694247) http://www.cambridge.org/catalogue/catalogue.asp?isbn=9

[R] reason for error in small function?

2007-10-11 Thread Dale Steele
Running the function below, tested using the cardiff dataset from splancs generates the following error. What changes do I need to make to get the function to work? Thanks. --Dale > gen.rpoints(events, poly, 99) > rpoints Error: object "rpoints" not found # test spatial data library(splancs)

[R] Speeding up simulation of mean nearest neighbor distances

2007-10-03 Thread Dale Steele
I've written the function below to simulate the mean 1st through nth nearest neighbor distances for a random spatial pattern using the functions nndist() and runifpoint() from spatsat. It works, but runs relatively slowly - would appreciate suggestions on how to speed up this function. Thanks. -