Re: [R] Excel Trend Function

2008-07-13 Thread paulandpen
Hi Felipe, Daniel mentions imputation is a disputed practice. There are recommendations and rules of thumb for its use. I am not sure that imputation is disputed. I would be interested to see some links to articles recommending against its use. Paul - Original Message - From: "

Re: [R] a warning message from lmer

2008-07-13 Thread Lan Wei
Thanks for reminding me. But, the problem still exists when I combine these two 'joy' levels. Quoting Douglas Bates <[EMAIL PROTECTED]>: > By the way, did you notice that the levels of Emotion include both > "joy" and "joy ". You may want to correct that. > > On Sat, Jul 12, 2008 at 7:47 AM, Do

Re: [R] Position in a vector of the last value > n - *SOLVED*

2008-07-13 Thread Thaden, John J
Yes, your version (func2) is quick, quickest for longer vectors: > m <- matrix(rexp(6e6,rate=0.05), nrow=5) # 120 cols > m[m<20] <- 20 > func1 <- function(v,cut=20) max(which(v>cut)) > func2 <- function(v,cut=20) { +x <- which(v>cut) +x[length(x)] + } > func3 <- function(v,cut=20) tail

Re: [R] R crash with ATLAS precompiled Rblas.dll on Windows XP Core2 Duo

