Re: [R] Moving window regressions - how can I improve this code?

2004-05-16 Thread Ajay Shah
Prof. Bates, Gabor, I had written a posting, some weeks ago, where I had written fortrannish code for moving window regressions (also called 'rolling window regression'), and asked how to do the code better. Both of you had put much pain on this, and emerged with this great code: data(women)

Re: [R] importing text file with duplicate rows / indexing rows and columns

2004-05-16 Thread Prof Brian Ripley
The issue is not `duplicate rows' but duplicated row names. You asked R explicitly to make a column into row names -- if they are not suitable row names, don't do that. You can remove duplicated rows later (see ?unique) but you cannot have duplicated row names in a data frame so leave them as

Re: [R] Moving window regressions - how can I improve this code?

2004-05-16 Thread Prof Brian Ripley
You forgot drop=FALSE, one of the commonest S programmers' oversights. The lm.fit call should be fit = lm.fit(x[ind, , drop = FALSE], y[ind]) Please don't mix assignment operators in posted code, BTW. -- Brian D. Ripley, [EMAIL PROTECTED] Professor

[R] Error in using coxph()

2004-05-16 Thread Siew Leng TENG
Hi, I am getting errors of the following kind. I can't seem to point the source of the error. I would greatly appreciate any advice. Many thanks and good day, -Melinda Error message : Ran out of iterations and did not converge in: fitter(X, Y, strats, offset, init, control,

Re: [R] Error in using coxph()

2004-05-16 Thread Prof Brian Ripley
Note you said you used 1-F but the output said you used F. You also say `1-F is a vector of '0's' so I think you may have declared that all observations are right-censored. (NB if you give Surv an event vector of all 1's it is ambiguous, so don't do this.) If you did declare all observations as

Re: [R] Fwd: filter out many data.frames

2004-05-16 Thread Uwe Ligges
Christian Schulz wrote: X - numeric(length(data.frame)) before the loop maybe work, because my computer works and works !? christian -- Weitergeleitete Nachricht -- Subject: filter out many data.frames Date: Sonntag, 16. Mai 2004 00:02 From: Christian Schulz [EMAIL PROTECTED]

Re: [R] Moving window regressions - how can I improve this code?

2004-05-16 Thread Douglas Bates
Ajay Shah [EMAIL PROTECTED] writes: I had written a posting, some weeks ago, where I had written fortrannish code for moving window regressions (also called 'rolling window regression'), and asked how to do the code better. Both of you had put much pain on this, and emerged with this great

Re: [R] Moving window regressions - how can I improve this code?

