[R] cut2 once, bin twice...

2009-10-22 Thread sdanzige
Hello, I'm using the Hmisc cut2 function to bin a set of data. It produces bins that I like with results like this: [96,270]:171 [69, 96): 54 [49, 69): 40 [35, 49): 28 [28, 35): 14 [24, 28): 8 (Other) : 48 I would like to take a second set of data, and assign it to bins based on factors defin

[R] coxph() and survfit()

2009-10-22 Thread Mura Tamakou
Dear All, I have a question regarding the output of survfit() when I supply a Cox model. Lets say for example: library(survival) fit <- coxph(Surv(time, status == 2) ~ factor(spiders), data = pbc) fit # HR for spiders is significant newdata <- data.frame(spiders = factor(0:1)) sf <- survfit(f

Re: [R] Functional data analysis - problems with smoothing

2009-10-22 Thread Peter Ehlers
The error message is pretty clear: regardless of what *you* think, R says that 'isi' is not numeric. Are you sure that 'isi' is not a *factor* object? I'm willing to bet that it is. Use str() to check your data. -Peter Ehlers Benjamin Cheah wrote: Hi all, I'm having major issues with smooth

[R] Functional data analysis - problems with smoothing

2009-10-22 Thread Benjamin Cheah
Hi all, I'm having major issues with smoothing my functional data I'm referring to Jim Ramsay's examples in his books. The following error message keeps appearing, despite all my data being numeric can anyone kindly offer any suggestions? isi - vector of argument values - i.e. the independen

Re: [R] Bayesian regression stepwise function?

2009-10-22 Thread Charles C. Berry
On Thu, 22 Oct 2009, Ben Bolker wrote: Allan.Y wrote: Hi everyone, I am wondering if there exists a stepwise regression function for the Bayesian regression model. I tried googling, but I couldn't find anything. I know "step" function exists for regular stepwise regression, but nothing f

Re: [R] How to make R packages?

2009-10-22 Thread Jorge Ivan Velez
Hi Peng, Also, take a look at the following links: http://robjhyndman.com/research/Rpackages_notes.pdf http://www.biostat.wisc.edu/~kbroman/Rintro/Rwinpack.html HTH, Jorge On Fri, Oct 23, 2009 at 12:10 AM, Peng Yu <> wrote: > I found the following document on making R packages. But it is old. >

Re: [R] How to make R packages?

2009-10-22 Thread Benilton Carvalho
Maybe http://cran.r-project.org/doc/manuals/R-exts.pdf ? b On Oct 23, 2009, at 2:10 AM, Peng Yu wrote: I found the following document on making R packages. But it is old. I'm wondering if there is more current ones and hopefully more complete ones. http://biosun1.harvard.edu/courses/individ

Re: [R] splitting a vector of strings...