2008-07-13 Thread Prof Brian Ripley
Yes, that Rblas.dll is known to be faulty, and the person who built it is unable to re-build it. It needs to be removed from CRAN. (I've also tried to build on Core 2 Duo, and my Cygwin installation has a compiler crash during the build.) On Tue, 8 Jul 2008, Law, Jason wrote: I noticed a p

Re: [R] How to build a package which loads Rgraphviz (if installed)...

2008-07-13 Thread Uwe Ligges
Søren Højsgaard wrote: The tricky part is not getting it through the checks on my computer. It is when I upload to CRAN I get the problems, because "their" computers need Rgraphviz as well... ("Suggests" does not seem to be the solution...) Søren, "CRAN" (which means my machine in the cas

Re: [R] R crash with ATLAS precompiled Rblas.dll on Windows XP Core2 Duo

2008-07-13 Thread Uwe Ligges
Prof Brian Ripley wrote: Yes, that Rblas.dll is known to be faulty, and the person who built it is unable to re-build it. It needs to be removed from CRAN. Whoops, I forgot to remove it and will do so this afternoon. Uwe (I've also tried to build on Core 2 Duo, and my Cygwin installation

Re: [R] Installing RWinEdt

2008-07-13 Thread Uwe Ligges
[EMAIL PROTECTED] wrote: From the R console I invoke: install.packages("RWinEdt") and get: Warning in install.packages("RWinEdt") : argument 'lib' is missing: using 'F:\Users\Kevin\Documents/R/win-library/2.7' --- Please select a CRAN mirror for use in this session --- trying URL 'http:/

Re: [R] shapiro wilk normality test

2008-07-13 Thread Marta Colombo
Hi! Well, if you look at the output: shapiro.test(rnorm(5000)) > >        Shapiro-Wilk normality test > > data:  rnorm(5000) > W = 0.9997, p-value = 0.6205 You can see that the p-value is 0.6205 so you can't refuse the normality hypotesis. H0: normal data    vs H1: not normal So shapiro

Re: [R] Assoociative array?

2008-07-13 Thread jim holtman
The reason for the empty levels was I did not put drop=TRUE on the split to remove unused levels. Here is the revised script: > set.seed(1) # start with a known number > x <- data.frame(cat=sample(LETTERS[1:3],20,TRUE),a=sample(letters[1:4], 20, > TRUE), b=runif(20)) > x cat a b 1

Re: [R] Reading Multi-value data fields for descriptive analysis

2008-07-13 Thread jim holtman
This may do what you want: > x <- read.table("/tempxx.txt", comment="", quote="", sep="|", header=TRUE, > as.is=TRUE) > # split out by name > z <- lapply(seq(nrow(x)), function(.row){ + .result <- NULL + # construct the data output + for (i in c('picnic', 'food', 'other')){ +

Re: [R] shapiro wilk normality test

2008-07-13 Thread Frank E Harrell Jr
Marta Colombo wrote: Hi! Well, if you look at the output: shapiro.test(rnorm(5000))     Shapiro-Wilk normality test data: rnorm(5000) W = 0.9997, p-value = 0.6205 You can see that the p-value is 0.6205 so you can't refuse the normality hypotesis. H0: normal data   vs H1: not n

Re: [R] shapiro wilk normality test

2008-07-13 Thread Ted Harding
On 13-Jul-08 13:29:13, Frank E Harrell Jr wrote: > [...] > A large P-value means nothing more than needing more data. No > conclusion is possible. Please read the classic paper Absence of > Evidence is not Evidence for Absence. Is that ironic, Frank, or is there really a "classic paper" with t

Re: [R] shapiro wilk normality test

2008-07-13 Thread Charles Annis, P.E.
http://www.bmj.com/cgi/content/full/311/7003/485 Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ted Harding Sent: Sunday, July 13, 2008

Re: [R] shapiro wilk normality test

2008-07-13 Thread Berwin A Turlach
G'day all, On Sun, 13 Jul 2008 15:55:38 +0100 (BST) (Ted Harding) <[EMAIL PROTECTED]> wrote: > On 13-Jul-08 13:29:13, Frank E Harrell Jr wrote: > > [...] > > A large P-value means nothing more than needing more data. No > > conclusion is possible. I would have thought that "we need more data

Re: [R] Another packaging question

2008-07-13 Thread Johannes Huesing
Uwe Ligges <[EMAIL PROTECTED]> [Sat, Jul 12, 2008 at 11:48:38AM CEST]: > > > Johannes Huesing wrote: >> I am still trying to build a package. At the moment I am stuck with a >> file not found error message when processing R code from the tests >> subdirectory. What would be the accurate relative pa

[R] initialize a factor vector

2008-07-13 Thread Johannes Huesing
What is the least surprising way of initializing a factor with predefined levels and with length 0? as.factor(c("eins", "zwei", "drei"))[FALSE] does the job but looks a bit weird. -- Johannes Hüsing There is something fascinating about science. One

Re: [R] Another packaging question

2008-07-13 Thread Uwe Ligges
Johannes Huesing wrote: Uwe Ligges <[EMAIL PROTECTED]> [Sat, Jul 12, 2008 at 11:48:38AM CEST]: Johannes Huesing wrote: I am still trying to build a package. At the moment I am stuck with a file not found error message when processing R code from the tests subdirectory. What would be the accu

Re: [R] shapiro wilk normality test

2008-07-13 Thread Ted Harding
Many thanks to Berwin, and also to Charles Annis, for the references. The're good! Ted. On 13-Jul-08 15:22:03, Berwin A Turlach wrote: > G'day all, > > On Sun, 13 Jul 2008 15:55:38 +0100 (BST) > (Ted Harding) <[EMAIL PROTECTED]> wrote: > >> On 13-Jul-08 13:29:13, Frank E Harrell Jr wrote: >> > [

Re: [R] how do I read only specific columns using read.csv or other read function

2008-07-13 Thread Juliet Hannah
I was not able to follow the solution posted. Could you demonstrate this technique on an example data set. Thanks! dat <- data.frame(a = letters[1:3], b = LETTERS[1:3], c = 1:3, d = 3:1) On Wed, Jul 2, 2008 at 1:13 PM, Charles C. Berry <[EMAIL PROTECTED]> wrote: > On Wed, 2 Jul 2008, Ben Tupper w

Re: [R] mpirun question with Rmpi

2008-07-13 Thread Martin Morgan
"Erin Hodgess" <[EMAIL PROTECTED]> writes: > Dear R People: > > I'm running Rmpi on a single machine and I have the following > statement from the command line: > > mpirun -np 3 ./R --no-save < eek1.in >stuff4.out All three versions of eek1.in write to the same location, over-writing one another

Re: [R] shapiro wilk normality test

2008-07-13 Thread Frank E Harrell Jr
(Ted Harding) wrote: On 13-Jul-08 13:29:13, Frank E Harrell Jr wrote: [...] A large P-value means nothing more than needing more data. No conclusion is possible. Please read the classic paper Absence of Evidence is not Evidence for Absence. Is that ironic, Frank, or is there really a "clas

Re: [R] initialize a factor vector

2008-07-13 Thread Gavin Simpson
On Sun, 2008-07-13 at 18:47 +0200, Johannes Huesing wrote: > What is the least surprising way of initializing a factor with > predefined levels and with length 0? > as.factor(c("eins", "zwei", "drei"))[FALSE] > does the job but looks a bit weird. > Notice that one does not need to specify any

Re: [R] Excel Trend Function

2008-07-13 Thread Daniel Malter
Disputed was probably not the correct wording for it. However, imputation means that you make assumptions regarding the distribution of your missing data dependent on the data that is available to you. Felipe had time series data, and it is common to predict from the past to the future in such mode

[R] rm anova

2008-07-13 Thread korhan ozkan
Dear all, I am new to r and most happy for now:) I would like to ask an issue about rm-anova. I have data of an experiment with 24 subjects 3 treatment (8 replicates for each treatment) and 8 sampling through time. data sheet is something like that(just an example, not real). sample id,response(t

Re: [R] Quick plotmath question

2008-07-13 Thread Mike Lawrence
While the earlier solutions involving expression() and paste() work great, unfortunately Gabor's first suggestion doesn't display on the OS X default quartz device, and Gabor's second suggestion displays on quartz, but not to the pdf() device. In any event, the first replies in this thread

Re: [R] initialize a factor vector

2008-07-13 Thread Johannes Huesing
Gavin Simpson <[EMAIL PROTECTED]> [Sun, Jul 13, 2008 at 08:18:37PM CEST]: > On Sun, 2008-07-13 at 18:47 +0200, Johannes Huesing wrote: [...] > > as.factor(c("eins", "zwei", "drei"))[FALSE] > > does the job but looks a bit weird. > > [...] > > factor(levels = c("one","two","three")) > factor(0) >

Re: [R] shapiro wilk normality test

2008-07-13 Thread Johannes Huesing
Frank E Harrell Jr <[EMAIL PROTECTED]> [Sun, Jul 13, 2008 at 08:07:37PM CEST]: > (Ted Harding) wrote: >> On 13-Jul-08 13:29:13, Frank E Harrell Jr wrote: >>> [...] >>> A large P-value means nothing more than needing more data. No >>> conclusion is possible. Please read the classic paper Absence

Re: [R] how do I read only specific columns using read.csv or other read function

2008-07-13 Thread Charles C. Berry
On Sun, 13 Jul 2008, Juliet Hannah wrote: I was not able to follow the solution posted. Could you demonstrate this technique on an example data set. Thanks! dat <- data.frame(a = letters[1:3], b = LETTERS[1:3], c = 1:3, d = 3:1) Using your example: dat <- data.frame(a = letters[1:3], b = LE

[R] (no subject)

2008-07-13 Thread Paul Adams
Hello everyone, I am using the following code to try to calculate the mean : dat<-read.table(file="C:\\Documents and  Settings.txt") dat<-as.numeric(dat) x1.m__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do r

Re: [R] (no subject)

2008-07-13 Thread jim holtman
What does 'str(dat)' show? the statement dat <- as.numeric(dat) says you are trying to make an entire dataframe numeric. This is probably not what you want to do. What is it you want to do? Have you tried summary(dat) e.g., > x <- data.frame(a=1:10, b=101:110, c=letters[1:10]) > summary(x)

Re: [R] shapiro wilk normality test

2008-07-13 Thread Ted Harding
On 13-Jul-08 19:53:47, Johannes Huesing wrote: > Frank E Harrell Jr <[EMAIL PROTECTED]> [Sun, Jul 13, 2008 at > 08:07:37PM CEST]: >> (Ted Harding) wrote: >>> On 13-Jul-08 13:29:13, Frank E Harrell Jr wrote: [...] A large P-value means nothing more than needing more data. No conclu

[R] stem and leaf plot: how to edit the stem-values

2008-07-13 Thread Jörg Groß
Hi, I would like to make a stem and leaf plot and I want to edit the category-names. So, by doing this: > x <- c(1,2,2,3,3,3,3,2,2,1) > stem(x) I get: 1 | 00 1 | 2 | 2 | 3 | First Question: Why do I get gaps between the categories? (like in line 2 and line 4) And seco

Re: [R] Assoociative array?

2008-07-13 Thread rkevinburton
Thank you I will try drop=TRUE. In the mean time do you know how I can access the members (for lack of a better term) of the results of a split? In the sample you provided below you have: z <- split(x, list(x$cat, x$a), drop=TRUE) Now I can print out 'z[1], z[2] etc' This is nice but what if I

Re: [R] Difficultes with grep

2008-07-13 Thread Fran100681
Thank you, but this is not what i want exactly.. i would want to launch function "myfun" with this script: > table <- sample(LETTERS[1:5], 20,TRUE) > > name <- "A" > > myfun <- function(name) { + r <- grep (name[^0-9], table ) + return (r) } but if I do it ,R doesn't accept this.. i want this be

Re: [R] Installing RWinEdt

2008-07-13 Thread rkevinburton
I checked and reapplied full access to the whole WinEdt directory. I am not the administrator but I am a member of the administrators group. This couple with the fact the I have given full control to the WinEdt directory suggests that the problem is elsewhere. But this is not the first time that

Re: [R] shapiro wilk normality test

2008-07-13 Thread Johannes Huesing
Ted Harding <[EMAIL PROTECTED]> [Sun, Jul 13, 2008 at 10:59:21PM CEST]: > On 13-Jul-08 19:53:47, Johannes Huesing wrote: > > Frank E Harrell Jr <[EMAIL PROTECTED]> [Sun, Jul 13, 2008 at > > 08:07:37PM CEST]: > >> (Ted Harding) wrote: > >>> On 13-Jul-08 13:29:13, Frank E Harrell Jr wrote: > [..

[R] any way to set defaults for par?

2008-07-13 Thread Carl Witthoft
I know how to set graphic parameters by calling par(), but what I'd like is a way to set the default values so that subsequent calls to par() use my defaults. The reason to want this is that every time I create a new graphic window (I'm using quartz on OSX, and so far no answers in the Mac mai

Re: [R] Difficultes with grep

2008-07-13 Thread Charles C. Berry
On Sun, 13 Jul 2008, Fran100681 wrote: Thank you, but this is not what i want exactly.. i would want to launch function "myfun" with this script: table <- sample(LETTERS[1:5], 20,TRUE) name <- "A" myfun <- function(name) { + r <- grep (name[^0-9], table ) ...XX

Re: [R] Assoociative array?

2008-07-13 Thread jim holtman
On Sun, Jul 13, 2008 at 5:45 PM, <[EMAIL PROTECTED]> wrote: > Thank you I will try drop=TRUE. > > In the mean time do you know how I can access the members (for lack of a > better term) of the results of a split? In the sample you provided below you > have: > > z <- split(x, list(x$cat, x$a), dr

Re: [R] Difficultes with grep

2008-07-13 Thread jim holtman
or your function looks like this were you dynamically create the string: myfun <- function(name) { r <- grep (paste(name, "[^0-9]", sep=""), table ) return (r) } On Sun, Jul 13, 2008 at 7:24 AM, Fran100681 <[EMAIL PROTECTED]> wrote: > > Thank you, but this is not what i want exactly.. i would wa

Re: [R] shapiro wilk normality test

2008-07-13 Thread Ted Harding
See at end. On 13-Jul-08 21:42:19, Johannes Huesing wrote: > Ted Harding <[EMAIL PROTECTED]> [Sun, Jul 13, 2008 at > 10:59:21PM CEST]: >> On 13-Jul-08 19:53:47, Johannes Huesing wrote: >> > Frank E Harrell Jr <[EMAIL PROTECTED]> [Sun, Jul 13, 2008 at >> > 08:07:37PM CEST]: >> >> (Ted Harding) wrot

Re: [R] Reading Multi-value data fields for descriptive analysis

2008-07-13 Thread Hohm, Dale
Thanks Jim, I wish I were comfortable enough with the language for the fix needed to the syntax to be obvious, but it is not yet. With your example, I get: Error in strsplit(x[.row, ][[i]], ";#") : non-character argument x appears to be filled properly, but z is not due to the error.

Re: [R] any way to set defaults for par?

2008-07-13 Thread jim holtman
One way that I do it is to save the default parameters with the following statement in my profile: assign('Default.par', par(no.readonly=T)) An then I have a function which will reset them: plotReset <- function() {# reset plotting window par(Default.par) windows(width=7.5,height=4.7

[R] Moran's I test- Ordinal Logistic Regression Model

2008-07-13 Thread Rees, Lisa Marie (MU-Student)
Hi, I am trying to do a Moran's I test on an ordinal logistic regression model. I have a simple spatial weights matrix listed below I would like to use. Y= 10 0 0 0 0 0 0 0 01 1 0 0 0 0 1 1

[R] Moran's I- Ordinal Logistic Regression

2008-07-13 Thread Lisa Rees
Hi, I am trying to do a Moran's I test on an ordinal logistic regression model. I have a simple spatial weights matrix listed below I would like to use. Y= 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 0 1 1 0 0 0 0 1 1 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0

Re: [R] Reading Multi-value data fields for descriptive analysis

2008-07-13 Thread jim holtman
Is one of the rows NULL? Do an 'str(x)' show? The example you sent seems to work with the code. Are you reading in a different set of data? I think I know what happened. I shortened the names on your example so it was easier to access. Here is the data I used: ID|name|picnic|food|other 1|Yog

[R] Computing row means for sets of 2 columns

2008-07-13 Thread Daren Tan
Is there a better or more efficent approach than this without the use of t() ? > (m <- matrix(1:40, ncol=4)) [,1] [,2] [,3] [,4] [1,]1 11 21 31 > [2,]2 12 22 32 [3,]3 13 23 33 [4,]4 14 24 34 > [5,]5 15 25 35 [6,]6 16 26 36 [7,]

Re: [R] Computing row means for sets of 2 columns

2008-07-13 Thread Henrik Bengtsson
m <- matrix(1:40, ncol=4); groups <- rep(1:2, each=2); uGroups <- unique(groups); mMeans <- matrix(NA, nrow=nrow(m), ncol=length(uGroups)); for (gg in seq(along=uGroups)) { mMeans[,gg] <- rowMeans(m[,groups == uGroups[gg], drop=FALSE]); } (Preallocation of result matrix is more memory efficient

Re: [R] stem and leaf plot: how to edit the stem-values

2008-07-13 Thread Duncan Murdoch
On 13/07/2008 5:40 PM, Jörg Groß wrote: Hi, I would like to make a stem and leaf plot and I want to edit the category-names. If you have a computer you can do much better histograms. But since you have chosen to do this, one way is to edit the underlying C code. It's available in https

[R] Off topic: Tcl/Tk outside R.

2008-07-13 Thread Rolf Turner
I'm trying to learn about the tcltk package and its uses. Floundering around a bit ... Have discovered Peter Dalgaard's articles in R-News, which should help. Also James Wettenhall's suite of examples look like they might be enlightening, even though the indications are that they are Windoze

Re: [R] stem and leaf plot: how to edit the stem-values

2008-07-13 Thread Rolf Turner
On 14/07/2008, at 1:45 PM, Duncan Murdoch wrote: On 13/07/2008 5:40 PM, Jörg Groß wrote: Hi, I would like to make a stem and leaf plot and I want to edit the category-names. If you have a computer you can do much better histograms. But since you have chosen to do this, one way is to ed

Re: [R] Computing row means for sets of 2 columns

2008-07-13 Thread Daren Tan
Instead of rowMeans(m[,groups == uGroups[gg], drop=FALSE]), I used apply(m[,groups == uGroups[gg], drop=FALSE], 1, mean), which really slow down the processing. I modified your codes slightly so that I can use sd, median, and mad also. Better and efficient approach ?> Date: Sun, 13 Jul 2008 18:

[R] source code for R-dev packages

2008-07-13 Thread Mark Kimpel
Where is the link on www.r-project.org or CRAN to download source code for development versions of packages? This is straightforward for BioConductor packages but I can't seem to find it for R packages. Mark -- Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry Indiana University Schoo