Re: [R] arima forecast function

2008-08-16 Thread warthog29
Thanks for the correction Gabor. I am still new to R. Gabor Grothendieck wrote: > > forecast must be quoted: > > install.packages("forecast") > > and in this case its actually part of the forecasting bundle so we > could also do this: > > install.packages("forecasting") > > Look at ?install

[R] Dealing with NaN's in data frames

2008-08-16 Thread Peck, Jon
I am looking for the most efficient way to replace all occurrences of NaN in a data frame with NA. I can do this with a double loop, but it seems that there should be a higher level and more efficient way. With is.na, I could use ifelse, but if.nan seems not to have similar capabilities. T

Re: [R] Dealing with NaN's in data frames

2008-08-16 Thread Dimitris Rizopoulos
try this: dat <- data.frame(x = rnorm(10), y = rnorm(10), z = rnorm(10), g = gl(5,2)) dat$x[sample(10, 3)] <- NaN dat$y[sample(10, 3)] <- NaN dat$z[sample(10, 3)] <- NaN dat[] <- lapply(dat, function(x){ x[is.nan(x)] <- NA x }) I hope it helps. Best, Dimitris Peck, Jon wrote: I

Re: [R] Dealing with NaN's in data frames

2008-08-16 Thread Dieter Menne
Peck, Jon spss.com> writes: > > I am looking for the most efficient way to replace all occurrences of NaN in a data frame with NA. I can do this > with a double loop, but it seems that there should be a higher level and more efficient way. With is.na, I > could use ifelse, but if.nan seems not

Re: [R] Lattice: problem using panel.superpose and panel.groups

2008-08-16 Thread Dieter Menne
Michael Braun MIT.EDU> writes: > > I have some data that is split into two groups: some "actual" data, > and some simulated data, generated from several different models. The > actual data come from two different datasets (calibration and > holdout), and the simulations were calibrated o

Re: [R] post hoc tests two way repeated measures anova

2008-08-16 Thread Dieter Menne
Jean-Pierre Bresciani tuebingen.mpg.de> writes: > is there a specific/appropriate function/package to perform post hoc tests > when running a two way repeated measures anova? I'm looking for something > that will be equivalent to the 'TukeyHSD()' for between subjects anova (with > 'aov()'). For o

Re: [R] Design-consistent variance estimate

2008-08-16 Thread Doran, Harold
Thank you again, Stas. Indeed, treating both as random variables and taking the expansion of Y/N gives the more general expression for the variance. Now, what I see in this new expression is that when cluster sizes are all the same, there is no covariance between Y and N and then the variance re

[R] ANCOVA: Next steps??

2008-08-16 Thread Brown, Heidi
Having spent the last few weeks trying to decipher R, I feel I may finally be getting somewhere, but i'M still in need of some advice and all my tutors seem to be on holiday! Basically a bit of background, I have data collected on a population of Lizards which includes age,sex, and body condit

Re: [R] Department of Redundancy Department.