2009-10-22 Thread andrew
the following works - double backslash to remove the "or" functionality of | in a regex. (Bill Dunlap showed that you don't need sapply for it to work) xs <- "this is | string" xsv <- paste(xs, 1:10) strsplit(xsv, "\\|") On Oct 23, 3:50 pm, Jonathan Greenberg wrote: > William et al: > >     Th

Re: [R] splitting a vector of strings...

2009-10-22 Thread Jonathan Greenberg
William et al: Thanks! I think I have a somewhat more complicated issue due to the type of string I'm using -- the split is " | " (space pipe space) -- how do I code that based on your sub code below? Using " | *" doesn't seem to be working. Thanks! --j William Dunlap wrote: -Ori

[R] factor analysis: extract principal components until the eigen value <1

2009-10-22 Thread Tiger Guo
Hello, I am trying to do factor analysis using principle components analysis. I use “fa” in package “psych”. I would like extract principal components until the eigen value <1. Two questions: First, can I calculate the eigenvalue of the covariance matrix and decide the number of eigenvalues>

[R] How to make R packages?

2009-10-22 Thread Peng Yu
I found the following document on making R packages. But it is old. I'm wondering if there is more current ones and hopefully more complete ones. http://biosun1.harvard.edu/courses/individual/bio271/lectures/L6/Rpkg.pdf __ R-help@r-project.org mailing l

[R] a problem about integrate function in R .thank you .

2009-10-22 Thread fuzuo xie
e2 <- function(x) { out <- 0*x for(i in 1:length(x)) out[i] <-integrate(function(y) qnorm(y),lower=0,upper=x[i])$value out } integrate(e2,lower=0, upper=a)$value above is my code , when a is small , say a<0.45 the result is right . however , when a>0.5 the result is incorrect .

Re: [R] splitting a vector of strings...

2009-10-22 Thread andrew
xs <- "this is string" xsv <- paste(xs, 1:10) sapply(xsv, function(x) strsplit(x, '\\sis\\s')) This will split the vector of string "xsv" on the word 'is' that has a space immediately before and after it. On Oct 23, 1:34 pm, Jonathan Greenberg wrote: > Quick question -- if I have a vector of s

Re: [R] splitting a vector of strings...

2009-10-22 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Jonathan Greenberg > Sent: Thursday, October 22, 2009 7:35 PM > To: r-help > Subject: [R] splitting a vector of strings... > > Quick question -- if I have a vector of strings tha

Re: [R] glm.fit to use LAPACK instead of LINPACK

2009-10-22 Thread Ted
On Thu, 22 Oct 2009, Douglas Bates wrote: On Thu, Oct 22, 2009 at 10:26 AM, Ravi Varadhan wrote: Ted, LAPACK is newer and is supposed to contain better algorithms than LINPACK.  It is not true that LAPACK cannot handle rank-deficient problems.  It can. It's not just a question of handlin

[R] splitting a vector of strings...

2009-10-22 Thread Jonathan Greenberg
Quick question -- if I have a vector of strings that I'd like to split into two new vectors based on a substring that is inside of each string, what is the most efficient way to do this? The substring that I want to split on is multiple characters, if that matters, and it is contained in every

Re: [R] integrate() function error

2009-10-22 Thread andrew
Change e2 to the following and it works e2 <- function(a) a^2/2 The reason it doesn't is that e2 must be able to handle vector inputs correctly. Your original function does not do this. from ?integrate f - an R function taking a numeric first argument and returning a numeric vector of the sam

[R] integrate() function error

2009-10-22 Thread fuzuo xie
This is my code , when i run it ,error happed . can you tell me what's the reason and modify it ?thank you very much !! the error is "evaluation of function gave a result of wrong length" e2<-function(a) integrate(function(x) x,lower=0,upper=a)$value integrate(e2,lower=0, upper=0.5)$value

Re: [R] inspect s4 methods

2009-10-22 Thread Douglas Bates
On Thu, Oct 22, 2009 at 8:11 PM, Ista Zahn wrote: > Hi everyone, > I'm sure this has been asked before, but I could not find the right > search terms to find it. > > If I want to see what summarizing a model fit with lm() does, I can > write "summary.lm". But what if I want to see what summarizing

Re: [R] glm.fit to use LAPACK instead of LINPACK

2009-10-22 Thread Douglas Bates
On Thu, Oct 22, 2009 at 10:26 AM, Ravi Varadhan wrote: > Ted, > LAPACK is newer and is supposed to contain better algorithms than LINPACK.   > It is not true that LAPACK cannot handle rank-deficient problems.  It can. It's not just a question of handling rank-deficiency. It's the particular for

[R] inspect s4 methods

2009-10-22 Thread Ista Zahn
Hi everyone, I'm sure this has been asked before, but I could not find the right search terms to find it. If I want to see what summarizing a model fit with lm() does, I can write "summary.lm". But what if I want to see what summarizing a model fit with lmer() (lme4 package) does? showMethods(sum

Re: [R] PDF too large, PNG bad quality

2009-10-22 Thread Lasse Kliemann
* Message by -Greg Snow- from Thu 2009-10-22: > If you want to go the pdf route, then you need to find some way > to reduce redundant information while still getting the main > points of the plot. With so many point, I would suggest > looking at the hexbin package (bioconductor I think) as on

Re: [R] removing random effect from nlme or using varPower() in nls

2009-10-22 Thread Kingsford Jones
help(gnls, pack=nlme) hth, Kingsford Jones On Thu, Oct 22, 2009 at 4:36 PM, Michael A. Gilchrist wrote: > Hello, > > I've been fitting a random effects model using nlme to some data, but I am > discovering that the variation in my random effect is very small.  As a > result, I would like to rep

Re: [R] Recode issue

2009-10-22 Thread Ista Zahn
Hi Nikhil, The problem is that your initial "as.factor(0)" causes x to have values of "1" : "20" instead of 1 : 20. There are two possible solutions: 1) > library(car) > x <- 1:20 > y <- as.factor(recode(x, " 1:5='A'; 6:10='B'; 11:15='C'; 16:20='D' ")) > y [1] A A A A A B B B B B C C C C C D D D

[R] Recode issue

2009-10-22 Thread Nikhil Kaza
I am having trouble with the recode function that is provided in the CAR package. I trying to create a new factors based on existing factors. E.g. >x <- as.factor(1:20) >y <- recode(x, " 1:5='A'; 6:10='B'; 11:15='C'; 16:20='D' ") >y [1] A A A A A 6 7 8 9 A A A A A A A A A A A Levels: 6 7 8 9

