Re: [R] Suggestion for ?split

2006-06-22 Thread Prof Brian Ripley
On Thu, 22 Jun 2006, Simon Blomberg wrote: Hi all, I noticed an undocumented feature for split. It sorts the resulting list according to the grouping factor. An example: test - data.frame(x=rnorm(48), f=letters[sample(1:8)]) split(test, test$f) I wasn't expecting this behaviour, although

Re: [R] NLME: using the layout option with the plot command

2006-06-22 Thread Mark Difford
Hi Greg, Since you haven't yet had a response, you could distill this. It uses the pixel dataset from nlme() as an example. ## To get separate files, do this postscript(c:\MyGraph%03.ps, onefile=F) plot(Pixel, display = Dog, inner = ~Side, layout=c(4,1)) dev.off() ## To get your layout into

[R] Basic NA handling problem

2006-06-22 Thread Sumanta Basak
Hi All, I need your help in NA handling. I've following data series. x-c(1,4,5,8,NA,4,NA,5,5,1,2,7,8,9,NA,NA,NA,15,6,8) Now i want to interpolate where NA value persists. Like, between 9 and 5 there are three NA's. So, that should be interpolated like, 1st NA- (15-9)/4 2nd NA- 1st NA value +

Re: [R] Basic NA handling problem

2006-06-22 Thread JeeBee
Try this: help.search(interpolate) Then find this: library(zoo) na.approx(x) [1] 1.0 4.0 5.0 8.0 6.0 4.0 4.5 5.0 5.0 1.0 2.0 7.0 8.0 9.0 10.5 [16] 12.0 13.5 15.0 6.0 8.0 Hth, JeeBee. On Thu, 22 Jun 2006 06:54:53 +0100, Sumanta Basak wrote: Hi All, I need your help in

Re: [R] How to plot a image with restrictions?

2006-06-22 Thread Roger Bivand
On Wed, 21 Jun 2006, Cleber N.Borges wrote: Hello All! How to plot a image ( image function ) with restrictions, like a polygon?? The suggestions given in: http://finzi.psych.upenn.edu/R/Rhelp02a.new/archive/15030.html by Denis White let you overplot the image with a masking polygon

Re: [R] Rosner's test

2006-06-22 Thread Martin Maechler
BertG == Berton Gunter [EMAIL PROTECTED] on Tue, 13 Jun 2006 14:34:48 -0700 writes: BertG RSiteSearch('Rosner') ?RSiteSearch or search directly BertG from CRAN. BertG Incidentally, I'll repeat what I've said BertG before. Don't do outlier tests. They're BertG

[R] multivariate splits

2006-06-22 Thread Bálint Czúcz
Thanks to everyone for the replies to my question. There are several good algorithms to make decision trees with multivariate splits (sometimes called oblique trees), some are even freeware (QUEST, CRUISE...), but most are not open-sourced. Unfortunately there seems to be no good choice for

Re: [R] sort matrix by sum of columns

2006-06-22 Thread john seers \(IFR\)
Albert Is this what you want?: a[,order(colSums(a))] John S --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Albert Vilella Sent: 21 June 2006 11:38 To: r help Subject: [R] sort matrix by sum of columns Hi all, I would like to know how can

[R] Two sets of axis in a lattice plot?

2006-06-22 Thread Fredrik Karlsson
Dear list, Is it possible to have lattice provide two different ordinate axis, one on the right side and one of the left side of the plot? I would like to make a xyplot with x both in a linear scale and in a log-approximate scale. Thank you in advance. /Fredrik

[R] problem with integrate() - correction

2006-06-22 Thread Rainer M Krug
Sorry should read: ip - function(x) 1240 * x^(-0.88) Rainer M Krug wrote: Hi System: Linux, SuSE 10 R 2.3.0 I try to do the following ip - function(x) 1240*dip(x, 0.88) iip - function(x) integrate(ip, x - 0.045, x + 0.045)$value f - integrate(iip, 10, 100) Error in

Re: [R] problem with integrate() - correction

