[R] How to make R running faster

2008-05-28 Thread ctu
Hi everyone, I run the R loops on window XP and vista. Both are Intel core 2 Duo 2.2 GHz with 2 GB ram and XP is significantly faster than vista. Dose anyone know how speed up R loops in vista? Thank you in advance. Chunhao Tu __ R-help@r-project.

Re: [R] Tukey HSD (or other post hoc tests) following repeated measures ANOVA

2008-05-28 Thread Dieter Menne
Ullrich Ecker uwa.edu.au> writes: > I am fairly new to R, and I am aware that others have had this > problem before, but I have failed to solve the problem from previous > replies I found in the archives. > > Now, I want to calculate a post-hoc test following up a within-subjects ANOVA. Prob

[R] R News, volume 8, issue 1 is now available

2008-05-28 Thread John Fox
Dear R users, The May 2008 issue of `R News' is now available on CRAN under the Documentation/Newsletter link. John (on behalf of the R News Editorial Board) John Fox, Professor Department of Sociology McMaster University Hamilton ON Canada L8S 4M4

[R] can I do this with R?

2008-05-28 Thread Maria
Hello, I am just about to install R and was wondering about a few things. I have only worked in Matlab because I wanted to do a logistic regression. However Matlab does not do logistic regression with stepwiseforward method. Therefore I thought about testing R. So my question is can I do logi

Re: [R] request: which integer in each column is in majority

2008-05-28 Thread jim holtman
try this: > x [,1] [,2] [,3] [,4] [1,]1234 [2,]1241 [3,]1342 [4,]2343 [5,]2343 > apply(x, 2, function(.col)dimnames(table(.col))[[1]][which.max(table(.col))]) [1] "1" "3" "4" "3" > On Wed, May 28, 2008 at 5:23 A

Re: [R] Help with lines when x-axis is a date

2008-05-28 Thread Jim Lemon
Joe Trubisz wrote: Hi... I have a set of data, that looks like the following: date mornenzyme niteenzyme pdate where date is the original data char string and pdate is the POSIX representation. mornenzyme and niteenzyme are both float values. What I want to do is plot pdate against both en

Re: [R] hash or other quick lookup function?

2008-05-28 Thread Esmail Bonakdarian
Hi Duncan, Duncan Murdoch wrote: Duncan Murdoch wrote: Esmail Bonakdarian wrote: Hello all, I have a matrix of bit values. I compute certain values based on the bits in each row. There may be *duplicate* entries in the matrix, ie several rows may be identical. These rows change over time,

Re: [R] Unexpected behaviour in reading genomic coordinate files of R-2.7.0

2008-05-28 Thread Prof Brian Ripley
From the NEWS file for R-patched: o A field containing just a sign is no longer regarded as numeric (it was on all platforms in 2.7.0, but not on most in earlier versions of R). So the default behaviour has already been changed. The right way to overcome this was (as you

Re: [R] request: which integer in each column is in majority

2008-05-28 Thread Uwe Ligges
Muhammad Azam wrote: Respected R helpers/ users I am one of the new R user. I have a problem regarding to know which of the integer in each column of the following matrix is in majority. I want to know that integer e.g. in the first column 1 is in majority. Similarly in the third column 4 is

Re: [R] rmeta package: metaplot or forestplot of meta-analysis under DSL (ramdon) model

2008-05-28 Thread Jonathan Baron
I don't know if this helps, but recently I tried to use rmeta to make a forest plot and gave up because the data I had were not in the right format, so I simulated a forest plot using gplots. I did it all sideways and then rotated the PostScript. See http://www.sas.upenn.edu/~baron/journal/jdm7

[R] Unexpected behaviour in reading genomic coordinate files of R-2.7.0

2008-05-28 Thread Margherita
Great R people, I have noticed a strange behaviour in read.delim() and friends in the R 2.7.0 version. I will describe you the problem and also the solution I already found, just to be sure it is an expected behaviour and also to tell people, who may experience the same difficulty, a way to ov

[R] Tukey HSD (or other post hoc tests) following repeated measures ANOVA

2008-05-28 Thread Ullrich Ecker
Hi everyone, I am fairly new to R, and I am aware that others have had this problem before, but I have failed to solve the problem from previous replies I found in the archives. As this is such a standard procedure in psychological science, there must be an elegant solution to this...I think.

[R] confidence interval for the logit - predict.glm

2008-05-28 Thread Christine Sonvilla
Hello all, I've come across an online posting http://www.biostat.wustl.edu/archives/html/s-news/2001-10/msg00119.html that described how to get confidence intervals for predicted values from predict.glm. These instructions were meant for S-Plus. Yet, it generally seems to work with R too, b

[R] Computing P-Value

2008-05-28 Thread Edward Wijaya
Hi, Is there an R function or package that computes p-value? -GV __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minim

Re: [R] how to bind lists recursively

2008-05-28 Thread Patrick Burns
[EMAIL PROTECTED] wrote: This is somewhat subtle. Rolf's solution (here corrected to...) a <- list() for(i in 0:1) a[[i+1]] <- i is the best of the loop solutions (or at least the best I know of). The But Bill does know a better way -- it just slipped his mind. > system.time({ a <-

[R] request: which integer in each column is in majority

2008-05-28 Thread Muhammad Azam
Respected R helpers/ users I am one of the new R user. I have a problem regarding to know which of the integer in each column of the following matrix is in majority. I want to know that integer e.g. in the first column 1 is in majority. Similarly in the third column 4 is in majority. So what is

Re: [R] request: which integer in each column is in majority

2008-05-28 Thread Karl Ove Hufthammer
Muhammad Azam: > I am one of the new R user. I have a problem regarding to know which of > the integer in each column of the following matrix is in majority. I want > to know that integer e.g. in the first column 1 is in majority. > >> x=matrix(c(1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,4,1,2,3,3),ncol=4) >>

Re: [R] Pros and Cons of R

2008-05-28 Thread Neil Shephard
I feel the discussion about ease of installation on Linux (/*NIX type systems) isn't really relevant to the Pros and Cons of R. The problems encountered by people are often a consequence of their lack of knowledge/understanding of the operating system, and not a deficiency of R itself. Just my t

[R] Sample size for 2-sample proportion tests

2008-05-28 Thread Karl Knoblick
Hallo! I found a question exactly as mine, but I did not found an answer. Therefore I post this again - hopefully there will be an answer! Thanks in advance! karl From: Berta Date: Tue, 27 Feb 2007 18:58:48 +0100 Hi R-users, I want to calculate the sample size needed to carry out a 2-sample p

[R] extracting information from lmer objects

2008-05-28 Thread epigone26
Hi, I wish to extract a subset of the information of given by summary(lmer.object) as a dataframe. In particular, I wish to extract just a table listing the Estimate, Std Error, and t-values rounded to 3 decimal places. I have learned how to extract the coefficients with "round(fixef(lmer.object),

[R] Evidence Theory in R

2008-05-28 Thread Lars Fischer
Hello, well, I searched list-archive, cran and the references, but found nothing. Thus: Does anybody around here know anything about Dempster-Shafer Theory, Evidence Theory or Hints in R? Has anybody stumbled about a package that I overlooked or implemented something in this area? I really would

[R] How to remove NAs and lme function

2008-05-28 Thread Jen_mp3
I am working on a project to find a model for the concentration of dissolved oxygen in the river clyde. Ive fitted a linear mixed model as lme(DOW~Temperature+Salinity+Year+factor(Station)*factor(Depth), random~1|id), where id is an identifier of the day over 20 years defined as Day*1 + Month*

Re: [R] package functions documentation

2008-05-28 Thread Martin Morgan
Ardia David <[EMAIL PROTECTED]> writes: > Great, thanks a lot! It works properly now. > By the way, how can I get rid of the warning message : > > * checking line endings in C/C++/Fortran sources/headers ... WARNING > Found the following sources/headers with CR or CRLF line endings: > > Should I o

Re: [R] How to remove NAs and lme function

2008-05-28 Thread Andrew Robinson
Jen, try na.action = na.exclude Andrew On Wed, May 28, 2008 9:26 pm, Jen_mp3 wrote: > > I am working on a project to find a model for the concentration of > dissolved > oxygen in the river clyde. Ive fitted a linear mixed model as > lme(DOW~Temperature+Salinity+Year+factor(Station)*factor(Dept

Re: [R] how to bind lists recursively

2008-05-28 Thread John Fox
Dear Brian and Bill, Here's an interesting contrasting example (taken from this month's Help Desk column in R News, which Bill has already seen), first verifying the relative timings for Brian's example: > system.time({ + a <- vector("list", 10001) + for(i in 0:1) a[[i+1]] <- i + })

Re: [R] need help for building R in Ubuntu 8.04

2008-05-28 Thread Martin Maechler
> "EH" == Erin Hodgess <[EMAIL PROTECTED]> > on Sun, 25 May 2008 13:27:04 -0500 writes: EH> Try: ./configure --with-x=no well.. no! really don't. If you want to enjoy a Linux system and building from the source, and then maybe learn how that is happening, learning about she

Re: [R] How to make R running faster

2008-05-28 Thread Neil Shephard
ctu wrote: > > Hi everyone, > I run the R loops on window XP and vista. Both are Intel core 2 Duo > 2.2 GHz with 2 GB ram and XP is significantly faster than vista. Dose > anyone know how speed up R loops in vista? > > Loops are not massively efficient within R. Look into using the appl

Re: [R] Rotated text on a regression line

2008-05-28 Thread Thomas Adams
Christoph, I see two problems: (1) use plot(x,y,pch=16,xlim=c(0,10),asp=1), as the default has the x/y scales different. (2) It looks to me that the expression "srt=180/pi*atan(slope)" should be "srt=180*atan(slope)/pi" Regards, Tom Dr. Christoph Scherber wrote: Dear all, I stumbled over

Re: [R] How to make R running faster

2008-05-28 Thread John Fox
Dear Chunhao Tu, There is, coincidentally, a discussion of loops and related issues in the Help Desk column in the current issue of R News (see the newsletter link on CRAN). Regards, John -- John Fox, Professor Department of Sociology McMaster University Hamilton, On

Re: [R] need help for building R in Ubuntu 8.04

2008-05-28 Thread Dirk Eddelbuettel
On Wed, May 28, 2008 at 02:29:10PM +0200, Martin Maechler wrote: > > "EH" == Erin Hodgess <[EMAIL PROTECTED]> > > on Sun, 25 May 2008 13:27:04 -0500 writes: > > EH> Try: ./configure --with-x=no > > well.. no! really don't. Seconded. At best this qualified for the 'then do

[R] "rbinom" not using probability of success right

2008-05-28 Thread Philip Twumasi-Ankrah
I am trying to simulate a series of ones and zeros (1 or 0) and I am using "rbinom" but realizing that the number of successes expected is not accurate. Any advice out there. This is the example: N<-500 status<-rbinom(N, 1, prob = 0.15) count<-sum(status) 15 percent of 500 should be 75 but wha

Re: [R] can I do this with R?

2008-05-28 Thread Charilaos Skiadas
A google search for "logistic regression with stepwise forward in r" returns the following post: https://stat.ethz.ch/pipermail/r-help/2003-December/043645.html Haris Skiadas Department of Mathematics and Computer Science Hanover College On May 28, 2008, at 7:01 AM, Maria wrote: Hello, I am

Re: [R] function to compute consensus DNA sequence by plurality?

2008-05-28 Thread Jean lobry
Kim, Is is what you want? tmp <- readLines(textConnection( "TGCATACACCGACAACATCCTCGACGACTACACCTACTACG CGCCTACACCAACGATGTCCTGGACGACTTCTGCTACTACG CGCCTACACCAACGATGTCCTGGACGACTTCTGCTACTACG CGCCTACACCAACGATGTCCTGGACGACTTCTGCTACTACG CGCCTACACCAACGATGTCCTGGACGACTTCTGCTACTACG AGCATACACCGACAACATCCTCGATG

Re: [R] how to bind lists recursively

2008-05-28 Thread Prof Brian Ripley
On Wed, 28 May 2008, John Fox wrote: Dear Brian and Bill, Here's an interesting contrasting example (taken from this month's Help Desk column in R News, which Bill has already seen), first verifying the relative timings for Brian's example: system.time({ + a <- vector("list", 10001) + fo

Re: [R] "rbinom" not using probability of success right

2008-05-28 Thread Prof Brian Ripley
You asked for each of 500 to be included with probability 0.15, not for 15% of 500. If you want the latter, use sample, e.g. sample(c(rep(1,75), rep(0,425))) And to see if your 77 is reasonable for binomial sampling: binom.test(77, 500, 0.15) Exact binomial test data: 77 and 500

Re: [R] "rbinom" not using probability of success right

2008-05-28 Thread Ted Harding
On 28-May-08 12:53:26, Philip Twumasi-Ankrah wrote: > I am trying to simulate a series of ones and zeros (1 or 0) and I am > using "rbinom" but realizing that the number of successes expected is > not accurate. Any advice out there. > > This is the example: > > N<-500 > status<-rbinom(N, 1, prob

Re: [R] "rbinom" not using probability of success right

2008-05-28 Thread Charles Annis, P.E.
Do it again. What did you get this time? Then do it another time. Do you see what is happening? Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On

Re: [R] How to make R running faster

2008-05-28 Thread Erin Hodgess
I remember reading the colSum and colMean were better, when you need sums and means On Wed, May 28, 2008 at 8:26 AM, Esmail Bonakdarian <[EMAIL PROTECTED]> wrote: > Neil Shephard wrote: >> >> Loops are not massively efficient within R. >> >> Look into using the apply() family of functions >> (eapp

Re: [R] "rbinom" : Does randomness preclude precision?

2008-05-28 Thread Philip Twumasi-Ankrah
Teds reply is a bit comforting and as indicated in my post, I am resorting to using "sample" but as an academic issue, does randomness preclude precision? Randomness should be in the sequence of zeros and ones and how they are simulated at each iteration of the process but not in the eventual n

Re: [R] How to make R running faster

2008-05-28 Thread Esmail Bonakdarian
Neil Shephard wrote: Loops are not massively efficient within R. Look into using the apply() family of functions (eapply()/lapply()/mapply/rapply()/tapply()). Didn't someone post not too long ago that apply is internally represented as a for-loop? Or am I not remembering this correctly? The

Re: [R] How to make R running faster

2008-05-28 Thread Esmail Bonakdarian
Erin Hodgess wrote: I remember reading the colSum and colMean were better, when you need sums and means Well .. I'm waiting for the experts to jump in and give us the straight story on this :-) __ R-help@r-project.org mailing list https://stat.ethz.

Re: [R] Computing P-Value

2008-05-28 Thread Ben Bolker
Edward Wijaya gmail.com> writes: > > Hi, > > Is there an R function or package that computes > p-value? > > -GV Many, but this is far too vague a question for us to answer usefully. Perhaps if you tell us specifically what you want to do we can help. (Please make sure to read the posting

Re: [R] confidence interval for the logit - predict.glm

2008-05-28 Thread Prof Brian Ripley
Possibly your calculation overflows: exp(upperlogit)/(1+exp(upperlogit)) could be replaced by 1/(1+exp(-upperlogit)), or even better by plogis(upperlogit). This could happen via the Hauck-Donner effect: the fitted probabilities are very near one and the standard errors are very large. As for

Re: [R] Computing P-Value

2008-05-28 Thread Gundala Viswanath
Dear Ben, Given a set of words ('foo', 'bar', 'bar', 'bar', "quux" . "foo") this can be in 10.000 items. I would like to compute the significance of the word occurrence with P-Value. Is there a simple way to do it? - GV On Wed, May 28, 2008 at 11:46 PM, Ben Bolker <[EMAIL PROTECTED]> wrot

Re: [R] (no subject)

2008-05-28 Thread Ben Bolker
Philip Twumasi-Ankrah yahoo.com> writes: > > Teds reply is a bit comforting and as indicated in my post, > I am resorting to > using "sample" but as an academic > issue, does randomness preclude precision? > > Randomness should be in the sequence of zeros and ones and > how they are simulate

Re: [R] "rbinom" : Does randomness preclude precision?

2008-05-28 Thread Charles Annis, P.E.
What do you mean by "... *eventual* nature of the distribution?" If you simulated 100 samples, would you expect to see 1.5 successes? Or 1? Or 2? How many, in your thinking, is "eventual?" Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEng

[R] Grouped weighted.mean

2008-05-28 Thread Chip Barnaby
Dear all -- I want to compute weighted.mean() for grouped rows. Data frame extract is just below. For each Key, I want the mean of IAC weighted by Wt. DP0[1:20,] Key IACWt 2 C3-PD030020050.PD030020050.3.12.3.0 0.765 0.85

[R] individual analysis

2008-05-28 Thread julien . jung
Dear R-community, I'm looking forward to analyse the results statistically for a new medical diagnostic tool. The aim is to know whether a given subject is different from the mean or distribution of a population of controls for one continuous variable (a neuro-imaging results which can be q

Re: [R] How to remove NAs and lme function

2008-05-28 Thread Jen_mp3
Thanks, that worked! Andrew Robinson-6 wrote: > > Jen, > > try > > na.action = na.exclude > > Andrew > > > On Wed, May 28, 2008 9:26 pm, Jen_mp3 wrote: >> >> I am working on a project to find a model for the concentration of >> dissolved >> oxygen in the river clyde. Ive fitted a linear mi

[R] Fixing the coefficient of a regressor in formula

2008-05-28 Thread Marie-Pierre Sylvestre
Dear R users, I want to estimate a Cox PH model with time-dependent covariates so I am using a counting process format with the following formula: Surv(data$start, data$stop, data$event.time) ~ cluster(data$id) + G1 + G2 + G3 + G4 + G5 +G6 Gs represent a B-spline basis functions so they s

Re: [R] "rbinom" : Does randomness preclude precision?

2008-05-28 Thread Charles Annis, P.E.
I think I see the rub: You would like to see the distribution of a sample be identical to the distribution from which it was sampled. But if it is random then that can happen only in the long run, not on every sample. That is why samples from a normal density are *not* themselves normal - they'r

Re: [R] can I do this with R?

2008-05-28 Thread Smita Pakhale
Hi Maria, But why do you want to use forwards or backwards methods? These all are 'backward' methods of modeling. Try using AIC or BIC. BIC is much better than AIC. And, you do not have to believe me or any one else on this. Just make a small data set with a few variables with known relationship

[R] odds ratio's and function

2008-05-28 Thread Wim Bertels
Hallo, i tried writing a function to extract all the odds ratio's from a ftable: (+ p.adjust needs to build in) So i tried the following: ORCalcul <- function(m) { or<-matrix(1:(length(m[,1])-1)*(length(m[1,])-1)*5,length(m[,1])-1,length(m[1,])-1) for(i in 1:length(m[,1])-1) {

Re: [R] Grouped weighted.mean

2008-05-28 Thread Erik Iverson
Hello - Chip Barnaby wrote: Dear all -- I want to compute weighted.mean() for grouped rows. Data frame extract is just below. For each Key, I want the mean of IAC weighted by Wt. DP0[1:20,] Key IACWt 2 C3-PD030020050.P

[R] Search&replace string?

2008-05-28 Thread Romain
Hi there, I would like to know if it is possible to modify a text file with a R function. In fact I would like to know if a function "Search & Replace" exists. My problem is to create config files from a Base file in which I have to modify values of parameters. My Base File: #... #... Param1

Re: [R] Computing P-Value

2008-05-28 Thread Ben Bolker
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Gundala Viswanath wrote: | Dear Ben, | | Given a set of words | ('foo', 'bar', 'bar', 'bar', "quux" . "foo") this can be in 10.000 items. | I would like to compute the significance of the word occurrence with P-Value. | | Is there a simple way t

Re: [R] "rbinom" : Does randomness preclude precision?

2008-05-28 Thread Daniel Nordlund
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf > Of Philip Twumasi-Ankrah > Sent: Wednesday, May 28, 2008 6:52 AM > To: [EMAIL PROTECTED] > Cc: r-help@r-project.org > Subject: Re: [R] "rbinom" : Does randomness preclude precision? > > Teds reply is a bit

[R] Help on Calculating day differences

2008-05-28 Thread Thorsten Muehge
Hello R Freaks, I calculate the difference in days between two events with the following litte R expresseion: T1a <- strptime(T1,"%m/%d/%y %H:%M:%S"); T2a <- strptime(T2,"%m/%d/%y %H:%M:%S"); T1b <- as.Date(T1a); T2b <- as.Date(T2a); days <- T2b-T1b; time <- T2a - T1a; In the project I would lik

[R] superposing barplots having different scales

2008-05-28 Thread Bill Shipley
Hello. I know how to make a bar plot in which a numeric y variable is plotted against some grouping variable X (say, groups A, B, C) when this grouping variable is subdivided into each of two subgroups; so the bars would be: (group A subgroup 1) beside (group A subgroup 2), then (group B subgroup 1

Re: [R] How to make R running faster

2008-05-28 Thread Robert A LaBudde
At 10:25 AM 5/28/2008, Esmail Bonakdarian wrote: Erin Hodgess wrote: I remember reading the colSum and colMean were better, when you need sums and means Well .. I'm waiting for the experts to jump in and give us the straight story on this :-) All of the algorithms are represented internally

Re: [R] need help for building R in Ubuntu 8.04

2008-05-28 Thread Martin Maechler
> "DE" == Dirk Eddelbuettel <[EMAIL PROTECTED]> > on Wed, 28 May 2008 12:46:50 + writes: DE> On Wed, May 28, 2008 at 02:29:10PM +0200, Martin DE> Maechler wrote: >> > "EH" == Erin Hodgess <[EMAIL PROTECTED]> >> > on Sun, 25 May 2008 13:27:04 -0500 writes:

Re: [R] Help on Calculating day differences

2008-05-28 Thread Henrique Dallazuanna
Try this: # Without the weekend sum(!format(seq(T1a, T2a, by = "days"), "%w") %in% c("0","6")) On Wed, May 28, 2008 at 10:30 AM, Thorsten Muehge <[EMAIL PROTECTED]> wrote: > Hello R Freaks, > I calculate the difference in days between two events with the following > litte R expresseion: > > T1a

Re: [R] Fixing the coefficient of a regressor in formula

2008-05-28 Thread Prof Brian Ripley
See ?offset On Wed, 28 May 2008, Marie-Pierre Sylvestre wrote: Dear R users, I want to estimate a Cox PH model with time-dependent covariates so I am using a counting process format with the following formula: Surv(data$start, data$stop, data$event.time) ~ cluster(data$id) + G1 + G2 + G3

Re: [R] Help on Calculating day differences

2008-05-28 Thread Gabor Grothendieck
See ?is.holiday in chron. You need to supply a .Holidays vector and then do this: library(chron) d1 <- Sys.Date() d2 <- Sys.Date() + 100 sq <- sq(d1, d2, by = "day") sum(!is.holiday(sq) & !is.weekend(sq)) # endpoints included The fCalendar package also has functionality in this area. On Wed, M

Re: [R] Evidence Theory in R

2008-05-28 Thread H. W. Borchers
Lars Fischer sec.informatik.tu-darmstadt.de> writes: > Hello, > > well, I searched list-archive, cran and the references, but found > nothing. Thus: > > Does anybody around here know anything about Dempster-Shafer Theory, > Evidence Theory or Hints in R? Has anybody stumbled about a package tha

Re: [R] lm() output with quantiative predictors not the same as SAS

2008-05-28 Thread Ben Bolker
yale.edu> writes: > > I am trying to use R lm() with quantitative and qualitative predictors, but am > getting different results than those that I get in SAS. > > In the R ANOVA table documentation I see that "Type-II tests corresponds to > the > tests produced by SAS for analysis-of-variance

[R] heatmap-changing column or row names

2008-05-28 Thread Moreno Ignazio Coco
Dear R Community, I am trying to create an heatmap for the following set of data: ##example of data matrix o4 V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 green 27 28 29 29 28 28 26 25 25 23 23 22 22 21 21 22 22 22 yellow 6 8 8 7 7 7 6 6 6 7 7 7

Re: [R] can I do this with R?

2008-05-28 Thread Frank E Harrell Jr
Smita Pakhale wrote: Hi Maria, But why do you want to use forwards or backwards methods? These all are 'backward' methods of modeling. Try using AIC or BIC. BIC is much better than AIC. And, you do not have to believe me or any one else on this. How does that help? BIC gives too much penaliz

Re: [R] how to bind lists recursively

2008-05-28 Thread John Fox
Dear Brian, Thanks for the explanation -- it makes sense of what I've observed in a range of problems. I think that the bottom line is that in typical problems involving lists, pre-allocation of the pointers won't make much (proportional) difference to the total time. For curiosity, I modified th

[R] postscript

2008-05-28 Thread Antonio.Gasparrini
Hello, I'm trying to save a graph as a .ps file to include it in a LaTex presentation, but R replies: Error: Invalid font type In addition: Warning messages: 1: font family not found in PostScript font database 2: font family not found in PostScript font database If I load the package grDevice

Re: [R] superposing barplots having different scales

2008-05-28 Thread Ben Bolker
Bill Shipley usherbrooke.ca> writes: > > Hello. I know how to make a bar plot in which a numeric y variable is > plotted against some grouping variable X (say, groups A, B, C) when this > grouping variable is subdivided into each of two subgroups; so the bars > would be: (group A subgroup 1) bes

Re: [R] plot rownames

2008-05-28 Thread T.D.Rudolph
I did have the problem of not having two continuous variables and this approach circumvents this, allowing me in fact to plot the rownames. Prof Brian Ripley wrote: > > On Tue, 27 May 2008, T.D.Rudolph wrote: > >> >> In the following example: >> x <- rnorm(1:100) >> y <- seq(from=-2.5, to=3.

[R] manipulating multiply imputed data sets

2008-05-28 Thread Donald Braman
Hi folks, I have five imputed data sets and would like to apply the same recoding routines to each. I could do this sort of thing pretty easily in Stata using MIM, but I've decided to go cold turkey on other stats packages as a incentive for learning more about R. Most of the recoding is for nom

[R] Suitable package for carrying out sigma and beta convergence in panel data

2008-05-28 Thread Amarjit Singh Sethi
Dear all   I wish to carry out sigma- and beta-convergence analysis in respect of panel data [wherein current value of one of the variables needs be regressed upon suitably transformed lagged values of another variable(s)]. I am quite new to the R-language and am not very much aware of the avail

Re: [R] Binning groups

2008-05-28 Thread Julian Burgos
see ?findIntervals francogrex wrote: Hi, this is probably quite simple but I can't seem to do it correctly. I have a data frame of counts of infections in different ages; something like: count=c(1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 7, 8, 8, 9, 9, 10, 11, 15, 17, 17, 17, 17, 19, 19, 19,

[R] interactive heatmap dendrogram locator layout grid package

2008-05-28 Thread Wittner, Ben, Ph.D.
Hello, I would like to display a heatmap with dendrograms and allow the user to click on either dendrogram to choose a sub-dendrogram. The function heatmap() uses layout() and image() and the plot method of dendrogram to plot the heatmap and dendrograms, but if locator() is then called and the us

[R] Writing intermediate analysis to disk

2008-05-28 Thread stephen sefick
Is there a way to write and analysis to disk and then reconstruct the whole thing back into an object. wavCWT() #wmtsa package I am running out of memory on my computer and I was wondering if there was a way to iterate through this process (as it is an iterative process anyway- it just stores the

[R] R reference Books

2008-05-28 Thread Neil Gupta
Hi I am still fairly new to R but picking it up quickly. I have some problems manipulating data in tables. I was wondering if anyone new any good resources such as an R manual. Some of the intro pdfs I viewed do not show how...much appreciated. [[alternative HTML version deleted]] ___

Re: [R] manipulating multiply imputed data sets

2008-05-28 Thread John Fox
Dear Donald, I can't guarantee that there aren't other problems, but your call to update() is in error; you need allmis <- update(allmis, white = recode(RACE, '1=1; else=0; ')) not allmis <- update(allmis, white <- recode(RACE, '1=1; else=0; ')) [The last ; in the recode specification is unne

[R] Gantt chart like graphics

2008-05-28 Thread kljosc
Dear R Community, I have a dataframe like this dat product1 product2 ... productn 01.1.2008 1 1 1 02.1.2008 1 1 2 . 15.2.2008 2 2 NA . 04.4.2008 2 2 1 05.4.2008 NA 2

[R] multistate survival analysis w/ time varying covariates

2008-05-28 Thread gulemeto
Hi, I've seen in the NestCohort package that one can do a hazard model with a binary outcome using covariates. I am interested in multistate hazard models with time-varying covariates, but can't seem to find this already implemented in an R package. Is this included somewhere but called something

Re: [R] R reference Books

2008-05-28 Thread Douglas Bates
There is a very good book called "Data Manipulation with R" by Phil Spector that just became available. It is brief and concise. I would recommend that book for learning about manipulating data in tables. For anyone interested in data exploration and graphics I would also recommend Deepayan Sarka

[R] library(Matrix) and image() colors?

2008-05-28 Thread jgarcia
Hi, I'm trying to produce a plot of an image of a Matrix, but I don't get other colors than the default grey scale: > image(Matrix(topo.matrix.2),col.regions=topo.colors(100),colorkey=FALSE) this still is plotted in grey. Is there any mistake in my syntax? Thanks and regards, Javier -- ___

[R] Can plot() be used for multiple plots?

2008-05-28 Thread Ben Fairbank
Greetings helpRs -- I would like to use plot() to plot two cumulative distribution curves so that a user of the plot can compare the distributions of the two variables. The following code draws two distributions separately, but I cannot find the instruction necessary to add a second cumulative

Re: [R] manipulating multiply imputed data sets

2008-05-28 Thread Donald Braman
Thanks -- that's very helpful! -Don On Wed, May 28, 2008 at 4:34 PM, John Fox <[EMAIL PROTECTED]> wrote: > Dear Donald, > > I can't guarantee that there aren't other problems, but your call to > update() is in error; you need > > allmis <- update(allmis, white = recode(RACE, '1=1; else=0; ')) > >

Re: [R] extracting information from lmer objects

2008-05-28 Thread Douglas Bates
On Wed, May 28, 2008 at 6:18 AM, epigone26 <[EMAIL PROTECTED]> wrote: > Hi, > I wish to extract a subset of the information of given by > summary(lmer.object) as a dataframe. In particular, I wish to extract > just a table listing the Estimate, Std Error, and t-values rounded to > 3 decimal places

Re: [R] Can plot() be used for multiple plots?

2008-05-28 Thread Philipp Pagel
On Wed, May 28, 2008 at 04:15:34PM -0500, Ben Fairbank wrote: > > I would like to use plot() to plot two cumulative distribution curves so > that a user of the plot can compare the distributions of the two > variables. The following code draws two distributions separately, but I > cannot find the

[R] bootstrap confidence bands

2008-05-28 Thread Geertje van der Heijden
Hi all, I have bootstrapped my weighted regression equation using the following formula and the package boot to obtain bootstrap confidence intervls for my parameters: >drought <- read.table("D:/drought080525.txt", header=T) >regres <- function(x, indices) { >x <- x[indices,] >coef(lm(x$AGB ~ x$

Re: [R] library(Matrix) and image() colors?

2008-05-28 Thread Deepayan Sarkar
On 5/28/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > I'm trying to produce a plot of an image of a Matrix, but I don't get > other colors than the default grey scale: > > > image(Matrix(topo.matrix.2),col.regions=topo.colors(100),colorkey=FALSE) > > this still is plotted in grey. >

Re: [R] can I do this with R?

2008-05-28 Thread Xiaohui Chen
step or stepAIC functions do the job. You can opt to use BIC by changing the mulplication of penalty. I think AIC and BIC are not only limited to compare two pre-defined models, they can be used as model search criteria. You could enumerate the information criteria for all possible models if t

[R] calling C function from R

2008-05-28 Thread Wen-Ching Lin
Hi, I am reading the source code of rpart. I have problems understand the following code and would appreciate for any helps. In rpart.s, there is a line: rpfit <- .C(C_s_to_rp,             n = as.integer(nobs),             nvarx = as.integer(nvar),             ncat = as.integer(cats* !isord),

Re: [R] can I do this with R?

2008-05-28 Thread Frank E Harrell Jr
Xiaohui Chen wrote: step or stepAIC functions do the job. You can opt to use BIC by changing the mulplication of penalty. I think AIC and BIC are not only limited to compare two pre-defined models, they can be used as model search criteria. You could enumerate the information criteria for all

Re: [R] can I do this with R?

2008-05-28 Thread Xiaohui Chen
Frank E Harrell Jr 写道: Xiaohui Chen wrote: step or stepAIC functions do the job. You can opt to use BIC by changing the mulplication of penalty. I think AIC and BIC are not only limited to compare two pre-defined models, they can be used as model search criteria. You could enumerate the info

Re: [R] How to make R running faster

2008-05-28 Thread Richard Rowe
[EMAIL PROTECTED] wrote: Hi everyone, I run the R loops on window XP and vista. Both are Intel core 2 Duo 2.2 GHz with 2 GB ram and XP is significantly faster than vista. Dose anyone know how speed up R loops in vista? Thank you in advance. Chunhao Tu

Re: [R] can I do this with R?

2008-05-28 Thread Andrew Robinson
On Wed, May 28, 2008 at 03:47:49PM -0700, Xiaohui Chen wrote: > Frank E Harrell Jr ??: > >Xiaohui Chen wrote: > >>step or stepAIC functions do the job. You can opt to use BIC by > >>changing the mulplication of penalty. > >> > >>I think AIC and BIC are not only limited to compare two pre-defin

Re: [R] Gantt chart like graphics

2008-05-28 Thread Gabor Grothendieck
Try gantt.chart in the plotrix package. On Wed, May 28, 2008 at 1:54 PM, kljosc <[EMAIL PROTECTED]> wrote: > > Dear R Community, > > I have a dataframe like this > > dat product1 product2 ... productn > 01.1.2008 1 1 1 > 02.1.2008 1 1 2 >

Re: [R] can I do this with R?

2008-05-28 Thread Xiaohui Chen
Andrew Robinson 写道: On Wed, May 28, 2008 at 03:47:49PM -0700, Xiaohui Chen wrote: Frank E Harrell Jr ??: Xiaohui Chen wrote: step or stepAIC functions do the job. You can opt to use BIC by changing the mulplication of penalty. I think AIC and BIC are not only limited to co

Re: [R] Writing intermediate analysis to disk

2008-05-28 Thread Moshe Olshansky
Hi Stephen, Have you looked at 'save' and 'load'? As far as I understand, to really release the memory you need to close R, so you may try to write a script (shell script on Unix, batch file on Windows) which invokes Rcmd to load the data, make an iteration and save the result, so that R dies bet

Re: [R] confidence interval for the logit - predict.glm

2008-05-28 Thread Christine Sonvilla
Dear Brian and list members, Thanks very much for your response Brian! I applied the adjusted calculation that you advised me to use [1/(1+exp(-upperlogit))] and as a result I don't get any more NA values in my upper confidence interval values. Yet, some outcomes are very akward, since for ver

[R] Separator argument in read.table

2008-05-28 Thread Gundala Viswanath
Hi, Suppose I have the following tabular data: 1729_at | TRADD | TNFRSF1A-associated via death domain | protein-coding 1773_at | FNTB | farnesyltransferase, CAAX box, beta | protein-coding 177_at | PLD1 | phospholipase D1, phosphatidylcholine-specific | protein-coding What is the right separat

  1   2   >