Re: [R] The error in R while using bugs.R function

2005-05-17 Thread Prof Brian Ripley
On Mon, 16 May 2005, Li, Jia wrote: I followed the instuctions on Dr. Gelman's web to install all of documents that bugs.R needs, but when I try to run the school example that the web posted in R, I got an error: couldn't find function bugs, what's wrong? I suggest you ask Dr Gelman. There is

RE: [R] NA erase your data trick

2005-05-17 Thread Daniel Nordlund
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anders Schwartz Corr Sent: Monday, May 16, 2005 10:38 PM To: r-help@stat.math.ethz.ch Subject: [R] NA erase your data trick Oops, I just erased all my data using this gizmo that I thought

Re: [R] The error in R while using bugs.R function

2005-05-17 Thread Duncan Murdoch
Li, Jia wrote: Dear R users, I followed the instuctions on Dr. Gelman's web to install all of documents that bugs.R needs, but when I try to run the school example that the web posted in R, I got an error: couldn't find function bugs, what's wrong? It sounds as though you missed an instruction,

Re: [R] NA erase your data trick

2005-05-17 Thread Uwe Ligges
Anders Schwartz Corr wrote: Oops, I just erased all my data using this gizmo that I thought would replace -9 with NA. A) Can I get my tcn5 back? As you got it the first time. There is nothing like undo. B) How do I do it right next time, I learned my lesson, I'll never do it again, I promise! By

Re: [R] NA erase your data trick

2005-05-17 Thread Duncan Murdoch
Anders Schwartz Corr wrote: Oops, I just erased all my data using this gizmo that I thought would replace -9 with NA. A) Can I get my tcn5 back? Not if you don't have it backed up somewhere else. I wouldn't recommend keeping your only copy of anything in an R workspace. It's too easy to

Re: [R] The error in R while using bugs.R function

2005-05-17 Thread Uwe Ligges
Li, Jia wrote: Dear R users, I followed the instuctions on Dr. Gelman's web to install all of documents that bugs.R needs, but when I try to run the school example that the web posted in R, I got an error: couldn't find function bugs, what's wrong? Have you forgot to source() Andrew's bugs.R

Re: [R] NA erase your data trick

2005-05-17 Thread Petr Pikal
Hi Maybe tcn5[tcn5 == -9] - NA if tcn5 is matrix mat-matrix(rnorm(100),10,10) mat[5,6:7]- -9 mat[mat == -9]-NA Read some intro on data manipulation, it helps you to avoid thinking in loops Cheers Petr On 17 May 2005 at 1:37, Anders Schwartz Corr wrote: Oops, I just erased all my

Re: [R] A question about bugs.R: functions for running WinBUGs from R

2005-05-17 Thread Uwe Ligges
Li, Jia wrote: Dear R users, I've found bugs.R : the functions for running WinBUGs from R that is writen by Dr. Andrew Gelman who is a professor from Columbia University. The bugs.R would be very useful for me, and I think many of you know it as well. I followed the instuctions on Dr. Gelman's

Re: [R] NA erase your data trick

2005-05-17 Thread Detlef Steuer
On Tue, 17 May 2005 08:33:00 +0200 Uwe Ligges [EMAIL PROTECTED] wrote: Anders Schwartz Corr wrote: Oops, I just erased all my data using this gizmo that I thought would replace -9 with NA. A) Can I get my tcn5 back? As you got it the first time. There is nothing like undo. If

Re: [R] NA erase your data trick

2005-05-17 Thread Prof Brian Ripley
On Tue, 17 May 2005, Uwe Ligges wrote: Anders Schwartz Corr wrote: Oops, I just erased all my data using this gizmo that I thought would replace -9 with NA. A) Can I get my tcn5 back? As you got it the first time. There is nothing like undo. B) How do I do it right next time, I learned my lesson,

RE: [R] parsing speed

2005-05-17 Thread Martin Maechler
BertG == Berton Gunter [EMAIL PROTECTED] on Mon, 16 May 2005 15:20:01 -0700 writes: BertG (just my additional $.02) ... and as a general rule BertG (subject to numerous exceptions, caveats, etc.) BertG 1) it is programming and debugging time that most BertG impacts overall

[R] Vuong test