2008-08-16 Thread Douglas Bates
On Fri, Aug 15, 2008 at 7:57 AM, Liaw, Andy <[EMAIL PROTECTED]> wrote: > I couldn't resist, either... > >> From: Henrik Bengtsson >> >> Hmm, >> >> couldn't resists: >> >> > X <- NA >> > is.logical(X) >> [1] TRUE >> > (X == TRUE) >> [1] NA >> >> > "==.MaybeNA" <- function(e1, e2) { !is.na(e1) && (e1

Re: [R] ANCOVA: Next steps??

2008-08-16 Thread Prof Brian Ripley
On Sat, 16 Aug 2008, Brown, Heidi wrote: Having spent the last few weeks trying to decipher R, I feel I may finally be getting somewhere, but i'M still in need of some advice and all my tutors seem to be on holiday! Basically a bit of background, I have data collected on a population of Liza

Re: [R] Dealing with NaN's in data frames

2008-08-16 Thread Muenchen, Robert A (Bob)
Hi Jon, Here's one way. > x <- c(1,2,3,4,NaN) > y <- c(1,2,NaN,4,5) > > myDF <- data.frame(x,y) > myDF x y 1 1 1 2 2 2 3 3 NaN 4 4 4 5 NaN 5 > > myDF[ is.na(myDF) ] <- NA > myDF x y 1 1 1 2 2 2 3 3 NA 4 4 4 5 NA 5 Cheers, Bob =

Re: [R] map("state" ...) Is the USA cracking up?

2008-08-16 Thread John Kane
Check your tectonic plates. You may have been using predict() to get those figures. --- On Fri, 8/15/08, John P. Burkett <[EMAIL PROTECTED]> wrote: > From: John P. Burkett <[EMAIL PROTECTED]> > Subject: Re: [R] map("state" ...) Is the USA cracking up? > To: R-help@r-project.org > Received:

Re: [R] ecdf manipulation

2008-08-16 Thread Martin Maechler
> <[EMAIL PROTECTED]> > on Fri, 15 Aug 2008 00:51:56 +0100 writes: > I’m using the edcf function to look at a number of > empirical distributions graphically for run-time analyses > of stochastic optimization algorithms. When dealing with > problems where the optimal

Re: [R] Restricted Least Squares

2008-08-16 Thread Nelson Villoria
Thank you very much Dr. Brian -- I appreciate your response. I understand the idea of building the constraints into the equation but my problem is that i have to deal with potentially hundreds of dummy variables, and I want the sum of their estimates to equal zero, so LS can be fitted with an inter

[R] use of all row elements

2008-08-16 Thread Jan Akko Eleveld
Good day, A function is used on a database with 50 rows and 200 collumns. every row is 1 seperate study that the function should run through. Desired outcome are [x,y] and a weight for that coordinate. I have problems with generating x. ## Generating random time or x coordinate (through

Re: [R] Dealing with NaN's in data frames

2008-08-16 Thread Gabor Grothendieck
Try this: is.na(DF) <- is.na(DF) or this which returns a transformed data frame without overwriting DF: replace(DF, is.na(DF), NA) On Fri, Aug 15, 2008 at 10:27 PM, Peck, Jon <[EMAIL PROTECTED]> wrote: > I am looking for the most efficient way to replace all occurrences of NaN in > a data fram

[R] To package or not to package?

2008-08-16 Thread Carl Witthoft
I'd like a little advice as to when it's appropriate to create an R-package and submit it, as opposed to just providing the source to some simple code. In this case, I've written a function that draws a line plot (with options for points, etc) where the color of the line changes at specified va

Re: [R] cor() btwn columns in two matrices - no complete element pairs

2008-08-16 Thread Daniel Malter
Hi, the argument use should be: use="p" (for pairwise complete obs.) Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von rcoder Gesendet: Friday, August 15, 200

Re: [R] To package or not to package?

2008-08-16 Thread Duncan Murdoch
On 16/08/2008 1:54 PM, Carl Witthoft wrote: I'd like a little advice as to when it's appropriate to create an R-package and submit it, as opposed to just providing the source to some simple code. In this case, I've written a function that draws a line plot (with options for points, etc) where t

Re: [R] Lattice: problem using panel.superpose and panel.groups

2008-08-16 Thread Michael Braun
Dieter: Thank you for your response. As you requested, I created a self- running example, pasted below. It may be a little wordier than I would like, but it runs. The data I am creating assumes that there are two datasets ("calib" and "hold"), with actual values actual.calib and actual.hol

Re: [R] post hoc tests two way repeated measures anova

2008-08-16 Thread Frank E Harrell Jr
Dieter Menne wrote: Jean-Pierre Bresciani tuebingen.mpg.de> writes: is there a specific/appropriate function/package to perform post hoc tests when running a two way repeated measures anova? I'm looking for something that will be equivalent to the 'TukeyHSD()' for between subjects anova (with

Re: [R] Dealing with NaN's in data frames

2008-08-16 Thread Dieter Menne
Gabor Grothendieck gmail.com> writes: > is.na(DF) <- is.na(DF) I knew you would win the shortest competition. I missed you at the useR meeting. Dieter __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read th

[R] Pseudo R2 for Tobit Regression

2008-08-16 Thread ldotero
Dear All: I need some guidance in calculating a goodness-of-fit statistic for a Tobit Regression model. To develop the Tobit regression, I used the tobit() method from the AER package, which is basically a simpler interface to the survreg() method. I've read about pseudo R2 and C-index and wa

Re: [R] Axes in filled.contour plots

2008-08-16 Thread hippie dream
I am still struggling on how edit axes on a filled contour plot. I have managed to figure out how to place labels on the key of this graph but how to place the axes I want on this plot still eludes me. This command produces the plot I am looking for however as mentioned before these axes only go f

[R] Wichmann-Hill Random Number Generator and the Birthday Problem

2008-08-16 Thread Shengqiao Li
Dear all, Recently I am generating large random samples (10M) and any duplicated numbers are not desired. We tried several RNGs in R and found Wichmann-Hill did not produce duplications. The duplication problem is the interesting birthday problem. If there are M possible numbers, randomly d

Re: [R] Dealing with NaN's in data frames

2008-08-16 Thread JKPeck
Thanks for all the suggestions. The last one is certainly minimalist! On Aug 16, 1:20 pm, Dieter Menne <[EMAIL PROTECTED]> wrote: > Gabor Grothendieck gmail.com> writes: > > > is.na(DF) <- is.na(DF) > > I knew you would win the shortest competition. I missed you at the useR > meeting. > > Diete

Re: [R] cor() btwn columns in two matrices - no complete element pairs

2008-08-16 Thread rcoder
Hi Daniel, Thanks for your reply. I experimented with various options since my poet and eventually tried use="pairwise.complete.obs" which seemed to do the trick. Thanks, rcoder Daniel Malter wrote: > > Hi, > > the argument use should be: use="p" (for pairwise complete obs.) > > Daniel >