[R] Any upcoming R training course in Boston or East Coast?

2009-02-16 Thread steve Jones
Hi List, I am new to R and hoping to convince my advisor to send me to a training course. If you know of any upcoming training course in Boston or East Coast, please let me know. Regards - Steve [[alternative HTML version deleted]] __ R-help@r

[R] [R-pkgs] Package fechner for Fechnerian scaling, on CRAN now

2009-02-16 Thread Ali Uenlue
Version 1.0-0 of fechner has been released to CRAN. Fechnerian scaling of discrete object (or stimulus) sets provides a theoretical framework for deriving, so-called Fechnerian, distances among objects representing subjective dissimilarities. A Fechnerian metric on a set of stimuli is cons

Re: [R] R crash after fGarch update

2009-02-16 Thread Prof Brian Ripley
Start R with --vanilla, or rename youe saved workspace (.RData). Then library(fGarch) load(".RData") # or whatever you renamed it to. This will either work or (more ikely) tell you it cannot find fGarch or a package it depends on). On Mon, 16 Feb 2009, John Kerpel wrote: Hi folks! After up

Re: [R] PDF append help

2009-02-16 Thread Prof Brian Ripley
You cannot just append to PDF files. (Not just those generated by R, but any PDf fiiles: you can combine files but it involves changing them.) Similarly, a PDF file that is incomplete (and it will be incomplete if the deviae is sitll open) cannot be viewed. Technical note: the problem is th

Re: [R] annual maximum value