[R] Linear Regression Model with GARCH errors

2009-10-22 Thread Ioana D
Hello I was wondering if there is any possibility of estimating a linear regression model with GARCH errors in R? I tried using fGarch library, but I could only find for instance how to estimate arma-garch models or similar combinations. Thank you, Ioana -- View this message in context: http:

[R] removing random effect from nlme or using varPower() in nls

2009-10-22 Thread Michael A. Gilchrist
Hello, I've been fitting a random effects model using nlme to some data, but I am discovering that the variation in my random effect is very small. As a result, I would like to replace it as a fixed effect (i.e. essentially fit the same model but with no random effect). As I understand it I

Re: [R] help sub setting data frame

2009-10-22 Thread Sean MacEachern
Works perfectly! Thanks to all who responded. Sean On Thu, Oct 22, 2009 at 6:24 PM, Ista Zahn wrote: > Is this what you want? > > df = data.frame('id'=c(1:100),'res'=c(1001:1100)) > dfb=df[1:10,] > dfc = df[df$id %in% dfb$id,] > > Still not sure, but that's my best guess. Going back to your ori

[R] dgTMatrix --- [, , drop=F] strange behavior, Matrix 0.999375-20

2009-10-22 Thread Jose Quesada
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I have something strange here... I want to subset a large sparse matrix, with the subset being still in sparse form. Easily achievable with mm[i,,drop=F] , right? Well, it doesn't work on the matrix I'm working on. This is a very large wikipedia

Re: [R] help sub setting data frame

2009-10-22 Thread Ista Zahn
Is this what you want? df = data.frame('id'=c(1:100),'res'=c(1001:1100)) dfb=df[1:10,] dfc = df[df$id %in% dfb$id,] Still not sure, but that's my best guess. Going back to your original data you can try dfb = chkPd[chkPd$PN %in% df$PN,] Hope it helps, Ista On Thu, Oct 22, 2009 at 6:10 PM, Sea

Re: [R] help sub setting data frame

2009-10-22 Thread Sean MacEachern
Hi Ista, I think I'm suffering long dayitis myself. You are probably right. I don't use subset that often. I typically use brackets to subset dataframes. Essentially what I am trying to do is take my original dataframe (chkPd) and subset it using a smaller dataframe with some matching PN IDs. They

Re: [R] help sub setting data frame

2009-10-22 Thread Ista Zahn
Hi Sean, Comment in line below. On Thu, Oct 22, 2009 at 5:39 PM, Sean MacEachern wrote: > Hi, > > I'm running into a problem subsetting a data frame that I have never > encountered before: > >> dim(chkPd) > [1] 3213    6 > >> df = head(chkPd) >> df >               PN        WB      Sire     Dam  

Re: [R] Automatization of non-linear regression

2009-10-22 Thread Douglas Bates
Alternatively you could install the NRAIA package and collapse the construction of the plot to a call to plotfit as shown in the enclosed. Note that this is a poor fit of a logistic growth model. There are no data values beyond the inflection point so the Asym parameter (the asymptote) is poorly

[R] help sub setting data frame

2009-10-22 Thread Sean MacEachern
Hi, I'm running into a problem subsetting a data frame that I have never encountered before: > dim(chkPd) [1] 32136 > df = head(chkPd) > df PNWB Sire Dam MG SEX 601 1001 715349 61710 61702 67F 969 1001_1 511092 616253 615037 168F 986 1

Re: [R] PDF too large, PNG bad quality