2005-05-17 Thread =?iso-8859-1?Q?St=E9phanie_PAYET?=
Hi, I have two questions. First, I'd like to compare a ZINB model to a negativ binomial model with the Vuong test, but I can't find how to performe it from the zicount package. Does a programm exist to do it ? Second, I'd like to know in which cases we have to use a double hurdle model instead of

Re: [R] cluster results using fanny

2005-05-17 Thread TEMPL Matthias
Barbara Diaz wrote: Hi, I am using fanny and I have estrange results. I am wondering if someone out there can help me understand why this happens. First of all in most of my tries, it gives me a result in which each object has equal membership in all clusters. I have read that

Re: [R] Vuong test

2005-05-17 Thread Seyed Reza Jafarzadeh
Hi Stéphanie, The Vuong test can be done in Stata (http://www.stata.com/support/faqs/stat/vuong.html), but I am also looking for its code in R. In addition to zicounts, Dr. Simon Jackman (http://pscl.stanford.edu/) has provided the code for fitting the zero-inflated

Re: [R] a problem sourcing a file using chdir=TRUE

2005-05-17 Thread Prof Brian Ripley
This and some related problems should be fixed in tomorrow's R-patched snapshot. On Mon, 16 May 2005, Luca Scrucca wrote: Dear R-users, I used to give commands such as: source(file=~/path/to/file.R, chdir=TRUE) but with the latest v. 2.1.0 it does not seem to work anymore. I tried to figure out

Re: [R] parsing speed

2005-05-17 Thread Jan T. Kim
On Tue, May 17, 2005 at 09:50:20AM +0200, Martin Maechler wrote: BertG == Berton Gunter [EMAIL PROTECTED] on Mon, 16 May 2005 15:20:01 -0700 writes: BertG (just my additional $.02) ... and as a general rule BertG (subject to numerous exceptions, caveats, etc.) BertG 1)

Re: [R] adjusted p-values with TukeyHSD?

2005-05-17 Thread Christoph Buser
Dear Christoph You can use the multcomp package. Please have a look at the following example: library(multcomp) The first two lines were already proposed by Erin Hodgess: summary(fm1 - aov(breaks ~ wool + tension, data = warpbreaks)) TukeyHSD(fm1, tension, ordered = TRUE) Tukey multiple

Re: [R] parsing speed

2005-05-17 Thread Barry Rowlingson
Jan T. Kim wrote: Generally, I fully agree -- modular coding is good, not only in R. However, with regard to execution time, modularisation that involves passing of large amounts of data (100 x 1000 data frames etc.) can cause problems. I've just tried a few simple examples of throwing biggish

[R] setting value arg of pdSymm() in nlme

2005-05-17 Thread William Valdar
Dear All, I wish to model random effects that have known between-group covariance structure using the lme() function from library nlme. However, I have yet to get even a simple example to work. No doubt this is because I am confusing my syntax, but I would appreciate any guidance as to how. I

Re: [R] adjusted p-values with TukeyHSD?

2005-05-17 Thread Christoph Strehblow
Hi! Thanks a lot, works as advertised. If i used Tukey, it even gives raw, Bonferroni- and Tukey-corrected p-values! Thx for the help, Christoph Strehblow, MD Department of Rheumatology, Diabetes and Endocrinology Wilhelminenspital, Vienna, Austria [EMAIL PROTECTED] Am 17.05.2005 um 13:23

RE: [R] install.packages parameters

2005-05-17 Thread Liaw, Andy
Caveat: I know next to nothing about Mac... That said, my guess is that you installed R from binary, rather than building from source. In that case the compilers and flags, etc., are configured to the machine that the binary is built on. You can look in $RHOME/etc/Makeconf to see the settings,

Re: [R] adjusted p-values with TukeyHSD?

2005-05-17 Thread Sander Oom
Hi Chris and Chris, I was keeping my eye on this thread as I have also been discovering multiple comparisons recently. Your instructions are very clear! Thanks. Now I would love to see an R boffin write a nifty function to produce a graphical representation of the multiple comparison, like this

[R] Finding the right number of clusters

2005-05-17 Thread Philip Bermingham
SAS has something called the cubic criterion cutoff for finding the most appropriate number of clusters. Does R have anything that would replicate that? I've been searching the lists and can't seem to find anything that would point me in the right direction. Thank in advance, Philip

Re: [R] Finding the right number of clusters

2005-05-17 Thread Romain Francois
Le 17.05.2005 14:42, Philip Bermingham a écrit : SAS has something called the cubic criterion cutoff for finding the most appropriate number of clusters. Does R have anything that would replicate that? I've been searching the lists and can't seem to find anything that would point me in the

