Re: [R] Leave one out Cross validation (LOO)

2009-02-24 Thread Alex Roy
Dear Frank, Thanks for your comments. But in my situation, I do not have any future data and I want to calculate Mean Square Error for prediction on future data. So, is it not it a good idea to go for LOO? thanks Alex On Tue, Feb 24, 2009 at 7:15 PM, Frank E Harrell Jr < f.har

Re: [R] run latent class analysis with R

2009-02-24 Thread Tobias Verbeke
Hi, The flexmix package should provide what you need: http://cran.r-project.org/web/packages/flexmix/index.html The package has an extensive vignette. HTH, Tobias Wen Gu wrote: What's the best approach to running latent class analysis with R? I've downloaded both randomLCA and poLCA packag

[R] [R-pkgs] kml 0.9.2

2009-02-24 Thread cgenolin
KmL, version 0.9.2 KmL is a new implematation of k-means for longitudinal data (or trajectories). This algorithm is able to deal with missing value and provides an easy way to re roll the algorithm several times, varying the starting conditions and/or the number of clusters looked for. It als

Re: [R] All the products of common factors

2009-02-24 Thread Stavros Macrakis
Argh! The second (concise) version should have |, not & !!! -s On 2/24/09, Stavros Macrakis wrote: > "L'esprit de l'escalier" strikes again > > An even simpler statement of your original problem: > > Find the factors that A and B have in common. > > If A and B are fairly sma

[R] how to label the branches of a tree

2009-02-24 Thread Utkarsh Singhal
Hi, I am using rpart package to fit classification trees. library(rpart) fit <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis) plot(fit,uniform=T) text(fit, use.n=TRUE) But I am unable to label the branches (not the nodes) of the tree. Can somebody help me out in this? T

Re: [R] Help with Latex (Hmisc)

2009-02-24 Thread Dieter Menne
Frank E Harrell Jr vanderbilt.edu> writes: ... Word and pdf > It depends on how you copy. By all means use Insert ... Picture ... > from file and directly insert pdf. Please, tell me how you got this to work. Dieter __ R-help@r-project.org maili

[R] run latent class analysis with R

2009-02-24 Thread Wen Gu
What's the best approach to running latent class analysis with R? I've downloaded both randomLCA and poLCA packages, but I am interesting in running a standard LCA with individual records (not frequency table) as input data. Wen Gu John Jay College of Criminal Justice445 West 59 StreetNew York

Re: [R] how to NULL multiple variables of a df efficiently?

