[R] mle2(): logarithm of negative pdfs

2008-07-23 Thread Zornitsa Luleva
Hi, In order to use the mle2-function, one has to define the likelihood function itself. As we know, the likelihood function is a sum of the logarithm of probability density functions (pdf). I have implemented myself the pdfs that I am using. My problem is, that the pdfs values are negative and I

Re: [R] Editor for Mac

2008-07-23 Thread Hans-Peter Suter
> Thanks for the answers, > but I'm looking for an editor like Tinn-R. What about VM Fusion and continue to use Tinn-R then? -- Regards, Hans-Peter PS: I use TextMate (and like it) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/lis

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-23 Thread Mark Difford
Hi All, It really comes down to a question of attitude: you either want to learn something fundamental or core and so bootstrap yourself to a "better" place (at least away from where you are), or you don't. As Marc said, Michal seems to have erected a wall around his thinking. I don't think it's

Re: [R] mle2(): logarithm of negative pdfs

2008-07-23 Thread Patrizio Frederic
this is an off-topic, of course! by definition, pdf MUST BE POSITIVE and log function is defined ONLY for positive values. check your pdf code and find out the errors. regards Patrizio Frederic +- | Patrizio Frederic | Research associate in Statis

[R] Combining 4th column from 30 files

2008-07-23 Thread Daren Tan
Better approach than this brute force ? mm <- NULL for (i in dir(pattern="data")) { m <- readTable(i); mm <- cbind(mm, m[,4]) } _ [[alternative HTML version deleted]] __ R-help@

Re: [R] S4 : setGeneric for classical methods

2008-07-23 Thread Martin Maechler
> "CG" == Christophe Genolini <[EMAIL PROTECTED]> > on Tue, 22 Jul 2008 19:04:37 +0200 writes: CG> Prof Brian Ripley <[EMAIL PROTECTED]> a écrit : >> On Tue, 22 Jul 2008, [EMAIL PROTECTED] wrote: >> >>> Hi the list (well, half of the list, only the one who >>> ar

Re: [R] scatter plot using ggplot

2008-07-23 Thread ONKELINX, Thierry
Dear Megh, You need to use the ggplot2 package instead of ggplot. Use the size argument in geom_point() to get bigger circles. Have a look at Hadley's website for more info (and examples) on ggplot2: http://had.co.nz/ggplot2/ library(ggplot2) library(mnormt) Sigma = matrix(c(1, 0.6, 0.6, 1), 2,

Re: [R] F test

2008-07-23 Thread Peter Dalgaard
Vicki Meng wrote: --- On Tue, 7/22/08, Peter Dalgaard <[EMAIL PROTECTED]> wrote: From: Peter Dalgaard <[EMAIL PROTECTED]> Subject: Re: [R] F test To: [EMAIL PROTECTED] Cc: r-help@r-project.org Date: Tuesday, July 22, 2008, 11:51 PM Vicki Meng wrote: Dear R users, I need to do a F test on

Re: [R] experimental semivariogram

2008-07-23 Thread ONKELINX, Thierry
Alessandro, Have a look at the gstat package. library(gstat) demo(examples) demo(krige) HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biomet

Re: [R] Indicator Kriging?

2008-07-23 Thread ONKELINX, Thierry
Sascha, Have a look at ?krige in the gstat package. HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg /

[R] maximum likelihood method to fit a model

2008-07-23 Thread silvia narduzzi
Dear R users, I use the glm() function to fit a generalized linear model with gamma distribution function and log link. I have read in the help page that the default method used by R is "glm.fit" (iteratively reweighted least squares, IWLS). Is it possible to use maximum likelihood method? Than

Re: [R] rpart confidence intervals?

2008-07-23 Thread Richard Pearson
Hi RichardP I guess you'll increase your chances of a response if you include some affiliation info. This could also avoid getting you confused with other people - I thought for a minute I'd been sleep-emailing :-) Cheers A N Other RichardP RichardP wrote: hi, I am using rpart with a cont

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-23 Thread Gustaf Rydevik
On Wed, Jul 23, 2008 at 4:54 AM, Michal J. Figurski <[EMAIL PROTECTED]> wrote: > Dear all, > > Since you guys are frank, let me be frank as well. I did not ask anyone to > impose on me their point of view on bootstrap. It's my impression that this is > what you guys are trying to do - that's sad. S

Re: [R] How to simulate heteroscedasticity (correlation)

2008-07-23 Thread Patrizio Frederic
> Now I also want to generate two correlated variables where the error > variance vary over the variable-correlation. > And I want to plot this for showing heteroscedasticity. > > Like shown here: > http://upload.wikimedia.org/wikipedia/de/1/1b/Heteroske2.png > > Is that possible with R? > of cour

[R] par() function does not work

