Re: [R] monotone spline

2003-10-06 Thread Martin Maechler
alessandro == alessandro ambrosi [EMAIL PROTECTED] on Sun, 05 Oct 2003 22:53:37 +0200 writes: alessandro Hi all! alessandro I have a simple question and I hope someone can alessandro give me some hints. I have to fit a constrained alessandro nonparametric model. More

[R] More questions about R extension programming

2003-10-06 Thread Edzer J. Pebesma
I have been strugling to get character data in and out of c functions using the .Call() interface, but I don't succeed getting them back into R. The example: #include R.h #include Rdefines.h char *cp = xxx; SEXP do_char(SEXP c) { int i; SEXP s; for (i = 0; i LENGTH(c); i++)

RE: [R] Placing legends

2003-10-06 Thread Alexander Ploner
I'm trying to automate making a bunch of figures and I need a way to automate legend position. As I understand it the legend is placed based on coordinates. I don't know before hand what the coordinates are going to be. On one graph my y axis might go from -50 to -10. On

[R] auto.key = TRUE in xyplot() draws max. 7 groups

2003-10-06 Thread Edzer J. Pebesma
In the example below: library(lattice) n = 100 a = rnorm(n) b = rnorm(n) c = sample(c(1:7), n, repl=TRUE) xyplot(a ~ b, groups = c, auto.key = TRUE) c = sample(c(1:8), n, repl=TRUE) xyplot(a ~ b, groups = c, auto.key = TRUE) a key is drawn for the first, but not for the second graph. I suppose it

RE: [R] Jonckheere-Terpstra test

2003-10-06 Thread Kim Mouridsen
The Jonckheere-Terpstra test is a distribution-free test for ordered alternatives in a one-way layout. More specifically, assume X_ij = m + t_j + e_ij, i=1,...,n_j and j=1,...,k, where the errors are idependent and identically distributed. Then you can use the Jonckheere-Terpstra to

[R] conversion of some lines of matlab code to R

2003-10-06 Thread Christoph Lehmann
Dear R-users I got some matlab code (just a few lines) for the deconvolution of a signal: function q=Dconvolve(funct) w=squeeze(size(funct)); % gets the length t=0:3:(w(1,1)-1)*3; h=Dehemo(t,1.25,3); r=fft(h); rinv = 1./r; q = real(ifft( fft(funct(:)).*rinv(:)));

Re: [R] Apply and its friends

2003-10-06 Thread Thomas W Blackwell
Crispin - This is a familiar problem. The only way I know of to do it is: result - lapply(seq(along=list.a), function(i,a,b) do.it(a[[i]], b[[i]]), list.a, list.b) Here, do.it() is the function which operates on two elements. I use this construction frequently. - tom blackwell - u

RE: [R] Jonckheere-Terpstra test

2003-10-06 Thread Ted Harding
On 06-Oct-03 Kim Mouridsen wrote: The Jonckheere-Terpstra test is a distribution-free test for ordered alternatives in a one-way layout. More specifically, assume X_ij = m + t_j + e_ij,i=1,...,n_j and j=1,...,k, where the errors are idependent and identically distributed.

RE: [R] Apply and its friends