2009-02-24 Thread Tony Breyal
Another way is: > subset(df, select=c(var.b, var.c)) though I'd be willing to bet that using %in% is probably faster.[1] Tony [1] Unfortuantly I'm skint :-( On 24 Feb, 20:10, Sean Zhang wrote: > Dear R-helpers: > > I am an R novice and would appreciate answer to the following question. > > Wa

[R] R parser for If-else

2009-02-24 Thread Dani
Hi list, I don't know if somebody has spent a lot of time debugging strange problems with if else positioning - the parser seems to recognize only the syntax bellow - this is the only way of making these pieces of code to work. As far as i'm concerned, no examples were available (it would be so a

Re: [R] regexp capturing group in R

2009-02-24 Thread Christos Hatzis
I don't know if there is a direct, perl-like way to capture the matches, but here is a solution: > mdat <- gregexpr("[[:digit:]]{8}", txt) > dates <- mapply(function(x, y) substr(txt, x, x + y - 1), mdat[[1]], attr(mdat[[1]], "match.length")) > dat

Re: [R] learning R

2009-02-24 Thread markleeds
Hi Ira: For your first question, under the hood of R, names<- is actually a function so , when you do that, you need to say names(a)[2] rather than names(a[2]). why this is is tricky and I wouldn't do it justice if i tried to explain it. it's best if you do ?"names<-" at an R prompt and read t

Re: [R] learning R

2009-02-24 Thread David Winsemius
On Feb 25, 2009, at 12:12 AM, David Winsemius wrote: On Feb 24, 2009, at 11:36 PM, Fuchs Ira wrote: also unrelated: if I have two vectors and I want to combine them to form a matrix ,is cbind (or rbind) the most direct way to do this? e.g. x=c(1,2,3) y=c(3,4,5) z=rbind(x,y) Tha

Re: [R] learning R

2009-02-24 Thread David Winsemius
On Feb 24, 2009, at 11:36 PM, Fuchs Ira wrote: I was wondering why the following doesn't work: > a=c(1,2) > names(a)=c("one","two") > a one two 1 2 > > names(a[2]) [1] "two" > > names(a[2])="too" > names(a) [1] "one" "two" > a one two 1 2 I must not be understanding some basic concept h

Re: [R] regexp capturing group in R

2009-02-24 Thread Gabor Grothendieck
Try this: library(gsubfn) strapply("blah blah start=20080101 end=20090224", "start=(\\d{8}) end=(\\d{8})", c, perl = TRUE)[[1]] or perhaps just: strapply("blah blah start=20080101 end=20090224", "\\d{8}", perl = TRUE)[[1]] On Tue, Feb 24, 2009

Re: [R] All the products of common factors

2009-02-24 Thread Stavros Macrakis
"L'esprit de l'escalier" strikes again An even simpler statement of your original problem: Find the factors that A and B have in common. If A and B are fairly small (< 1e7, say), a very direct approach is: which( ! (A %% 1:min(A,B)) & !(B %% 1:min(A,B)) ) Is this "brute forc

[R] learning R

2009-02-24 Thread Fuchs Ira
I was wondering why the following doesn't work: > a=c(1,2) > names(a)=c("one","two") > a one two 1 2 > > names(a[2]) [1] "two" > > names(a[2])="too" > names(a) [1] "one" "two" > a one two 1 2 I must not be understanding some basic concept here. Why doesn't the 2nd name change to "too"?

Re: [R] Simulating contingency table (Basic question, help please)

2009-02-24 Thread Turner Rolf
From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of bbbnc [benwo...@gmail.com] Sent: Wednesday, February 25, 2009 6:01 AM To: r-help@r-project.org Subject: [R] Simulating contingency table (Basic question, help please) I'd like

Re: [R] regexp capturing group in R

2009-02-24 Thread jim holtman
> txt <- "blah blah start=20080101 end=20090224" > nums <- sub(".*start=(\\d+).*end=(\\d+).*", "\\1 \\2", txt, perl=TRUE) > nums <- strsplit(sub(".*start=(\\d+).*end=(\\d+).*", "\\1 \\2", txt, > perl=TRUE), ' ')

[R] Wavelet Bootstrap Size Simulation

2009-02-24 Thread PudgeDavid
I have written a short script to estimate the size of a test of non-constant mean in an AR(1) time series. When I run the simulation on my PC (R version 2.7.1), I get the expected result: an empirical size much larger than the nominal size. On the Red Hat machine (R version 2.7.2) in my departmen

[R] regexp capturing group in R

2009-02-24 Thread pierre
Hello, Newbie question: how do you capture groups in a regexp in R? Let's say I have txt="blah blah start=20080101 end=20090224". I'd like to get the two dates start and end. In Perl, one would say: my ($start,$end) = ($txt =~ /start=(\d{8}).*end=(\d{8})/); I've

Re: [R] polr (MASS): score test for proportional odds model

2009-02-24 Thread Frank E Harrell Jr
Michael Friendly wrote: For the following model, library(vcd) arth.polr <- polr(Improved ~ Sex + Treatment + Age, data=Arthritis) summary(arth.polr) where Improved is an ordered, 3-level response I'm looking for a *simple* way to test the validity of the proportional odds assumption, typically

[R] polr (MASS): score test for proportional odds model

2009-02-24 Thread Michael Friendly
For the following model, library(vcd) arth.polr <- polr(Improved ~ Sex + Treatment + Age, data=Arthritis) summary(arth.polr) where Improved is an ordered, 3-level response I'm looking for a *simple* way to test the validity of the proportional odds assumption, typically done via a score test

Re: [R] All the products of common factors

2009-02-24 Thread Stavros Macrakis
On Mon, Feb 23, 2009 at 9:52 PM, Fox, Gordon wrote: > This is a seemingly simple problem - hopefully someone can help. > Problem: we have two integers. We want (1) all the common factors, and > (2) all the possible products of these factors. We know how to get (1), > but can't figure out a general

[R] leaps package help

2009-02-24 Thread Evelina Naryvska
Colleagues, sorry for the simple question, but I'm novice in using R. How can I print all needed statistics for models results while using leaps package? I want to see R squared and significance of each model and also B & significance for coefficients. Also I can't understand what data I can see wi

Re: [R] Help with Latex (Hmisc)

2009-02-24 Thread Frank E Harrell Jr
jimdare wrote: Dear R Users, I have three questions. 1) Is there a way to get the output tex file to include \documentclass{report} \begin{document} and \end{document} so I can generate a PDF straight away. (I am trying to generate hundreds of these and don't want to have to manually

Re: [R] biplot.princomp - changing score labels

2009-02-24 Thread Axel Strauß
OK, the one thing I figured out: Is should be like: biplot(test.pca, cex=c(2,1), col=c("red","green")... to change size, colours etc separately. But I still don't know how change lables of observations to symbols properly. Tipps? Thanks again, Axel Dear R helpers, When producing a PCA biplot,

Re: [R] how to NULL multiple variables of a df efficiently?

2009-02-24 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: > On Tue, Feb 24, 2009 at 3:10 PM, Sean Zhang wrote: > >> ...Want to delete many variables in a dataframe >> df<-data.frame(var.a=rnorm(10), var.b=rnorm(10),var.c=rnorm(10)) >> df[,'var.a']<-NULL #this works for one single variable >> df[,c('var.a','var.b')]<-NULL

Re: [R] bigest part of vector

2009-02-24 Thread Bert Gunter
Well, yes to all -- that's why I pointed this out. Sorting is (depending on details) >= O(n log(n)) while the quantile algorithm uses R's partial sort option, which I think would be O(n) for a single quantile. For n of a few thousand or so, the difference shouldn't be noticeable. For large n, of co

Re: [R] bigest part of vector

2009-02-24 Thread Stavros Macrakis
On Tue, Feb 24, 2009 at 3:01 PM, Bert Gunter wrote: > Nothing wrong with prior suggestions, but strictly speaking, (fully) sorting > the vector is unnecessary. > > y[y > quantile(y, 1- p/length(y))] > > will do it without the (complete) sort. (But sorting is so efficient anyway, > I don't think yo

Re: [R] how to NULL multiple variables of a df efficiently?

2009-02-24 Thread Christos Hatzis
You're right. The help page is somewhat misleading at first read. ?`[<-.data.frame` states that (with added emphasis) value A suitable replacement value: it will be repeated a whole number of times if necessary and it may be coerced: see the Coercion section. *** If NULL, deletes the column if

[R] biplot.princomp - changing score labels

2009-02-24 Thread Axel Strauß
Dear R helpers, When producing a PCA biplot, vectors of environmental variables (as red arrows with labels) and scores of the observations (black labels (observation names)) are plotted by default. How can I change the graphical output? Let's say I would like that the scores are plottet only

Re: [R] how to NULL multiple variables of a df efficiently?

2009-02-24 Thread Stavros Macrakis
On Tue, Feb 24, 2009 at 3:10 PM, Sean Zhang wrote: > ...Want to delete many variables in a dataframe > df<-data.frame(var.a=rnorm(10), var.b=rnorm(10),var.c=rnorm(10)) > df[,'var.a']<-NULL #this works for one single variable > df[,c('var.a','var.b')]<-NULL #does not work for multiple variab

[R] Help with Latex (Hmisc)

2009-02-24 Thread jimdare
Dear R Users, I have three questions. 1) Is there a way to get the output tex file to include \documentclass{report} \begin{document} and \end{document} so I can generate a PDF straight away. (I am trying to generate hundreds of these and don't want to have to manually type this in ever

Re: [R] Installing archived package alongisde current one

2009-02-24 Thread Uwe Ligges
Manuel Morales wrote: Hi list, I'd like to install an archived version of lmer to compare results with the current version. I guess one way to do this would be to download the source, rename the package and then install it. Is there a better alternative? Yes: Install into a different librar

[R] Installing archived package alongisde current one

2009-02-24 Thread Manuel Morales
Hi list, I'd like to install an archived version of lmer to compare results with the current version. I guess one way to do this would be to download the source, rename the package and then install it. Is there a better alternative? -- http://mutualism.williams.edu signature.asc Description: T

Re: [R] how to NULL multiple variables of a df efficiently?

2009-02-24 Thread Christos Hatzis
Setting to NULL works only if a single column is selected. More generally, df[, !(colnames(df) %in% c("var.b", "var.c")), drop=FALSE] -Christos > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Sean Zhang > Sent: Tuesday, Fe

Re: [R] how to NULL multiple variables of a df efficiently?

2009-02-24 Thread markleeds
One way is to use %in% like below: df<-data.frame(var.a=rnorm(10), var.b=rnorm(10),var.c=rnorm(10)) print(df) df <- df[,!(names(df) %in% c('var.a','var.b')),drop=FALSE] print(df) On Tue, Feb 24, 2009 at 3:10 PM, Sean Zhang wrote: Dear R-helpers: I am an R novice and would appreciate answer

[R] how to NULL multiple variables of a df efficiently?

2009-02-24 Thread Sean Zhang
Dear R-helpers: I am an R novice and would appreciate answer to the following question. Want to delete many variables in a dataframe. Am able to delete one variable by assigning it as NULL Have a large number of variables and would like to delete them without using a for loop. Is there a command

Re: [R] bigest part of vector

2009-02-24 Thread Bert Gunter
Nothing wrong with prior suggestions, but strictly speaking, (fully) sorting the vector is unnecessary. y[y > quantile(y, 1- p/length(y))] will do it without the (complete) sort. (But sorting is so efficient anyway, I don't think you could notice any difference). -- Bert Gunter Genentech -

Re: [R] Simulating contingency table (Basic question, help please)

2009-02-24 Thread Achim Zeileis
On Tue, 24 Feb 2009, bbbnc wrote: I'd like to carry out a Monte Carlo simulation test where given data is a contingency table. I think this is something to do with using rmultinonom(), but I'm not sure how to code this, to simulate contingency tables. Could anyone please help with how to use R t

Re: [R] bigest part of vector

2009-02-24 Thread Peterko
Thanks for all Peterko wrote: > > Hi, may be simle question, but a do not find it anywhere. > Is there same function like max() ,but giving more results. > max() give 1number-maximum > I need funcion what give p bigest number. > many thanks > -- View this message in context: http://www.nabb

Re: [R] bigest part of vector

2009-02-24 Thread markleeds
There's probably something built in to R but you can change the values of the percentiles (p) below to get the value that corresponds to it. rounding might be problematic also. temp <- c(1,4,8,3,5) p <- 0.8 temp[order(temp)][round(length(temp)*p)] On Tue, Feb 24, 2009 at 2:36 PM, Peterko

Re: [R] bigest part of vector

2009-02-24 Thread Jorge Ivan Velez
Dear Peter, Perhaps: set.seed(1) # For reproducibility p<-2 # Two biggest values of x x<-rnorm(10) tail(sort(x),p) [1] 0.7383247 1.5952808 In a function mode, foo<-function(x,p=2) tail(sort(x),p) foo(x,p=3) [1] 0.5757814 0.7383247 1.5952808 HTH, Jorge On Tue, Feb 24, 2009 at 2:36

Re: [R] bigest part of vector

2009-02-24 Thread seelenhirt
On Tue, 24 Feb 2009 11:36:06 -0800 (PST) (SO, 55 Chs 3175 YOLD) Peterko wrote: > > Hi, may be simle question, but a do not find it anywhere. > Is there same function like max() ,but giving more results. > max() give 1number-maximum > I need funcion what give p bigest number. > many thanks How

Re: [R] Insurance data in library(MASS)

2009-02-24 Thread Richardson, Patrick
Try ?relevel -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of choonhong ang Sent: Tuesday, February 24, 2009 2:33 PM To: r-help@r-project.org Subject: Re: [R] Insurance data in library(MASS) Hi, In the result shown, the District

[R] bigest part of vector

2009-02-24 Thread Peterko
Hi, may be simle question, but a do not find it anywhere. Is there same function like max() ,but giving more results. max() give 1number-maximum I need funcion what give p bigest number. many thanks -- View this message in context: http://www.nabble.com/bigest-part-of-vector-tp22188901p22188901

Re: [R] Insurance data in library(MASS)

2009-02-24 Thread choonhong ang
Hi, In the result shown, the District 1 is used as the base category. How to change to make District 4 as a base category ? On Mon, Feb 23, 2009 at 11:05 AM, choonhong ang wrote: > I have used the insurance data from R library and I have 2 questions: > I use the following: > >library(MASS) > >d

Re: [R] matrix computation???

2009-02-24 Thread Kutlwano Ramaboa
Thank you Greg! Yes this is the comparison I was looking for. >>> Greg Snow 2009/02/24 06:07 PM >>> The same as what? It is not clear what you are trying to compare. Is this the comparison that you are looking for?: > A <- scale(stackloss) > > fit1 <- lm( stack.loss ~ . - 1, data=as.data.fram

Re: [R] 3D or 4D plot

2009-02-24 Thread Duncan Murdoch
One more followup on this: I just added a function shapelist3d() to rgl (so far only on R-forge, not CRAN) that automates a lot of this. To get the plot as below, the following code works: x <- rep(1:5, each=25) y <- rep(rep(1:5, each=5), 5) z <- rep(1:5, 25) shapelist3d(cube3d(), x,y,z, size

Re: [R] growing dataframes with rbind

2009-02-24 Thread Jorge Ivan Velez
Dear all, Here is one more way to go though using rep() and then matrix(): > rows <- 1:3 > matrix(rep(rows,5),ncol=5) [,1] [,2] [,3] [,4] [,5] [1,]11111 [2,]22222 [3,]33333 HTH, Jorge On Tue, Feb 24, 2009 at 1:43 PM, Gabor Grothe

Re: [R] growing dataframes with rbind

2009-02-24 Thread Gabor Grothendieck
Suppose we want 3 rows and the ith row should have 5 columns of i. Create a list whose ith component is the ith row and rbind them: > rows <- 1:3 > do.call(rbind, lapply(rows, rep, 5)) [,1] [,2] [,3] [,4] [,5] [1,]11111 [2,]22222 [3,]333

Re: [R] Inference for R Spam

2009-02-24 Thread Dieter Menne
> > > And, since my son asked me and I am basketball ignorant: Why are > > basketball scores mostly much too close to equality? The arguments > > (loose power when leading) manchester.ac.uk> writes: > Or: Once you are in the lead, become much more defensive against > attacking play by the

Re: [R] Inference for R Spam

2009-02-24 Thread Ted Harding
On 24-Feb-09 17:25:53, Dieter Menne wrote: > Tony Breyal googlemail.com> writes: > >>Cheers for that information; I've just registered for the useR meeting >>in London and then about 10 minutes later got that same bit of spam >>too which made me a wee bit suspicious. > > Welcome in the Fooled by

Re: [R] Leave one out Cross validation (LOO)

2009-02-24 Thread milton ruser
Hi Alex, Give a look at: http://search.r-project.org/cgi-bin/namazu.cgi?query=leave+one+out&max=20&result=normal&sort=score&idxname=Rhelp02a&idxname=functions&idxname=docs Cheers miltinho astronauta brazil On Tue, Feb 24, 2009 at 3:07 PM, Alex Roy wrote: > Dear R user, >

Re: [R] Follow-up to Reply: Overdispersion with binomial distribution

2009-02-24 Thread Michael Dewey
At 15:24 23/02/2009, Jessica L Hite/hitejl/O/VCU wrote: THANKS so very much for your help (previous and future!). I have a two follow-up questions. 1) You say that dispersion = 1 by definition dispersion changes from 1 to 13.5 when I go from binomial to quasibinomialdoes this suggest th

Re: [R] Transpose array

2009-02-24 Thread Peter Dalgaard
MarcioRibeiro wrote: Hi Listers, Is there a way that I can transpose an array... Suppose I have the following array... x<-array(c(1,2,3,4),dim=c(1,2,2)) , , 1 [,1] [,2] [1,]12 , , 2 [,1] [,2] [1,]34 And I would like to get the following result... , , 1 [,1] [1,]

Re: [R] Leave one out Cross validation (LOO)

2009-02-24 Thread Frank E Harrell Jr
Alex Roy wrote: Dear R user, I am working with LOO. Can any one who is working with leave one out cross validation (LOO) could send me the code? Thanks in advance Alex I don't think that LOO adequately penalizes for model uncertainty. I recommend the bootstrap or 50

Re: [R] growing dataframes with rbind

2009-02-24 Thread Greg Snow
If you know the final size that your matrix will be, it is better to preallocate the matrix, then insert the rows into the matrix: mymat <- matrix( nrow=100, ncol=10 ) for( i in 1:100 ){ mymat[i, ] <- rnorm(10) } Even better than this is to use replicate or sapply if you can, they will t

[R] Leave one out Cross validation (LOO)

2009-02-24 Thread Alex Roy
Dear R user, I am working with LOO. Can any one who is working with leave one out cross validation (LOO) could send me the code? Thanks in advance Alex [[alternative HTML version deleted]] __ R-help@r-project.org mailing

Re: [R] Transpose array

2009-02-24 Thread Greg Snow
Try aperm(x, c(2,1,3)) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of MarcioRibeiro > Sent: Tuesday, Februar

Re: [R] Tracing gradient during optimization

2009-02-24 Thread Greg Snow
Here is a simple example (finding the parameters of a normal) that shows one way to do it: x <- rnorm(25, 100, 5) tmpfun <- function(x) { steps <- matrix( 0:1, nrow=1 ) myfn <- function(param) { print(param)

[R] growing dataframes with rbind

2009-02-24 Thread Alexy Khrabrov
I'm growing a large dataframe by composing new rows and then doing row <- compute.new.row.somehow(...) d <- rbind(d,row) Is this a fast/preferred way? Cheers, Alexy __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEA

[R] samr-package: problem with large sample size multiclass data

2009-02-24 Thread Rainer Tischler
Dear all, I'm using the samr-package to identify significantly differentially expressed genes in microarray data. So far, I had no problems, but when I used a large multiclass data set with 327 samples, I obtained the following error/warning message: Warning message: Inf In factorial(length(y))

[R] Simulating contingency table (Basic question, help please)

2009-02-24 Thread bbbnc
I'd like to carry out a Monte Carlo simulation test where given data is a contingency table. I think this is something to do with using rmultinonom(), but I'm not sure how to code this, to simulate contingency tables. Could anyone please help with how to use R to simulate contingency tables like t

[R] Transpose array

2009-02-24 Thread MarcioRibeiro
Hi Listers, Is there a way that I can transpose an array... Suppose I have the following array... x<-array(c(1,2,3,4),dim=c(1,2,2)) , , 1 [,1] [,2] [1,]12 , , 2 [,1] [,2] [1,]34 And I would like to get the following result... , , 1 [,1] [1,]1 [,2]2 , , 2

Re: [R] statistical significance of accuracy increase in classification

2009-02-24 Thread Monica Pisica
Hi again, Looking more into test statistics i realized that maybe i can use the power.prop.test to see if the difference between the 2 accuracies are zero or not. Do you have any comments about that? Also, should i considered kappa statistics also a kind of proportion and use the same test? I

Re: [R] Inference for R Spam

2009-02-24 Thread Dieter Menne
Tony Breyal googlemail.com> writes: >Cheers for that information; I've just registered for the useR meeting >in London and then about 10 minutes later got that same bit of spam >too which made me a wee bit suspicious. Welcome in the Fooled by Randomness society. 2:0 is a bit away from significa

Re: [R] Tracing gradient during optimization

2009-02-24 Thread Shimrit Abraham
Rob Steele suggested the same thing but I'm not sure I understand how to implement this exactly. Is there any documentation that you could suggest? This might be something that could be useful for the future. Thanks, Shimrit On Tue, Feb 24, 2009 at 5:09 PM, Greg Snow wrote: > It looks like you

Re: [R] Inference for R Spam

2009-02-24 Thread Albyn Jones
I also received the spam, and have not registered for the conference. I decided to do the noble experiment, and used their web interface to unsubscribe to the newsletter to which they claim I had subscribed, and for good measure added my name to their "do not contact" list. albyn On Tue, Feb 24,

Re: [R] multiple regressions on columns

2009-02-24 Thread Greg Snow
The add1 function might be what you want, there is also addterm in the MASS package and the leaps package can do some things along this line (plus more). But before doing this, you may want to ask yourself what question you are really trying to answer, then explore if this answers that question

Re: [R] All the products of common factors

2009-02-24 Thread Jorge Ivan Velez
Dear Gordon, Try also, > unique(apply(expand.grid(commfac,commfac),1,prod)) [1] 1 2 5 4 10 25 HTH, Jorge On Mon, Feb 23, 2009 at 9:52 PM, Fox, Gordon wrote: > This is a seemingly simple problem - hopefully someone can help. > Problem: we have two integers. We want (1) all the common fact

[R] useR Group Meeting - London

2009-02-24 Thread Sharon Lazenby
All Mango Solutions are pleased to announce the first meeting of the London useR Group. DateTuesday 31st March Time4pm to 7pm Venue The Wall 45 Old Broad St London EC2N 1HU Tel 020 7588 4845 S

Re: [R] Odfweave

2009-02-24 Thread Dieter Menne
Irina Ursachi itwm.fraunhofer.de> writes: > > Dear all, > > When using odfWeave, I get the following error: > > odfWeave(file.in,file.out) > Copying Example2.odt > Setting wd to /tmp/Rtmp8ekeDC/odfWeave24145003519 > Unzipping ODF file using unzip -o Example2.odt > Archive: Example2.od

[R] multiple regressions on columns

2009-02-24 Thread GOUACHE David
R-helpers, A quick question regarding my wanting to run multiple regressions without writing a loop. Looking at a previous discussion : http://tolstoy.newcastle.edu.au/R/e2/help/07/02/9740.html my objective is to do the "opposite", i.e. instead of having the same independent variable and testi

Re: [R] odfWeave problem "Error in xmlEventParse"

2009-02-24 Thread Dieter Menne
Fredrik Karlsson gmail.com> writes: > > Dear list, > > Sorry for bothering you with a pure odfSweave question, but I just ran > into a problem that I cannot find the cause of. > Anyonse seen this before? This file "used to work", but not anymore. > > Would apreciate all the help I could get. >

Re: [R] Tracing gradient during optimization

2009-02-24 Thread Greg Snow
It looks like you found a solution, but if you find yourself in this situation again using optim, then one approach is to modify your function that you are optimizing (or write a wrapper for it) to produce the tracing information for you. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center

Re: [R] any function for package searching?

2009-02-24 Thread Gabor Grothendieck
On Tue, Feb 24, 2009 at 10:56 AM, Zheng, Xin (NIH) [C] wrote: > Hi there, > > I wanted to search some packages related with 'genetics'. I know I can do it > on CRAN webpage. I'm just wondering if there's some function in R could do > that. Debian apt offers one way. It would be perfect if R has

Re: [R] reading text files compressed by gzip

2009-02-24 Thread jim holtman
What did the data appear like when it was read in? Have you just tried to read in the lines (readLines) to see if the decompression is working? Does this compare to what you get if you decompress the file outside of R? Not exactly sure what you mean by "force" since the command it probably readi

[R] R, Shapley Values and TURF

2009-02-24 Thread Data Analytics Corp.
Hi, I'm looking for any information on calculating and using Shapley Values in a TURF context. A paper was presented at an S-Plus conference about this: Conklin M., Lipovetsky S. Modern Marketing Research Combinatorial Computations: Shapley Value versus TURF Tools, Proceedings of 1998 Inter

Re: [R] predicting cumulative hazard for coxph using predict

2009-02-24 Thread Terry Therneau
> I am estimating the following coxph function with stratification and > frailty, where each person had multiple events. > m <- coxph(Surv(dtime1,status1) ~ gender +cage +uplf+ strata(enum)+ > frailty(id), xmodel) >I want to predict the cumulative hazard for each person for their

[R] statistical significance of accuracy increase in classification

2009-02-24 Thread Monica Pisica
Hi everyone, I would like to test for the statistical significance(for what it worth ...) in increasing classification accuracy and kappa statistics from different land classifications. The classifications were done using other software (like eCognition and See5), but the results were "sampled

Re: [R] any function for package searching?

2009-02-24 Thread Zheng, Xin (NIH) [C]
Thanks Wacek. Sorry that I didn't clarify my question. I want to search uninstalled packaged in repository. I just found RSitesearch could do that and open the results in system browser. It's not flexible, although it's better than none. Xin -Original Message- From: Wacek Kusnierczyk [

Re: [R] any function for package searching?

2009-02-24 Thread Wacek Kusnierczyk
Zheng, Xin (NIH) [C] wrote: > Hi there, > > I wanted to search some packages related with 'genetics'. I know I can do it > on CRAN webpage. I'm just wondering if there's some function in R could do > that. Debian apt offers one way. It would be perfect if R has some builtin > function like Debia

Re: [R] subsetting a matrix based on condition

2009-02-24 Thread Dimitris Rizopoulos
one way is: mat <- matrix(rnorm(2500*12), 2500, 12) ind <- rowSums(mat > 0) > 6 mat[ind, ] I hope it helps. Best, Dimitris A Ezhil wrote: Dear All, I have matrix of size 2500 x 12. I would like to select all the rows if 6 out 12 values are > 0. How can I do that in R? Thanks in advance

Re: [R] matrix computation???

2009-02-24 Thread Greg Snow
The same as what? It is not clear what you are trying to compare. Is this the comparison that you are looking for?: > A <- scale(stackloss) > > fit1 <- lm( stack.loss ~ . - 1, data=as.data.frame(A)) > tmp1 <- fitted(fit1) > > fit2 <- svd(A[,-4]) > tmp2 <- fit2$u %*% t(fit2$u) %*% A[,4] > > al

Re: [R] Help with t.test

2009-02-24 Thread UsuarioR España
Hi, If you want to see any result by gene, you should apply the function by genes, not by samples. As I understood, you are applying the test with the columns Samplea and SamplVehicle, but what you need is a result per row (per gene). Then you will see wich of the genes are significant. Reg

[R] subsetting a matrix based on condition

2009-02-24 Thread A Ezhil
Dear All, I have matrix of size 2500 x 12. I would like to select all the rows if 6 out 12 values are > 0. How can I do that in R? Thanks in advance. Kind regards, Ezhil __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-he

[R] any function for package searching?

2009-02-24 Thread Zheng, Xin (NIH) [C]
Hi there, I wanted to search some packages related with 'genetics'. I know I can do it on CRAN webpage. I'm just wondering if there's some function in R could do that. Debian apt offers one way. It would be perfect if R has some builtin function like Debian apt. Appreciate any help. Xin Zheng

Re: [R] Initialize varFunc in R

2009-02-24 Thread ONKELINX, Thierry
Dear Tania, Shouldn't that be varIdent(form = ~species.group) instead of varIdent(form = ~1|species.group)? Notice that this is untested as you did not provide a self-contained example (as de posting guide asked you to do). HTH, Thierry PS Next time try the mixed-models mailing list with quest

Re: [R] control data symbols in pairs function

2009-02-24 Thread Uwe Ligges
Kirk Wythers wrote: How does one control the size and type of data symbols in pairs()? I am trying to use the little dot (as in type=".") with absolutely no success. I guess you mean pch="." and hence pairs(data.frame, panel=panel.smooth, pch=".") Uwe Ligges Here is the pairs call I am

Re: [R] Inference for R Spam

2009-02-24 Thread Gabor Grothendieck
On Tue, Feb 24, 2009 at 9:58 AM, Martin Maechler wrote: >> "TL" == Thomas Lumley >>     on Tue, 24 Feb 2009 05:39:33 -0800 (PST) writes: > >    TL> The same company caused a complaint about a year ago >    TL> https://stat.ethz.ch/pipermail/r-help/2008-March/157423.html > > thanks, Thomas

[R] RODBC connectivity

2009-02-24 Thread Rad Nag
I am using R to access .mdb files (created in Microsoft access 2003)  through RODBC. I am able to view the Tables and also list their attributes through the sql. commands. However, when try to acces the primary keys (using sqlPrimaryKeys /odbcPrimaryKeys) I get a value of  '-1' on m

Re: [R] Inference for R Spam

2009-02-24 Thread Tony Breyal
Cheers for that information; I've just registered for the useR meeting in London and then about 10 minutes later got that same bit of spam too which made me a wee bit suspicious. On 24 Feb, 13:39, Thomas Lumley wrote: > The same company caused a complaint about a year > agohttps://stat.ethz.ch/p

[R] Initialize varFunc in R

2009-02-24 Thread Tania BrenesArguedas
Hi, I am running R2.8.1 under Linux, and I am having trouble using the variance functions in nlme My basic model was something like: model0 <- lme( log(growth) ~ light * species.group , data=data, random=~light|species ) # with 20 odd species divided in 2 groups Following the methods in Pinh

Re: [R] Tracing gradient during optimization

2009-02-24 Thread Shimrit Abraham
Yes, initially, it didn't work and thanks to one of the examples in the help file, I found out that I need to set maximize = T...but thanks for your suggestion anyway. I mainly work with state space models and I'm currently dealing with a case where the estimation time is halved (!!!) by spg(). Sh

[R] control data symbols in pairs function

2009-02-24 Thread Kirk Wythers
How does one control the size and type of data symbols in pairs()? I am trying to use the little dot (as in type=".") with absolutely no success. Here is the pairs call I am using: pairs(data.frame, panel=function(x,y) {points(x,y); lines(lowess(x,y))}) or even simpler: pairs(data.frame, pan

[R] Help with t.test

2009-02-24 Thread Amit Patel
Hi I have managed to do a paired t-test with a data set i have 5 colums of data im dealing with GENE SampA SampB SampC SampVehicle ctcc 859 na145 24 gtcg 45 5 54 69 and so on but they are much larger col

Re: [R] Tracing gradient during optimization

2009-02-24 Thread Ravi Varadhan
Hi Shimrit, Make sure that you set maximize=TRUE in the control settings (since you have fnscale = -1 in your optim() call). A nice feature of spg() is that the entire code is in R, and can be readily seen by just typing the function name at the R prompt. On smaller problems (with only a few p

Re: [R] Tracing gradient during optimization

2009-02-24 Thread Shimrit Abraham
Hi Ravi, Thanks for your great suggestion, it does exactly what I need as it provides more insight into what is going on in the 'black box'. In addition, it's much faster than optim(). I will use this function in the future. Kind Regards, Shimrit On Tue, Feb 24, 2009 at 2:33 PM, Ravi Varadhan

[R] odfWeave problem "Error in xmlEventParse"

2009-02-24 Thread Fredrik Karlsson
Dear list, Sorry for bothering you with a pure odfSweave question, but I just ran into a problem that I cannot find the cause of. Anyonse seen this before? This file "used to work", but not anymore. Would apreciate all the help I could get. /Fredrik

  1   2   >