RE: [R] parsing speed

2005-05-17 Thread Liaw, Andy
From: Barry Rowlingson Jan T. Kim wrote: Generally, I fully agree -- modular coding is good, not only in R. However, with regard to execution time, modularisation that involves passing of large amounts of data (100 x 1000 data frames etc.) can cause problems. I've just tried a

RE: [R] Survey of moving window statistical functions - still l ooking for fast mad function

2005-05-17 Thread Tuszynski, Jaroslaw W.
On 9 Oct 2004, Brian D. Ripley wrote: On Fri, 8 Oct 2004, Tuszynski, Jaroslaw W. wrote: Finally a question: I still need to get moving windows mad function faster my runmad function is not that much faster than apply/embed combo, and that I used before, and this is where my code

[R] installing R on Irix

2005-05-17 Thread =?ISO-8859-2?Q?Cserh=E1ti_M=E1ty=E1s?=
Hello veeryone, I nedd some help here. The problem is I was trying to install R on my Irix system, with little success: I got the following ugly error messages: watch out: begin installing recommended package mgcv Cannot create directory : No such file or directory * Installing *source*

Re: [R] adjusted p-values with TukeyHSD?

2005-05-17 Thread Sander Oom
Shame I can not get hold of Hsu, J. C. and M. Peruggia (1994) just now. I am quite curious to see what their graphs look like. Would you be able to give an example in R.? ;-) The graph I put forward is typically used by ecologists to summarize data. It comes down to a simple means plot

Re: [R] installing R on Irix

2005-05-17 Thread Peter Dalgaard
Cserháti Mátyás [EMAIL PROTECTED] writes: Hello veeryone, I nedd some help here. The problem is I was trying to install R on my Irix system, with little success: I got the following ugly error messages: watch out: begin installing recommended package mgcv Cannot create directory : No

Re: [R] setting value arg of pdSymm() in nlme

2005-05-17 Thread William Valdar
Hi, I'm afraid that I don't understand what you are trying to do. With a formula of ~ 1 the pdSymm generator creates a 1x1 variance-covariance matrix, which you are initializing to a 3x3 matrix. Oh... I had a feeling I was doing something wrong there. What is batch.mat supposed to represent? I

[R] Combinations with two part column

2005-05-17 Thread Sofyan Iyan
Dear R-helpers, I am a beginner using R. This is the first question in this list. My question, Is there possible to make combinations with two part column? If I have a number 1,2,3,4,5,6,7,8. I need the result something like below: 1,2,3,4,5 6,7,8 1,2,3,4,7 5,6,8 2,3,4,5,6 1,7,8

[R] Problem in lme longitudinal model

2005-05-17 Thread Bernardo Rangel Tura
Hi R-masters! I trying model Heart disease mortality in my country with a lme model like this: m1.lme-lme(log(rdeath)~age*year,random=~age|year,data=dados) where: rdeath is rate of mortality per 10 person per age and year age: age of death (22 27 32 37 42 47 52 57 62 67 72 77 82)

RE: [R] Omitting NAs in aggregate.ts()

2005-05-17 Thread Waichler, Scott R
I have a time series vector (not necessarily ts class) that has NAs in it. How can I omit the NAs when using aggregate.ts() to compute a function on each window? If there is at least one non-NA value in each window, I'd like to proceed with evaluating the function; otherwise, I would

[R] simple question, i hope

2005-05-17 Thread BJ
How do you output a list to a text file without the extra line numbers and stuff? I have a list b, and tried zz-textConnection(captest.txt,w) sink(zz) b sink() close(zz) but that isnt what i want, because i get [[1]] [1] a etc. Is there a

Re: [R] Combinations with two part column

2005-05-17 Thread Gabor Grothendieck
On 5/17/05, Sofyan Iyan [EMAIL PROTECTED] wrote: Dear R-helpers, I am a beginner using R. This is the first question in this list. My question, Is there possible to make combinations with two part column? If I have a number 1,2,3,4,5,6,7,8. I need the result something like below: 1,2,3,4,5

[R] predict() question

2005-05-17 Thread Weiwei Shi
Hi, there: Following yesterday's question ( i had a new level for a categorical variable occurred in validation dataset and predict() complains about it: i made some python code to solve the problem), but here, I am just curious about some details about the mechanism: I believed rpart follows