2009-10-22 Thread Greg Snow
For getting the details in the outer points, here is what I do. 1. use hexbin to create the big central blob (but with additional info). 2. use the chull function to find the outer points and save their indices in another vector 3. use chull on the rest of the points (excluding those found prev

Re: [R] tapply with multiple arguments that are not part of the same data frame

2009-10-22 Thread Kavitha Venkatesan
I just realized my earlier post of my question below was not in "Plain" Text mode, hence the repeat post...apologies! Kavitha On Thu, Oct 22, 2009 at 4:19 PM, Kavitha Venkatesan wrote: > Hi all, > > I would like to invoke a function that takes multiple arguments (some of > which are specified co

Re: [R] PDF too large, PNG bad quality

2009-10-22 Thread Barry Rowlingson
On Thu, Oct 22, 2009 at 8:28 PM, Greg Snow wrote: > The problem with the pdf files is that they are storing the information for > every one of your points, even the ones that are overplotted by other points. >  The png file is smaller because it only stores information on which color > each pix

[R] URGENT helo re-beggining with R

2009-10-22 Thread Jose Narillos de Santos
Hi all, I have re-begging to use R. I need to using a matrix Y and X with the first row been the name to get a ols regression and to plot a two elements graph...on the top the scattergraph and the line representing the regressiónbelow the resids...at the same time I want to plot with small li

Re: [R] Temperature Prediction Model

2009-10-22 Thread Clint Bowman
Aneeta, If I understand the figure at this problem deals with sensors in a lab that is probably isolated from outdoor temperature changes. I assume the predictive model must detect when a "rampaging 800 pound gorilla" messes with a sensor. Do w

[R] tapply with multiple arguments that are not part of the same data frame

2009-10-22 Thread Kavitha Venkatesan
Hi all, I would like to invoke a function that takes multiple arguments (some of which are specified columns in the data frame, and others that are independent of the data frame) on split parts of a data frame, how do I do this? For example, let's say I have a data frame >fitness_data name heigh

[R] intervals package dependence on R 2.9.0

2009-10-22 Thread Ross Boylan
I notice that the intervals package indicates a dependence on R >= 2.9.0. Is there some feature of R 2.9 that intervals depends on, or might it work with R 2.7.1, which I am running? Thanks. Ross Boylan __ R-help@r-project.org mailing list https://stat

Re: [R] data frame is killing me! help

2009-10-22 Thread Steve Lianoglou
Hi, On Oct 22, 2009, at 2:35 PM, bbslover wrote: Usage data(gasoline) Format A data frame with 60 observations on the following 2 variables. octane a numeric vector. The octane number. NIR a matrix with 401 columns. The NIR spectrum and I see the gasoline data to see below NIR.1686 nm NIR.1688

Re: [R] Bayesian regression stepwise function?

2009-10-22 Thread Rolf Turner
On 23/10/2009, at 8:20 AM, Peter Flom wrote: Frank E Harrell Jr wrote Ben Bolker wrote: Allan.Y wrote: Hi everyone, I am wondering if there exists a stepwise regression function for the Bayesian regression model. I tried googling, but I couldn't find anything. I know "step" function

[R] data frame is killing me! help

2009-10-22 Thread bbslover
Usage data(gasoline) Format A data frame with 60 observations on the following 2 variables. octane a numeric vector. The octane number. NIR a matrix with 401 columns. The NIR spectrum and I see the gasoline data to see below NIR.1686 nm NIR.1688 nm NIR.1690 nm NIR.1692 nm NIR.1694 nm NIR.1

Re: [R] Automatization of non-linear regression

2009-10-22 Thread Peter Ehlers
Joel, The following should answer most of your questions: time <- c(seq(0,10),seq(0,10),seq(0,10)) plant <- c(rep(1,11),rep(2,11),rep(3,11)) severity <- c( 42,51,59,64,76,93,106,125,149,171,199, 40,49,58,72,84,103,122,138,162,187,209, 41,49,57,71,89,112,146,174,218,

Re: [R] Intersection an Sum between list and matrix

2009-10-22 Thread Romildo Martins
Sorry... example 2 was error! 2009/10/22 Romildo Martins > Hello, > > I need to do an intersection between the list elements (partitionslist) and > the columns and rows of a matrix (mm), so that the result will be the sums > of the rows and columns. > > > Thanks a lot, > > Romildo Martins > > Ex

Re: [R] PDF too large, PNG bad quality

2009-10-22 Thread Greg Snow
The problem with the pdf files is that they are storing the information for every one of your points, even the ones that are overplotted by other points. The png file is smaller because it only stores information on which color each pixel should be, not how many points contributed to a particul

[R] Intersection an Sum between list and matrix

2009-10-22 Thread Romildo Martins
Hello, I need to do an intersection between the list elements (partitionslist) and the columns and rows of a matrix (mm), so that the result will be the sums of the rows and columns. Thanks a lot, Romildo Martins Example 1.The Intersection and sum betweeen partitionslist[[1]][[2]] and mm is i

Re: [R] Simple extraction of level,x,y from contourLines()

2009-10-22 Thread Alberto Monteiro
Ted Harding asked: > > I can of course get these individually with, for the 5th one for > instance, > > C.W[[5]]$level > C.W[[5]]$x > C.W[[5]]$y > > But I can't see how to obtain, in one line and without running > a nasty loop, to get all the levels at once! > > In other words, I'm looking

Re: [R] Bayesian regression stepwise function?

2009-10-22 Thread Peter Flom
Frank E Harrell Jr wrote >Ben Bolker wrote: >> >> >> Allan.Y wrote: >>> Hi everyone, >>> >>> I am wondering if there exists a stepwise regression function for the >>> Bayesian regression model. I tried googling, but I couldn't find >>> anything. I know "step" function exists for regular stepwi

Re: [R] PDF too large, PNG bad quality

2009-10-22 Thread Benilton Carvalho
Dear Lasse, This won't answer your specific questions and I apologize for that. AFAIK, pdf() produces uncompressed PDFs only. But you could use tools like pdftk to compress your PDFs. About the PNGs, you can always set the 'res' argument to improve resolution, but it won't beat the PDFs.

Re: [R] Diffusion of particles inside a sphere

2009-10-22 Thread cls59
carferper wrote: > > Hello veryone, > > I am interested in the diffusion of particles inside a sphere, and its > release through a small pore on the sphere surface. Unfortunately, I have > not found the way to do this in R. Could you help me? > > Thank very much in advance for your help > >

Re: [R] What happen for Negative binomial link in Lmer fonction?

2009-10-22 Thread Douglas Bates
On Thu, Oct 22, 2009 at 1:39 PM, Ben Bolker wrote: > ROBARDET Emmanuelle wrote: >> >> Dear R users, >> I'm performing some GLMMs analysis with a negative binomial link. >> I already performed such analysis some months ago with the lmer() function >> but when I tried it today I encountered this pr

Re: [R] Simple extraction of level,x,y from contourLines()

2009-10-22 Thread Ted Harding
On 22-Oct-09 19:03:06, Duncan Murdoch wrote: > On 22/10/2009 2:57 PM, (Ted Harding) wrote: >> A follow-up to my previous query. >> >> Say one of the results returned by contourLines() is >> >> C.W <- contourLines() >> >> Then C.W is a list of (in this case 28) lists, >> each of which is a

Re: [R] Bayesian regression stepwise function?

2009-10-22 Thread Frank E Harrell Jr
Ben Bolker wrote: Allan.Y wrote: Hi everyone, I am wondering if there exists a stepwise regression function for the Bayesian regression model. I tried googling, but I couldn't find anything. I know "step" function exists for regular stepwise regression, but nothing for Bayes. Why? That

[R] PDF too large, PNG bad quality

2009-10-22 Thread Lasse Kliemann
I wish to save a scatter plot comprising approx. 2 million points in order to include it in a LaTeX document. Using 'pdf(...)' produces a file of size about 20 MB, which is useless. Using 'cairo_pdf(...)' produces a smaller file, around 3 MB. This is still too large. Not only that the document

Re: [R] Simple extraction of level,x,y from contourLines()

2009-10-22 Thread Duncan Murdoch
On 22/10/2009 2:57 PM, (Ted Harding) wrote: A follow-up to my previous query. Say one of the results returned by contourLines() is C.W <- contourLines() Then C.W is a list of (in this case 28) lists, each of which is a list with components $level (a single number), $x (the x coords of th

Re: [R] contour() & contourLines()

2009-10-22 Thread Ted Harding
Hi Peter! Many thanks -- I had overlooked that line. Ted. On 22-Oct-09 18:53:25, Peter Ehlers wrote: > Hi Ted, > > Here's what the last example in ?contour says: > > "## contourLines produces the same contour lines as contour" > > So, even without digging into the source, I would guess > that

[R] Simple extraction of level,x,y from contourLines()

2009-10-22 Thread Ted Harding
A follow-up to my previous query. Say one of the results returned by contourLines() is C.W <- contourLines() Then C.W is a list of (in this case 28) lists, each of which is a list with components $level (a single number), $x (the x coords of the points on a contour at that level) and $y (t

Re: [R] contour() & contourLines()

2009-10-22 Thread Peter Ehlers
Hi Ted, Here's what the last example in ?contour says: "## contourLines produces the same contour lines as contour" So, even without digging into the source, I would guess that your hunch is correct. Cheers, Peter Ehlers (Ted Harding) wrote: Hi Folks, I have been using contour() to produce

Re: [R] help regarding creating package for GUI

2009-10-22 Thread Liviu Andronic
On 10/22/09, Peter Ehlers wrote: > But as to your query: perhaps you could get some ideas from > the Greg Snow's TeachingDemos package. > Also, check the related Rcmdr plug-in [1]. Liviu [1] http://cran.r-project.org/web/packages/RcmdrPlugin.TeachingDemos/index.html ___

Re: [R] What happen for Negative binomial link in Lmer fonction?

2009-10-22 Thread Ben Bolker
ROBARDET Emmanuelle wrote: > > Dear R users, > I'm performing some GLMMs analysis with a negative binomial link. > I already performed such analysis some months ago with the lmer() function > but when I tried it today I encountered this problem: > Erreur dans famType(glmFit$family) : unknown GL

Re: [R] Bayesian regression stepwise function?

2009-10-22 Thread Ben Bolker
Allan.Y wrote: > > Hi everyone, > > I am wondering if there exists a stepwise regression function for the > Bayesian regression model. I tried googling, but I couldn't find > anything. I know "step" function exists for regular stepwise regression, > but nothing for Bayes. > Why? That seem

Re: [R] arima crashes too

2009-10-22 Thread Barry Rowlingson
On Thu, Oct 22, 2009 at 6:19 PM, Alberto Monteiro wrote: > Another pathological test. > > arima does not crash for that series that crashes arma: > > arima(c(2.01, 2.22, 2.09, 2.17, 2.42), order=c(1,0,0)) > > However, arima crashes for this: > > arima(c(1.71, 1.78, 1.95, 1.59, 2.13), order=c(1,0,0

[R] contour() & contourLines()

2009-10-22 Thread Ted Harding
Hi Folks, I have been using contour() to produce some contour plots (of a spatially-smooted density produced by kde2d()), with very satisfactory results. I now want access to the coordinates of the points on the contours, and it would seem that contour() does not return a value, so there is nothin

Re: [R] Cairo package, png files within for loop are black?

2009-10-22 Thread Douglas Bates
On Thu, Oct 22, 2009 at 12:46 PM, Douglas M. Hultstrand wrote: > Hello, > > I am generating .png images using the Cairo package in a for loop (looping > on the number of zones, number of zones equals the number of plots to create > based on different zone data).   When  I run the R script the .png

Re: [R] loop vs. apply(): strange behavior with data frame?

2009-10-22 Thread Roberto Perdisci
Thanks for the suggestion. I found some documentation on why accessing a data.gram using the matrix notation (e.g., [i,j]) is so expensive, which was the cause of the problem. regards, Roberto On Thu, Oct 22, 2009 at 12:05 AM, Jim Holtman wrote: > try running Rprof on the two examples to see

[R] How to find moving averages within each subgroup of a data frame

2009-10-22 Thread clair.crossup...@googlemail.com
Dear all, If I have the following data frame: > set.seed(21) > df1 <- data.frame(col1=c(rep('a',5), rep('b',5), rep('c',5)), > col4=rnorm(1:15)) col1 col4 1 a 0.793013171 2 a 0.522251264 3 a 1.74641 4 a -1.271336123 5 a 2.197389533 6 b 0.433130777 7

[R] Bayesian regression stepwise function?

2009-10-22 Thread Allan.Y
Hi everyone, I am wondering if there exists a stepwise regression function for the Bayesian regression model. I tried googling, but I couldn't find anything. I know "step" function exists for regular stepwise regression, but nothing for Bayes. Thanks -- View this message in context: http://

[R] Cairo package, png files within for loop are black?

2009-10-22 Thread Douglas M. Hultstrand
Hello, I am generating .png images using the Cairo package in a for loop (looping on the number of zones, number of zones equals the number of plots to create based on different zone data). When I run the R script the .png files are created but they are all black? If I comment out the for

Re: [R] help regarding creating package for GUI

2009-10-22 Thread Peter Ehlers
Well, I wonder which 'Sister' you're thinking of. I can think of more than a few ... Sarah? Ulrike? Heather? ... And I'm not so sure God would bless an old sinner like me. But as to your query: perhaps you could get some ideas from the Greg Snow's TeachingDemos package. -Peter Ehlers SANKET J

[R] arima crashes too

2009-10-22 Thread Alberto Monteiro
Another pathological test. arima does not crash for that series that crashes arma: arima(c(2.01, 2.22, 2.09, 2.17, 2.42), order=c(1,0,0)) However, arima crashes for this: arima(c(1.71, 1.78, 1.95, 1.59, 2.13), order=c(1,0,0)) arima seems pretty consistent in its crashing behaviour, since crash

Re: [R] How to calculate the area under the curve

2009-10-22 Thread Frank E Harrell Jr
I'm not clear on why we are emphasizing the trapezoidal rule when the Wilcoxon approach gives you everything plus a standard error. Frank Ravi Varadhan wrote: I assume that you have an ordered pair (x, y) data, where x = sensitivity, and y = 1 - specificity. Your `x' values may or may not b

Re: [R] Simple question, I think

2009-10-22 Thread Chuck Cleland
On 10/22/2009 12:37 PM, David Kaplan wrote: > Greetings, > > I am recoding a dummy variable (coded 1,0) so that 0 = 2. I am using > the line > > sciach$dummyba[sciach$ba==0] <- 2 > > I notice that it creates a new column dummyba, with 0 coded as 2 but > with 1's now coded as NA. Is there a sim

Re: [R] Simple question, I think

2009-10-22 Thread Kevin E. Thorpe
David Kaplan wrote: Greetings, I am recoding a dummy variable (coded 1,0) so that 0 = 2. I am using the line sciach$dummyba[sciach$ba==0] <- 2 I notice that it creates a new column dummyba, with 0 coded as 2 but with 1's now coded as NA. Is there a simple way around this in the line I am

[R] arma crashing

2009-10-22 Thread Alberto Monteiro
Function arma is crashing in some (pathological, but crashing is never good) cases. For example: library(tseries) arma(c(2.01, 2.22, 2.09, 2.17, 2.42), order=c(1,0)) I came to that pathological series while doing test cases; probably there are crashing cases with longer series. Alberto Montei

Re: [R] Simple question, I think

2009-10-22 Thread Henrique Dallazuanna
Use ifelse: sciach$dummyba <- ifelse(sciach$ba == 0, 2, 1) On Thu, Oct 22, 2009 at 2:37 PM, David Kaplan wrote: > Greetings, > > I am recoding a dummy variable (coded 1,0) so that 0 = 2.  I am using the > line > > sciach$dummyba[sciach$ba==0] <- 2 > > I notice that it creates a new column dummyb

[R] Simple question, I think

2009-10-22 Thread David Kaplan
Greetings, I am recoding a dummy variable (coded 1,0) so that 0 = 2. I am using the line sciach$dummyba[sciach$ba==0] <- 2 I notice that it creates a new column dummyba, with 0 coded as 2 but with 1's now coded as NA. Is there a simple way around this in the line I am using, or do I need

Re: [R] Boxplot with grouped data

2009-10-22 Thread Paul Smith
On Thu, Oct 22, 2009 at 5:31 PM, Jakson A. Aquino wrote: >> Is there some way of drawing a boxplot, with R, when one does not have >> the original continuous data, but only the data grouped in classes? >> The function boxplot() can only deal with original data. > > Do you mean a numeric vector gro

Re: [R] Boxplot with grouped data

2009-10-22 Thread Jakson A. Aquino
On Thu, Oct 22, 2009 at 04:36:22PM +0100, Paul Smith wrote: > Is there some way of drawing a boxplot, with R, when one does not have > the original continuous data, but only the data grouped in classes? > The function boxplot() can only deal with original data. Do you mean a numeric vector grouped

[R] help regarding creating package for GUI

2009-10-22 Thread SANKET JANEWOO
Hello Brothers/Sister, I am trying to create a GUI for some formulas in R using tcltk and then convert them into R package . Can anyone please tell me how to create a package having GUI capabilities in it. I would be thankful if somebody can help me.May god bless every one

[R] What happen for Negative binomial link in Lmer fonction?

2009-10-22 Thread ROBARDET Emmanuelle
Dear R users, I'm performing some GLMMs analysis with a negative binomial link. I already performed such analysis some months ago with the lmer() function but when I tried it today I encountered this problem: Erreur dans famType(glmFit$family) : unknown GLM family: 'Negative Binomial' Does anyone

Re: [R] Boxplot with grouped data

2009-10-22 Thread Peter Flom
Paul Smith wrote > >Is there some way of drawing a boxplot, with R, when one does not have >the original continuous data, but only the data grouped in classes? >The function boxplot() can only deal with original data. It's not clear how the data are, now. What are the classes? Are they numbers?

[R] Boxplot with grouped data

2009-10-22 Thread Paul Smith
Dear All, Is there some way of drawing a boxplot, with R, when one does not have the original continuous data, but only the data grouped in classes? The function boxplot() can only deal with original data. Thanks in advance, Paul __ R-help@r-project.o

Re: [R] Replacing multiple elements in a vector !

2009-10-22 Thread Henrique Dallazuanna
Try this: merge(rs.id, snp.id, by.x = 1, by.y = 2)$V2 or: with(snp.id, V2[match(rs.id, V3)]) On Thu, Oct 22, 2009 at 12:12 PM, Praveen Surendran wrote: > Hi, > > > > I have a vector with elements > > > > rs.id=c('rs100','rs101','rs102','rs103') > > > > And a dataframe 'snp.id' > > > > 1      

Re: [R] Replacing multiple elements in a vector !

2009-10-22 Thread Steve Lianoglou
Hi, On Oct 22, 2009, at 10:12 AM, Praveen Surendran wrote: Hi, I have a vector with elements rs.id=c('rs100','rs101','rs102','rs103') And a dataframe 'snp.id' 1 SNP_100 rs100 2 SNP_101 rs101 3 SNP_102 rs102 4

Re: [R] glm.fit to use LAPACK instead of LINPACK

2009-10-22 Thread Ravi Varadhan
Ted, LAPACK is newer and is supposed to contain better algorithms than LINPACK. It is not true that LAPACK cannot handle rank-deficient problems. It can. However, I do not know if using LAPACK in glm.fit instead of LINPACK would be faster and/or more memory efficient. Ravi.

Re: [R] How to calculate the area under the curve

2009-10-22 Thread Tom Fletcher
See package ROCR. Then see ?performance; in the details, it describes a measure of auc. Tom Fletcher -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of olivier.abz Sent: Thursday, October 22, 2009 9:23 AM To: r-help@r-project.org Sub

Re: [R] How to calculate the area under the curve

2009-10-22 Thread Ravi Varadhan
I assume that you have an ordered pair (x, y) data, where x = sensitivity, and y = 1 - specificity. Your `x' values may or may not be equally spaced. Here is how you could solve your problem. I show this with an example where we can compute the area-under the curve exactly: # Area under the

Re: [R] How to calculate the area under the curve

2009-10-22 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of olivier.abz > Sent: Thursday, October 22, 2009 7:23 AM > To: r-help@r-project.org > Subject: [R] How to calculate the area under the curve > > > Hi all, > > I would like to c

Re: [R] How to calculate the area under the curve

2009-10-22 Thread Sebastien Bihorel
Well, you can use the trapezoidal rule to numerically calculate any area under the curve. I don't know if a specific exists but you could create one. The principle is basically to compute the area between two successive points of your profile with: AREA=0.5*(Response1 + Response2)/(Time2-Time1)

Re: [R] How to calculate the area under the curve

2009-10-22 Thread Frank E Harrell Jr
olivier.abz wrote: Hi all, I would like to calculate the area under the ROC curve for my predictive model. I have managed to plot points giving me the ROC curve. However, I do not know how to get the value of the area under. Does anybody know of a function that would give the result I want usi

Re: [R] glm.fit to use LAPACK instead of LINPACK

2009-10-22 Thread Ted
Hi, I understand that the glm.fit calls LINPACK fortran routines instead of LAPACK because it can handle the 'rank deficiency problem'. If my data matrix is not rank deficient, would a glm.fit function which runs on LAPACK be faster? Would this be worthwhile to convert glm.fit to use LAPACK? H

Re: [R] how to create a new data type

2009-10-22 Thread cls59
Markus Weisner-2 wrote: > > I am working on a new package to do fire department analysis. I am > working > with emergency dispatch data from different agencies that all contain the > same information but have slightly different formats. Typically the > variable names and date-time formats are

Re: [R] Diffusion of particles inside a sphere

2009-10-22 Thread Ravi Varadhan
Hi, You need to be a lot more specific about what you want. Are you trying to solve a partial differential equation (PDE) in time and space, in spherical coordinates? Do you have a closed form solution that provides the values of the dependent variable (e.g. concentration or temperature) as a

[R] How to calculate the area under the curve

2009-10-22 Thread olivier.abz
Hi all, I would like to calculate the area under the ROC curve for my predictive model. I have managed to plot points giving me the ROC curve. However, I do not know how to get the value of the area under. Does anybody know of a function that would give the result I want using an array of speci

[R] Replacing multiple elements in a vector !

2009-10-22 Thread Praveen Surendran
Hi, I have a vector with elements rs.id=c('rs100','rs101','rs102','rs103') And a dataframe 'snp.id' 1 SNP_100 rs100 2 SNP_101 rs101 3 SNP_102 rs102 4 SNP_103 rs103 Task is

[R] sunflowerplot - digits parameter separate for x and y values?

2009-10-22 Thread Rainer M Krug
Hi I have a sunflowerplot, in which the x and y axis cover different ranges (different orders of magnitude). Is it possible to specify different "digits" for the x and y axis? Rainer -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Cen

Re: [R] Normality test

2009-10-22 Thread Duncan Murdoch
On 10/22/2009 9:48 AM, rkevinbur...@charter.net wrote: I am having a hard time interpreting the results of the 'shapiro.test' for normality. If I do ?shapiro.test I see two examples using rnorm and runif. When I run the test using rnorm I get a wide variation of results. Most of this may be fr

Re: [R] Putting names on a ggplot

2009-10-22 Thread John Kane
--- On Tue, 10/20/09, hadley wickham wrote: > From: hadley wickham > Subject: Re: [R] Putting names on a ggplot > To: "John Kane" > Cc: m...@z107.de, "R R-help" > Received: Tuesday, October 20, 2009, 10:59 AM > On Sun, Oct 18, 2009 at 10:29 AM, > John Kane > wrote: > > Thanks Stefan, the an

  1   2   >