2006-06-22 Thread Frede Aakmann Tøgersen
Well why not do it symbolically, e.g. int(a*x^b,x) = \frac{a}{b+1}x^{b+1} and integrating this again gives \frac{a}{(b+1)(b+2)}x^{b+2}, of course for resonable values of a and b such that things are well defined. But if you follow the link

Re: [R] problem with integrate() - correction

2006-06-22 Thread Rainer M Krug
Thanks a lot - the symbolic solution will work and I understand what is wrong with my function Rainer Frede Aakmann Tøgersen wrote: Well why not do it symbolically, e.g. int(a*x^b,x) = \frac{a}{b+1}x^{b+1} and integrating this again gives \frac{a}{(b+1)(b+2)}x^{b+2}, of course for

Re: [R] Two sets of axis in a lattice plot?

2006-06-22 Thread Deepayan Sarkar
On 6/22/06, Fredrik Karlsson [EMAIL PROTECTED] wrote: Dear list, Is it possible to have lattice provide two different ordinate axis, one on the right side and one of the left side of the plot? Not easily. I hope to add some support for this sort of thing in the future, but I'm not sure when.

[R] As.Factor with Logistic Regression

2006-06-22 Thread Justin Rapp
I am modeling the probability of player succeeding in the NFL with a binomial logistic regression with 1 signifying success and 0 signifying no success. I performed the regression of the binomial variable against overall draft position using the college conference for which each player played as

Re: [R] glm beta hypothesis testing

2006-06-22 Thread Davis, Jacob B.
Thanks for the insight on the debugger. It has taken me a day or so to get use to it, but it is very helpful. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ben Bolker Sent: Tuesday, June 20, 2006 12:56 PM To: r-help@stat.math.ethz.ch Subject: Re: [R]

Re: [R] As.Factor with Logistic Regression

2006-06-22 Thread Frank E Harrell Jr
Justin Rapp wrote: I am modeling the probability of player succeeding in the NFL with a binomial logistic regression with 1 signifying success and 0 signifying no success. I performed the regression of the binomial variable against overall draft position using the college conference for

[R] GLM plotting estimated responses

2006-06-22 Thread Davis, Jacob B.
I have recently fit a binomial link = logit model and I want to visually see the estimated response across a specific covariate. I can accomplish this by creating a function that extracts the betas from the model then forms a linear combination with the classes I'm interested in next pass the

[R] programming advice

2006-06-22 Thread Fred JEAN
Dear R users I want to compute Kendall's Tau between two vectors x and y. But x and y may have zeros in the same position(s) and I wrote the following function to be sure to drop out those double zeros cor.kendall - function(x,y) { nox - c() noy - c() # for (i in 1:length(x)) if (x[i]!=

[R] Basic package structure question

2006-06-22 Thread Jay Emerson
At the encouragement of many at UseR, I'm trying to build my first real package. I have no C/Fortran code, just plain old R code, so it should be rocket science. On a Linux box, I used package.skeleton() to create a basic package containing just one hello world type of function. I edited the

[R] Why different results with different initial values for MLE (optim)!

2006-06-22 Thread Xin
Hi, All: I used optim() to minimise likelihood function for fitting the data to a partiuclar distribution. The function is converged and the value of log-likelihood is different when I change the intial value. Whether it means the program does not work well? Thanks! Xin

Re: [R] Bayesian Networks with deal

2006-06-22 Thread Spencer Graves
Since I haven't seen a reply to this, I will offer a couple of comments. I've never used deal, but it sounded interesting, so I thought I'd look at it. Have you looked at Susanne G. Bøttcher and Claus Dethlefsen. deal: A Package for Learning Bayesian Networks. Journal of

Re: [R] Reading in a table with ISO-latin1 encoding in MacOS-X (Intel)

2006-06-22 Thread Antti Arppe
Dear colleagues, With the help of a colleague of mine here in Helsinki (Seppo Nyrkkö) who looked at innards of the R source code for Mac it turned out that this was indeed an issue concerning the Mac locale and its settings and not R. Though we had tried this earlier by changing the LANG

[R] Package structure question (progress!)

2006-06-22 Thread John W Emerson
Thanks to Jeff Laake for giving me a starting point. It appears my zipping should have been: zip -r hello.zip hello essentially creating an outer folder having the package name inside the zip file. It still didn't quite work, with an error as follows: utils:::menuInstallLocal()