2008-07-23 Thread Fabio Sanchez
Dear R-nautes, I installed the 2.7.1 version of R and found it is not possible to modify graphical parameters with par(). for example; > par(mfrow=c(2,2)) Error in c(2, 2) : unused argument(s) (2) > par$mfrow NULL Does any one know what is the cause of this problem? Regards, Fabio -- Fabio S

Re: [R] par() function does not work

2008-07-23 Thread john seers (IFR)
Hi Fabio Works OK for me. > par(mfrow=c(2,2)) > par("mfrow") [1] 2 2 > But then I am using Windows ... > sessionInfo() R version 2.7.1 (2008-06-23) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252

Re: [R] par() function does not work

2008-07-23 Thread Prof Brian Ripley
Did you start R with --vanilla to check that this is not something you have done? It is good practice, and I suspect will show you that you have mis-diagosed this problem. On Wed, 23 Jul 2008, Fabio Sanchez wrote: Dear R-nautes, I installed the 2.7.1 version of R and found it is not possibl

Re: [R] maximum likelihood method to fit a model

2008-07-23 Thread Prof Brian Ripley
On Wed, 23 Jul 2008, silvia narduzzi wrote: Dear R users, I use the glm() function to fit a generalized linear model with gamma distribution function and log link. I have read in the help page that the default method used by R is "glm.fit" (iteratively reweighted least squares, IWLS). Is it

Re: [R] par() function does not work

2008-07-23 Thread john seers (IFR)
Hi Fabio Have you used the name "c" for something else? Try typing in "c" at the command line, you should see something like: > c function (..., recursive = FALSE) .Primitive("c") Regards John --- for example; > par(mfrow=c(2,2)) Error in c(2, 2) : unused argument(s) (2) > par$mfr

Re: [R] maximum likelihood method to fit a model

2008-07-23 Thread Patrizio Frederic
dear Silvia, quoting Venables WN and Ripley DB (1994) Modern Applied Statistics with S-plus, sringer, pag 185: "Since explicit expressions for the maximum likelihood estimators are not usually available estimates MUST be calculate iteratively" means that glm.fit performs MLE indirectly and effici

Re: [R] par() function does not work