[R] Sweave and paths

2005-05-17 Thread Bill Rising
Is there some way to encourage \SweaveInput{foo} to find foo in a subdirectory of a file tree? Something along the lines of the behavior of list.files(stuff, recursive=TRUE). This would be very helpful at calling small modular files, such as solution sets and the like. I couldn't see

[R] Error message glmmPQL

2005-05-17 Thread Pedro Torres Saavedra
Hi, I'm fitting a model for two-nested binay data in glmmPQL function but I have this error message: Error in solve.default(estimates[dimE[1] - (p:1), dimE [2] - (p:1), drop = FALSE]) : system is computationally singular: reciprocal condition number = 1.14416e-018. How do I can solve this

Re: [R] Combinations with two part column

2005-05-17 Thread Sofyan Iyan
Thanks for you quick answer. Could I extend my question? How to make the result for each rows with comma ,; library(gtools) comb8.5 - t(apply(combinations(8,5), 1, function(x) c(x,setdiff(1:8, x comb8.5[,1:5] [,1] [,2] [,3] [,4] [,5] [1,]12345 [2,]123

Re: [R] Combinations with two part column

2005-05-17 Thread Gabor Grothendieck
Try write.table: write.table(comb8.5[,1:5], sep = ,, row.names = FALSE, col.names = FALSE) write.table(comb8.5[,6:8], sep = ,, row.names = FALSE, col.names = FALSE) On 5/17/05, Sofyan Iyan [EMAIL PROTECTED] wrote: Thanks for you quick answer. Could I extend my question? How to make the

[R] cumsum on chron objects

2005-05-17 Thread Sebastian Luque
Hi, Is there some alternative to cumsum for chron objects? I have data frames that contain some chron objects that look like this: DateTime 13/10/03 12:30:35 NA NA NA 15/10/03 16:30:05 NA NA ... and I've been trying to replace the NA's so that a date/time sequence is created starting with the

[R] Hmisc/Design and problem with cgroup

2005-05-17 Thread Aric Gregson
Hello, I am trying to use the following to output a table to latex: cohortbyagesummary - by(data.frame(age,ethnicity), cohort, summary) w - latex.default(cohortbyagesummary, caption=Five Number Age Summaries by Cohort, label=agesummarybycohort,

Re: [R] cumsum on chron objects

2005-05-17 Thread Gabor Grothendieck
On 5/17/05, Gabor Grothendieck [EMAIL PROTECTED] wrote: On 5/17/05, Sebastian Luque [EMAIL PROTECTED] wrote: Hi, Is there some alternative to cumsum for chron objects? I have data frames that contain some chron objects that look like this: DateTime 13/10/03 12:30:35 NA NA NA

Re: [R] Combinations with two part column

2005-05-17 Thread Sofyan Iyan
Dear to Gabor Grothendieck and James Holtman, Thank you for giving me so much of your time to solve my problem. Many thanks and best regards, Sofyan On 5/17/05, Gabor Grothendieck [EMAIL PROTECTED] wrote: Try write.table: write.table(comb8.5[,1:5], sep = ,, row.names = FALSE, col.names =

Re: [R] cumsum on chron objects

2005-05-17 Thread Gabor Grothendieck
On 5/17/05, Sebastian Luque [EMAIL PROTECTED] wrote: Hi, Is there some alternative to cumsum for chron objects? I have data frames that contain some chron objects that look like this: DateTime 13/10/03 12:30:35 NA NA NA 15/10/03 16:30:05 NA NA ... and I've been trying to replace

Re: [R] Centered overall title with layout()

2005-05-17 Thread Stephen D. Weigand
Dear Pierre, On May 15, 2005, at 6:36 PM, Lapointe, Pierre wrote: Hello, I would like to have a centered overall title for a graphics page using the layout() function. Example, using this function: z - layout(matrix(c(1:6), 3,2, byrow = TRUE)) layout.show(6) I'd like to get this: Centered

Re: [R] cumsum on chron objects

2005-05-17 Thread Sebastian Luque
Hello Gabor, Thanks for your reply. na.locf would replace the NA's with the most recent non-NA, so it wouldn't create a sequence of chron dates/times (via as.vector, as in your example). To expand my original example: On 5/17/05, Sebastian Luque [EMAIL PROTECTED] wrote: [...] DateTime