Re: [R] Why different results with different initial values for MLE(optim)!

2006-06-22 Thread Ravi Varadhan
It is difficult to say much since you haven't described your likelihood function. However, there are some general things that you can do: (1) make sure that you are maximizing, by defining your objective function as the negative of likelihood, (2) use log-likelihood rather than the likelihood

Re: [R] useR! Thanks

2006-06-22 Thread Ravi Varadhan
Dear All, I would like to totally echo Frank Harrell's appreciation of both UseR! and Vienna. I had a wonderful time despite being jet-lagged for the whole time! I was also wondering whether the minutes of the final session on getting credit for contributions to computational statistics

[R] QUERY: correlation between two time series

2006-06-22 Thread Stefano Sofia
I am writing on the behalf of a colleague. She needs to evaluate the correlation between two time series. How can this be performed through R? (how many types of correlations can be performed and which are the commands to do it?) thank you for your help and attention Stefano

Re: [R] High breakdown/efficiency statistics -- was RE: Rosner's test [Broadcast]

2006-06-22 Thread Liaw, Andy
What would be nice is to have something like a robust task view... Andy From: Berton Gunter Many thanks for this Martin. There now are several packages with what appear to be overlapping functions (or at least algorithms). Besides those you mentioned, robust and roblm are at least two

Re: [R] useR! Thanks

2006-06-22 Thread Jeffrey Horner
Achim Zeileis wrote: [...] The plan is to provide the original presentation slides of the panelists and a video of the whole panel disc, and probably some minutes and/or further information. Did you happen to video Ivan Mizera's talk as well? I'd really like to see that again! -- Jeffrey

Re: [R] useR! Thanks

2006-06-22 Thread Marc Schwartz (via MN)
On Thu, 2006-06-22 at 15:40 -0500, Jeffrey Horner wrote: Achim Zeileis wrote: [...] The plan is to provide the original presentation slides of the panelists and a video of the whole panel disc, and probably some minutes and/or further information. Did you happen to video Ivan Mizera's

Re: [R] QUERY: correlation between two time series

2006-06-22 Thread Ben Bolker
Stefano Sofia stefano.sofia at regione.marche.it writes: I am writing on the behalf of a colleague. She needs to evaluate the correlation between two time series. How can this be performed through R? (how many types of correlations can be performed and which are the commands to do it?)

Re: [R] xyplot, type=b