2008-07-23 Thread Henrique Dallazuanna
Perhaps you have a function called 'par' in your workspace. On Wed, Jul 23, 2008 at 6:56 AM, Fabio Sanchez <[EMAIL PROTECTED]> wrote: > Dear R-nautes, > > I installed the 2.7.1 version of R and found it is not possible to modify > graphical parameters with par(). > > for example; > >> par(mfrow=

Re: [R] Calculating Betweenness - Efficiency problem

2008-07-23 Thread Gabor Csardi
Senthil, sending a 12Mb file to the list is not a good idea. I've run the code in my previous email without any problem, so you need to be a bit more specific about what went wrong for you. This is what I get: > library(igraph) > tab <- read.csv("/tmp/Test.csv") > dim(tab) [1] 304711 2 > l

Re: [R] adding the mean and standard deviation to boxplots

2008-07-23 Thread jim holtman
?bxp This is the underlying routine called by boxplot and you can supply your own values to the 5 that define a boxplot. On Wed, Jul 23, 2008 at 2:24 AM, Fernando Marmolejo-Ramos <[EMAIL PROTECTED]> wrote: > > Dear users > > This is a message I was directing to Harold Baize but because I pressed

Re: [R] Combining 4th column from 30 files

2008-07-23 Thread Henrique Dallazuanna
Maybe: sapply(lapply(dir(pattern="data"), read.table), '[[', 4) On Wed, Jul 23, 2008 at 5:21 AM, Daren Tan <[EMAIL PROTECTED]> wrote: > > Better approach than this brute force ? > > mm <- NULL > for (i in dir(pattern="data")) { m <- readTable(i); mm <- cbind(mm, m[,4]) } > ___

Re: [R] par() function does not work

2008-07-23 Thread Duncan Murdoch
Fabio Sanchez wrote: Dear R-nautes, I installed the 2.7.1 version of R and found it is not possible to modify graphical parameters with par(). for example; par(mfrow=c(2,2)) Error in c(2, 2) : unused argument(s) (2) That's not an error from par(), it's an error from c(). I woul

Re: [R] How to....

2008-07-23 Thread Jim Lemon
On Tue, 2008-07-22 at 16:31 -0400, Jia Ying Mei wrote: > Hi everyone, > > I am not new to R, but its been over a year since I've used it, so I > don't remember how to do some things. > > I have a data set (in excel currently, but will be converted to text), > that has date, country and price, w

Re: [R] R package

2008-07-23 Thread Prof Brian Ripley
On Tue, 8 Jul 2008, Duncan Murdoch wrote: On 7/8/2008 10:53 AM, Sergi M.Garrido wrote: Hello, I have tried to create a package, and I have got it. I checked the files and I built the package. Nevertheless, I want a .pdf file with the package's documentation. Anyone know what I have to do?

Re: [R] maximum likelihood method to fit a model

2008-07-23 Thread Peter Dalgaard
silvia narduzzi wrote: Dear R users, I use the glm() function to fit a generalized linear model with gamma distribution function and log link. I have read in the help page that the default method used by R is "glm.fit" (iteratively reweighted least squares, IWLS). Is it possible to use maximum

Re: [R] Editor for Mac

2008-07-23 Thread stephen sefick
simultron On Wed, Jul 23, 2008 at 4:04 AM, Hans-Peter Suter <[EMAIL PROTECTED]> wrote: > > Thanks for the answers, > > but I'm looking for an editor like Tinn-R. > > What about VM Fusion and continue to use Tinn-R then? > > -- > Regards, > Hans-Peter > > PS: I use TextMate (and like it) > > _

Re: [R] par() function does not work

2008-07-23 Thread Fabio Sanchez
Thank you all, I accidentally loaded a variable named "c". All the best, Fabio On Wed, Jul 23, 2008 at 1:08 PM, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > Did you start R with --vanilla to check that this is not something you have > done? It is good practice, and I suspect will show you t

Re: [R] par() function does not work

2008-07-23 Thread Peter Dalgaard
Fabio Sanchez wrote: Dear R-nautes, I installed the 2.7.1 version of R and found it is not possible to modify graphical parameters with par(). for example; par(mfrow=c(2,2)) Error in c(2, 2) : unused argument(s) (2) par$mfrow NULL Does any one know what is the cause of thi

Re: [R] average replicate probe values

2008-07-23 Thread jim holtman
It would be helpful if you included a sample of the data so that we could understand what you would like to do with it (before/after pictures). ?aggregate On Tue, Jul 22, 2008 at 9:57 PM, Kaposi-Novak, Pal <[EMAIL PROTECTED]> wrote: > Hi, > > Could somebody tell me how I can average expression va

Re: [R] Decoding subscripts/superscripts from CSVs

2008-07-23 Thread Jim Lemon
On Tue, 2008-07-22 at 16:18 -0400, [EMAIL PROTECTED] wrote: > Hi, > > I have a CSV file with various biological reactions. Subscripts, superscripts, > and italics are encoded in carats, and I was wondering if R can actually > recognize those and print actual superscripts, etc. Here's an example: >

[R] Using RODBC to use SQL queries

2008-07-23 Thread Megan J Bellamy
Hello, I am new to the RODBC package, but I have looked over the PDF as well as a few websites that go over the SQL language. I can connect to my database fine using >channel<-odbcConnect("Oracle ODBC") # then am prompted to enter my user id and password After that I'd like to use the odbcQuery

[R] Simple... but...

2008-07-23 Thread Shubha Vishwanath Karanth
Hi R, If x=c(1,3,5) y=c(2,4,6) I need a vector which is c(1,2,3,4,5,6) from x and y. How do I do it? I mean the best way Thanks, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}} __ R-help@r-proje

[R] [Fwd: Re: Coefficients of Logistic Regression from bootstrap - how to get them?]

2008-07-23 Thread Michal Figurski
I think the argument supporting the use of bootstrap to determine coefficients, as opposed to just running linear regression on the whole dataset, is the comparison of Rsq and prediction errors between these two approaches - page 1502. There's a substantial difference in favor of the bootstrap app

Re: [R] Simple... but...

2008-07-23 Thread Henrique Dallazuanna
If I understand: sort(c(x,y)) or if you want combine the elements: as.vector(mapply(c, x, y)) On Wed, Jul 23, 2008 at 9:54 AM, Shubha Vishwanath Karanth <[EMAIL PROTECTED]> wrote: > Hi R, > > > > If > > x=c(1,3,5) > > y=c(2,4,6) > > > > I need a vector which is c(1,2,3,4,5,6) from x and y. >

Re: [R] Simple... but...

2008-07-23 Thread Doran, Harold
Shubba I'm confused. Your first post said the result should be c(1,2,3,4,5,6) when x and y are combined. The code I sent does that. But here you say your result should be c(4,1,2,5,2,3). What do you want your result to actually be? > -Original Message- > From: Shubha Vishwanath Karanth

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-23 Thread Michal Figurski
Thank you Gustaf, I apologize for not including an example data in my first email. Nevertheless, your code worked for me excellently - I only added "55" as the size of sample. I must admit this code looks so much simpler, compared to SAS. I am beginning to love R, despite some disrespectful

Re: [R] Simple... but...

2008-07-23 Thread Shubha Vishwanath Karanth
Guess this should be fine c(rbind(x,y)) Please let me know if there are some better ways... Thanks, Shubha -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shubha Vishwanath Karanth Sent: Wednesday, July 23, 2008 6:25 PM To: [EMAIL PROTECTED] Subje