2009-02-16 Thread CJ Rubio
thank you very much for your reply. i studied the code you gave me and tried to make adjustments to fit the requirements that i need, thank you again.. i used the following codes: > m <- read.table("D:/documents/5 stations/01014000.csv", sep =",") > z <- zoo(m[,4],as.Date(as.character(DF[,3]), "

Re: [R] Alternate to for-loop

2009-02-16 Thread Wacek Kusnierczyk
Patrick Burns wrote: > Wacek Kusnierczyk wrote: >> Patrick Burns wrote: >> >>> If the goal is to "look" professional, then >>> 'replicate' probably suits. If the goal is to >>> compute as fast as possible, then that isn't >>> the case because 'replicate' is really a 'for' >>> loop in disguise an

[R] What's the predict procedure of ARIMA in R?

2009-02-16 Thread Saji Ren
Hello,guys: Recently, I am working on a seasonal ARIMA model. And I met some problem in the forecasting. Now I just want to know that How does R perform the predict procedure(the predict formula, the initial setting of errors,etc.)? I run the following commands and get the original code of the "p

[R] How to simulate a seasonal ARIMA model in R?

2009-02-16 Thread Saji Ren
Guys: Is it possible to simulate a seasonal ARIMA model in R? Which package can do this job? saji from Shanghai __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/p

[R] R crash after fGarch update

2009-02-16 Thread John Kerpel
Hi folks! After updating my packages my R seems to have completely crashed as will not start up - even after I installed 2.8.1 from 2.8.0. I get the following: Fatal error: unable to restore saved data in .Rdata Error in loadNamespeace(name): there is no package called fGarch But I do have a pa

[R] Article on R and SAS in NY Times Blog

2009-02-16 Thread Ajay ohri
http://bits.blogs.nytimes.com/2009/02/16/sas-warms-to-open-source-one-letter-at-a-time/ SAS Warms to Open-Source One Letter at a TimeBy ASHLEE VANCE The SAS Institute has borrowed a page from Sesame Street. It is now sponsoring the letter 'R.' L

Re: [R] Applying functions to partitions

2009-02-16 Thread Stavros Macrakis
On Mon, Feb 16, 2009 at 7:52 PM, Bert Gunter wrote: > I suppose the clean way to do this would be to define a cartesian product of > two factors with the induced lexicographic order (is there a standard > function for doing this?):" > > Of course. ?interaction. Perhaps my specification was unclea

Re: [R] how to control the overall shape of a figure?

2009-02-16 Thread Marc Schwartz
on 02/16/2009 07:51 PM Oliver wrote: > hi, > > I am a R beginner. One thing I notice is that when do graphing is, > > if I want to draw two figures in a row such as this: > > par(mfrow(1, 2)) > plot(...) > plot(...) > > Each figure inside will be rectangle instead of the familiar square > shape

Re: [R] Processing a list of fit objects

2009-02-16 Thread David Winsemius
On Feb 16, 2009, at 9:57 PM, Barker, Chris wrote: Hi, I have a list of fit objects (fit objects from HMISC functions) "Hmisc", and they are actually probably from "Design" functions. I create elements in the list in this way lrm.sumtot <- lrm( ae7bepn ~ trarm + sumtot , data=sd.fix)

Re: [R] annual maximum value

2009-02-16 Thread Gabor Grothendieck
Try this: > Lines <- textConnection("10/1/1989,2410 + 10/2/1989,2460 + 10/3/1989,2890 + 12/31/2005,5730") > > library(zoo) > library(chron) > z <- read.zoo(Lines, header = FALSE, sep = ",", FUN = chron) > aggregate(z, floor(as.numeric(as.yearmon(time(z, max) 1989 2005 2890 5730 See ?read.zoo,

Re: [R] Comparison of age categories using contrasts

2009-02-16 Thread Dylan Beaudette
On Mon, Feb 16, 2009 at 5:28 PM, Patrick Giraudoux wrote: > Greg Snow a écrit : >> One approach is to create your own contrasts matrix: >> >> >>> mycmat <- diag(8) >>> mycmat[ row(mycmat) == col(mycmat) + 1 ] <- -1 >>> mycmati <- solve(mycmat) >>> contrasts(agefactor) <- mycmati[,-1] >>> >> >> Now

[R] annual maximum value

2009-02-16 Thread CJ Rubio
hi everyone! hope you can help me here. i am a new R user. what i am trying to do is to find the maximum annual discharge from a daily record. i have a data.frame which includes date and the discharge. somewhat like this.. 10/1/1989 2410 10/2/1989 2460 10/3/1989 2890 ... ...

[R] Processing a list of fit objects

2009-02-16 Thread Barker, Chris
Hi, I have a list of fit objects (fit objects from HMISC functions) I create elements in the list in this way lrm.sumtot <- lrm( ae7bepn ~ trarm + sumtot , data=sd.fix) lrm.list[['lrm.sumtot']] <- lrm.sumtot And I can run (anova(lrm.sumtot)) The following also gives the anova I'd expect z

[R] how to control the overall shape of a figure?

2009-02-16 Thread Oliver
hi, I am a R beginner. One thing I notice is that when do graphing is, if I want to draw two figures in a row such as this: par(mfrow(1, 2)) plot(...) plot(...) Each figure inside will be rectangle instead of the familiar square shape. Though you can drag the edge the window to resize it. I wou

Re: [R] Problems with labeling a set X axis in chron plots

2009-02-16 Thread Gabor Grothendieck
Date class does not support times. See R News 4/1 for a discussion of the difference between different classes. On Mon, Feb 16, 2009 at 8:08 PM, somewhereondearth wrote: > > HI, > > I couldn't get your problem exactly, but if you are looking for dates on > x-axis, then try using > axis.Date() op

[R] Problem with +(POSIXt, difftime) dispatching -- WAS: How to create sequence of constant time interval

2009-02-16 Thread Stavros Macrakis
There seems to be a problem in the way `+` is dispatched for POSIXt/difftime (R 2.8.0 Windows). With the following definitions: t0 <- as.POSIXct('2009-01-01 00:00') halfhour.mins <- as.difftime(30,units='mins') I would have thought that the straightforward answer to Suresh's question woul

Re: [R] Comparison of age categories using contrasts

2009-02-16 Thread Patrick Giraudoux
Greg Snow a écrit : > One approach is to create your own contrasts matrix: > > >> mycmat <- diag(8) >> mycmat[ row(mycmat) == col(mycmat) + 1 ] <- -1 >> mycmati <- solve(mycmat) >> contrasts(agefactor) <- mycmati[,-1] >> > > Now when you use agefactor, the intercept will be the first age gr

[R] Create package with Fortran 90 and C code

2009-02-16 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm trying to add some Fortran 90 code to an existing package. When I compile and load the file manually like: SHELL> R CMD SHLIB file.f90 R> dyn.load("file.so") I can use the .Fortran() fine. However, when I try to build, install and load the librar

Re: [R] Whitening Time Series

2009-02-16 Thread Bob McCall
Look in the package "forecast" for the function "Arima". It will do what you want. It's different than arima function in the stats package. Bob Pele wrote: > > Hi R users, > > I am doing cross correlation analysis on 2 time series (call them > y-series and x-series) where I need the use the mo

Re: [R] Problems with labeling a set X axis in chron plots

2009-02-16 Thread somewhereondearth
HI, I couldn't get your problem exactly, but if you are looking for dates on x-axis, then try using axis.Date() option. you can give the weekly, daily sequence if you like.( I am trying for a 6-hour sequence, but hasn't got it yet). Neotropical bat risk assessments wrote: > > I am having di

[R] Overdispersion with binomial distribution

2009-02-16 Thread Jessica L Hite/hitejl/O/VCU
I am attempting to run a glm with a binomial model to analyze proportion data. I have been following Crawley's book closely and am wondering if there is an accepted standard for how much is too much overdispersion? (e.g. change in AIC has an accepted standard of 2). In the example, he fits sever

[R] Problems with labeling a set X axis in chron plots

2009-02-16 Thread B. Miller
I am having difficulties getting the X-axis labels (dates) to be as needed when plotting from chron The help syntax from chron lists this example: x <- chron(dates = c("02/27/92", "02/27/92", "01/14/92", "02/28/92"), I have activity plots by time on the y-axis and the dates on the x-axis. Wha

Re: [R] PDF append help

2009-02-16 Thread somewhereondearth
Hi, I need to append my multiple plots in pdf files. my problem is that I would want to run the R script a number times(closing and opening) and still want to append. If i keep the dev.off() it wouldnt let me see my plots while R is open. any idea!! Jorge Ivan Velez wrote: > > Hi Ramya, > > P

[R] Time series prediction

2009-02-16 Thread dan ben moshe
I am trying to predict time series.  I have several samples which consist of measurement of 4 different variables over different time periods, and other measurements over subsequent time periods which I believe is predicted by the 4 variables. I am thinking of using cluster analysis, to confirm tha

Re: [R] Problems with labeling a set X axis in chron plots

2009-02-16 Thread David Winsemius
On Feb 16, 2009, at 6:11 PM, Neotropical bat risk assessments wrote: I am having difficulties getting the X-axis labels (dates) to be as needed when plotting from chron The help syntax from chron lists this example: x <- chron(dates = c("02/27/92", "02/27/92", "01/14/92", "02/28/92"), On

Re: [R] Applying functions to partitions

2009-02-16 Thread Bert Gunter
"... I suppose the clean way to do this would be to define a cartesian product of two factors with the induced lexicographic order (is there a standard function for doing this?):" Of course. ?interaction. -- Bert Gunter Genentch __ R-help@r-project.

Re: [R] Applying functions to partitions

2009-02-16 Thread Stavros Macrakis
On Mon, Feb 16, 2009 at 4:23 PM, Martin Morgan wrote: > Stavros Macrakis writes: > >matrix(tapply(mm, outer(rfact,cfact,paste), mean), > > length(unique(rfact))) > > or the variant > > idx <- outer(rfact, (cfact - 1) * max(rfact), "+") > matrix(tapply(m, idx, mean), max(rfact

[R] Problems with labeling a set X axis in chron plots

2009-02-16 Thread Neotropical bat risk assessments
I am having difficulties getting the X-axis labels (dates) to be as needed when plotting from chron The help syntax from chron lists this example: x <- chron(dates = c("02/27/92", "02/27/92", "01/14/92", "02/28/92"), I have activity plots by time on the y-axis and the dates on the x-axis. Wh

Re: [R] Alternate to for-loop

2009-02-16 Thread Stefan Evert
A couple of remarks on vQ's naive benchmark: f.rep = function(n, m) replicate(n, rnorm(m)) I suppose you meant f.rep = function(n, m) replicate(n, mean(rnorm(m))) which doesn't make a substantial speed difference, though. f.pat = function(n, m) colMeans(array(rnorm(n*m), c(n, m)))

Re: [R] controlling number of decimals printed in anova tables?

2009-02-16 Thread Michael Friendly
Thanks, Gabor No, that wasn't it at all. In print.anova, I found: if (length(i <- grep("Df$", cn))) zap.i <- zap.i[!(zap.i %in% i)] so it only recognizes "Df", not "df" as a column name prefix to print as integers. -Michael Gabor Grothendieck wrote: Or safer: df <- as.integer(rou

Re: [R] problem of "local" ! :-(

2009-02-16 Thread Gabor Grothendieck
The Date class does not work with times and neither it nor the chron dates and times classes use time zones so that cannot be the problem if you are using those classes. Much of this is discussed in R News 4/1. On Mon, Feb 16, 2009 at 4:05 PM, Suresh_FSFM wrote: > > Dear R- Experts, > > Seek your

Re: [R] incl.non.slopes=FALSE does not work at predict.lm

2009-02-16 Thread Rolf Turner
On 17/02/2009, at 10:54 AM, dimitris kapetanakis wrote: Dear all, I am trying to estimate the prediction from a fixed effects model and their confidence intervals as well. Though I do not want to include in the prediction and at the confidence intervals the intercept. For that reason I u

[R] incl.non.slopes=FALSE does not work at predict.lm

2009-02-16 Thread dimitris kapetanakis
Dear all, I am trying to estimate the prediction from a fixed effects model and their confidence intervals as well. Though I do not want to include in the prediction and at the confidence intervals the intercept. For that reason I used the argument incl.non.slopes=FALSE. But either if it is TRUE

Re: [R] rimage

2009-02-16 Thread Hufkens Koen
I would love to fix it however my C++ skills are limited. Hope someone fixes this before it disappears. Koen -Original Message- From: Dirk Eddelbuettel [mailto:e...@debian.org] Sent: Mon 16-2-2009 21:49 To: Hufkens Koen Cc: r-help@r-project.org Subject: Re: [R] rimage On 16 February 20

Re: [R] Applying functions to partitions

2009-02-16 Thread Martin Morgan
Stavros Macrakis writes: > Assuming your matrix is: > > mm <- matrix(runif(6*6),6,6) > > And your blocks are defined by integers or factors: > >cfact <- c(1,1,1,2,3,3) >rfact <- c(1,1,1,2,2,3) > > Then the following should do the trick: > >matrix(tapply(mm, outer(rfact,cfact,paste

Re: [R] Comparison of age categories using contrasts

2009-02-16 Thread Greg Snow
One approach is to create your own contrasts matrix: > mycmat <- diag(8) > mycmat[ row(mycmat) == col(mycmat) + 1 ] <- -1 > mycmati <- solve(mycmat) > contrasts(agefactor) <- mycmati[,-1] Now when you use agefactor, the intercept will be the first age group and the slopes will be the differences

[R] problem of "local" ! :-(

2009-02-16 Thread Suresh_FSFM
Dear R- Experts, Seek your help. I created a time sequence using: x[i] <-chron(dates, tt, format=c(dates="y-m-d", tt="h:m:s")) first element in the list is displayed as: (09-01-01 00:00:00) Now, I want to store this value as date. If I use: format.Date(x[1],"%y-%m-%d %H:%M:%S"), I expect follo

Re: [R] Printing out a graph using different graphics devices

2009-02-16 Thread Greg Snow
You might want to look at the dev.copy function. I just tried with your example and the postscript device, used the print(plot) command with the postscript device open, then switched to the windows graphics device and did dev.copy then closed the postscript file, the result had 2 pages, the fir

Re: [R] rimage

2009-02-16 Thread Dirk Eddelbuettel
On 16 February 2009 at 21:09, Koen Hufkens wrote: | Hi list, | | I'm trying to install/compile rimage on ubuntu linux (i386) interpid. | However, the compilation hangs on: | | gcc -std=gnu99 -I/usr/share/R/include -g -O2 -fpic -g -O2 -c | laplacian.c -o laplacian.o | laplacian.c: In funct

Re: [R] Alternate to for-loop

2009-02-16 Thread Patrick Burns
Wacek Kusnierczyk wrote: Patrick Burns wrote: If the goal is to "look" professional, then 'replicate' probably suits. If the goal is to compute as fast as possible, then that isn't the case because 'replicate' is really a 'for' loop in disguise and there are other ways. Here's one other way

Re: [R] Ideal (possible) configuration for an exalted R system

2009-02-16 Thread Kingsford Jones
Hi Harsh, The useR! 2008 site has useful information. E.g. talks by Graham Williams: http://www.statistik.uni-dortmund.de/useR-2008/slides/Williams.pdf Dirk Eddelbuettel http://www.statistik.uni-dortmund.de/useR-2008/tutorials/useR2008introhighperfR.pdf and others http://www.statistik.uni-d

Re: [R] Applying functions to partitions

2009-02-16 Thread David Winsemius
Its not clear that the object returned from such an operation would be a matrix, but if things remain very regular then perhapos you will succeed with this: > markmtx <- matrix(scan(textConnection("a a a d g g + a a a d g g + a a a d g g + b b b e h h + b b b e h h + c c c

Re: [R] Applying functions to partitions

2009-02-16 Thread Stavros Macrakis
Assuming your matrix is: mm <- matrix(runif(6*6),6,6) And your blocks are defined by integers or factors: cfact <- c(1,1,1,2,3,3) rfact <- c(1,1,1,2,2,3) Then the following should do the trick: matrix(tapply(mm, outer(rfact,cfact,paste), mean), length(unique(rfact)))

[R] rimage

2009-02-16 Thread Koen Hufkens
Hi list, I'm trying to install/compile rimage on ubuntu linux (i386) interpid. However, the compilation hangs on: gcc -std=gnu99 -I/usr/share/R/include -g -O2 -fpic -g -O2 -c laplacian.c -o laplacian.o laplacian.c: In function ‘laplacian’: laplacian.c:14: warning: implicit declaration of f

Re: [R] superscript

2009-02-16 Thread David Douterlungne
David and Danel, Indeed, the missing symbol is "*". Now it works, although, with a change of font in the brackets of the axis=label. Thanks, david > To: daviddou...@hotmail.com > Subject: Re: [R] superscript > From: davidcr...@charter.net > Date: Sat, 14 Feb 2009 17:49:11 -0600 > > >

Re: [R] Applying functions to partitions

2009-02-16 Thread Charles C. Berry
On Mon, 16 Feb 2009, Titus von der Malsburg wrote: On Mon, Feb 16, 2009 at 01:45:52PM -0500, Stavros Macrakis wrote: How are the blocks defined? As a priori index ranges? By factors? By some property of i,j? Or...? Ok, I should have been more specific. The blocks are defined by factors. The

Re: [R] Anova and unbalanced designs

2009-02-16 Thread Greg Snow
Tal, The reparametirized cell means model can help with the understanding of what the individual terms mean in an analysis with contrasts. The cell means model is y=W*mu + e, where mu is the vector of the cell means (the mean for each group) and W is just a stretched identity matrix, this mode

Re: [R] Alternate to for-loop

2009-02-16 Thread Wacek Kusnierczyk
Patrick Burns wrote: > If the goal is to "look" professional, then > 'replicate' probably suits. If the goal is to > compute as fast as possible, then that isn't > the case because 'replicate' is really a 'for' > loop in disguise and there are other ways. > > Here's one other way: > > function (si

Re: [R] assuming AR(1) residuals in OLS

2009-02-16 Thread Prof Brian Ripley
You will need library(nlme) first. But not for ?arima, which seems the more obvious way to do this simple example. On Mon, 16 Feb 2009, Michael Kubovy wrote: ?gls On Feb 16, 2009, at 12:28 PM, constantine wrote: In other statistical software, such as Eviews, it is possible to regress a

Re: [R] Adjusting the Axis in a histogram to the prespecified breaks

2009-02-16 Thread Titus von der Malsburg
On Mon, Feb 16, 2009 at 11:08:24AM -0800, Christian Langkamp wrote: > I could of course log the whole data > set, but then explaining that transformation within a presentation is > generally not a pleasant exercise. You don't have to explain it. Just calculate the hist of the log and label the ax

Re: [R] Applying functions to partitions

2009-02-16 Thread Titus von der Malsburg
On Mon, Feb 16, 2009 at 01:45:52PM -0500, Stavros Macrakis wrote: > How are the blocks defined? As a priori index ranges? By factors? By > some property of i,j? Or...? Ok, I should have been more specific. The blocks are defined by factors. There's a factor for the columns and a factor for the r

[R] Adjusting the Axis in a histogram to the prespecified breaks

2009-02-16 Thread Christian Langkamp
Hello I tried a few searches on hist, histogram, equidist and space (space=0 was mentioned in one contribution), but none of that so far worked. It also says in the help "##-- For non-equidistant breaks, counts should NOT be graphed unscaled:" - which is precisely what I am looking for, but I cann

Re: [R] several "ifelse" problems...

2009-02-16 Thread Patrizio Frederic
do you mean: f=function(x) 0*(abs(x-.5)<=.3)-1*(abs(x-.5)>=.4)+(10*x-2)*(x>.1&x<.2)+(-10*x+8)*(x>=.2&x<=.5) f(x) curve(f,0,1) hope it helps. Patrizio 2009/2/14 kathie : > > Dear R users, > > >From the code below, I try to compute "y" value. (In fact, y looks like a > trapezoid) > >

Re: [R] Website, book, paper, etc. that shows example plots of distributions?

2009-02-16 Thread Greg Snow
I had a Murphy's law calendar a while back with many different laws in it. One of those laws was along the lines of: An easily understood, simple falsehood is often more useful than a complicated, often misunderstood truth (though the original was probably much better phrased than my memory).

[R] Help with rgl

2009-02-16 Thread Iuri Gavronski
Hi, I don't know much about the RGL package, and I have read the documentation and tried some parameters, with no luck... I would like to generate a movie from a 3D object (code below), where the vortex A is closer to the observer, and then the object rotates and the B vortex gets closer. I would

Re: [R] assuming AR(1) residuals in OLS

2009-02-16 Thread Michael Kubovy
?gls On Feb 16, 2009, at 12:28 PM, constantine wrote: In other statistical software, such as Eviews, it is possible to regress a model with the Least Squares method, assuming that the residuals follow an AR(q) process. For example the resulting regression is something like y = 1.2154 + 0.2215

Re: [R] Whitening Time Series

2009-02-16 Thread stephen sefick
if you want to whiten the series why not just new series <- rnorm(num.obs)+series On Mon, Feb 16, 2009 at 12:25 PM, Pele wrote: > > Hi R users, > > I am doing cross correlation analysis on 2 time series (call them y-series > and x-series) where I need the use the model developed on the x-series

Re: [R] Using eval in multinom argument

2009-02-16 Thread Charles C. Berry
Forget eval(parse(text = )) See ?as.formula ?update.formula and try out the example() s there. HTH, Chuck On Mon, 16 Feb 2009, Crouch, Daniel wrote: Hi, I am having difficulty entering a 'programmable' argument into the multinom function from the nnet package. Intera

Re: [R] (no subject)

2009-02-16 Thread Vincze Orsolya
Dear Peter,Thanks for the answer, it's working very well. And again sorry, about asking as a banal question, but I really didn't have who to ask to help me. Uwe: I don't have a teacher, I never learned R before. I'm just trying to learn self-educating, because it's very helpful in data manipulation

Re: [R] Printing out a graph using different graphics devices

2009-02-16 Thread Deepayan Sarkar
On 2/16/09, Dimitri Liakhovitski wrote: > Hello, everyone! > The code below allows me to produce the graph I want (I know - the > colors are strange, but it's just for the sake of an example). > After you run the plot<- part and then do print(plot) - that's what I want. > However, when I run t

[R] Applying functions to partitions

2009-02-16 Thread Titus von der Malsburg
Hi list! I have a large matrix which I'd like to partition into blocks and for each block I'd like to compute the mean. Following a example where each letter marks a block of the partition: a a a d g g a a a d g g a a a d g g b b b e h h b b b e h h c c c f i i I

Re: [R] Outlier Detection for timeseries

2009-02-16 Thread Bert Gunter
Danger: More careful thought required. "Outliers" (Title of a TECHNOMETRICS paper of a couple of decades ago) are an artificial construct: there is NO SUCH THING in the abstract. They exist only wrt to a model. So there is no such thing as software that "tells whether the changes are considere

[R] sandwich matrix multiplication and efficient determinant

2009-02-16 Thread Shimrit Abraham
Hi, I am looking for two ways to speed up my computations: 1. Is there a function that efficiently computes the 'sandwich product' of three matrices, say, ZPZ' 2. Is there a function that efficiently computes the determinant of a positive definite symmetric matrix? Thanks, S.A. [[alter

[R] assuming AR(1) residuals in OLS

2009-02-16 Thread constantine
Hi to all, In other statistical software, such as Eviews, it is possible to regress a model with the Least Squares method, assuming that the residuals follow an AR(q) process. For example the resulting regression is something like y = 1.2154 + 0.2215 x + 0.251 AR(1) How is it possible to do th

[R] Whitening Time Series

2009-02-16 Thread Pele
Hi R users, I am doing cross correlation analysis on 2 time series (call them y-series and x-series) where I need the use the model developed on the x-series to prewhiten the yseries.. Can someone point me to a function/filter in R that would allow me to do that? Thanks in advance for any hel

[R] Printing out a graph using different graphics devices

2009-02-16 Thread Dimitri Liakhovitski
Hello, everyone! The code below allows me to produce the graph I want (I know - the colors are strange, but it's just for the sake of an example). After you run the plot<- part and then do print(plot) - that's what I want. However, when I run the bits of code below (with graphics devices) - what th

Re: [R] scatterplot and correlation for weird data format

2009-02-16 Thread hadley wickham
On Mon, Feb 16, 2009 at 10:21 AM, William Simpson wrote: > I have data in a format like this: > > namessexsex viewnum rating rt > ahl4f m f 56 -1082246 > ahl4f m f 74 85 1444 > ahl4f m f 52

Re: [R] Alternate to for-loop

2009-02-16 Thread Gustaf Rydevik
On Mon, Feb 16, 2009 at 12:59 PM, megh wrote: > > Hi, I am trying to create a vector of length 10 (say), wherein each element > will be average of random sample of size 100, from a distribution, say > Normal. Can anyone please tell me without creating a "for" loop, how I can > do that? > > Regards

Re: [R] Alternate to for-loop

2009-02-16 Thread Patrick Burns
If the goal is to "look" professional, then 'replicate' probably suits. If the goal is to compute as fast as possible, then that isn't the case because 'replicate' is really a 'for' loop in disguise and there are other ways. Here's one other way: function (size, replicates, distfun, ...) {

Re: [R] (no subject)

2009-02-16 Thread Uwe Ligges
Peter Dalgaard wrote: Uwe Ligges wrote: Vincze Orsolya wrote: There are three columns, I was just careless. I succeed to merge the two tables. But: 1) in the first table there were rows, which were not present in the second table, these rows were deleted from the merged table too, but I need

Re: [R] controlling number of decimals printed in anova tables?

2009-02-16 Thread Dieter Menne
Gabor Grothendieck gmail.com> writes: > > On Mon, Feb 16, 2009 at 11:08 AM, Dieter Menne > > Yes, with as.integer(round(...)) It looks like this: > > > modelFit.glm(berk.mod2) > Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > > modelFit.glm(berk.mod2) > Analysis of Deviance

[R] Using eval in multinom argument

2009-02-16 Thread Crouch, Daniel
Hi, I am having difficulty entering a 'programmable' argument into the multinom function from the nnet package. Interactively, I can get the function to work fine by calling it this way: z1=multinom(formula = class.ind(grp[-outgroup])~ (PC1 + PC2 + PC3), data=data.frame(scores)) However I nee

[R] scatterplot and correlation for weird data format

2009-02-16 Thread William Simpson
I have data in a format like this: namessexsex viewnum rating rt ahl4f m f 56 -1082246 ahl4f m f 74 85 1444 ahl4f m f 52 151 1595 ahl4f m f 85 1 1447

Re: [R] controlling number of decimals printed in anova tables?

2009-02-16 Thread Gabor Grothendieck
On Mon, Feb 16, 2009 at 11:08 AM, Dieter Menne wrote: > Gabor Grothendieck gmail.com> writes: > >> >> Or safer: >> >> df <- as.integer(round(...)) >> > > Did you try? I believe it is a problem of printCoefmat that has quite > a few options for special column, but none for df. Ask Martin Mächler.

Re: [R] is there any way to find match with tolerance

2009-02-16 Thread Suresh_FSFM
Thank you for the positve response. Gabor Grothendieck wrote: > > ?all.equal has a tolerance argument. > > On Mon, Feb 16, 2009 at 8:41 AM, Suresh_FSFM > wrote: >> >> Hello all, >> >> suppose I have a time-stamp: "16-02-2009 00:20:00" >> and other array that stores lot of time values. >> >>

Re: [R] controlling number of decimals printed in anova tables?

2009-02-16 Thread Dieter Menne
Gabor Grothendieck gmail.com> writes: > > Or safer: > > df <- as.integer(round(...)) > Did you try? I believe it is a problem of printCoefmat that has quite a few options for special column, but none for df. Ask Martin Mächler. Dieter __ R-help@r-

Re: [R] LCA (e1071 package): error

2009-02-16 Thread Evgenia
Before using lca, try data<-as.matrix(data). For example when I tried using lca " lca(LSAT,2,niter=100)" for known LSAT data (library ltm), I took error messages. But, when I use data<-as.matrix(LSAT) lca(data,2,niter=100) I took results for lca King Regards, Evgenia Tryntsje Wesselius wrot

Re: [R] (no subject)

2009-02-16 Thread Peter Dalgaard
Uwe Ligges wrote: > > > Vincze Orsolya wrote: >> There are three columns, I was just careless. >> I succeed to merge the two tables. But: >> 1) in the first table there were rows, which were not present in the >> second >> table, these rows were deleted from the merged table too, but I need >> th

Re: [R] controlling number of decimals printed in anova tables?

2009-02-16 Thread Gabor Grothendieck
Or safer: df <- as.integer(round(...)) On Mon, Feb 16, 2009 at 10:54 AM, Gabor Grothendieck wrote: > Try this: > > On Mon, Feb 16, 2009 at 9:02 AM, Michael Friendly wrote: >> For glm() models, I often find both the print() and summary() method >> disappointing if my main interest >> is seeing h

[R] I can't apply the summary function when I use de armaFit (fArma)...

2009-02-16 Thread Ana Patricia Silva Cunha Martins (DGR)
Hi, I can't apply the summary function when I use de armaFit (fArma). Can you help? fit<-armaFit(~arma(1,0),data=age55) fit Title: ARIMA Modelling Call: armaFit(formula = ~arma(1, 0), data = age55) Model: ARIMA(1,0,0) with method: CSS-ML Coefficient(s): ar1 intercept -0

Re: [R] controlling number of decimals printed in anova tables?

2009-02-16 Thread Gabor Grothendieck
Try this: On Mon, Feb 16, 2009 at 9:02 AM, Michael Friendly wrote: > For glm() models, I often find both the print() and summary() method > disappointing if my main interest > is seeing how well a given model fits. A basic display would just compare > the null model to to my model. > > I wrote th

[R] odd GARCH(1,1) results

2009-02-16 Thread Helena Richter
Hi everybody, I'm trying to fit a Garch(1,1) process to the DAX returns. My data consists of about 2300 10day-logreturns in chronologically descending order (see attachment). But if I use the garch function I get a very high alpha_1 and a quite low beta, which doesn't make that much sense. I

Re: [R] solve.QP with box and equality constraints

2009-02-16 Thread Selwyn McCracken
Berwin, Many thanks for your reply - your solution is exactly what I was looking for and the additional advice is also much appreciated. Have a good day :-) Selwyn On Mon, Feb 16, 2009 at 3:13 PM, Berwin A Turlach wrote: > G'day Selwyn, > > On Mon, 16 Feb 2009 10:11:20 + > Selwyn McCracken

Re: [R] is there any way to find match with tolerance

2009-02-16 Thread Gabor Grothendieck
?all.equal has a tolerance argument. On Mon, Feb 16, 2009 at 8:41 AM, Suresh_FSFM wrote: > > Hello all, > > suppose I have a time-stamp: "16-02-2009 00:20:00" > and other array that stores lot of time values. > > My tolerance limit = +5 minutes > I would like to find values from this array matchi

[R] How to add direction of time to plot.circular()

2009-02-16 Thread Michael Kubovy
Dear r-helpers, I want to show that time is flowing CCW in the following: require(circular) len <- 8 labl <- as.character(c(0, 1, 1, 1, 0, 0, 1, 0)) r <- circular(2*pi* (rep(c(1, 3, 6), each = 200)/len + rnorm(600, 0, 0.025))) r.dens <- density(r, bw = 25, adjust = 4, kernel = 'vonmises') plot(

Re: [R] solve.QP with box and equality constraints

2009-02-16 Thread Berwin A Turlach
G'day Selwyn, On Mon, 16 Feb 2009 10:11:20 + Selwyn McCracken wrote: > I am trying to follow an example that estimates a 2x2 markov > transition matrix across several periods from aggregate data using > restricted least squares. > > I seem to be making headway using solve.QP(quadprog) as th

Re: [R] How to create sequence of constant time interval

2009-02-16 Thread Tony Breyal
ahh, didn't see Gabor's solution, that works much better :-) On 16 Feb, 10:00, Suresh_FSFM wrote: > Dear R-Experts, > > seek your help. > > There are two parts I want to deal with. > 1) > I want to create a time interval of say, 30 minutes starting from "00:00:00" > hrs > Thus at the end, I want

Re: [R] How to create sequence of constant time interval

2009-02-16 Thread Tony Breyal
Something like the following might give a few ideas: > start.date <- '2009-01-01' > start.time <- '00:00:00' > interval <- 30 > > increment.mins <- interval * 60 > x <- paste(start.date, start.time) > > for(i in 1:20) { + print(strptime(x, "%Y-%m-%d %H:%M:%S") + i*increment.mins) + } [1] "2009-

Re: [R] Alternate to for-loop

2009-02-16 Thread Uwe Ligges
megh wrote: No, it is not homework. I obviously For some value of "obvious" as you has not given a single line of code as the posting guide suggests. You probably want: replicate(10, mean(rnorm(100))) Uwe Ligges could do that using a for-loop, and that I already did. However I though

Re: [R] How do i compute predicted failure time from a cox model?

2009-02-16 Thread Frank E Harrell Jr
Eleni Rapsomaniki wrote: Given a cox model: library(Hmisc); library(survival); (library(Design); cox.model=cph(Surv(futime, fustat) ~ age, data=ovarian, surv=T) str(cox.model) What I need is the total estimated time until failure (death), not the probability of failing at a given time (sur

[R] controlling number of decimals printed in anova tables?

2009-02-16 Thread Michael Friendly
For glm() models, I often find both the print() and summary() method disappointing if my main interest is seeing how well a given model fits. A basic display would just compare the null model to to my model. I wrote the function below based on code in some package. How can I make it so that the

Re: [R] Comparison of age categories using contrasts

2009-02-16 Thread Frank E Harrell Jr
Mark Difford wrote: Hi Patrick, The default in glm is cont.treatment (for unordered factors) and that leads to compare each level to the first one. I would rather prefer to compare the 2nd to the 1st, the 3rd to the 2nd, the 4th to the 3rd, etc... The functions ?C and ?contrasts allow you t

[R] How do i compute predicted failure time from a cox model?

2009-02-16 Thread Eleni Rapsomaniki
Given a cox model:   library(Hmisc); library(survival); (library(Design); cox.model=cph(Surv(futime,  fustat) ~ age, data=ovarian, surv=T) str(cox.model)   What I need is the total estimated time until failure (death), not the probability of failing at a given time (survival probability), or haz

[R] is there any way to find match with tolerance

2009-02-16 Thread Suresh_FSFM
Hello all, suppose I have a time-stamp: "16-02-2009 00:20:00" and other array that stores lot of time values. My tolerance limit = +5 minutes I would like to find values from this array matching with the value: "16-02-2009 00:20:00" + tolerance Before I write some function, I would like to know:

Re: [R] loading mgcv package

2009-02-16 Thread Simon Wood
What happens if you type runif(1) before loading `mgcv'? best, Simon On Sunday 15 February 2009 17:06, Veerappa Chetty wrote: > Hi ,When I try to load the 'mgcv" package, often, but not always, get this > error message. What am I doing wrong? I even tried reinstalling a few > times. ___

[R] Odp: several "ifelse" problems...

2009-02-16 Thread Petr PIKAL
Hi > x <- seq(0,1,.01) > y <- ifelse(abs(x-.5)<=0.3,0, + ifelse(abs(w-.5)>=0.4,-1, +ifelse((0.1 y <- ifelse(abs(x-.5)<=0.3,0, + ifelse(abs(x-.5)>=0.4,-1, +ifelse((0.1 > y [1] -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0

  1   2   >