2006-06-22 Thread Benjamin Tyner
For those who are interested, here is a solution using grid. This preserves some of the original spirit of do_plot_xy, but is more satisfactory when x and y are on different scales: my.panel - function(x, y, cex=1, ...){ require(grid) panel.xyplot(x, y, cex = cex, ...) a - 0.5 * cex *

Re: [R] Effect size in mixed models

2006-06-22 Thread Spencer Graves
I just learned that my earlier suggestion was wrong. It's better to compute the variance of the predicted or fitted values and compare those with the estimated variance components. To see how to do this, consider the following minor modification of an example in the lme

Re: [R] rank(x,y)?

2006-06-22 Thread Duncan Murdoch
Gabor Grothendieck wrote: On 6/21/06, Duncan Murdoch [EMAIL PROTECTED] wrote: Peter Dalgaard wrote: Duncan Murdoch [EMAIL PROTECTED] writes: Suppose I have two columns, x,y. I can use order(x,y) to calculate a permutation that puts them into increasing order of x, with

[R] hurdle and zip model

2006-06-22 Thread Jeff Miller
This is more of a stats question, but since I'm using R. Can someone tell me if the standard errors produced by hurdle(), zicounts(), poisson, and the negative binomial formulations of three are directly comparable? Why or why not? Thank you, Jeff [[alternative HTML

Re: [R] Basic package structure question

2006-06-22 Thread Gabor Grothendieck
On 6/22/06, Duncan Murdoch [EMAIL PROTECTED] wrote: Jay Emerson wrote: At the encouragement of many at UseR, I'm trying to build my first real package. I have no C/Fortran code, just plain old R code, so it should be rocket science. On a Linux box, I used package.skeleton() to create a

Re: [R] eacf

2006-06-22 Thread Spencer Graves
RSiteSearch(EACF) led me to http://finzi.psych.upenn.edu/R/Rhelp02a.new/archive/43927.html;. In this note from Oct. 2004, Brian Ripley said the EACF did not exist but 'acf' and 'pacf' did. Moreover, he said that model selection using acf and pacf is a rather old-fashioned idea. Just

Re: [R] xyplot, type=b

2006-06-22 Thread Paul Murrell
Hi Benjamin Tyner wrote: For those who are interested, here is a solution using grid. This preserves some of the original spirit of do_plot_xy, but is more satisfactory when x and y are on different scales: my.panel - function(x, y, cex=1, ...){ require(grid) panel.xyplot(x, y, cex =

Re: [R] xyplot, type=b

2006-06-22 Thread Benjamin Tyner
Most clever! I'd completely forgotten about panel.segments. Paul Murrell wrote: Here's one way to vectorize the lines ... my.panel2 - function(x, y, cex=1, ...){ panel.xyplot(x, y, cex = cex, ...) a - 0.5 * cex * convertWidth(unit(1, char), native, valueOnly=TRUE) b - 0.5 *

Re: [R] positioning of separate y-axis labels in xyplot

2006-06-22 Thread Paul Murrell
Hi Benjamin Tyner wrote: I like the functionality provided by outer=TRUE, but when it comes time to place separate xlabs or ylabs, I always end up 'eyeballing' it on a case-by-case basis. For example, ##begin example require(lattice) cars.lo - loess(dist ~ speed, cars)

Re: [R] frechet distance

2006-06-22 Thread Spencer Graves
RSiteSearch(Frechet distance) returned only one hit for me just now, and that was for a Frechet distribution, as you mentioned. Google found www.cs.concordia.ca/cccg/papers/39.pdf, which suggests that computing it may not be easy. If you'd like more help from this

Re: [R] Nested variance-covariance matrix in Multilevel model

2006-06-22 Thread Spencer Graves
What's your error message? I see a syntax error in random=list(Probe=pdBlocked(list(~1,pdCompSymm(~1 ),End=~1,ProbeNo=pdCompSymm(~1)) I count 5 open parens and 3 close parens. I know that might have been part of what you copied into this email and not what you gave R.

[R] Time series labeling with Zoo

2006-06-22 Thread Gad Abraham
Hi, I'm using zoo because it can automatically label the months of a time series composed of daily observations. This works well for certain time series lengths, but not for others, e.g.: While: library(zoo) plot(zoo(runif(10), as.Date(2005-06-01) + 0:50)) Shows up the months and day of

Re: [R] frechet distance

2006-06-22 Thread Rajarshi Guha
On Thu, 2006-06-22 at 19:52 -0700, Spencer Graves wrote: RSiteSearch(Frechet distance) returned only one hit for me just now, and that was for a Frechet distribution, as you mentioned. Google found www.cs.concordia.ca/cccg/papers/39.pdf, which suggests that computing it may not be

Re: [R] frechet distance

2006-06-22 Thread Spencer Graves
see inline Rajarshi Guha wrote: On Thu, 2006-06-22 at 19:52 -0700, Spencer Graves wrote: RSiteSearch(Frechet distance) returned only one hit for me just now, and that was for a Frechet distribution, as you mentioned. Google found www.cs.concordia.ca/cccg/papers/39.pdf, which

Re: [R] High breakdown/efficiency statistics -- was RE: Rosner's test [Broadcast]

2006-06-22 Thread Martin Maechler
AndyL == Liaw, Andy [EMAIL PROTECTED] on Thu, 22 Jun 2006 14:21:17 -0400 writes: AndyL What would be nice is to have something like a AndyL robust task view... Andy Indeed. I have volunteered to do this a while ago. First wanted to get robustbase to a reasonable state. A

Re: [R] Time series labeling with Zoo

2006-06-22 Thread Gabor Grothendieck
When the axis labelling does not work well you will have to do it yourself like this. The plot statement is instructed not to plot the axis and then we extract into tt all the dates which are day of the month 1. Then we manually draw the axis using those. library(zoo) set.seed(1) z -