Re: [R] Simple... but...

2008-07-23 Thread Doran, Harold
x <- c(1,3,5) y <- c(2,4,6) sort(c(x,y)) > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Shubha > Vishwanath Karanth > Sent: Wednesday, July 23, 2008 8:55 AM > To: [EMAIL PROTECTED] > Subject: [R] Simple... but... > > Hi R, > > > > If > >

Re: [R] Simple... but...

2008-07-23 Thread Wacek Kusnierczyk
Shubha Vishwanath Karanth wrote: > Hi R, > > > > If > > x=c(1,3,5) > > y=c(2,4,6) > > > > I need a vector which is c(1,2,3,4,5,6) from x and y. > > > > How do I do it? I mean the best way > > > the absolutely best way is: ?c vQ __ R-hel

Re: [R] adding the mean and standard deviation to boxplots

2008-07-23 Thread John Kane
This thread may help http://www.nabble.com/adding-the-mean-and-standard-deviation-to-boxplots-td15271398.html --- On Wed, 7/23/08, Fernando Marmolejo-Ramos <[EMAIL PROTECTED]> wrote: > From: Fernando Marmolejo-Ramos <[EMAIL PROTECTED]> > Subject: Re: [R] adding the mean and standard deviation to

Re: [R] Simple... but...

2008-07-23 Thread Mitchell Maltenfort
Z=NULL;for (i in 1:3) Z=c(Z,c(x[i],y[i])) On Wed, Jul 23, 2008 at 8:54 AM, Shubha Vishwanath Karanth <[EMAIL PROTECTED]> wrote: > Hi R, > > > > If > > x=c(1,3,5) > > y=c(2,4,6) > > > > I need a vector which is c(1,2,3,4,5,6) from x and y. > > > > How do I do it? I mean the best way > > > > Th

Re: [R] Simple... but...

