Re: [R] Problem with as.data.frame when an extra attribute is present

2006-11-10 Thread Prof Brian Ripley
On Fri, 10 Nov 2006, Frank E Harrell Jr wrote: > Prof Brian Ripley wrote: >> It's quite intentional, as it is the documented behaviour of data.frame: >> >> Objects passed to 'data.frame' should have the same number of >> rows, but atomic vectors, factors and character vectors protected >

Re: [R] Speed Optimization: Faster Way of Accessing data.frame in a Loop?

2006-11-10 Thread Prof Brian Ripley
I don't see how this code can work at all. '[<-.data.frame' does not accept three arguments, e.g. > women[1,2,3] <- 17 Error in `[<-.data.frame`(`*tmp*`, 1, 2, 3, value = 17) : unused argument(s) (3) If df is in fact a three-dimensional array you can do df[1:20, 1:30, 20] <- df[1:20, 1

Re: [R] predict.lda is missing ?

2006-11-10 Thread Weiwei Shi
i think you should use lda_res <- lda(over_win ~ t1_scrd_a + t1_alwd_a, data=train, CV=F) loo should be disabled for predicting purpose. On 11/10/06, Larry White <[EMAIL PROTECTED]> wrote: > I'm trying to classify some observations using lda and I'm getting a > strange error. I loaded the MASS p

[R] predict.lda is missing ?

2006-11-10 Thread Larry White
I'm trying to classify some observations using lda and I'm getting a strange error. I loaded the MASS package and created a model like so: >train <- mod1[mod1$rand < 1.7,] >classify <- mod1[mod1$rand >= 1.7,] >lda_res <- lda(over_win ~ t1_scrd_a + t1_alwd_a, data=train, CV=TRUE) That works, and

Re: [R] missing symbols for mathplot

2006-11-10 Thread Gabor Grothendieck
Try this: plot(0, main = quote(P(X ~ "|" ~ A ~ intersect(B On 11/10/06, stortignauz <[EMAIL PROTECTED]> wrote: > > Hi all, > > I'm trying to write an axis label > that sounds P( X | K and Xb ) (probability of X given K and Xb ) > but I need the intersection symbol > (the "\cap" in latex) > A

Re: [R] count data with nested mixed effects

2006-11-10 Thread Francisco Zagmutt
Hi Deborah, A very good source for hands-on information on mixed models in S is: "Mixed-effects models in S and S-PLUS" by Pinheiro and Bates Incidentally, it's available in your university's library http://toroprod.library.utoronto.ca/uhtbin/cgisirsi/2XfWcMI0Ns/ROBARTS/140640080/2/1000 I beli

[R] count data with nested mixed effects

2006-11-10 Thread kohn
Dear R-Pros, I have count data in which 6-10 points are nested within 17 larger units (which are nested within 3 larger-still units) plus a number of covariates. It could be nested ANCOVA but for poisson family. Could someone kindly advise me 1) if lmer is the correct function for the analysis? a

Re: [R] Selective subsetting

2006-11-10 Thread Peter Dalgaard
"Davendra Sohal" <[EMAIL PROTECTED]> writes: > Hi all, > Here's an interesting (for me, at least!) problem I came across: > I have a correlation matrix, let's say with 6 variables, A to F, as column > headings and the same 6 as row headings. > The matrix is filled with correlation coefficients. Th

Re: [R] Selective subsetting

2006-11-10 Thread Francisco Zagmutt
Look at the functions tril() and triu() in the Matrix package Regards Francisco Davendra Sohal wrote: > Hi all, > Here's an interesting (for me, at least!) problem I came across: > I have a correlation matrix, let's say with 6 variables, A to F, as column > headings and the same 6 as row headin

Re: [R] Selective subsetting

2006-11-10 Thread Dimitrios Rizopoulos
try this: cor.mat <- cor(iris[1:4]) cor.mat[lower.tri(cor.mat)] I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/3

Re: [R] Selective subsetting

2006-11-10 Thread Benilton Carvalho
A=matrix(1:9,3) A[lower.tri(A)] b On Nov 10, 2006, at 4:50 PM, Davendra Sohal wrote: > Hi all, > Here's an interesting (for me, at least!) problem I came across: > I have a correlation matrix, let's say with 6 variables, A to F, as > column > headings and the same 6 as row headings. > The matr

[R] Position as professor of statistics availabe

2006-11-10 Thread Göran Broström
Dear R community, The Department of Statistics, Umeå University, Sweden, is searching for a Professor of Statistics (deadline December 7, 2006). We would appreciate applications from people on this list! More information is available at http://www.stat.umu.se/index_eng.shtml Welcome with your app

[R] Selective subsetting

2006-11-10 Thread Davendra Sohal
Hi all, Here's an interesting (for me, at least!) problem I came across: I have a correlation matrix, let's say with 6 variables, A to F, as column headings and the same 6 as row headings. The matrix is filled with correlation coefficients. Therefore, the diagonal is all 1's, and each of the two tr

[R] history in Mac

2006-11-10 Thread Weiwei Shi
Hi, my "history" in Mac for R does not work. I found the solution is GNU readline and re-installation from source. is there any other way to solve this? i really do not want to re-install: which means I need to install many packages, blabla... i used to use JGR (which solved that problem) but fou

Re: [R] lattice: histogram of factor variable

2006-11-10 Thread Deepayan Sarkar
On 11/10/06, Albrecht, Dr. Stefan (AZ Private Equity Partner) <[EMAIL PROTECTED]> wrote: > Dear all, > > I am encountering a problem with lattice in the current version 0.14-13 > with R version 2.4.0 on a Windows XP system. > For example, > > histogram(~voice.part, singer) > > is not labeling the x

Re: [R] Meta-regression with lmer() ? If so, how ?

2006-11-10 Thread Emmanuel Charpentier
Wolfgang Vietchbauer wrote : > The dependent variable to be used with the mima function can be any > measure for which we have a known sampling variance (or approximately > so) and that is (approximately) normally distributed. So, the > dependent variable could be log odds ratios, log risk ratios,

[R] Variable limit in nlm?

2006-11-10 Thread Robert Shnidman
Admittedly I am using an old version 1.7.1, but can anyone tell if this is or was a problem. I can only get nlm (nonlinear minimization) to adjust the first three components of function variable. No gradient or hessian is supplied. E.G.; fnoise function(y) { y[5]/(y[4]*sp2) * exp(-((x[,3]-y[1]-

Re: [R] Making a case for using R in Academia

2006-11-10 Thread David Farrar
I am just joining this thread. Regarding a tendency of journals to lock out the use of particular packages, there are rumours that SAS proc mixed has to be used for particular things. I wonder if whether R might displace SAS or proc mixed in such a role could depend on wether there the QA

Re: [R] Making a case for using R in Academia

2006-11-10 Thread Jeffrey Robert Spies
As a student, I'll throw my two cents into this discussion. To preface my opinion, I am in a Joint Ph.D. program in Quantitative Psychology and Computer Science; I have a significant programming background and use R (or custom-built software that relies on R in some way) for the majority o

Re: [R] Making a case for using R in Academia

2006-11-10 Thread Tamas K Papp
On Wed, Nov 08, 2006 at 09:24:38PM -0500, Charilaos Skiadas wrote: Hi Charilaos, > I would particularly like to hear from people who were not "hard-core > programmers" before taking up R, so perhaps had originally some > difficulties with it. How hard was it, and how quickly did it start >

Re: [R] Rpad

2006-11-10 Thread vittorio
Tom, I've just downloaded Rpad_1.1.1.tar.gz file from CRAN and I can assure you that those files are ** ALL** missing in it . Ciao Vittorio Alle 16:35, venerdì 10 novembre 2006, tshort ha scritto: > Vittorio, > > Those files being missing is what's causing the errors. Try recopying them > to y

Re: [R] Problem with as.data.frame when an extra attribute is present

2006-11-10 Thread Frank E Harrell Jr
Prof Brian Ripley wrote: > It's quite intentional, as it is the documented behaviour of data.frame: > > Objects passed to 'data.frame' should have the same number of > rows, but atomic vectors, factors and character vectors protected > by 'I' will be recycled a whole number of times

Re: [R] Simplifying Sweave graphics

2006-11-10 Thread Charles C. Berry
On Fri, 10 Nov 2006, ONKELINX, Thierry wrote: > Dear all, > > > > I was wondering if it's possible to simplify graphs created with Sweave. > I'm using in a document several plots with each about 4000 points > (qqnorm(rnorm(4000))). It looks likes the information of each points is > maintained in t

Re: [R] Problems with plot and X11 in ubuntu

2006-11-10 Thread Mon de Vera
That is, of course, an option. I didn't know his level of familiarity with those things so I answered his question simply. Regards, Mon On 11/10/06, Scionforbai <[EMAIL PROTECTED]> wrote: > > > Change those occurrences in the config file, reboot and that should fix > it. > > Why reboot? Rebuildin

Re: [R] Making a case for using R in Academia

2006-11-10 Thread Charles C. Berry
On Fri, 10 Nov 2006, Jim Lemon wrote: > Charilaos Skiadas wrote: >> Not having a background in SPSS would put these students at a >> disadvantage." >> >> Is this really the case? Does anyone have any such statistics? >> > Unfortunately not statistics, but my experience in nearly every > (psycholog

Re: [R] Problems with plot and X11 in ubuntu

2006-11-10 Thread Scionforbai
> Change those occurrences in the config file, reboot and that should fix it. Why reboot? Rebuilding the font-cache and restart X is *largely* enough! Marco __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] lattice: histogram of factor variable

2006-11-10 Thread Albrecht, Dr. Stefan (AZ Private Equity Partner)
Dear all, I am encountering a problem with lattice in the current version 0.14-13 with R version 2.4.0 on a Windows XP system. For example, histogram(~voice.part, singer) is not labeling the x labels according to the factor levels of voice.part, which it should do (and has done in former vers

Re: [R] Question about error message - or is it a bug?

2006-11-10 Thread Sundar Dorai-Raj
Carmen Meier said the following on 11/10/2006 9:46 AM: > Hi to all ... the same code, but another question. > > I changed only the type='n' to type='l' and debugged the function xy.coords. > with type = 'l' : > there are the correct values of x and y inside the function xy.coords > but the y valu

Re: [R] Problems with plot and X11 in ubuntu

2006-11-10 Thread Mon de Vera
Davide, It looks to be an issue in the /etc/X11/xorg.conf file of Edgy. The paths to the X11 fonts are wrong, you've got to change them to the right one. I'm not in my Ubuntu box, but I think the part of the Font paths should have been /usr/share/fonts/X11 and it was /usr/share/X11/fonts in the co

Re: [R] axis command and excel time format

2006-11-10 Thread Robert Baer
You should look at ?plot.default ?times You need to supply an x vector (time) along with a y value vector of the same length. Your error message tells you that you vectors were not of equal length. You are repeatedly supplying different length vectors. times() takes a text vector and translate

Re: [R] Rpad

2006-11-10 Thread tshort
Vittorio, Those files being missing is what's causing the errors. Try recopying them to your server home location. Those files should be under Rpad/basehtml/gui/* in your R library installation. If not, try reinstalling or extract the necessary files right out of the Rpad_1.1.1.tar.gz file. - T

Re: [R] Problems with plot and X11 in ubuntu

2006-11-10 Thread oscar.moreno
A few questions before I may help. Is this a NEW installation or an upgrade? If an upgrade, what version are you upgrading from? Regards, Oscar >From: Bagatti Davide <[EMAIL PROTECTED]> >Date: 2006/11/10 Fri AM 09:22:24 CST >To: r-help@stat.math.ethz.ch >Subject: [R] Problems with plot and X1

[R] Can plot(augPred()) be used with objects that are not groupedData?

2006-11-10 Thread Michael Kubovy
Dear Friends, Is there a workaround to this problem or must the object plotted by plot(augPred(object, ...)) be a grouped object? score <- c(108, 103, 96, 84, 118, 110, 129, 90, 84, 96, 105, 113, 96, 117, 107, 85, 125, 107, 128, 84, 104, 100, 114, 117, 110, 127, 106, 92, 125, 96, 123,

Re: [R] Which genetic optimization package allows customized crossover and mutation operation

2006-11-10 Thread Dirk Eddelbuettel
On 10 November 2006 at 16:19, sun wrote: | No, I am not familiar with that project, actually never heard it before your | reply.:) | | Anyway, I found some code later on from "Claudio Agostinelli" who developed | this code for his teaching, I think. Unfortornuitly, his code does not work | on

Re: [R] Confidence interval for relative risk

2006-11-10 Thread Viechtbauer Wolfgang (STAT)
Hello, A common way to calculate the CI for a relative risk is the following. Given a 2x2 table of the form: a b c d the log of the risk ratio is given by: lrr = log[ a/(a+b) / ( c/(c+d) ) ] which is asymptotically normal with variance: vlrr = 1/a - 1/(a+b) + 1/c - 1/(c+d). So an approximat

[R] Speed Optimization: Faster Way of Accessing data.frame in a Loop?

2006-11-10 Thread Sven C. Koehler
Hello, currently I am using code, which basically works like this: | | for (i in 1:20) { | for (j in 1:30) { | df[i, j, 20] <- df[i,j,27] + df[i,j,30] | } | } df is: `data.frame: 360 obs. of 30 variables' Do you have any ideas whether I could get this code any faster? Regards, Sven

[R] Question about error message - or is it a bug?

2006-11-10 Thread Carmen Meier
Hi to all ... the same code, but another question. I changed only the type='n' to type='l' and debugged the function xy.coords. with type = 'l' : there are the correct values of x and y inside the function xy.coords but the y value is filled with NA seems that the length is matching now because o

[R] Announcement: sciplot (includes functions for graphs w/ error bars)

2006-11-10 Thread Manuel Morales
The package "sciplot" is now available for download from CRAN. This package includes a collection of functions that create graphs with error bars for data collected from one-way or higher factorial designs, as well as a function to plot bifurcation diagrams resulting from analysis with XPPAUTO. The

[R] Problems with plot and X11 in ubuntu

2006-11-10 Thread Bagatti Davide
Hello, I am an italian student, who is trying to use R 2.3.1 with Ubuntu 6.10 (last version). When I try to use the plot command, I get the error: "could not find any X11 fonts Check that the Font Path is correct" How can I solve this problem? Thank you very much Davide [[alternative

Re: [R] Which genetic optimization package allows customized crossover and mutation operation

2006-11-10 Thread sun
No, I am not familiar with that project, actually never heard it before your reply.:) Anyway, I found some code later on from "Claudio Agostinelli" who developed this code for his teaching, I think. Unfortornuitly, his code does not work on my settings. And I do not want to send much time on th

[R] Confidence interval for relative risk

2006-11-10 Thread Michael Dewey
The concrete problem is that I am refereeing a paper where a confidence interval is presented for the risk ratio and I do not find it credible. I show below my attempts to do this in R. The example is slightly changed from the authors'. I can obtain a confidence interval for the odds ratio from fi

[R] Rpad

2006-11-10 Thread Vittorio
I've just compiled and installed Rpad from the sources under *nix (freeBSD 6.1) and R 2.4.0, and followed the suggested procedure to setup an Rpad server step by step. Now when I try to execute whatever .Rpad example file the IE browser hangs endlessly with a "loading page" pop-up and the fol

[R] help with nlme function

2006-11-10 Thread Bill Shipley
Hello. I am trying to fit a nonlinear mixed model involving 3 parameters. I have successfully made a self-starting function. getInitial() correctly outputs the initial estimates. I can also use the nlsList with this function to get the separate nonlinear fits by group. However, I get an error m

Re: [R] Problem with as.data.frame when an extra attribute is present

2006-11-10 Thread Prof Brian Ripley
It's quite intentional, as it is the documented behaviour of data.frame: Objects passed to 'data.frame' should have the same number of rows, but atomic vectors, factors and character vectors protected by 'I' will be recycled a whole number of times if necessary. > data.frame(a =

Re: [R] Making a case for using R in Academia

2006-11-10 Thread Marwan Khawaja
More impressions -- > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Charilaos Skiadas > Sent: Thursday, November 09, 2006 11:45 PM > To: r-help@stat.math.ethz.ch > Subject: Re: [R] Making a case for using R in Academia > > John (and everyone els

Re: [R] Combining factors

2006-11-10 Thread Peter Dalgaard
Rainer M Krug <[EMAIL PROTECTED]> writes: > Hi > > I know this is a basic question and I know I have done it before but I > can't find the answer any more. > > I have a data set, say: > > F1, F2, Value > > F1 and F2 are Factors. > > I would like to plot > > plot(TheCombinationOf(F1, F2), Va

Re: [R] Combining factors

2006-11-10 Thread Rainer M Krug
Peter Dalgaard wrote: > Rainer M Krug <[EMAIL PROTECTED]> writes: > >> Hi >> >> I know this is a basic question and I know I have done it before but I >> can't find the answer any more. >> >> I have a data set, say: >> >> F1, F2, Value >> >> F1 and F2 are Factors. >> >> I would like to plot >> >>

Re: [R] Simplifying Sweave graphics

2006-11-10 Thread Stéphane Dray
Hi. One guy of my team (Thibaut Jombart) wrote a driver to sweave in png (see http://tolstoy.newcastle.edu.au/R/devel/06/03/4599.html). The driver works very nice and is very useful for plots with many points, raster images... I thought that Friedrich Leisch would include it in the Sweave distr

[R] missing symbols for mathplot

2006-11-10 Thread stortignauz
Hi all, I'm trying to write an axis label that sounds P( X | K and Xb ) (probability of X given K and Xb ) but I need the intersection symbol (the "\cap" in latex) Actually I did'nt find any "cap" symbol in plotmath, the only one is intersect(A[i],i==1,n) but is not my case because subscript

[R] Combining factors

2006-11-10 Thread Rainer M Krug
Hi I know this is a basic question and I know I have done it before but I can't find the answer any more. I have a data set, say: F1, F2, Value F1 and F2 are Factors. I would like to plot plot(TheCombinationOf(F1, F2), Value) I remember there was a function for TheCombinationOf() but I don'

Re: [R] Making a case for using R in Academia

2006-11-10 Thread Jonathan Baron
Our first-year graduate statistics course (in psychology) is taught by Prof. Paul Rosenbaum, in the statistics department. Last year (according to my students), he discouraged students from using R for their homework. He told them it was too hard. Now he is again teaching the course, recommending

[R] Simplifying Sweave graphics

2006-11-10 Thread ONKELINX, Thierry
Dear all, I was wondering if it's possible to simplify graphs created with Sweave. I'm using in a document several plots with each about 4000 points (qqnorm(rnorm(4000))). It looks likes the information of each points is maintained in the graph. As a result of that the pdf filesize get's quite

Re: [R] axis command and excel time format

2006-11-10 Thread Carmen Meier
> > > Carmen, > > Gabor has already given you the detail you ask for, but might try the > following plot to see what is going wrong: > > plot(times(tt), x, type='l') > > This does not give you the EXACT control of the axis you asked for, > but this simple plot command gives you a fairly nice resu

Re: [R] Making a case for using R in Academia

2006-11-10 Thread Jim Lemon
Charilaos Skiadas wrote: > As a addendum to all this, this is one of the responses I got from > one of my colleagues: > > "The problem with R is that our students in many social science > fields, are expected to know SPSS when they go to graduate school. > Not having a background in SPSS wo

Re: [R] Command Line Prompt Symbol

2006-11-10 Thread Duncan Murdoch
On 11/10/2006 1:46 AM, [EMAIL PROTECTED] wrote: > The simplest way to do this is to put > > options(prompt = "R> ") > > in your .Rprofile file. If you don't have an .Rprofile file, > then persuading Windows to let you call a file by that name can > be frustrating. The easiest way is probabl

Re: [R] Meta-regression with lmer() ? If so, how ?

2006-11-10 Thread Viechtbauer Wolfgang (STAT)
I guess I'll chip in, since I wrote that function (which is going to be updated thoroughly in the near future -- I will probably expand it to an entire package). > > Have a look at "MiMa" at Wolfgang Viechtbauer's page. Is that what > > you are looking for? > > > >

Re: [R] About using the boot function

2006-11-10 Thread Andrew Robinson
Joaquim, you have to write your own function that takes the data and the index, which is passed to it by boot(). try this ... x2 <- c(2, 3, 4, 5, 6, 5, 4, 5, 6, 5, 4, 5, 6, 5, 7, 2, 3, 4, 3, 4, 3, 5, 6, 7, 5) mean.boot <- function(x, i) mean(x[i]) b1 <-boot(x2, mean.boot, 999) b1

[R] About using the boot function

2006-11-10 Thread Joaquim Marques de Sá
Dear All, I tried to use the boot function, provided in the boot package, in such a simple task as to create a bootstrap distribution of the mean of a vector x. I wrote: b <- boot(x, mean, R=200) Well, it doesn't work. I suspect it has something to do with what is called "second argument" of the

[R] Value at Risk historical simulation

2006-11-10 Thread Benjamin Dickgiesser
Hi Has someone got a package/script at hand to do a historical simulation to calculate the Value at Risk? If your not sure what Historical Simulation is: In simple terms, Historical Simulation (HS) is just taking sample percentiles over a moving sample. Suppose we want to use HS to predict a port

Re: [R] PCA reconstruction funtion

2006-11-10 Thread Andris Jankevics
Also new values can be easy calculated from prcomp object: Data <- scale(iris[,1:4],center=TRUE,scale=TRUE) iris.pc <- prcomp(Data) # Explained variation (iris.pc$sdev^2/sum(iris.pc$sdev^2))*100 # Loadings iric.pc$rotation #Scores iris.pc$x #Fitted Values for each PC # Xfit = T*P^t PCfit <-

Re: [R] dissimilarity matrices

2006-11-10 Thread Gavin Simpson
On Thu, 2006-11-09 at 17:50 +, Kris Lockyear wrote: > Dear All, > > I have a dissimilarity matrix which I happily convert to a distance object > by running: > > X <- as.dist(Y) > > and I can happily now run either hclust(X) or agnes(X). > > So that the various bits of output are labelled c