2003-10-06 Thread Crispin Miller
Smart! Thanks Crispin -Original Message- From: Berwin Turlach [mailto:[EMAIL PROTECTED] Sent: 06 October 2003 13:11 To: Crispin Miller Subject: Re: [R] Apply and its friends CM == Crispin Miller [EMAIL PROTECTED] writes: CM Hi, CM Forgive a very basic question...

Re: [R] polynomial fit

2003-10-06 Thread Thomas W Blackwell
Karim - try function gam() in package mgcv. library(mgcv) help(gam) - tom blackwell - u michigan medical school - ann arbor - On Mon, 6 Oct 2003, Karim Elsawy wrote: I would like to fit a function H = F(x,y,z) but I do not know the analytical expression of H, is there a way to

Re: [R] Apply and its friends

2003-10-06 Thread Ben Bolker
As of a recent version (1.7.1?), see ?mapply Ben On Mon, 6 Oct 2003, Thomas W Blackwell wrote: Crispin - This is a familiar problem. The only way I know of to do it is: result - lapply(seq(along=list.a), function(i,a,b) do.it(a[[i]], b[[i]]), list.a, list.b) Here, do.it()

RE: [R] polynomial fit

2003-10-06 Thread Liaw, Andy
Or even mars() in the mda package... Andy From: Thomas W Blackwell [mailto:[EMAIL PROTECTED] Karim - try function gam() in package mgcv. library(mgcv) help(gam) - tom blackwell - u michigan medical school - ann arbor - On Mon, 6 Oct 2003, Karim Elsawy wrote: I

Re: [R] Apply and its friends

2003-10-06 Thread Thomas Lumley
On Mon, 6 Oct 2003, Crispin Miller wrote: Hi, Forgive a very basic question... I need to take two lists-of-lists, and apply a function to each pair of elements in the lists to return a single list... For example l1 - list(1:5,6:10,2:15) l2 - list(1:8,4:12,1:19,4:20) I could easily do an

[R] Off topic - Differences among stat packages in GLM results

2003-10-06 Thread Yves Claveau
Dear colleagues, I have performed the same analysis using the GLM module of three statistical softwares: SYSTAT 10, JMP 4.0.2 and R 1.6.2 (see below for more details). Although SYSTAT and R give roughly the same level of significance for all variables, JMP yield a 20 percent difference in

Re: [R] Off topic - Differences among stat packages in GLM results

2003-10-06 Thread Thomas Lumley
On Mon, 6 Oct 2003, [iso-8859-1] Yves Claveau wrote: Dear colleagues, I have performed the same analysis using the GLM module of three statistical softwares: SYSTAT 10, JMP 4.0.2 and R 1.6.2 (see below for more details). Although SYSTAT and R give roughly the same level of

[R] documentation typo in coxph?

2003-10-06 Thread Ramon Diaz-Uriarte
Dear All, I think there is a typo in the documentation for coxph (library survival). The help says: eps: convergence threshold. Iteration will continue until the relative change in the log-likelihood is less than eps. Default is .0001. However, if I do coxph.control() I

[R] convolution question

2003-10-06 Thread Christoph Lehmann
Dear R-users I have a question about convolution, using the convolve() command: the following code gives a function, which will be convolved with a train of delta functions. Can anybody tell me, why the convolved function doesn't have the same length as the original train of delta functions? tau

[R] Selecting a random sample for lmList()

2003-10-06 Thread Harold Doran
Dear List: I have a data set with over 7000 students with about 4 observations over time per student. I want to examine the within-group fits of a random sample of this group as it takes forever to compute and draw all 7000 regressions. Here is the code I have used so far.

[R] prcomp or princomp

2003-10-06 Thread Ann Devitt
Hello, is there any documentation on doing principal components analysis with R besides the R manual itself which is not very informative Thank you Ann __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Re: [R] Selecting a random sample for lmList()

2003-10-06 Thread John Fox
Dear Harold, There are examples of sampling and plotting hierarchical and longitudinal data in this manner in the appendix on mixed models to my R and S-PLUS Companion to Applied Regression; the appendix is available at

Re: [R] prcomp or princomp

2003-10-06 Thread Thomas W Blackwell
Ann - Some useful references are given in the help for each function. Please DO READ the help. - tom blackwell - u michigan medical school - ann arbor - On Mon, 6 Oct 2003, Ann Devitt wrote: Hello, is there any documentation on doing principal components analysis with R besides the R

Re: [R] prcomp or princomp

2003-10-06 Thread Uwe Ligges
Ann Devitt wrote: Hello, is there any documentation on doing principal components analysis with R besides the R manual itself which is not very informative Thank you Ann Have a look into the References given in ?prcomp and ?princomp. Uwe Ligges __

Re: [R] prcomp or princomp

2003-10-06 Thread Thomas Petzoldt
Ann Devitt schrieb: Hello, is there any documentation on doing principal components analysis with R besides the R manual itself which is not very informative yes, see the reference cited on the princomp() - help page: Venables, W. N. and B. D. Ripley (2002). Modern Applied Statistics with S,

Re: [R] non-linear trends in kriging model

2003-10-06 Thread David Pleydell
Thanks Paulo Option 1 seems to work nicely, but I'm not sure how to specify the likelihood function so that I can calculate AIC for comparison with models fitted with likfit? David At 12:24 01/10/2003 +0200, you wrote: David Indeed, the trend term in geoR must be a linear one. You can: 1)

[R] tick marks: 0, 12, 24, 36 ...

2003-10-06 Thread Gabor Borgulya
Dear R-help list, I have a problem with the tick marks of a Kaplan-Meier survival plot. Here is a sample: follow.up-c(10,20,30,40,50,60,70,80,90,100) #months dead-c(1,1,1,0,1,1,0,0,0,0) KM -survfit(Surv(follow.up, dead)) plot(KM) The result is a nice plot. However, our research group thinks it

Re: [R] Point and click

2003-10-06 Thread Michael A. Miller
Jason == Jason Turner [EMAIL PROTECTED] writes: Cliff Lunneborg wrote: The following query raises the question: What is it that students learn from point and click dialogs? [...] I will state one thing - the point and click interface *can* teach about the underlying

Re: [R] Selecting a random sample for lmList()

2003-10-06 Thread Douglas Bates
(Didn't I show this at the workshop you attended in June?) You want to sample the levels of childid and subset the group accordingly. samp - sample(levels(group$childid), 100) subgroup - subset(group, childid %in% samp) You could, if you want, combine these into subgroup - subset(group,

Re: [R] tick marks: 0, 12, 24, 36 ...

2003-10-06 Thread Uwe Ligges
Gabor Borgulya wrote: Dear R-help list, I have a problem with the tick marks of a Kaplan-Meier survival plot. Here is a sample: follow.up-c(10,20,30,40,50,60,70,80,90,100) #months dead-c(1,1,1,0,1,1,0,0,0,0) KM -survfit(Surv(follow.up, dead)) plot(KM) The result is a nice plot. However, our

Re: [R] tick marks: 0, 12, 24, 36 ...

2003-10-06 Thread Marc Schwartz
On Mon, 2003-10-06 at 10:55, Gabor Borgulya wrote: Dear R-help list, I have a problem with the tick marks of a Kaplan-Meier survival plot. Here is a sample: follow.up-c(10,20,30,40,50,60,70,80,90,100) #months dead-c(1,1,1,0,1,1,0,0,0,0) KM -survfit(Surv(follow.up, dead)) plot(KM) The

Re: [R] tick marks: 0, 12, 24, 36 ...

2003-10-06 Thread Spencer Graves
Hopefully, someone who knows will answer. In case that won't happen, I'll tell you what I would do that would likely produce the desired result fairly quickly -- but longer than it would take me to test it: 1. class(KM) = survfit. 2. methods(plot) includes plot.survfit. 3.

[R] bioconductor installation problem

2003-10-06 Thread Weiming Zhang
Hi, I am having some problems on installing bioconductor packages. I got 7 warnings and those 7 packages were not compiled correctly. I installed Graphviz by using RPM, but not sure about HDF (I downloaded it and did what doc says I should do but rhdf5 could not find it). I am running R 1.7.1 on

Re: [R] auto.key = TRUE in xyplot() draws max. 7 groups

2003-10-06 Thread Deepayan Sarkar
On Monday 06 October 2003 03:19, Edzer J. Pebesma wrote: In the example below: library(lattice) n = 100 a = rnorm(n) b = rnorm(n) c = sample(c(1:7), n, repl=TRUE) xyplot(a ~ b, groups = c, auto.key = TRUE) c = sample(c(1:8), n, repl=TRUE) xyplot(a ~ b, groups = c, auto.key = TRUE) a

[R] visualizing transition probability matrices

2003-10-06 Thread Tamas Papp
Dear List, I have a couple of (~200) 3x3 transition probability matrices (ie each defines a Markov chain). They are all estimated from the same underlying process, so it ie meaningful to take their elemetwise mean and standard deviation. [1] First question: supposing that they are given in a

Re: [R] visualizing transition probability matrices

2003-10-06 Thread Thomas W Blackwell
On Mon, 6 Oct 2003, Tamas Papp wrote: I have a couple of (~200) 3x3 transition probability matrices (ie each defines a Markov chain). They are all estimated from the same underlying process, so it ie meaningful to take their elemetwise mean and standard deviation. [1] First question:

Re: [R] tick marks: 0, 12, 24, 36 ...

2003-10-06 Thread Prof Brian Ripley
On Mon, 6 Oct 2003, Spencer Graves wrote: Hopefully, someone who knows will answer. In case that won't happen, I'll tell you what I would do that would likely produce the desired result fairly quickly -- but longer than it would take me to test it: 1. class(KM) = survfit. 2.

[R] Re: Use of the Foreign package to import Stata files

2003-10-06 Thread Alan Cobo-Lewis
Long ago (Sat, 2 Nov 2002), Bill Hart [EMAIL PROTECTED] wrote: An R newbie here. I am using R 1.6 currently and have (successfully, I think) installed the Foreign package. Tried to import a data file created with Stata 7.0 SE. Had minor problems with syntax then R decided that my file

[R] [Help] relative error in rpart() (classification)

2003-10-06 Thread Ji Zhu
Dear all, Could any one tell me how the output relative error (in CP table) is defined in rpart() in the classification case? Thank you. Regards, Ji ~~ Ji Zhu 439 West Hall Assistant Professor 550 East

[R] vif() from Design and car

2003-10-06 Thread Rajarshi Guha
Hi, I've been generating linear models with lm(). I wanted to look at the VIF's for the coefficient. Using the vif() function from the package Design, I would get unusually high VIF's. However using vif() from the car package I get more reasonable values (ie in line with the quality of the

[R] Cannot Install rimage in R-1.7.1 (RH 9.0)

2003-10-06 Thread Rick Bilonick
The rimage install can't find the ffw header. Any idea why? Rick B. install.packages(rimage) trying URL `http://cran.r-project.org/src/contrib/PACKAGES' Content type `text/plain; charset=iso-8859-1' length 130159 bytes opened URL .. .. .. .. .. ..

[R] installation of R

2003-10-06 Thread Stefanie Chau
Hi, I wish to install R on my computer but I do not know how to do this. I have a Windows ME. Please advise on how to install R. Thank you. Stefanie [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list

Re: [R] Cannot Install rimage in R-1.7.1 (RH 9.0)

2003-10-06 Thread Douglas Bates
Rick Bilonick [EMAIL PROTECTED] writes: The rimage install can't find the ffw header. Any idea why? Because you haven't installed the fftw package for your Linux distribution first? Sources, .rpm and .deb files are at http://www.fftw.org/ Rick B. install.packages(rimage) trying URL

Re: [R] installation of R

2003-10-06 Thread Thomas W Blackwell
This is a question you should be able to answer from the R web site, www.r-project.org. - tom blackwell - u michigan medical school - ann arbor - On Mon, 6 Oct 2003, Stefanie Chau wrote: I wish to install R on my computer but I do not know how to do this. I have a Windows ME. Please

Re: [R] Re: Use of the Foreign package to import Stata files

2003-10-06 Thread Thomas Lumley
On Mon, 6 Oct 2003, Alan Cobo-Lewis wrote: But sometimes older works better than newer. The read.dta() function in R 1.7.0's foreign package (package 0.6-3) fails to recognize as a Stata file what seems to be a genuine Stata file, even though R 1.6.2's foreign package (package 0.5-9) imports

Re: [R] Re: Use of the Foreign package to import Stata files

2003-10-06 Thread Thomas Lumley
On Mon, 6 Oct 2003, Thomas Lumley wrote: On Mon, 6 Oct 2003, Alan Cobo-Lewis wrote: But sometimes older works better than newer. The read.dta() function in R 1.7.0's foreign package (package 0.6-3) fails to recognize as a Stata file what seems to be a genuine Stata file, even though R

[R] Log transformed values and contrasts in LME

2003-10-06 Thread Francisco J. Zagmutt Vergara
Dear All This is probably a very basic question for this list but I just wanted to make sure that I am doing things right: I have an LME model with 4 categorical variables and 2 continuous variables (analysis of covariance model). I had to use a log transformation on the data to achieve

Fw: Re: [R] Point and click

2003-10-06 Thread Mark Hall
To bring this back to be somewhat on topic for this list, my point is that R has a well designed interface. It may not be all things to all users, but it is really good for the users that are willing to learn it. While there might be some more powerful interfaces possible with a gui and a

[R] Installing R in Linux 8.0

2003-10-06 Thread Javier Arsuaga
I am trying to install R in Linux 8.0 and I downloaded R-1.7.1-1.i386.rpm and did rpm -hiv R-1.7.1-1.i386.rpm and I am getting the following message: warning: R-1.7.1-1.i386.rpm: V3 DSA signature: NOKEY, key ID 97d3544e error: Failed dependencies: libblas.so.3 is needed by R-1.7.1-1

Re: [R] vif() from Design and car

2003-10-06 Thread John Fox
Dear Rajarshi, I don't have the book to which Frank Harrell refers in the documentation for the vif function in the Design package, but looking at the code for the function, I believe that there's an error: vif - function (fit) { v - Varcov(fit, regcoef.only = TRUE) nam -

Re: [R] Installing R in Linux 8.0

2003-10-06 Thread Peter Dalgaard BSA
Javier Arsuaga [EMAIL PROTECTED] writes: I am trying to install R in Linux 8.0 and I downloaded R-1.7.1-1.i386.rpm and did rpm -hiv R-1.7.1-1.i386.rpm and I am getting the following message: warning: R-1.7.1-1.i386.rpm: V3 DSA signature: NOKEY, key ID 97d3544e error: Failed dependencies:

[R] randomizing within factors and combining unequal-sized arrays

2003-10-06 Thread Christopher Wills
Dear R folks - Sorry to be so dense, but can you help me with two programming problems? 1. Randomizing within factors. I have factored the values in an array according to a series of ranked breakpoints. Now I want to randomize the values that fall within each of the

Re: [R] Installing R in Linux 8.0

2003-10-06 Thread Marc Schwartz
On Mon, 2003-10-06 at 18:00, Peter Dalgaard BSA wrote: Javier Arsuaga [EMAIL PROTECTED] writes: I am trying to install R in Linux 8.0 and I downloaded R-1.7.1-1.i386.rpm and did rpm -hiv R-1.7.1-1.i386.rpm and I am getting the following message: warning: R-1.7.1-1.i386.rpm: V3 DSA

Re: [R] Re: Use of the Foreign package to import Stata files

2003-10-06 Thread Thomas Lumley
I just found an old 1.6.2 (Mac OS/Darwin) lying around and it doesn't recognize the file as a stata file (with foreign 0.5-8) -thomas On Mon, 6 Oct 2003, Thomas Lumley wrote: On Mon, 6 Oct 2003, Thomas Lumley wrote: On Mon, 6 Oct 2003, Alan Cobo-Lewis wrote: But sometimes

win.metafile [RE: [R] insert eps into microsft word]

2003-10-06 Thread Gabor Borgulya
2003-09-10, sze keltezssel David Khabie-Zeitoune ezt rta: Have you tried win.metafile (I'm assuming you are using Windows)? E.g. win.metafile(file = c:/test.wmf) plot(rnorm(100)) dev.off() Hi! I could not run this example: Error: couldn't find function win.metafile I am using Linux. Does

Re: [R] vif() from Design and car

2003-10-06 Thread Frank E Harrell Jr
On Mon, 06 Oct 2003 18:42:04 -0400 John Fox [EMAIL PROTECTED] wrote: Dear Rajarshi, I don't have the book to which Frank Harrell refers in the documentation for the vif function in the Design package, but looking at the code for the function, I believe that there's an error: vif -

[R] Data Mining Contest, $1500 Grand Prize, Please forward to students and professors.

2003-10-06 Thread Lisa Solomon
Apologies for cross-posting. As part of the CART 2004 Data Mining Conference, we have organized a student competition focusing on the data mining technology of Leo Breiman, Jerome Friedman, Richard Olshen, and Charles Stone (CART, MARS, PRIM, and TreeNet/MART). We see this as an opportunity

RE: win.metafile [RE: [R] insert eps into microsft word]

2003-10-06 Thread Ted Harding
On 07-Oct-03 Gabor Borgulya wrote: I could not run this example: Error: couldn't find function win.metafile I am using Linux. Does this function only exist in the windows version of R? Why? Does it need some functions of the OS itself? Can the Linux version of R be invoked or compiled with

Re: win.metafile [RE: [R] insert eps into microsft word]

2003-10-06 Thread Marc Schwartz
On Mon, 2003-10-06 at 19:21, Gabor Borgulya wrote: 2003-09-10, sze keltezssel David Khabie-Zeitoune ezt rta: Have you tried win.metafile (I'm assuming you are using Windows)? E.g. win.metafile(file = c:/test.wmf) plot(rnorm(100)) dev.off() Hi! I could not run this example:

[R] Problem getting an ifelse statment to work

2003-10-06 Thread Greg Blevins
Hello R experts, I trust I have a simple request. I have a dataframe which among its contents are two variables, qs2 and qs9, which have the following frequencies. table(qs2) qs2 1 2 3 4 40 22 11 29 table(qs9) qs9 1 2 3 4 162 172 91 179 I simply want to create a new

RE: [R] Problem getting an ifelse statment to work

2003-10-06 Thread Liaw, Andy
This is a long way; i.e., not necessarily efficient: qs2 [1] 2 1 1 4 4 4 1 1 1 4 2 4 3 1 4 3 3 2 4 3 qs9 [1] 4 4 1 3 4 3 1 3 1 4 1 2 3 3 4 4 1 4 2 3 decision - function(a, b) { + if (a == 1 || b == 1) return(1) + if (a == 2 || b == 2) return(2) + if (a == 3 || b == 3) return(3) +

[R] NaN values returned by cmdscale

2003-10-06 Thread Janet Manry
Hello all, I'm using R1.7.1 on Linux, generating sammon-optimized MDS plots from distance matrices. This is a calculation I run routinely, often on sample sets of up to 100 samples. This time, with three samples, the sammon function returned an error (shown below), which I tracked down to the

RE: [R] Problem getting an ifelse statment to work

2003-10-06 Thread Richard A. O'Keefe
Something I see fairly often in R code is heavy use of 'return', like this example today: decision - function(a, b) { + if (a == 1 || b == 1) return(1) + if (a == 2 || b == 2) return(2) + if (a == 3 || b == 3) return(3) + if (a == 4 || b ==

[R] Automatic differentiation of compiled code.

2003-10-06 Thread Toby.Patterson
Hi all, I wondered if anyone had used automatic differentiation libraries (e.g ADIC/ADOL etc.) in conjunction with R? I have a C shared library that calculates a likelihood within a wrapper function that gets minimized by optim. This works OK but it would be nice to also have a function that