2008-07-23 Thread Shubha Vishwanath Karanth
OK, Let x=c(4,2,2) y=c(1,5,3) My result should be c(4,1,2,5,2,3) Thanks, Shubha -Original Message- From: Doran, Harold [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2008 6:47 PM To: Shubha Vishwanath Karanth; [EMAIL PROTECTED] Subject: RE: [R] Simple... but... x <- c(1

Re: [R] Simple... but...

2008-07-23 Thread john seers (IFR)
This is definitely the best way: c(lapply(1:length(x), function(i, x, y) c(x[i], y[i]), x, y), recursive=TRUE) JS --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shubha Vishwanath Karanth Sent: 23 July 2008 13:55 To: [EMAIL PROTECTED] Sub

[R] Convert list of lists <--> data frame

2008-07-23 Thread Michael Friendly
For a function that takes an argument as a list of lists of parameters, I'd like to be able to convert that to a data.frame and vice versa, but can't quite figure out how. pats <- list(structure(list(shape = 0, shape.col = "black", shape.lty = 1, cell.fill = "white", back.fill = "white", labe

Re: [R] Simple... but...

2008-07-23 Thread Doran, Harold
How about this as.vector(t(cbind(x,y))) > -Original Message- > From: Shubha Vishwanath Karanth [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 23, 2008 9:17 AM > To: Doran, Harold; [EMAIL PROTECTED] > Subject: RE: [R] Simple... but... > > OK, > > Let x=c(4,2,2) > y=c(1,5,3) >

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-23 Thread Johannes Huesing
It seems you have accidentally hit a surgeons' mailing list where all you wanted was some advice how to use this scalpel on your body. Sorry if we can't be of any help without intimidating you with unrelated and pompous terms -- like coagulation. Michal J. Figurski <[EMAIL PROTECTED]> [Wed, Jul 23

Re: [R] Simple... but...

2008-07-23 Thread ONKELINX, Thierry
Something like sort(c(x, y)) should do the trick. HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Sec

Re: [R] Simple... but...

2008-07-23 Thread Berwin A Turlach
G'day Shubha, On Wed, 23 Jul 2008 18:24:49 +0530 "Shubha Vishwanath Karanth" <[EMAIL PROTECTED]> wrote: > Hi R, > > > > If > > x=c(1,3,5) > > y=c(2,4,6) > > > > I need a vector which is c(1,2,3,4,5,6) from x and y. > > > > How do I do it? I mean the best way R> as.vector(rbind

Re: [R] Simple... but...

2008-07-23 Thread Dimitris Rizopoulos
check the following: x <- c(1,3,5) y <- c(2,4,6) c(t(cbind(x, y))) c(matrix(c(x, y), 2, by = TRUE)) I hope it helps. Best, Dimitris Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16

Re: [R] Using RODBC to use SQL queries

2008-07-23 Thread Prof Brian Ripley
You should at least start with higher-level functions like sqlFetch(). Oh, and reading the posting guide (you show us no examples let alone error message) and the tests.R examples file which comes with RODBC. SQL syntax is DBMS-specific, so we can't comment on abstract examples (and it is a lo

Re: [R] Simple... but...

2008-07-23 Thread Jim Porzak
Hi Shubha, Assuming you are after ordering by position in x and y (and not values), how about as.vector(t(cbind(x, y))) HTH, Jim Porzak Responsys, Inc. San Francisco, CA http://www.linkedin.com/in/jimporzak On Wed, Jul 23, 2008 at 5:54 AM, Shubha Vishwanath Karanth <[EMAIL PROTECTED]> wrote: >

Re: [R] Simple... but...

2008-07-23 Thread Nutter, Benjamin
> x <- c(1,3,5) > y <- c(2,4,6) > xy <- sort(c(x,y)) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shubha Vishwanath Karanth Sent: Wednesday, July 23, 2008 8:55 AM To: [EMAIL PROTECTED] Subject: [R] Simple... but... Hi R, If x=c(1,3,5) y=c(2,4,6)

Re: [R] Simple... but...

2008-07-23 Thread Ted Harding
On 23-Jul-08 12:54:49, Shubha Vishwanath Karanth wrote: > Hi R, > If > x=c(1,3,5) > y=c(2,4,6) > > I need a vector which is c(1,2,3,4,5,6) from x and y. > How do I do it? I mean the best way > Thanks, Shubha Your query is ambiguous, in that it is not clear whether you want a) The elements of

Re: [R] Simple... but...

2008-07-23 Thread Gabor Grothendieck
Try c(rbind(x, y)) On Wed, Jul 23, 2008 at 8:54 AM, Shubha Vishwanath Karanth <[EMAIL PROTECTED]> wrote: > Hi R, > > > > If > > x=c(1,3,5) > > y=c(2,4,6) > > > > I need a vector which is c(1,2,3,4,5,6) from x and y. > > > > How do I do it? I mean the best way > > > > Thanks, Shubha > > > > Thi

Re: [R] Simple... but...

2008-07-23 Thread Gustaf Rydevik
On Wed, Jul 23, 2008 at 3:23 PM, Doran, Harold <[EMAIL PROTECTED]> wrote: > Shubba > > I'm confused. Your first post said the result should be c(1,2,3,4,5,6) > when x and y are combined. The code I sent does that. But here you say > your result should be c(4,1,2,5,2,3). > > What do you want your re

Re: [R] Simple... but...

2008-07-23 Thread Ben Bolker
Doran, Harold air.org> writes: > > Shubba > > I'm confused. Your first post said the result should be c(1,2,3,4,5,6) > when x and y are combined. The code I sent does that. But here you say > your result should be c(4,1,2,5,2,3). > > What do you want your result to actually be? > I think

Re: [R] Simple... but...

2008-07-23 Thread Wacek Kusnierczyk
Shubha Vishwanath Karanth wrote: > Hi R, > > > > If > > x=c(1,3,5) > > y=c(2,4,6) > > > > I need a vector which is c(1,2,3,4,5,6) from x and y. > > > > How do I do it? I mean the best way > > ... but seriously, rbind(x,y)[1:6] is one concise way to do it (x and y are bound into rows i

Re: [R] Using RODBC to use SQL queries

2008-07-23 Thread Albin Blaschka
Megan J Bellamy schrieb: > After that I'd like to use the odbcQuery function and the SQL statement: > > SELECT * FROM table_name WHERE SAMPLE_YEA LIKE "1965%" > According to the RODBC PDF, the odbcQuery command should accept any valid SQL statement. Is there something wrong with my syntax? I have

[R] sequential sum of a vector...

2008-07-23 Thread Shubha Vishwanath Karanth
Hi R, Let, x=1:80 I want to sum up first 8 elements of x, then again next 8 elements of x, then again another 8 elements. So, my new vector should look like: c(36,100,164,228,292,356,420,484,548,612) I used: aggregate(x,list(rep(1:10,each=8)),sum)[-1] or rowsum(x,group=r

Re: [R] Plotting Multiple lines on one plot

2008-07-23 Thread hadley wickham
The easiest way to do with this ggplot2 is to melt your data first: dfm <- melt(df, id = "date", measure = c("theta","vega","delta")) qplot(date, value, data=dfm, geom="line", colour = variable) Hadley On Tue, Jul 22, 2008 at 6:05 PM, R_Learner <[EMAIL PROTECTED]> wrote: > > Hi, > I'm trying to

Re: [R] Quantitative analysis of non-standard scatter plots.

2008-07-23 Thread Ben Bolker
Firas Swidan gmail.com> writes: > > Hi, > > I am having difficulties in finding ways to analyse scatter plots and > quantitatively differentiate between them. Try quantile regression, implemented in Roger Koenker's quantreg package. There's a very thorough vignette (library(quantreg); vig

Re: [R] [Fwd: Re: Coefficients of Logistic Regression from bootstrap - how to get them?]

2008-07-23 Thread Gustaf Rydevik
On Wed, Jul 23, 2008 at 3:14 PM, Michal Figurski <[EMAIL PROTECTED]> wrote: > I think the argument supporting the use of bootstrap to determine > coefficients, as opposed to just running linear regression on the whole > dataset, is the comparison of Rsq and prediction errors between these > two app

Re: [R] Simple... but...

2008-07-23 Thread Prof Brian Ripley
On Wed, 23 Jul 2008, Shubha Vishwanath Karanth wrote: If x=c(1,3,5) y=c(2,4,6) I need a vector which is c(1,2,3,4,5,6) from x and y. I am assuming that you want to interleave the vectors, but that is not the only algorithm giving that result. How do I do it? I mean the best way as.

Re: [R] How to....

2008-07-23 Thread Jia Ying Mei
Thank you very much. As for the second part, for every price change, the percentage of every price change can be calculated (i.e. amount of change divided by previous price). I was looking for a way to merely find the mean and median of all price change percentages for each country. I don't kno

Re: [R] Simple... but...

2008-07-23 Thread Wacek Kusnierczyk
it's clear, he wants to combine x and y s that the result is (x[1], y[1], x[2], y[2], ...), unless i am confused as well ;) now, both rbind(x,y)[1:length(x)] and as.vector(mapply(c,x,y)) do the job, but the former is *much* faster: t1 = function(n) as.vector(mapply(c, 1:n, 1:n)) t2 = function(n)

Re: [R] Convert list of lists <--> data frame

2008-07-23 Thread N. Lapidus
Not very elegant but seems to work: pats.df <- as.data.frame(t(sapply (1:length(pats), function (i) do.call(cbind,pats[[i]] colnames(pats.df) <- names(pats[[1]]) # then pats2 <- lapply (1:nrow(pats.df), function (i) as.list(t(pats.df)[,i])) Nael On Wed, Jul 23, 2008 at 3:23 PM, Michael Frie

[R] RES: Simple... but...

2008-07-23 Thread Leandro Marino
I thinks this is the solution that you want! as.vector(matrix(c(x,y),byrow=T,ncol=3)) -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nome de Wacek Kusnierczyk Enviada em: quarta-feira, 23 de julho de 2008 10:25 Para: R help Assunto: Re: [R] Simple... but... Shubha V

Re: [R] Simple... but...

2008-07-23 Thread Wacek Kusnierczyk
john seers (IFR) wrote: > > > > > This is definitely the best way: > > c(lapply(1:length(x), function(i, x, y) c(x[i], y[i]), x, y), > recursive=TRUE) > > > you'd better test it yourself; it simply won't do the job -- you get a list of vectors, no? (hint: replace the initial 'c' with 'unlis

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-23 Thread Gustaf Rydevik
On Wed, Jul 23, 2008 at 4:08 PM, Michal Figurski <[EMAIL PROTECTED]> wrote: > Gustaf, > > I am sorry, but I don't get the point. Let's just focus on predictive > performance from the cited passage, that is the number of values predicted > within 15% of the original value. > So, the predictive perfo

Re: [R] Convert list of lists <--> data frame

2008-07-23 Thread Henrique Dallazuanna
Try this: pats.df <- do.call(rbind, pats) On Wed, Jul 23, 2008 at 10:23 AM, Michael Friendly <[EMAIL PROTECTED]> wrote: > For a function that takes an argument as a list of lists of parameters, I'd > like to be able to convert that > to a data.frame and vice versa, but can't quite figure out how.

Re: [R] Simple... but...

2008-07-23 Thread Jorge Ivan Velez
Hi Shubha, Is this what you want? x=c(4,2,2) y=c(1,5,3) c(rbind(x,y)) [1] 4 1 2 5 2 3 HTH, Jorge On Wed, Jul 23, 2008 at 9:17 AM, Shubha Vishwanath Karanth < [EMAIL PROTECTED]> wrote: > OK, > > Let x=c(4,2,2) >y=c(1,5,3) > > My result should be c(4,1,2,5,2,3) > > Thanks, Shubha >

Re: [R] Convert list of lists <--> data frame

2008-07-23 Thread Marc Schwartz
on 07/23/2008 08:23 AM Michael Friendly wrote: For a function that takes an argument as a list of lists of parameters, I'd like to be able to convert that to a data.frame and vice versa, but can't quite figure out how. pats <- list(structure(list(shape = 0, shape.col = "black", shape.lty = 1,

Re: [R] sequential sum of a vector...

2008-07-23 Thread Patrizio Frederic
try this colSums(matrix(x,8)) regards, PF +- | Patrizio Frederic | Research associate in Statistics, | Department of Economics, | University of Modena and Reggio Emilia, | Via Berengario 51, | 41100 Modena, Italy | | tel: +39 059 205 6727 | fax:

Re: [R] Convert list of lists <--> data frame

2008-07-23 Thread Patrizio Frederic
try ?unlist it may help regards +- | Patrizio Frederic | Research associate in Statistics, | Department of Economics, | University of Modena and Reggio Emilia, | Via Berengario 51, | 41100 Modena, Italy | | tel: +39 059 205 6727 | fax: +39 059 2

Re: [R] sequential sum of a vector...

2008-07-23 Thread Shubha Vishwanath Karanth
Many Thanks Jorge... That was one more way...Is it possible if I can do this without using rep(1:10,each=8) or the groupingbecause I feel the number 8 here is fixed... If there is some technique of tracking the position of first 8, then next 8... don't know whether I am clear in conveying...

Re: [R] Convert list of lists <--> data frame

2008-07-23 Thread Ben Bolker
Michael Friendly yorku.ca> writes: > > For a function that takes an argument as a list of lists of parameters, > I'd like to be able to convert that > to a data.frame and vice versa, but can't quite figure out how. > [snip data] pats.df <- do.call("rbind",pats) pats2 <- apply(pats.df,1,

Re: [R] sequential sum of a vector...

2008-07-23 Thread Marc Schwartz
on 07/23/2008 09:03 AM Shubha Vishwanath Karanth wrote: Hi R, Let, x=1:80 I want to sum up first 8 elements of x, then again next 8 elements of x, then again another 8 elements. So, my new vector should look like: c(36,100,164,228,292,356,420,484,548,612) I used: a

Re: [R] sequential sum of a vector...

2008-07-23 Thread Richard . Cotton
> x=1:80 > > I want to sum up first 8 elements of x, then again next 8 elements of x, > then again another 8 elements. So, my new vector should look like: > > c(36,100,164,228,292,356,420,484,548,612) > > I used: > > aggregate(x,list(rep(1:10,each=8)),sum)[-1] > > or > > rowsum(x,group=r

Re: [R] sequential sum of a vector...

2008-07-23 Thread Jorge Ivan Velez
Dear Shubha, Try this: x=1:80 tapply(x,rep(1:10,each=8),sum) 1 2 3 4 5 6 7 8 9 10 36 100 164 228 292 356 420 484 548 612 HTH, Jorge On Wed, Jul 23, 2008 at 10:03 AM, Shubha Vishwanath Karanth < [EMAIL PROTECTED]> wrote: > Hi R, > > > > Let, > > > > x=1:80 > > > > I want to

[R] Using if, else statements

2008-07-23 Thread Robin Williams
Hi all, Again I have searched the net and so on, without finding an answer to this surely simple problem. A short bit of code would be appreciated. I have a object named `data' with the following column headings. Date, maxitemp, minitemp, admissions, d.o.w. Where d.o.w. is day of the week,

Re: [R] sequential sum of a vector...

2008-07-23 Thread William Revelle
At 7:33 PM +0530 7/23/08, Shubha Vishwanath Karanth wrote: Hi R, Let, x=1:80 I want to sum up first 8 elements of x, then again next 8 elements of x, then again another 8 elements. So, my new vector should look like: c(36,100,164,228,292,356,420,484,548,612) I used: aggregate(x,list(rep(1:10

Re: [R] sequential sum of a vector...

2008-07-23 Thread Henrique Dallazuanna
Maybe: tapply(x, gl(10, 8), sum) or unlist(lapply(split(x, gl(10, 8)), sum)) On Wed, Jul 23, 2008 at 11:03 AM, Shubha Vishwanath Karanth <[EMAIL PROTECTED]> wrote: > Hi R, > > > > Let, > > > > x=1:80 > > > > I want to sum up first 8 elements of x, then again next 8 elements of x, > then again a

Re: [R] Quantitative analysis of non-standard scatter plots.

2008-07-23 Thread Bogaso Cristofer
Have u checked skewness of data? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Firas Swidan Sent: 23 July 2008 18:38 To: r-help@r-project.org Subject: [R] Quantitative analysis of non-standard scatter plots. Hi, I am having difficulties in finding ways

Re: [R] Convert list of lists <--> data frame

2008-07-23 Thread Jorge Ivan Velez
Dear Michael, Perhaps, data.frame(do.call(rbind,lapply(pats,function(x) t(as.matrix(x,ncol=10) HTH, Jorge On Wed, Jul 23, 2008 at 9:23 AM, Michael Friendly <[EMAIL PROTECTED]> wrote: > For a function that takes an argument as a list of lists of parameters, I'd > like to be able to conv

Re: [R] sequential sum of a vector...

2008-07-23 Thread Gustaf Rydevik
On Wed, Jul 23, 2008 at 4:03 PM, Shubha Vishwanath Karanth <[EMAIL PROTECTED]> wrote: > Hi R, > > > > Let, > > > > x=1:80 > > > > I want to sum up first 8 elements of x, then again next 8 elements of x, > then again another 8 elements. So, my new vector should look like: > > c(36,100,164,228,29

[R] Time series reliability questions

2008-07-23 Thread John Theal
Hello all, I have been using R's time series capabilities to perform analysis for quite some time now and I am having some questions regarding its reliability. In several cases I have had substantial disagreement between R and other packages (such as gretl and the commercial EViews package). I

Re: [R] Convert list of lists <--> data frame

2008-07-23 Thread Marc Schwartz
on 07/23/2008 09:42 AM Henrique Dallazuanna wrote: Try this: pats.df <- do.call(rbind, pats) Henrique, Take note of the object that results from this: > do.call(rbind, pats) shape shape.col shape.lty cell.fill back.fill label label.size [1,] 0 "black" 1 "white" "white"

[R] How to control the memory?

2008-07-23 Thread rlearner309
Hi, I have a huge data set to deal with. Sometimes I got warning message about limitation of memory, sometimes R reads in the data but it is very slow. My question is, is there anything I can do to lift the memory limitation (I did memory.limit(4095), anything else I can do?). I know I can also

Re: [R] Convert list of lists <--> data frame

2008-07-23 Thread Henrique Dallazuanna
Oh, you are rigth Marc, thanks. Another option is: pats.df <- do.call(rbind.data.frame, pats) On Wed, Jul 23, 2008 at 1:10 PM, Marc Schwartz <[EMAIL PROTECTED]> wrote: > on 07/23/2008 09:42 AM Henrique Dallazuanna wrote: >> >> Try this: >> >> pats.df <- do.call(rbind, pats) > > Henrique, > > Tak

[R] Calling LISP programs in R

2008-07-23 Thread francogrex
I have written some programs in Common Lisp and I have been using SAS to pipe those programs to my lisp compiler in batch mode by using the %xlog and %xlst SAS commands. I wonder if there is in R a similar way to pipe commands to LISP so that all my work would be concentrated in R even when I have

[R] shQuote and cat

2008-07-23 Thread Vadim Organovich
Dear R-users, It is my understanding that cat(shQuote(a.string)) should print the origintal a.string. Is this right? I am not sure cat() correctly prints strings which are generated by triple-shQuote(): > shQuote(shQuote("a")) [1] "\"\\\"a\\\"\"" > cat(shQuote(shQuote(shQuote("a"))), '\n') "\"\

[R] Warning message in if else statement

2008-07-23 Thread Monica Pisica
Hi, I am using an if else statement inside a function …. If I use that function I have no problems …. If I use the function with the if else statement inside a second function I get the following waring: Warning message: In if (pval == 0) p_value <- "< 2.2e-16" else p_value <- pval : the con

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-23 Thread Michal Figurski
Thank you all for your words of wisdom. I start getting into what you mean by bootstrap. Not surprisingly, it seems to be something else than I do. The bootstrap is a tool, and I would rather compare it to a hammer than to a gun. People say that hammer is for driving nails. This situation is a

Re: [R] sequential sum of a vector...

2008-07-23 Thread denise xifaras
Dear Patrizio and all, Do you know a similar approach to this, so that *any* function is sequentially applied on a matrix? Particularly, instead of wanting to sum columns every 8 rows, how could we apply a linear regression to the columns of a matrix every 8 rows? ie, if we have a matrix say of

[R] Flip Matrix form file?

2008-07-23 Thread Chris82
Hello, I have a problem to flip a 200x200 matrix, which is imported by a .asc file. I want to flip the matrix like in a created example below: > b <- matrix(1:9,3,3,byrow=T) > b [,1] [,2] [,3] [1,]123 [2,]456 [3,]789 > b1 <- apply(t(b),1,rev) > b1

Re: [R] Using if, else statements

2008-07-23 Thread jim holtman
You would have something that looks like this: if (data$d.o.w == "Sat") data$admission <- round(data$admission * 1.21) if (data$d.o.w == "Sun") ... On Wed, Jul 23, 2008 at 11:44 AM, Robin Williams <[EMAIL PROTECTED]> wrote: > Hi all, > > Again I have searched the net and so on, without find

Re: [R] Using if, else statements

2008-07-23 Thread jim holtman
My fingers slipped on the keyboard. Here what they intended to write. This sets up a list of the data and the matches on a subset for processing days <- list(list("Sat", 1.21), list("Sun", 1.22), list("Mon", 0.91)) for (i in days){ .subset <- data$d.o.w == i[[1]] # subset of data that matc

  1   2   >