2004-05-16 Thread Douglas Bates
Douglas Bates [EMAIL PROTECTED] writes: ... Try changing the call of lm.fit to lm.fit(x[ind, , drop = FALSE), y[ind]) It will probably work better without the syntax error, as lm.fit(x[ind, , drop = FALSE], y[ind]) __ [EMAIL

Re: [R] Fwd: filter out many data.frames

2004-05-16 Thread Christian Schulz
Yes, i have recognized my stupid approach. Now it works but any help how i get the names in tList from the expand.grid combinaton's instead number from 1:64 would like great! Thanks Christian data - expand.grid(class02 = c(A,B,C,D), class04 = c(A,B,C,D),PREDICT = c(A,B,C,D)) tList -

Re: [R] Moving window regressions - how can I improve this code?

2004-05-16 Thread Gabor Grothendieck
Others have already addressed the bug. Your other question seems to be how to get some simplification. Note that Greg Warnes responded in: http://article.gmane.org/gmane.comp.lang.r.general/18033 regarding the use of running in gregmisc. Another thing you could do if you want to retain the

Re: [R] Error in using coxph()

2004-05-16 Thread Peter Dalgaard
Prof Brian Ripley [EMAIL PROTECTED] writes: Note you said you used 1-F but the output said you used F. You also say `1-F is a vector of '0's' so I think you may have declared that all observations are right-censored. (NB if you give Surv an event vector of all 1's it is ambiguous, so don't

Re: [R] Fwd: filter out many data.frames

2004-05-16 Thread Uwe Ligges
Christian Schulz wrote: Yes, i have recognized my stupid approach. Now it works but any help how i get the names in tList from the expand.grid combinaton's instead number from 1:64 would like great! Thanks Christian data - expand.grid(class02 = c(A,B,C,D), class04 = c(A,B,C,D),PREDICT =

[R] obtaining the name of a named list

2004-05-16 Thread Ned
I have a list d, in which the names of each elements are single characters, and the actual elements are bit sequences representing those characters. If I type d[1], I get the name and the bit sequence. If I type d[[1]], I get only the bit sequence. What I want is some way to be able to get the

Re: [R] obtaining the name of a named list

2004-05-16 Thread Uwe Ligges
Ned wrote: I have a list d, in which the names of each elements are single characters, and the actual elements are bit sequences representing those characters. If I type d[1], I get the name and the bit sequence. If I type d[[1]], I get only the bit sequence. d[1] returns a list of length 1,

Re: [R] Error in using coxph()

2004-05-16 Thread Göran Broström
On Sun, May 16, 2004 at 02:25:07PM +0200, Peter Dalgaard wrote: Prof Brian Ripley [EMAIL PROTECTED] writes: Note you said you used 1-F but the output said you used F. You also say `1-F is a vector of '0's' so I think you may have declared that all observations are right-censored. (NB if

RE: [R] How to restore and edit saved graphics?

2004-05-16 Thread Shin, Daehyok
Thanks for the interesting solution. I am happy to find a way to save all graphic options into a file. There is a minor glitch. Is there is any way to replace title, not to overwrite it? And if I want to change the color of a line or the ranges of x or y axis, how can I do it with the restored

Re: [R] Fwd: filter out many data.frames

2004-05-16 Thread Christian Schulz
So, why are you doing these complicated things? Hmm, want upgrade my sklls, because i need more and more function's to reduce complexity in my analysis. And try , do.call and match.call seems very usefuel and i want at long last understand the flexbilty of this functions. Just using

Re: [R] How to restore and edit saved graphics?

2004-05-16 Thread Gabor Grothendieck
I don't think you can produce a graphic in R and then easily edit it *in R* to change the title and so on; however, if you are using Windows you can save the graphic as a Windows metafile (right click graphic and save as a Windows metafile or just copy it as Windows metafile to clipboard) and

Re: [R] Error in using coxph()

2004-05-16 Thread Prof Brian Ripley
On 16 May 2004, Peter Dalgaard wrote: Prof Brian Ripley [EMAIL PROTECTED] writes: Note you said you used 1-F but the output said you used F. You also say `1-F is a vector of '0's' so I think you may have declared that all observations are right-censored. (NB if you give Surv an event

RE: [R] How to restore and edit saved graphics?

2004-05-16 Thread Prof Brian Ripley
The display list on a screen device is enabled unless you explicitly disable it, and if you know how to do that you will understand the help for recordPlot, which says that it saves the display list so there had better be one. I suspect only a handful of R users have ever used dev.control and I

RE: [R] How to restore and edit saved graphics?

2004-05-16 Thread Prof Brian Ripley
Unfortunately a bug has been introduced into the recordPlot/replayPlot internal code, so what is saved is the current display list and not a snapshot. (For cognescenti, especially Paul M: duplicate() is required or the saved object will get a pointer to the actual display list.) There are many

[R] Newbie Poisson regression question

2004-05-16 Thread adelmaas
Greetings. I'm getting started learning R, and I'm trying to reproduce some models I've done previously in SAS. I'm trying to fit simple Poisson regressions, and I keep getting impossible results: the models predict negative numbers of cases for many observations. The code for the models

Re: [R] Newbie Poisson regression question

2004-05-16 Thread Peter Dalgaard
[EMAIL PROTECTED] writes: Greetings. I'm getting started learning R, and I'm trying to reproduce some models I've done previously in SAS. I'm trying to fit simple Poisson regressions, and I keep getting impossible results: the models predict negative numbers of cases for many

[R] GLMM error message

2004-05-16 Thread Matt Loveland
Hi, I wrote a few days ago about an error message I'm getting when I use GLMM from lme4 to do random effects modelling. When I add random effects, I get the following error message: Error in EMsteps-(`*tmp*`, value = control) : invalid source matrix. (I wanted to note that I've only just

Re: [R] GLMM error message

2004-05-16 Thread Deepayan Sarkar
On Sunday 16 May 2004 16:03, Matt Loveland wrote: Hi, I wrote a few days ago about an error message I'm getting when I use GLMM from lme4 to do random effects modelling. When I add random effects, I get the following error message: Error in EMsteps-(`*tmp*`, value = control) : invalid

Re: [R] GLMM error message

2004-05-16 Thread Peter Dalgaard
Matt Loveland [EMAIL PROTECTED] writes: Hi, I wrote a few days ago about an error message I'm getting when I use GLMM from lme4 to do random effects modelling. When I add random effects, I get the following error message: Error in EMsteps-(`*tmp*`, value = control) : invalid source

Re: [R] Error in using coxph()

2004-05-16 Thread Thomas Lumley
On Sun, 16 May 2004, Siew Leng TENG wrote: Hi, I am getting errors of the following kind. I can't seem to point the source of the error. I would greatly appreciate any advice. In addition to things other people have pointed out, you didn't actually set any of the control parameters you were

Re: [R] importing text file with duplicate rows / indexing rows and columns

2004-05-16 Thread grr
Thank you so much. I'll tell it not to use the row names. Also, if you have advice for basic texts for learning the programming language, please let me know. I am using Dalgaard's Introductory Statistics with R, but would like to find something with more of the command line options, regardless

Re: [R] How to restore and edit saved graphics?

2004-05-16 Thread Paul Murrell
Hi Shin, Daehyok wrote: Thanks for the interesting solution. I am happy to find a way to save all graphic options into a file. There is a minor glitch. Is there is any way to replace title, not to overwrite it? And if I want to change the color of a line or the ranges of x or y axis, how can I do