Re: [R] JSS Volume 18 (www.jstatsoft.org)
Jan de Leeuw wrote: Special Volume on Spectroscopy and Chemometrics in R Guest Edited by Katharine M. Mullen and Ivo H.M. van Stokkum 11 contributions, with software packages and examples Similar volumes on R in Psychometrics (guest edited by Jan de Leeuw) and R in Political Methodology (guest edited by Micah Altman and Simon Jackman) are close to being finished. Additional volumes are being worked on. Proposals for volumes are welcome. [...] Dear useRs and developeRs, one of the additional volumes is Ecology and Ecological Modelling in R Please note that the deadline will end next week (2007-02-15). We have already a handful interesting papers in review and some more announcements, and a few more high-quality contributions are, of course, welcome. More information, see: http://wiki.r-project.org/rwiki/doku.php?id=misc:r_in_ecology_and_ecological_modelling Thomas Petzoldt and Thomas Kneib, guest editors -- Thomas Petzoldt Technische Universitaet Dresden Institut fuer Hydrobiologie[EMAIL PROTECTED] 01062 Dresden http://tu-dresden.de/hydrobiologie/ GERMANY __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] writing a fomated matrix
Hi R-gurus, I have a 1000x1000 matrix and I would like to write it in a ASC file, where each row from my matrix are written in a separated line. I tryed write() function, but it don´t work fine to me. any idea? Kind regards, Miltinho __ [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] writing a fomated matrix
Milton Cezar Ribeiro wrote: I have a 1000x1000 matrix and I would like to write it in a ASC file, where each row from my matrix are written in a separated line. I tryed write() function, but it don´t work fine to me. any idea? Kind regards, Miltinho What was unsatisfying? You could also try ?write.table and library(MASS); ?write.matrix -- View this message in context: http://www.nabble.com/-R--writing-a-fomated-matrix-tf3173848.html#a8804977 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] writing a fomated matrix
On Mon, 5 Feb 2007, Milton Cezar Ribeiro wrote: Hi R-gurus, I have a 1000x1000 matrix and I would like to write it in a ASC file, where each row from my matrix are written in a separated line. I tryed write() function, but it don´t work fine to me. RSiteSearch(write matrix, restrict = c(functions, docs)) takes you to: library(MASS) ?write.matrix which ought to get you there. But: ?write would also have shown that there is an ncolumns argument - using that would probably also help. any idea? Kind regards, Miltinho __ [[alternative HTML version deleted]] -- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] RSNPper SNPinfo and making it handle a vector
I am not a card-carrying Bioinformatician or Biostatistician. At the risk of demonstrating naivete let me ask if you have reservations about snpper and its durability why not query dbSNP? : http://www.ncbi.nlm.nih.gov/projects/SNP/ That may be easy for me to say since I don't have the skills to do the programming, I am a pediatric otolaryngologist. another good question. dbSNP did not, at the time RSNPper was created, provide easy programmatic access to such nicely curated/amalgamated data from various sources. i suspect that is still the case. but there may be other web services providing information on SNPs, where a clear specification exists regarding what you issue and what you get back, and what you get back tells you things like SNP location, role, relation to genes, population frequency, etc.. if you find one and let me know about it i will consider writing another package to retrieve SNP-related metadata. you might look at the biomaRt package in Bioconductor and see if its snp query resolution facilities meet your needs. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] Exact matching with grep
Hello, I would know if it is possible with grep to match a exact string. For example, I want to match the string DP2 (and only this) and grep match DP2BS too. I have sought in the grep help but I didn't find what I want. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Exact matching with grep
Mahieux Dimitri wrote: Hello, I would know if it is possible with grep to match a exact string. For example, I want to match the string DP2 (and only this) and grep match DP2BS too. I have sought in the grep help but I didn't find what I want. ^DP2$ could be what you are looking for, although I wonder why you didn't just test for equality with == in the first place. Also, word matching as in \\DP2\\ could be relevant. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Exact matching with grep
Mahieux Dimitri wrote: I would know if it is possible with grep to match a exact string. For example, I want to match the string DP2 (and only this) and grep match DP2BS too. I have sought in the grep help but I didn't find what I want. grep(DP2, {other arguments}, fixed=TRUE) ?grep says that fixed is logical. If TRUE, pattern is a string to be matched as is. Overrides all conflicting arguments. -- View this message in context: http://www.nabble.com/-R--Exact-matching-with-grep-tf3174076.html#a8805966 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Exact matching with grep
Vladimir Eremeev wrote: Mahieux Dimitri wrote: I would know if it is possible with grep to match a exact string. For example, I want to match the string DP2 (and only this) and grep match DP2BS too. I have sought in the grep help but I didn't find what I want. grep(DP2, {other arguments}, fixed=TRUE) ?grep says that fixed is logical. If TRUE, pattern is a string to be matched as is. Overrides all conflicting arguments. That's not the issue here: grep(DP2, c(DP2,x, DP2BS,y)) [1] 1 3 grep(DP2, c(DP2,x, DP2BS,y), fixed=TRUE) [1] 1 3 grep(^DP2$, c(DP2,x, DP2BS,y)) [1] 1 which(DP2==c(DP2,x, DP2BS,y)) [1] 1 fixed=TRUE avoids special interpretation of metacharacters, but that doesn't solve the problem of matching the entire string. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] rgl.snapshot failed
Dear Roger Koenker, I have had just the same problem (rgl.snapshot returns failed) on my Fedora Core 6 system. It took me quite a while to figure out the solution, so I would like to post it here to make others' lives easier. My configuration: Linux zachariasz.dns6.org 2.6.18-1.2869.fc6 #1 SMP Wed Dec 20 14:51:19 EST 2006 i686 athlon i386 GNU/Linux Fedora Core 6 R version 2.4.0 Patched (2006-11-03 r39789) Package: rgl Version: 0.70 Date: 2007-01-06 What I had to do: Download the rgl package, install libX11, libX11-devel, libXt, libXt-devel, and then run: -- R CMD INSTALL --configure-args='--x-includes=/usr/include/X11 --x-libraries=/usr/lib' path_to_rgl_0.70.tar.gz -- The problem is that the ./configure script in the rgl_0.70 package does not seem to be able to locate the relevant X include and library paths. These have to be given explicitely, as shown. Hope this will help some in a similar situation. Best regards, Laszlo Kajan __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] Beginner Question on Persp()
I recently downloaded R for Windows, running on Win XP. I'm trying to create a perspective plot but not having any luck after reading the R manual and several examples found on the Internet. I have a 100 x 100 matrix of Z data as a tab-delimited text file exported from Minitab. I read this in to R using read.delim; this seemed to go ok. I created X and Y using seq() to get 100 divisions for the X and Y axes. Again, everything looked good, when I typed X or Y I got a string of 100 numbers. However, when I try to do persp(x,y,z) I get an error something like: (list) cannot be coerced to double. I know the basic data (matrix of z values) is ok (no hidden non-numeric values) because Minitab will graph it just fine. Any suggestions on how to proceed? Thanks in advanced for your help. -- View this message in context: http://www.nabble.com/Beginner-Question-on-Persp%28%29-tf3174399.html#a8806483 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] Confidence intervals of quantiles
Can anyone please tell me if there is a function to calculate confidence intervals for the results of the quantile function. Some of my data is normally distributed but some is also a squewed distribution or a capped normal distribution. Some of the data sets contain about 700 values whereas others are smaller with about 100-150 values, so I would like to see how the confidence intervals change for the different distributions and different data sizes. Thanks Mike White __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] Two ways to deal with age in Cox model
I hope one and all will allow a stats question: When running a cox proportional hazards model ,there are two ways to deal with age, including age as a covariate, or to include age as part of the follow-up time, viz, Age as a covariate: tetest1 - list(time= c(4, 3,1,1,2,2,3), status=c(1,NA,1,0,1,1,0), age= c(0, 2,1,1,1,0,0), riskfactor= c(0, 0,0,0,1,1,1)) fitagecovariate-coxph( Surv(time, status) ~ age +riskfactor, test1) fitagecovariate Age included as part of follow-up time: test2-test1 test2$timeplusage-test2$time+test2$age fitagefollowup-coxph( Surv(timeplusage, status) ~ riskfactor, test2) fitagefollowup I would appreciate any thoughts about the differences in the interpretation of the two models. One obvious difference is that in the first model (fitagecovariate) one can make inferences about age and in the second one cannot. I think a second difference may be that in the first model the riskfactor is assumed to have values measured at the values of age where as in the second model riskfactor is assumed to have given values throughout the subject's life. Your thoughts please. Thanks, John R 2.1.1 windows XP John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Baltimore VA Medical Center GRECC, University of Maryland School of Medicine Claude D. Pepper OAIC, University of Maryland Clinical Nutrition Research Unit, and Baltimore VA Center Stroke of Excellence University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) [EMAIL PROTECTED] Confidentiality Statement: This email message, including any attachments, is for the so...{{dropped}} __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Download stock prices
Hi Matthew, Matthew == Matthew Keller [EMAIL PROTECTED] on Sun, 4 Feb 2007 23:06:46 -0500 writes: Matthew Hi Mihai, You might check out the Rmetrics bundle, Matthew available on the cran website. I've used its Matthew fBasics library it's the fBasics *package*; a library is something (actually more than one thing!) different! Matthew to download stock prices. Try the Matthew yahooImport() function and the keystats() function Matthew for downloading specific stock prices. I had to Matthew fiddle with the keystats function to get it to work Matthew properly, but I wrote to the writer of the library you mean the maintainer of the *package* Matthew and it may have been fixed by now. the function is (now) called keystatsImport() and is part of 'fCalendar' -- which is automatically required from package 'fBasics'. help(keystatsImport) contains several examples, unfortunately explicitly not available through example(), but I can successfully execute all of them -- and they do work, including the yahooImport() one. Martin Maechler, ETH Zurich Matthew Best of luck, Matthew Matt Matthew On 2/4/07, Mihai Nica [EMAIL PROTECTED] wrote: gReetings: Is there any way to download a (or a sample of a) crossection of stock market prices? Or is it possible to use get.hist.quote with a *wild card*? Thanks, mihai Mihai Nica 170 East Griffith St. G5 Jackson, MS 39201 601-914-0361 Matthew -- Matthew C Keller Postdoctoral Fellow Virginia Matthew Institute for Psychiatric and Behavioral Genetics __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Beginner Question on Persp()
Tom H. wrote: I recently downloaded R for Windows, running on Win XP. I'm trying to create a perspective plot but not having any luck after reading the R manual and several examples found on the Internet. I have a 100 x 100 matrix of Z data as a tab-delimited text file exported from Minitab. I read this in to R using read.delim; this seemed to go ok. I created X and Y using seq() to get 100 divisions for the X and Y axes. Again, everything looked good, when I typed X or Y I got a string of 100 numbers. However, when I try to do persp(x,y,z) I get an error something like: (list) cannot be coerced to double. I know the basic data (matrix of z values) is ok (no hidden non-numeric values) because Minitab will graph it just fine. Any suggestions on how to proceed? Thanks in advanced for your help. Data frames are not matrices. Presumably, you want as.matrix(z). -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Beginner Question on Persp()
read.delim creates a data frame (which is a type of list), whereas persp requires that the z argument be a matrix. These are different classes of object in R -- you might want to read the Introduction to R that ships with the programme. Try persp(x,y,as.matrix(z)) On 05/02/07, Tom H. [EMAIL PROTECTED] wrote: I recently downloaded R for Windows, running on Win XP. I'm trying to create a perspective plot but not having any luck after reading the R manual and several examples found on the Internet. I have a 100 x 100 matrix of Z data as a tab-delimited text file exported from Minitab. I read this in to R using read.delim; this seemed to go ok. I created X and Y using seq() to get 100 divisions for the X and Y axes. Again, everything looked good, when I typed X or Y I got a string of 100 numbers. However, when I try to do persp(x,y,z) I get an error something like: (list) cannot be coerced to double. I know the basic data (matrix of z values) is ok (no hidden non-numeric values) because Minitab will graph it just fine. Any suggestions on how to proceed? Thanks in advanced for your help. -- View this message in context: http://www.nabble.com/Beginner-Question-on-Persp%28%29-tf3174399.html#a8806483 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. -- = David Barron Said Business School University of Oxford Park End Street Oxford OX1 1HP __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Beginner Question on Persp()
Your ``z'' which was read in by read.delim() is a *data frame* not a matrix. Do z - as.matrix(z), then persp(x,y,z) will work. cheers, Rolf Turner [EMAIL PROTECTED] ===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+=== Original message: I recently downloaded R for Windows, running on Win XP. I'm trying to create a perspective plot but not having any luck after reading the R manual and several examples found on the Internet. I have a 100 x 100 matrix of Z data as a tab-delimited text file exported from Minitab. I read this in to R using read.delim; this seemed to go ok. I created X and Y using seq() to get 100 divisions for the X and Y axes. Again, everything looked good, when I typed X or Y I got a string of 100 numbers. However, when I try to do persp(x,y,z) I get an error something like: (list) cannot be coerced to double. I know the basic data (matrix of z values) is ok (no hidden non-numeric values) because Minitab will graph it just fine. Any suggestions on how to proceed? Thanks in advanced for your help. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Exact matching with grep
Thank you. There was my misunderstanding of the documentation. (Un)fortunately, I haven't met the cases, when my code worked incorrectly. Peter Dalgaard wrote: Vladimir Eremeev wrote: Mahieux Dimitri wrote: I would know if it is possible with grep to match a exact string. For example, I want to match the string DP2 (and only this) and grep match DP2BS too. I have sought in the grep help but I didn't find what I want. grep(DP2, {other arguments}, fixed=TRUE) ?grep says that fixed is logical. If TRUE, pattern is a string to be matched as is. Overrides all conflicting arguments. That's not the issue here: grep(DP2, c(DP2,x, DP2BS,y)) [1] 1 3 grep(DP2, c(DP2,x, DP2BS,y), fixed=TRUE) [1] 1 3 grep(^DP2$, c(DP2,x, DP2BS,y)) [1] 1 which(DP2==c(DP2,x, DP2BS,y)) [1] 1 fixed=TRUE avoids special interpretation of metacharacters, but that doesn't solve the problem of matching the entire string. -- View this message in context: http://www.nabble.com/-R--Exact-matching-with-grep-tf3174076.html#a8806901 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Two ways to deal with age in Cox model
John Sorkin wrote: I hope one and all will allow a stats question: When running a cox proportional hazards model ,there are two ways to deal with age, including age as a covariate, or to include age as part of the follow-up time, viz, Age as a covariate: tetest1 - list(time= c(4, 3,1,1,2,2,3), status=c(1,NA,1,0,1,1,0), age= c(0, 2,1,1,1,0,0), riskfactor= c(0, 0,0,0,1,1,1)) fitagecovariate-coxph( Surv(time, status) ~ age +riskfactor, test1) fitagecovariate Age included as part of follow-up time: test2-test1 test2$timeplusage-test2$time+test2$age fitagefollowup-coxph( Surv(timeplusage, status) ~ riskfactor, test2) fitagefollowup I would appreciate any thoughts about the differences in the interpretation of the two models. One obvious difference is that in the first model (fitagecovariate) one can make inferences about age and in the second one cannot. I think a second difference may be that in the first model the riskfactor is assumed to have values measured at the values of age where as in the second model riskfactor is assumed to have given values throughout the subject's life. Model2 is plainly wrong, unless your times can be negative it represents long stretches of immortality (more obvious if all ages are about 80...)! Presumably, age is the age at entry, so a delayed-entry model could be appropriate (Surv(age,timeplusage,status)). If this modification is made, the main difference is that the time-since-entry scale can not (easily) have a separate effect in the delayed-entry model. If time is really is time since diagnosis or operation, then that could be badly wrong. Your thoughts please. Thanks, John R 2.1.1 windows XP John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Baltimore VA Medical Center GRECC, University of Maryland School of Medicine Claude D. Pepper OAIC, University of Maryland Clinical Nutrition Research Unit, and Baltimore VA Center Stroke of Excellence University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) [EMAIL PROTECTED] Confidentiality Statement: This email message, including any attachments, is for the so...{{dropped}} __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] rgl.snapshot failed
On 2/5/2007 8:48 AM, laszlo kajan wrote: Dear Roger Koenker, I have had just the same problem (rgl.snapshot returns failed) on my Fedora Core 6 system. It took me quite a while to figure out the solution, so I would like to post it here to make others' lives easier. My configuration: Linux zachariasz.dns6.org 2.6.18-1.2869.fc6 #1 SMP Wed Dec 20 14:51:19 EST 2006 i686 athlon i386 GNU/Linux Fedora Core 6 R version 2.4.0 Patched (2006-11-03 r39789) Package: rgl Version: 0.70 Date: 2007-01-06 What I had to do: Download the rgl package, install libX11, libX11-devel, libXt, libXt-devel, and then run: -- R CMD INSTALL --configure-args='--x-includes=/usr/include/X11 --x-libraries=/usr/lib' path_to_rgl_0.70.tar.gz -- The problem is that the ./configure script in the rgl_0.70 package does not seem to be able to locate the relevant X include and library paths. These have to be given explicitely, as shown. Hope this will help some in a similar situation. The configure script in rgl 0.70 uses some very old autoconf material. The next release will replace it with newer versions. Not sure when that will happen... If you'd like to test the new script you can get a copy from http://www.stats.uwo.ca/faculty/murdoch/temp/rgl_0.70.552.tar.gz I don't see the error you solved, so it's hard for me to know if this version fixes it, but I would hope you could leave out the extra install args, and just use the regular R CMD INSTALL path_to/rgl_0.70.552.tar.gz on a wider variety of systems. Duncan Murdoch __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Download stock prices
Thanks for the tips! Looking over the discussion I realized I might have been unclear. What I would like to do is download a *large* number of values for a certain date. I understood how to do download data for a specific stock, but any idea as to how I could download values for all (or a sample of) companies for a specific date :-)? something like... yahooSeries(symbols = c(ALL), from = NULL, to = NULL, nDaysBack = 365, quote = c(Open, High, Low, Close, Volume), aggregation = c(d, w, m), returnClass = c(timeSeries, ts, matrix, data.frame), getReturns = FALSE, ...) thanks, Mihai Nica 170 East Griffith St. G5 Jackson, MS 39201 601-914-0361 - Original Message From: Martin Maechler [EMAIL PROTECTED] To: Matthew Keller [EMAIL PROTECTED] Cc: Mihai Nica [EMAIL PROTECTED]; R list r-help@stat.math.ethz.ch Sent: Monday, February 5, 2007 8:01:04 AM Subject: Re: [R] Download stock prices Hi Matthew, Matthew == Matthew Keller [EMAIL PROTECTED] on Sun, 4 Feb 2007 23:06:46 -0500 writes: Matthew Hi Mihai, You might check out the Rmetrics bundle, Matthew available on the cran website. I've used its Matthew fBasics library it's the fBasics *package*; a library is something (actually more than one thing!) different! Matthew to download stock prices. Try the Matthew yahooImport() function and the keystats() function Matthew for downloading specific stock prices. I had to Matthew fiddle with the keystats function to get it to work Matthew properly, but I wrote to the writer of the library you mean the maintainer of the *package* Matthew and it may have been fixed by now. the function is (now) called keystatsImport() and is part of 'fCalendar' -- which is automatically required from package 'fBasics'. help(keystatsImport) contains several examples, unfortunately explicitly not available through example(), but I can successfully execute all of them -- and they do work, including the yahooImport() one. Martin Maechler, ETH Zurich Matthew Best of luck, Matthew Matt Matthew On 2/4/07, Mihai Nica [EMAIL PROTECTED] wrote: gReetings: Is there any way to download a (or a sample of a) crossection of stock market prices? Or is it possible to use get.hist.quote with a *wild card*? Thanks, mihai Mihai Nica 170 East Griffith St. G5 Jackson, MS 39201 601-914-0361 Matthew -- Matthew C Keller Postdoctoral Fellow Virginia Matthew Institute for Psychiatric and Behavioral Genetics [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Beginner Question on Persp()
Hi x-1:100 y-1:100 z-rnorm(100*100) dim(z)-c(100,100) persp(x,y,z) works ok so problem is with your data. Z being OK in Minitab does not mean it is read OK to R. On 5 Feb 2007 at 5:50, Tom H. wrote: Date sent: Mon, 5 Feb 2007 05:50:34 -0800 (PST) From: Tom H. [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Subject:[R] Beginner Question on Persp() I recently downloaded R for Windows, running on Win XP. I'm trying to create a perspective plot but not having any luck after reading the R manual and several examples found on the Internet. I have a 100 x 100 matrix of Z data as a tab-delimited text file exported from Minitab. I read this in to R using read.delim; this seemed to go ok. I created X and Y using seq() to get 100 divisions what does str(Z) says about your data? z-list(z) persp(x,y,z) Error in persp.default(x, y, z) : (list) object cannot be coerced to 'double' so although z looks like matrix it is actually list z1-z[[1]] persp(x,y,z1) works again OK. Based on structure of your data you need to extract a matrix for using it as z. See ?persp HTH Petr BTW try to transfer it to R just by selection of data list in Minitab, pressing Ctrl-C, and using z - read.delim(clipboard) in R. It works for me. for the X and Y axes. Again, everything looked good, when I typed X or Y I got a string of 100 numbers. However, when I try to do persp(x,y,z) I get an error something like: (list) cannot be coerced to double. I know the basic data (matrix of z values) is ok (no hidden non-numeric values) because Minitab will graph it just fine. Any suggestions on how to proceed? Thanks in advanced for your help. -- View this message in context: http://www.nabble.com/Beginner-Question-on-Persp%28%29-tf3174399.html# a8806483 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. Petr Pikal [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] futures, investment
The Rmetrics a (bundle for finance) page would be a good place to start. http://www.itp.phys.ethz.ch/econophysics/R/. R task view should also be good to look at. http://cran.r-project.org/src/contrib/Views/ I hope this helps Ansel. On 2/3/07, stephenc [EMAIL PROTECTED] wrote: Hi I am just starting to look at R and trading in futures, stock, etc Can anyone point me to useful background material? Stephen Choularton 02 2226 0413 545 182 -- 11:39 PM [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Two ways to deal with age in Cox model
Peter, Many thanks for your prompt reply. I think you may have been too quick to dismiss model2; there is no need for time to be negative. The time parameter is Surv represents survival, i.e. follow-up time. We usually start the follow-up clock at the time a subject is enrolled into a study, but this is not the only measure of survival time. One might argue that the clock should start at birth because the subject has survived to birth to plus the time represented by the ususal follow-up clock. John John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Baltimore VA Medical Center GRECC, University of Maryland School of Medicine Claude D. Pepper OAIC, University of Maryland Clinical Nutrition Research Unit, and Baltimore VA Center Stroke of Excellence University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) [EMAIL PROTECTED] Peter Dalgaard [EMAIL PROTECTED] 2/5/2007 9:16 AM John Sorkin wrote: I hope one and all will allow a stats question: When running a cox proportional hazards model ,there are two ways to deal with age, including age as a covariate, or to include age as part of the follow-up time, viz, Age as a covariate: tetest1 - list(time= c(4, 3,1,1,2,2,3), status=c(1,NA,1,0,1,1,0), age= c(0, 2,1,1,1,0,0), riskfactor= c(0, 0,0,0,1,1,1)) fitagecovariate-coxph( Surv(time, status) ~ age +riskfactor, test1) fitagecovariate Age included as part of follow-up time: test2-test1 test2$timeplusage-test2$time+test2$age fitagefollowup-coxph( Surv(timeplusage, status) ~ riskfactor, test2) fitagefollowup I would appreciate any thoughts about the differences in the interpretation of the two models. One obvious difference is that in the first model (fitagecovariate) one can make inferences about age and in the second one cannot. I think a second difference may be that in the first model the riskfactor is assumed to have values measured at the values of age where as in the second model riskfactor is assumed to have given values throughout the subject's life. Model2 is plainly wrong, unless your times can be negative it represents long stretches of immortality (more obvious if all ages are about 80...)! Presumably, age is the age at entry, so a delayed-entry model could be appropriate (Surv(age,timeplusage,status)). If this modification is made, the main difference is that the time-since-entry scale can not (easily) have a separate effect in the delayed-entry model. If time is really is time since diagnosis or operation, then that could be badly wrong. Your thoughts please. Thanks, John R 2.1.1 windows XP John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Baltimore VA Medical Center GRECC, University of Maryland School of Medicine Claude D. Pepper OAIC, University of Maryland Clinical Nutrition Research Unit, and Baltimore VA Center Stroke of Excellence University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) [EMAIL PROTECTED] Confidentiality Statement: This email message, including any attachments, is for the so...{{dropped}} __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. Confidentiality Statement: This email message, including any attachments, is for the so...{{dropped}} __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Confidence intervals of quantiles
you could use the Bootstrap method, using package 'boot', e.g., library(boot) f.quantile - function(x, ind, ...){ quantile(x[ind], ...) } ### x - rgamma(750, 2) quant.boot - boot(x, f.quantile, R = 1000, probs = c(0.025, 0.25, 0.5, 0.75, 0.975)) lapply(1:5, function(i) boot.ci(quant.boot, c(0.90, 0.95), type = c(perc, bca), index = i)) y - rgamma(150, 2) quant.boot - boot(y, f.quantile, R = 1000, probs = c(0.025, 0.25, 0.5, 0.75, 0.975)) lapply(1:5, function(i) boot.ci(quant.boot, c(0.90, 0.95), type = c(perc, bca), index = i)) However, you should be a little bit careful with Bootstrap if you wish to obtain CIs for extreme quantiles in small samples. I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: Mike White [EMAIL PROTECTED] To: R-help@stat.math.ethz.ch Sent: Monday, February 05, 2007 2:47 PM Subject: [R] Confidence intervals of quantiles Can anyone please tell me if there is a function to calculate confidence intervals for the results of the quantile function. Some of my data is normally distributed but some is also a squewed distribution or a capped normal distribution. Some of the data sets contain about 700 values whereas others are smaller with about 100-150 values, so I would like to see how the confidence intervals change for the different distributions and different data sizes. Thanks Mike White __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Beginner Question on Persp()
Thank you all for taking the time to point out that a data frame is not the same as a matrix! I'll give it another shot when I get home tonight. -- View this message in context: http://www.nabble.com/Beginner-Question-on-Persp%28%29-tf3174399.html#a8807536 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Beginner Question on Persp()
Tom H. wrote: I recently downloaded R for Windows, running on Win XP. I'm trying to create a perspective plot but not having any luck after reading the R manual and several examples found on the Internet. I have a 100 x 100 matrix of Z data as a tab-delimited text file exported from Minitab. I read this in to R using read.delim; this seemed to go ok. I created X and Y using seq() to get 100 divisions for the X and Y axes. Again, everything looked good, when I typed X or Y I got a string of 100 numbers. However, when I try to do persp(x,y,z) I get an error something like: (list) cannot be coerced to double. I know the basic data (matrix of z values) is ok (no hidden non-numeric values) because Minitab will graph it just fine. Any suggestions on how to proceed? Thanks in advanced for your help. -- View this message in context: http://www.nabble.com/Beginner-Question-on-Persp%28%29-tf3174399.html#a8807458 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] The ordinal Package
Hi dear all Where can I get the ordinal package ? Justin BEM Elève Ingénieur Statisticien Economiste BP 294 Yaoundé. Tél (00237)9597295. ___ Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] futures, investment, etc
Hi I am just starting to look at R and trading in futures, stock, etc Can anyone point me to useful background material? __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] vgam cao
Hi! I would like to calculate a constrained additive ordination with the package VGAM. I get the error message: Error in ncol(xbig.save) : object xbig.save not found My data consists of 90 samples, 10 species and 3 environmental variables. The species data is continous biomass data, with values from 0 to 3000 micrograms per litre. I use the function: cao (name.of.species.matrix~Temp+LF+Ptot, data=name.of.environmental.data.frame, family=gaussianff, df1.nl=3.5, Bestof=4) After fitting model 1, I get an error message. Here is the output of model 1: Obtaining initial values Using initial values TempLF Ptot lv 0.408 0.189 -0.77 Iteration 1 initial value 88934920.105286 iter 10 value 83029461.332581 iter 20 value 83028498.211367 final value 83028488.241532 converged Error in ncol(xbig.save) : object xbig.save not found I have tried it with fewer or more sites, fewer and more species, df1.nl from 0.5 to 5.5. I always get the same error message. It only works when I use family=poissonff. But as I have continuous data, I think I can't use poissonff. Can anybody help me? Thanks, Romana --- Versendet durch aonWebmail (webmail.aon.at) __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] rgl.snapshot failed
Hello Duncan, no, it unfortunately does not find the paths. Here's what happens: --- $ R CMD INSTALL rgl_0.70.552.tar.gzENTER ... checking for X... libraries , headers checking for libpng-config... yes ... ... g++ -I/usr/lib/R/include -I/usr/lib/R/include -I -DHAVE_PNG_H -I/usr/include/libpng12... ... --- As you can see, it does not find the X libraries and headers, consequently it fails to construct the correct g++ command (note the -Ispace-DHAVE_PNG_H - incorrect definition of HAVE_PNG_H). This latter leads to the error, because if I modify the autoconf.ac with the following patch: --- --- rgl/configure.ac2006-12-11 12:37:13.0 +0100 +++ ../rgl/configure.ac 2007-02-02 23:03:27.800030897 +0100 @@ -29,7 +29,9 @@ if test x$no_x == xyes ; then AC_MSG_ERROR([X11 not found but required, configure aborted.]) fi - CPPFLAGS=${CPPFLAGS} -I${x_includes} + #CPPFLAGS=${CPPFLAGS} -I${x_includes} + # kajla + if test x${x_includes} != x ; then CPPFLAGS=${CPPFLAGS} -I${x_includes}; fi LIBS=${LIBS} -L${x_libraries} -lX11 -lXext if test `uname` = Darwin ; then CPPFLAGS=${CPPFLAGS} -DDarwin --- , run autoconf, re-create the tar.gz and R CMD INSTALL that, then it works (rgl.snapshot generates pngs) even in the absence of the paths for X! I wouldn't be surprised if this turned out to be a problem with Fedora Core 6 and the installed packages though, rather than rgl. Laszlo Kajan Duncan Murdoch wrote: On 2/5/2007 8:48 AM, laszlo kajan wrote: Dear Roger Koenker, I have had just the same problem (rgl.snapshot returns failed) on my Fedora Core 6 system. It took me quite a while to figure out the solution, so I would like to post it here to make others' lives easier. My configuration: Linux zachariasz.dns6.org 2.6.18-1.2869.fc6 #1 SMP Wed Dec 20 14:51:19 EST 2006 i686 athlon i386 GNU/Linux Fedora Core 6 R version 2.4.0 Patched (2006-11-03 r39789) Package: rgl Version: 0.70 Date: 2007-01-06 What I had to do: Download the rgl package, install libX11, libX11-devel, libXt, libXt-devel, and then run: -- R CMD INSTALL --configure-args='--x-includes=/usr/include/X11 --x-libraries=/usr/lib' path_to_rgl_0.70.tar.gz -- The problem is that the ./configure script in the rgl_0.70 package does not seem to be able to locate the relevant X include and library paths. These have to be given explicitely, as shown. Hope this will help some in a similar situation. The configure script in rgl 0.70 uses some very old autoconf material. The next release will replace it with newer versions. Not sure when that will happen... If you'd like to test the new script you can get a copy from http://www.stats.uwo.ca/faculty/murdoch/temp/rgl_0.70.552.tar.gz I don't see the error you solved, so it's hard for me to know if this version fixes it, but I would hope you could leave out the extra install args, and just use the regular R CMD INSTALL path_to/rgl_0.70.552.tar.gz on a wider variety of systems. Duncan Murdoch __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Two ways to deal with age in Cox model
John Sorkin wrote: Peter, Many thanks for your prompt reply. I think you may have been too quick to dismiss model2; there is no need for time to be negative. The time parameter is Surv represents survival, i.e. follow-up time. We usually start the follow-up clock at the time a subject is enrolled into a study, but this is not the only measure of survival time. One might argue that the clock should start at birth because the subject has survived to birth to plus the time represented by the ususal follow-up clock. Yes, but your subjects logically cannot die before their recorded age if I understand the setup correctly. I.e. you have left truncation -- people who die before enrolment are not recorded at all. This is at odds with the proportional hazards assumption and it is a source of (potential) grave error if the length of the immortal period is related to the presence of the risk factor. John John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Baltimore VA Medical Center GRECC, University of Maryland School of Medicine Claude D. Pepper OAIC, University of Maryland Clinical Nutrition Research Unit, and Baltimore VA Center Stroke of Excellence University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) [EMAIL PROTECTED] Peter Dalgaard [EMAIL PROTECTED] 2/5/2007 9:16 AM John Sorkin wrote: I hope one and all will allow a stats question: When running a cox proportional hazards model ,there are two ways to deal with age, including age as a covariate, or to include age as part of the follow-up time, viz, Age as a covariate: tetest1 - list(time= c(4, 3,1,1,2,2,3), status=c(1,NA,1,0,1,1,0), age= c(0, 2,1,1,1,0,0), riskfactor= c(0, 0,0,0,1,1,1)) fitagecovariate-coxph( Surv(time, status) ~ age +riskfactor, test1) fitagecovariate Age included as part of follow-up time: test2-test1 test2$timeplusage-test2$time+test2$age fitagefollowup-coxph( Surv(timeplusage, status) ~ riskfactor, test2) fitagefollowup I would appreciate any thoughts about the differences in the interpretation of the two models. One obvious difference is that in the first model (fitagecovariate) one can make inferences about age and in the second one cannot. I think a second difference may be that in the first model the riskfactor is assumed to have values measured at the values of age where as in the second model riskfactor is assumed to have given values throughout the subject's life. Model2 is plainly wrong, unless your times can be negative it represents long stretches of immortality (more obvious if all ages are about 80...)! Presumably, age is the age at entry, so a delayed-entry model could be appropriate (Surv(age,timeplusage,status)). If this modification is made, the main difference is that the time-since-entry scale can not (easily) have a separate effect in the delayed-entry model. If time is really is time since diagnosis or operation, then that could be badly wrong. Your thoughts please. Thanks, John R 2.1.1 windows XP John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Baltimore VA Medical Center GRECC, University of Maryland School of Medicine Claude D. Pepper OAIC, University of Maryland Clinical Nutrition Research Unit, and Baltimore VA Center Stroke of Excellence University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) [EMAIL PROTECTED] Confidentiality Statement: This email message, including any attachments, is for the so...{{dropped}} __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] futures, investment, etc
Hi - you didn't give your name! http://finzi.psych.upenn.edu/search.html is a useful search engine from the help archives of R http://life.bio.sunysb.edu/~dstoebel/R/index.html is a mini-course in using R for statistical analysis http://www.stat.tamu.edu/~ljin/Finance/stat689-R.htm may be of more use to you as it is called Statistics and Finance: An Introduction in R Hope some of these links help you - R seems to be mostly about searching around on the internet (especially on that first search website) and finding your own way of doing things - it's so diverse (for example I am using R for climate and statistical analysis and producing graphs and maps). http://www.r-project.org/posting-guide.html This link is very useful (and I don't mean any offence) but it shows you how to ask good questions that are likely to prompt useful answers from this R-help mailing list.people on the mailing list are all very busy and involved in their own work, if you need help it can be very useful to write to this mailing list, but it pays to spend time writing the email using this posting guide - to get the best responses! Good luck, it's a steep learning curve :-) Jenny X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on hypatia.math.ethz.ch X-Spam-Level: *** X-Spam-Status: No, score=3.8 required=5.0 tests=BAYES_60, BLANK_LINES_70_80, NO_REAL_NAME autolearn=no version=3.1.7 Date: Mon, 5 Feb 2007 07:33:45 +1100 (EST) From: [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: by amavisd-new at stat.math.ethz.ch X-Mailman-Approved-At: Mon, 05 Feb 2007 16:13:51 +0100 Subject: [R] futures, investment, etc X-BeenThere: r-help@stat.math.ethz.ch X-Mailman-Version: 2.1.9 List-Id: Main R Mailing List: Primary help r-help.stat.math.ethz.ch List-Unsubscribe: https://stat.ethz.ch/mailman/listinfo/r-help, mailto:[EMAIL PROTECTED] List-Archive: https://stat.ethz.ch/pipermail/r-help List-Post: mailto:r-help@stat.math.ethz.ch List-Help: mailto:[EMAIL PROTECTED] List-Subscribe: https://stat.ethz.ch/mailman/listinfo/r-help, mailto:[EMAIL PROTECTED] Content-Transfer-Encoding: 7bit X-MSSL-MailScanner-Information: Please contact the ISP for more information X-MSSL-MailScanner: No virus found X-MSSL-MailScanner-SpamCheck: not spam, SpamAssassin (score=-0.152, required 5, BAYES_01 -1.52, NO_REAL_NAME 0.16, PRIORITY_NO_NAME 1.21) Hi I am just starting to look at R and trading in futures, stock, etc Can anyone point me to useful background material? __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. ~~ Jennifer Barnes PhD student: long range drought prediction Climate Extremes Group Department of Space and Climate Physics University College London Holmbury St Mary Dorking, Surrey, RH5 6NT Tel: 01483 204149 Mob: 07916 139187 Web: http://climate.mssl.ucl.ac.uk __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] Rconsole - setting the size and location of Windows help files (Rgui)
Hi, Using the Rconsole file I can specify the size and location of the Rgui windows on NT. e.g. # Dimensions (in characters) of the console. rows = 51 columns = 100 How can I specify the size of the help windows that popups when I ask for help? e.g. '?help' I would like the popup window to have say rows = 51 and columns = 100, just like the main window but a different location on the screen. In my .Rprofile file I have set 'options(winhelp=FALSE)'. platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 4.1 year 2006 month 12 day18 svn rev40228 language R version.string R version 2.4.1 (2006-12-18) Regards, John. John Gavin [EMAIL PROTECTED], Commodities, FIRC, UBS Investment Bank, 2nd floor, 100 Liverpool St., London EC2M 2RH, UK. Phone +44 (0) 207 567 4289 This communication is issued by UBS AG and/or affiliates to institutional investors; it is not for private persons. This is a product of a sales or trading desk and not the Research Dept. Opinions expressed may differ from those of other divisions of UBS, including Research. UBS may trade as principal in instruments identified herein and may accumulate/have accumulated a long or short position in instruments or derivatives thereof. UBS has policies designed to negate conflicts of interest. This e-mail is not an official confirmation of terms and unless stated, is not a recommendation, offer or solicitation to buy or sell. Any prices or quotations contained herein are indicative only. Communications may be monitored. © 2006 UBS. All rights reserved. Intended for recipient only and not for further distribution without the consent of UBS. UBS Limited is a company registered in England Wales under company number 2035362, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. UBS AG (London Branch) is registered as a branch of a foreign company under number BR004507, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. UBS Clearing and Execution Services Limited is a company registered in England Wales under company number 03123037, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] ran out of iteration in coxph
It is quite possible that you are trying to find an MPLE where none exists, in which case non-convergence is a good thing. Using only 300 cases for 188 or 215 variables is asking a lot, especially when 26% of them are only partially observed. Since you did not sign your message we have no idea of your background, but it looks like the problem here is with statistical expectations and not R usage. On Sun, 4 Feb 2007, carol white wrote: hi, I applied coxph to my matrix of 300 samples and 215 variables and got the following error Error in fitter(X, Y, strats, offset, init, control, weights = weights, : NA/NaN/Inf in foreign function call (arg 6) In addition: Warning message: Ran out of iterations and did not converge in: fitter(X, Y, strats, offset, init, control, weights = weights, 26% of time data is censored and here is the result of density of the matrix xy Min. :-6.943 Min. :-5.258e-18 1st Qu.:-4.086 1st Qu.: 2.341e-04 Median :-1.228 Median : 4.584e-03 Mean :-1.228 Mean : 8.740e-02 3rd Qu.: 1.630 3rd Qu.: 5.857e-02 Max. : 4.487 Max. : 7.099e-01 -- in another trial of the same matrix, the number of var is reduced to 188. the variables were normalized (mean = 0 and standard dev = 1 for each variable) and here is the result of density x y Min. :-8.1532 Min. :4.571e-16 1st Qu.:-4.3334 1st Qu.:1.043e-04 Median :-0.5136 Median :1.102e-03 Mean :-0.5136 Mean :6.538e-02 3rd Qu.: 3.3062 3rd Qu.:5.373e-02 Max. : 7.1260 Max. :4.337e-01 I get still the warning Warning message: Ran out of iterations and did not converge in: fitter(X, Y, strats, offset, init, control, weights = weights, but not error in fitter the number of iterations is 20 and didn't converge. saw from coefficient values and their p-value Why do I get this message? Look forward to your reply carol - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Another loop - deloop question
Thank you so much! This is super helpful, even if it turns out that vectorization doesn't improve performance in my situation. -- TMK -- 212-460-5430home 917-656-5351cell From: Charles C. Berry [EMAIL PROTECTED] To: Talbot Katz [EMAIL PROTECTED] CC: r-help@stat.math.ethz.ch Subject: Re: [R] Another loop - deloop question Date: Fri, 2 Feb 2007 17:04:22 -0800 Talbot, Vectorization is not panacea. For n == 100, m ==1000: system.time( for( i in 1:n ){ p[ g[[i]] ] - p[ g[[i]] ] + y[[i]] }) [1] 0 0 0 NA NA system.time( p2 - tapply( unlist(y), unlist(g), sum )) [1] 0.16 0.00 0.16 NA NA all.equal(p,as.vector(p2)) [1] TRUE system.time( p3 - xtabs( unlist(y) ~ unlist(g) ) ) [1] 0.08 0.00 0.08 NA NA all.equal(p,as.vector(p3)) [1] TRUE system.time( p4 - unlist(y) %*% diag(m)[ unlist(g), ] ) [1] 4.16 0.20 4.36 NA NA all.equal(p,as.vector(p4)) [1] TRUE Vectorization has had no victory, Grasshopper. --- For n == 1, m == 10, the slowest method above becomes the fastest, and the fastest above becomes the slowest. So, you need to consider the applications to which you will apply this. Read up on profiling if you really 'feel the need for speed'. (Writing R Extensions 3.2 Profiling R code for speed.) Chuck p.s. Please read Writing R Extensions 3.1 Tidying R code and follow the wisdom therein. On Fri, 2 Feb 2007, Talbot Katz wrote: Hi. You folks are so clever, I thought perhaps you could help me make another procedure more efficient. Right now I have the following setup: p is a vector of length m g is a list of length n, g[[i]] is a vector whose elements are indices of p, i.e., integers between 1 and m inclusive); the g[[i]] cover the full set 1:m, but they don't have to constitute an exact partition, theycan overlap members. y is another list of length n, each y[[i]] is a vector of the same length as g[[i]]. Now I build up the vector p as follows: p=rep(0,m) for(i in 1:n){p[g[[i]]]=p[g[[i]]]+y[[i]]} Can this loop be vectorized? Thanks! -- TMK -- 212-460-5430 home 917-656-5351 cell __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. Charles C. Berry(858) 534-2098 Dept of Family/Preventive Medicine E mailto:[EMAIL PROTECTED] UC San Diego http://biostat.ucsd.edu/~cberry/ La Jolla, San Diego 92093-0901 __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Two ways to deal with age in Cox model
On Mon, 5 Feb 2007, John Sorkin wrote: When running a cox proportional hazards model ,there are two ways to deal with age, including age as a covariate, or to include age as part of the follow-up time, viz, snip I would appreciate any thoughts about the differences in the interpretation of the two models. One obvious difference is that in the first model (fitagecovariate) one can make inferences about age and in the second one cannot. I think a second difference may be that in the first model the riskfactor is assumed to have values measured at the values of age where as in the second model riskfactor is assumed to have given values throughout the subject's life. There are even more possibilities (a nice example and discussion is in Breslow Day, the example being occupational exposure to nickel and later cancer). The Cox model works by comparing covariates for the observation that failed and other observations at risk at the same time, so the comparisons are entirely within time-point. If you use time since start of study you are comparing people with different covariates at the same time since start of study. If you use calendar time you are comparing people with different covariates at the same calendar time If you use age you are comparing people with different covariates at the same age. In an observational study it often is more important to control for age or for calendar time than for time since the study started, so these might be better time scales. A disadvantage in some studies with longitudinal data is that on the study time scale everyone may have measurements at the same time but on other time scales everyone may have measurements at different times. -thomas __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] read.spss and encodings
Thanks for the example file. I'm trying to work out what, if anything, is easy to support reliably for encodings in SPSS. -thomas On Sun, 4 Feb 2007, I. Soumpasis wrote: HI! This mail is related to Thomas mail so I follow up. I use Greek language and the spss files with value labels containing greek characters can not be imported with read.spss. I am on: sessionInfo() R version 2.5.0 Under development (unstable) (2007-02-01 r40632) i686-pc-linux-gnu locale: LC_CTYPE=el_GR.UTF-8;LC_NUMERIC=C;LC_TIME=el_GR.UTF-8;LC_COLLATE=el_GR.UTF-8;LC_MONETARY=el_GR.UTF-8;LC_MESSAGES=el_GR.UTF-8;LC_PAPER=el_GR.UTF-8;LC_NAME=el_GR.UTF-8;LC_ADDRESS=el_GR.UTF-8;LC_TELEPHONE=el_GR.UTF-8;LC_MEASUREMENT=el_GR.UTF-8;LC_IDENTIFICATION=el_GR.UTF-8 The following files are small examples used below: http://users.forthnet.gr/the/isoumpasis/data/1.sav http://users.forthnet.gr/the/isoumpasis/data/12.savhttp://users.forthnet.gr/the/isoumpasis/data/12.RData The first file has english value labels and can be read: read.spss(~/Desktop/1.sav) $VAR1 [1] \xf3\xf0\xdf\xf4\xe9\xf3\xf0\xdf\xf4\xe9 [3] \xf3\xf0\xdf\xf4\xe9\xf3\xf0\xdf\xf4\xe9 [5] \xf3\xf0\xdf\xf4\xe9\xe3\xf1\xe1\xf6\xe5\xdf\xef [7] \xe3\xf1\xe1\xf6\xe5\xdf\xef\xe3\xf1\xe1\xf6\xe5\xdf\xef [9] \xe3\xf1\xe1\xf6\xe5\xdf\xef\xf3\xf0\xdf\xf4\xe9 [11] \xe3\xf1\xe1\xf6\xe5\xdf\xef $VAR2 [1] 5 6 7 7 5 7 3 5 6 7 8 attr(,label.table ) attr(,label.table)$VAR1 NULL attr(,label.table)$VAR2 NULL I can then convert the characters to greek using Thomas' code, so there is no problem here. In file 12.sav the value labels are greek. The problem is that the file cannot be read. read.spss(~/Desktop/12.sav) Error in read.spss(~/Desktop/12.sav) : error reading system-file header In addition: Warning message: ~/Desktop/12.sav: position 0: Variable name begins with invalid character I also tried using use.value.labels=FALSE having the same message. read.spss(~/Desktop/12.sav, use.value.labels=FALSE) Error in read.spss(~/Desktop/12.sav, use.value.labels = FALSE) : error reading system-file header In addition: Warning message: ~/Desktop/12.sav: position 0: Variable name begins with invalid character The encoding of the spss files is windows-1253 (greek). The problem should be with other non-ascii characters too. Is there any workaround for this? Thanks in advance I.Soumpasis [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] LyX 1.4.3-5 problem generating PDF documents
You are posting in the wrong mailing list, mail your question to the lyx users list: http://www.lyx.org/internet/mailing.php John Kane wrote: I just changed machines and, at first, could not get LyX 1.4.3-4 to even load. I tried 1.5 which loaded nicely but would not give me PDF output. Removed 1.5 tried using 1.4.3-5.exe. Result : On loading LyX : lyx: Disabling socket cont class std::basic_stringchar struct std: char::char_traits ... Removed and installed from LyXWin143Complete-2-9.exe. Loads okay but no PDF generation. My PDF reader, Foxit Reader loads but nothing is produced. I have managed to produce a postscript doc and convert it using Ghostscript. Could this just be a Foxit problem? As soon as I figure out how to reset the Adobe to default pdf reader I'll try it out. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] RdbiPgSQL in R 2.4.1
Hi R-users I recently downloaded RdbiPgSQL 1.8.0 and Rdbi 1.8.0 from Bioconductor to be installed under R 2.4.1. When requiring RdbiPgSQL an error message is showed as follows: require(RdbiPgSQL) Loading required package: RdbiPgSQL Error in library(package, lib.loc = lib.loc, character.only = TRUE, logical = TRUE, : RdbiPgSQL is not a valid package installed 2.0.0? There is no issue about version restriction in Description file. Suggestions are welcome! _ Eng. Agr., Dr. Eduardo Dutra de Armas _ Universidade de São Paulo - Escola Superior de Agricultura Luiz de Queiroz Depto. de Ciência do Solo - Laboratório de Microbiologia Molecular Av. Pádua Dias 11, Bairro São Judas, CEP 13418-900 Piracicaba, SP, Brasil - Fone: (55-19)34172160 - Cel: (55-19)81924072 Skype: edarmas (Áreas de atuação: Poluição de solo e água, Biogeodinâmica de poluentes, Modelagem Hidrogeoquímica, Gerenciamento de Áreas Contaminadas, Análise de Risco, Biodegradação, Microbiologia Ambiental) _ -- Checked by AVG Free Edition. 14:04 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] rgl.snapshot failed
On 2/5/2007 10:28 AM, laszlo kajan wrote: Hello Duncan, no, it unfortunately does not find the paths. Here's what happens: Thanks for your patch. It looks like it would be good on any system, so I'll put it in place. Duncan Murdoch --- $ R CMD INSTALL rgl_0.70.552.tar.gzENTER ... checking for X... libraries , headers checking for libpng-config... yes ... ... g++ -I/usr/lib/R/include -I/usr/lib/R/include -I -DHAVE_PNG_H -I/usr/include/libpng12... ... --- As you can see, it does not find the X libraries and headers, consequently it fails to construct the correct g++ command (note the -Ispace-DHAVE_PNG_H - incorrect definition of HAVE_PNG_H). This latter leads to the error, because if I modify the autoconf.ac with the following patch: --- --- rgl/configure.ac2006-12-11 12:37:13.0 +0100 +++ ../rgl/configure.ac 2007-02-02 23:03:27.800030897 +0100 @@ -29,7 +29,9 @@ if test x$no_x == xyes ; then AC_MSG_ERROR([X11 not found but required, configure aborted.]) fi - CPPFLAGS=${CPPFLAGS} -I${x_includes} + #CPPFLAGS=${CPPFLAGS} -I${x_includes} + # kajla + if test x${x_includes} != x ; then CPPFLAGS=${CPPFLAGS} -I${x_includes}; fi LIBS=${LIBS} -L${x_libraries} -lX11 -lXext if test `uname` = Darwin ; then CPPFLAGS=${CPPFLAGS} -DDarwin --- , run autoconf, re-create the tar.gz and R CMD INSTALL that, then it works (rgl.snapshot generates pngs) even in the absence of the paths for X! I wouldn't be surprised if this turned out to be a problem with Fedora Core 6 and the installed packages though, rather than rgl. Laszlo Kajan Duncan Murdoch wrote: On 2/5/2007 8:48 AM, laszlo kajan wrote: Dear Roger Koenker, I have had just the same problem (rgl.snapshot returns failed) on my Fedora Core 6 system. It took me quite a while to figure out the solution, so I would like to post it here to make others' lives easier. My configuration: Linux zachariasz.dns6.org 2.6.18-1.2869.fc6 #1 SMP Wed Dec 20 14:51:19 EST 2006 i686 athlon i386 GNU/Linux Fedora Core 6 R version 2.4.0 Patched (2006-11-03 r39789) Package: rgl Version: 0.70 Date: 2007-01-06 What I had to do: Download the rgl package, install libX11, libX11-devel, libXt, libXt-devel, and then run: -- R CMD INSTALL --configure-args='--x-includes=/usr/include/X11 --x-libraries=/usr/lib' path_to_rgl_0.70.tar.gz -- The problem is that the ./configure script in the rgl_0.70 package does not seem to be able to locate the relevant X include and library paths. These have to be given explicitely, as shown. Hope this will help some in a similar situation. The configure script in rgl 0.70 uses some very old autoconf material. The next release will replace it with newer versions. Not sure when that will happen... If you'd like to test the new script you can get a copy from http://www.stats.uwo.ca/faculty/murdoch/temp/rgl_0.70.552.tar.gz I don't see the error you solved, so it's hard for me to know if this version fixes it, but I would hope you could leave out the extra install args, and just use the regular R CMD INSTALL path_to/rgl_0.70.552.tar.gz on a wider variety of systems. Duncan Murdoch __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] RdbiPgSQL in R 2.4.1
Hi Eduardo, It would probably be best to send question regarding Bioconductor packages to the bioconductor email list. Eduardo Dutra de Armas [EMAIL PROTECTED] writes: Hi R-users I recently downloaded RdbiPgSQL 1.8.0 and Rdbi 1.8.0 from Bioconductor to be installed under R 2.4.1. When requiring RdbiPgSQL an error message is showed as follows: require(RdbiPgSQL) Loading required package: RdbiPgSQL Error in library(package, lib.loc = lib.loc, character.only = TRUE, logical = TRUE, : RdbiPgSQL is not a valid package installed 2.0.0? There is no issue about version restriction in Description file. What OS are you running on? How did you install the packages? I'm not able to reproduce the message you posted. Perhaps try reinstalling using the biocLite install script. Like this: source(http://bioconductor.org/biocLite.R;) biocLite(c(Rdbi, RdbiPgSQL)) NB: normally, you don't need to specify dependencies, but this way it will reinstall Rdbi as well in case you have a bogus install... + seth __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] random forest proximities
Good Day, I'm using the randomForest package to perform a classification. If I supply weights to the optional classwt argument are proximity values computed as a weighted average? I understand that the forest will possibly change as a function of the particular weights I supply. Thanks in advance. Mike Michael Fugate Los Alamos National Laboratory Mail Stop MS-F600, Los Alamos, NM 87545 (505) 667-0398 __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] Problems installing R-2.4.1 on Solaris 11 x-86 from source: error in gmake after successful configure]
Dear friends, I am trying to install R-2.4.1 from source on Solaris 11 x-86_64. running on Sun Ultra-20 workstation, and using the SunStudio 11 compilers. I was able to configure R correctly, but received an error in make, aparently related to bzip2 which I have been unable to debug. The messages are listed below. The configure.log and configure.site and teh terminal output with the error message files are attached. Any help would be sincerely appreciated, as I have exausted my debugging resources. I believe that there is a problem with the configure script in dealing with my particular setup. Octavio Tourinho #! /bin/sh ### This file is part of R. ### ### R is free software; you can redistribute it and/or modify it under ### the terms of the GNU General Public License as published by the Free ### Software Foundation; either version 2 of the License, or (at your ### option) any later version. ### ### R is distributed in the hope that it will be useful, but WITHOUT ANY ### WARRANTY; without even the implied warranty of MERCHANTABILITY or ### FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public ### License for more details. ### ### You should have received a copy of the GNU General Public License ### along with R; if not, you can obtain it via the World Wide Web at ### 'http://www.gnu.org/copyleft/gpl.html', or by writing to the Free ### Software Foundation, ### 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ## By means of this file you can (also) provide default values for the ## configuration process. To set variables, uncomment the VAR=DEFAULT ## lines and set DEFAULT according to your needs. ## The command used to spool PostScript files to the printer. ## If unspecified, the system will look for either 'lpr' or 'lp'. ## R_PRINTCMD=lp ## The paper size for the local (PostScript) printer. ## It must either be left blank or set to one of 'a4' or 'letter'. ## If left blank the system will use 'a4'. ## R_PAPERSIZE=a4 ## Set the default behavior of R when ending a session ## Set this to one of '--save' or '--no-save' depending whether you ## want automatic saving of '.RData' or not. ## Note that this applies to interactive and batch use, ## but NOT to the utility R CMD BATCH ## (which defaults to --save irrespective of this setting) ## R_BATCHSAVE= ## The command which runs the C compiler. ## If unspecified, a search is made for gcc and cc (in that order). ## To override this choice, specify the name of the command which runs ## the compiler here, for example 'c89'. ## It is also convenient to set the architecture here, e.g. 'gcc -m32'. ## NB, as from R 2.5.0 configure will append flags for C99 compliance, ## e.g. CC=gcc -std=gnu99 ## To avoid this, set contradictory flags (such as -ansi) as part of CFLAGS. ## CC=/opt/SUNWspro/bin/cc -xarch=amd64 ## CC=gcc -std=gnu99 ## Debugging and optimization options for the C compiler. ## Use this to specify CFLAGS for the version of the C compiler ## specified above. ## If unspecified, defaults to '-g -O2' for gcc, ## and '-g' in all other cases except icc (for which see R-admin.html). ## CFLAGS=-xO3 ## Defines for C compilation. ## Use this to specify defines to be used in the compilation of R, ## e.g. -DUSE_TYPE_CHECKING_STRICT ## DEFS= ## The following additional CFLAGS to be used only in the main ## compilation and only in building shared libraries respectively. ## For example, on some systems one needs 'MAIN_CFLAGS=-pg' when ## profiling. ## MAIN_CFLAGS= ## SHLIB_CFLAGS= ## Header file search directory ('-IDIR') and any other miscellaneous ## options (such as defines) for the C preprocessor and compiler. ## If unset defaults to '-I/usr/local/include', with '-I/sw/include' ## prepended on systems using Fink with root '/sw'. ## CPPFLAGS=-I/usr/local/include -I/usr/local/include/readline -I/usr/sfw/include ## The command which runs the FORTRAN 77 compiler. ## If this is not specified, a search is made for ## f95 fort xlf95 ifort ifc efc pgf95 lf95 gfortran ftn g95 ## f90 xlf90 pgf90 pghpf epcf90 ## g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77 ## On HPUX fort77 is the POSIX compliant FORTRAN compiler, and replaces ## f77 in the search list. ## If CC is gcc, first preference is given to the matching FORTRAN ## compiler (g77 or gfortran). ## If none of these is found, R cannot be compiled. ## F77=opt/SUNWspro/bin/f95 -xarch=amd64 ## Options for the FORTRAN 77 compiler. ## Use this to specify FFLAGS for the version of the compiler specified ## above. If unspecified, defaults to '-g -O2' for g77, and '-g' if ## this is accepted, otherwise ''. ## FFLAGS=-xO3 ## Options for safe compilation under the FORTRAN 77 compiler. ## Use this to specify FFLAGS for the version of the compiler specified ## above, using as accurate a result as possible, e.g. no optimization ## or using -ffloat-store. ## SAFE_FFLAGS= ## The following additional FFLAGS to be used only in the main ## compilation and only in building shared libraries
[R] manova discriminant functions?
Hello, I've been playing with the manova() function to do some pretty straightforward multivariate analyses, and I can't for the life of me figure out how to get at the discriminant functions used. When predicting several variables simultaneously, it's important to be able to gauge how much each variable is contributing to the analysis...a simple p-value isn't really enough. I find examination of the discriminant function loadings to be a good indicator of this. Thanks, Adam Kramer __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] lme in R and Splus-7
Hi: I used the function lme in R and Splus-7. With the same dataset and same argument for the function, I got quite different estimation results from these two software. Anyone has this experience before? zhong - Get your own web address. [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] RSNPper SNPinfo and making it handle a vector
Doesn't this provide a programmer with the information that he would need. http://www.ncbi.nlm.nih.gov/projects/SNP/SNPeutils.htm Vincent Carey 525-2265 [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] another good question. dbSNP did not, at the time RSNPper was created, provide easy programmatic access to such nicely curated/amalgamated data from various sources. i suspect that is still the case. but there may be other web services providing information on SNPs, where a clear specification exists regarding what you issue and what you get back, and what you get back tells you things like SNP location, role, relation to genes, population frequency, etc.. if you find one and let me know about it i will consider writing another package to retrieve SNP-related metadata. you might look at the biomaRt package in Bioconductor and see if its snp query resolution facilities meet your needs. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Problems installing R-2.4.1 on Solaris 11 x-86 from source: error in gmake after successful configure]
On Mon, 5 Feb 2007, Octavio Tourinho wrote: Dear friends, I am trying to install R-2.4.1 from source on Solaris 11 x-86_64. running on Sun Ultra-20 workstation, and using the SunStudio 11 compilers. I was able to configure R correctly, but received an error in make, aparently related to bzip2 which I have been unable to debug. The messages are listed below. The configure.log and configure.site and teh terminal output with the error message files are attached. If you read your site settings *carefully*, you will see that at least some are not prefaced by tag=. They will then not be recognised and inserted where needed, leading to chaos. Please go through your site settings once again and correct them. Here is an example that just will not work: ## Header file search directory ('-IDIR') and any other miscellaneous ## options (such as defines) for the C preprocessor and compiler. ## If unset defaults to '-I/usr/local/include', with '-I/sw/include' ## prepended on systems using Fink with root '/sw'. ## CPPFLAGS=-I/usr/local/include -I/usr/local/include/readline -I/usr/sfw/include but you also have: ## The command which runs the C++ compiler. It not specified, configure ## uses the values of the environment variables 'CXX' or 'CCC' if set, ## and then looks under the names 'c++', 'g++', 'gcc', 'CC', 'cxx', and ## 'cc++' (in that order). CXX=/opt/SUNWspro/bin/CC -xarch=amd64 Any help would be sincerely appreciated, as I have exausted my debugging resources. I believe that there is a problem with the configure script in dealing with my particular setup. Octavio Tourinho -- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] The ordinal Package
Hi Justin, there seems to be an answer in this post from Peter Dalgaard: http://tolstoy.newcastle.edu.au/R/help/05/03/1472.html -- Friedrich Schuster [EMAIL PROTECTED] Tel.: +49 6221 737474 Tel.: +49 163 7374744 __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] lme in R and Splus-7
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of yyan liu Sent: Monday, February 05, 2007 11:25 AM To: r-help@stat.math.ethz.ch Subject: [R] lme in R and Splus-7 Hi: I used the function lme in R and Splus-7. With the same dataset and same argument for the function, I got quite different estimation results from these two software. Anyone has this experience before? Why don't you try searching the archives yourself to see? Bert Gunter Genentech Nonclinical Statistics South San Francisco, CA 94404 650-467-7374 __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] Help with party package
I am just starting to experiment with the party package and I am getting strange results. In the examples, the statistic and criterion seem related, i.e. criterion is a 1-p.value and statistic is the test statistic. Higher statistics are associated with higher criteria values. When I run these models on my own dataset, the highest statistic ends up getting a 0.00 criterion value and I get a no valid split message. Here are the results for my test run. $statistic consbanner ShopSpecifically4Toys ShopAlone 0.695049632 3.994070949 0.323828003 PlannedVisit HolidayGiftShoppingForInfants 5.959390531 1.215781494 0.008348165 ShoppingForToddlers Shopping5To8 Shopping9To12 1.514564166 1.272472976 2.916720663 ShoppingForBoys ShoppingForGirls 1.176195270 2.931369192 $criterion consbanner ShopSpecifically4Toys ShopAlone 0.234652500 0.35052 0.253931746 PlannedVisit HolidayGiftShoppingForInfants 0.0 0.775931830 0.006660795 ShoppingForToddlers Shopping5To8 Shopping9To12 0.870117187 0.796794880 0.996462676 ShoppingForBoys ShoppingForGirls 0.760483146 0.996625285 $maxcriterion [1] 0.35 PlannedVisit has the highest statistic but it's criterion is zeroed out. If I run this model utilizing only the ShopSpecifically4Toys variable I get the same statistic but it's criterion value is also zero. Does anyone know what might be causing this? My dataset has 2250 cases. I am using R version 2.4.0 (2006-10-03) Copyright (C) 2006 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform - Windows XP sp2 Michael Conklin Chief Methodologist - Advanced Analytics MarketTools, Inc. 6465 Wayzata Blvd. Suite 170 Minneapolis, MN 55426 Tel: 952.417.4719 | Mobile:612.201.8978 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] MarketTools(r)http://www.markettools.com http://www.markettools.com/ This e-mail and any attachments may contain privileged, confidential or proprietary information. If you are not the intended recipient, be aware that any review, copying, or distribution of this e-mail or any attachment is strictly prohibited. If you have received this e-mail in error, please return it to the sender immediately, and permanently delete the original and any copies from your system. Thank you for your cooperation. [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Problems installing R-2.4.1 on Solaris 11 x-86 from source: error in gmake after successful configure]
On Mon, 5 Feb 2007, Roger Bivand wrote: On Mon, 5 Feb 2007, Octavio Tourinho wrote: Dear friends, I am trying to install R-2.4.1 from source on Solaris 11 x-86_64. running on Sun Ultra-20 workstation, and using the SunStudio 11 compilers. I was able to configure R correctly, but received an error in make, aparently related to bzip2 which I have been unable to debug. The messages are listed below. The configure.log and configure.site and teh terminal output with the error message files are attached. If you read your site settings *carefully*, you will see that at least some are not prefaced by tag=. They will then not be recognised and inserted where needed, leading to chaos. Please go through your site settings once again and correct them. Here is an example that just will not work: Sorry, my mistake - the line breaks were in my mail client, not your original. Do you want to mix gcc and g77 with the SunStudio compilers? You are at the moment (from your configure output), not setting CC or F77 but setting CXX and FC. Is this an appropriate list for your question? ## Header file search directory ('-IDIR') and any other miscellaneous ## options (such as defines) for the C preprocessor and compiler. ## If unset defaults to '-I/usr/local/include', with '-I/sw/include' ## prepended on systems using Fink with root '/sw'. ## CPPFLAGS=-I/usr/local/include -I/usr/local/include/readline -I/usr/sfw/include but you also have: ## The command which runs the C++ compiler. It not specified, configure ## uses the values of the environment variables 'CXX' or 'CCC' if set, ## and then looks under the names 'c++', 'g++', 'gcc', 'CC', 'cxx', and ## 'cc++' (in that order). CXX=/opt/SUNWspro/bin/CC -xarch=amd64 Any help would be sincerely appreciated, as I have exausted my debugging resources. I believe that there is a problem with the configure script in dealing with my particular setup. Octavio Tourinho -- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] rpart
Hello, I have a question for rpart, I try to use it to do prediction for a continuous variable. But I get the different prediction accuracy for same training set, anyone know why? Aimin __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] The ordinal Package
Friedrich Schuster wrote: Hi Justin, there seems to be an answer in this post from Peter Dalgaard: http://tolstoy.newcastle.edu.au/R/help/05/03/1472.html (Including a sarcastic remark from yours truly. I'll stand by it -- he's moved again, it seems, and the software is now listed as available on request at http://popgen.unimaas.nl/~plindsey/rlibs.html ) __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] RSNPper SNPinfo and making it handle a vector
Farrel Buchinsky [EMAIL PROTECTED] wrote: If I run an analysis which generates statistical tests on many SNPs I would naturally want to get more details on the most significant SNPs. Directly from within R one can get the information by loading RSNPer (from Bioconductor) and simply issuing a command SNPinfo(2073285). Unfortunately, the command cannot handle a vector and therefore only wants to do one at a time. Another very useful feature for which I would like to use the same treatment is to use the SNPinfo as a way to get the gene information lapply(best.snp,function(x) try(geneDetails(SNPinfo(x And Vincent Carey 525-2265 [EMAIL PROTECTED] wrote: additionally, snpper is not particularly well maintained (builds seem pretty old) and i think it is going to be replaced. so i don't plan to put much more effort into it until i learn more about snpper.chip.org durability. You might instead look at Ensembl via the biomaRt package -- the HapMap Biomart interface does not (yet) implement the XML Mart interface that BiomaRt uses (boo hiss). These _are_ vectorized. I have made a couple of wrappers specific to SNPs, which you can email me about if they sound useful (snps.by.name, snps.by.region, annotate.snps, maf: they probably need to be updated before I show them off ;)). David Duffy -- | David Duffy (MBBS PhD) ,-_|\ | email: [EMAIL PROTECTED] ph: INT+61+7+3362-0217 fax: -0101 / * | Epidemiology Unit, Queensland Institute of Medical Research \_,-._/ | 300 Herston Rd, Brisbane, Queensland 4029, Australia GPG 4D0B994A v __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] rpart
Yes, I use the same setting, and I calculate MSE and CC as prediction accuracy measure. Someone told me I should not trust one tree and should do bagging. Is this correct? Aimin At 03:11 PM 2/5/2007, Wensui Liu wrote: are you sure you are using the same setting, tree size, and so on? On 2/5/07, Aimin Yan [EMAIL PROTECTED] wrote: Hello, I have a question for rpart, I try to use it to do prediction for a continuous variable. But I get the different prediction accuracy for same training set, anyone know why? Aimin __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. -- WenSui Liu A lousy statistician who happens to know a little programming (http://spaces.msn.com/statcompute/blog) __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] strange error in robust package
Hi everybody, I am using quite frequently the robust package and until now i never had any problems. Actually last time i used it was last Friday very successfully. Anyway, today anytime i want to use the function fit.models i get the following error even if i use the example form the help file: data(woodmod.dat) woodmod.fm - fit.models(list(Robust = covRob, Classical = cov), data = woodmod.dat) Error in donostah(data, control) : object .Random.seed not found Error in model.list[[i]] : subscript out of bounds Does anybody know what is wrong? Thanks, Monica Palaseanu-Lovejoy USGS / ETI Pro St. Petersburg, FL _ Spaces __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] prop.test() references
Dear Marc, I believe that this is a modification by Newcombe. See: Newcombe RG: Two-Sided Confidence Intervals for the Single Proportion: Comparison of Seven Methods. Statistics in Medicine 1998;17:857-872. Newcombe RG: Interval Estimation for the Difference Between Independent Proportions: Comparison of Eleven Methods. Statistics in Medicine 1998;17:873-890. thank you very much for the references. The paragraph with number 4 page 859 in Newcombe is as follows in LaTeX: % \documentclass{article} \begin{document} Score method incorporating continuity corection\cite{six,nineteen}. The interval consists of all $\theta$ such that $\left| p - \theta \right| - \frac{1}{2n} \le z \sqrt{\frac{\theta(1 - \theta)}{n}}$. Expressions for the lower and upper limits $L$ and $U$ in closed forms are available: $$ L = \frac{2np + z^2 -1 -z \sqrt{z^2 -2 -\frac1n + 4p(nq +1)}}{2 (n + z^2)} $$ $$ U = \frac{2np + z^2 +1 +z \sqrt{z^2 -2 -\frac1n + 4p(nq +1)}}{2 (n + z^2)} $$ However, if $p = 0$, $L$ must be taken as $0$; if $p = 1$, $U$ is then $1$. \begin{thebibliography}{99} \bibitem{six} Blyth, C.R., Still, H.A. (1983) Binomial confidence intervals. \textit{Journal of the American Statistical Association},\textbf{78}:108-116. \bibitem{nineteen} Fleiss, J.L. (1981) \textit{Statistical Methods for Rates and Proportions}, 2nd edn, Wiley, New York, USA. \end{thebibliography} \end{document} % After some rearangements, the formulas for the lower (L) and upper (U) bounds are consistent with the code used in prop.test(). Note that Newcombe credits them to earlier works. If I understand well the paper by Newcombe, the continuity correction in the confidence interval according to Wilson (1927) is always used. Could it be that it is the same when I'm using prop.test() just to get the confidence interval as in prop.test(x = 340, n = 400) ? the code : YATES - min(YATES, abs(x - n * p)) seems to have no effect because p is set to 0.5 by if (is.null(p) (k == 1)) p - 0.5 so that abs(x - n * p)) is at least 0.5 When correct == TRUE, YATES is initially set to 0.5, so that min(0.5, = 0.5) is always 0.5. On an other hand, the doc says that Continuity correction is used only if it does not exceed the difference between sample and null proportions in absolute value, so that shouldn't it be something like abs(x/n - p) to have two proportions ? Sorry if it is obvious, but I'm completely lost here. Best, -- Jean R. Lobry([EMAIL PROTECTED]) Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - LYON I, 43 Bd 11/11/1918, F-69622 VILLEURBANNE CEDEX, FRANCE allo : +33 472 43 27 56 fax: +33 472 43 13 88 http://pbil.univ-lyon1.fr/members/lobry/ __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] strange error in robust package
Probably not worth the effort to try and figure out. Try reinstalling the latest version of the package and repeating. Maybe something got corrupted. Also, while you're at it, make sure you have the latest version or R installed and all your other packages are up to date (robust uses some of them). Bert Gunter Nonclinical Statistics 7-7374 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Monica Pisica Sent: Monday, February 05, 2007 2:34 PM To: r-help@stat.math.ethz.ch Subject: [R] strange error in robust package Importance: High Hi everybody, I am using quite frequently the robust package and until now i never had any problems. Actually last time i used it was last Friday very successfully. Anyway, today anytime i want to use the function fit.models i get the following error even if i use the example form the help file: data(woodmod.dat) woodmod.fm - fit.models(list(Robust = covRob, Classical = cov), data = woodmod.dat) Error in donostah(data, control) : object .Random.seed not found Error in model.list[[i]] : subscript out of bounds Does anybody know what is wrong? Thanks, Monica Palaseanu-Lovejoy USGS / ETI Pro St. Petersburg, FL _ Spaces __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] manova discriminant functions: Addendum
As an addendum to my earlier post, I am having another difficulty with getting manova() to behave as I would like: when I specify contrasts for my independent variable(s), I am unsure of how to test them. This is a contrived example of both of my questions: Assume three alertness measurements, alert1 alert2 alert3, a within-subjects variable measuring their alertness at three timepoints, minutes after taking the drug (alert1), one hour (alert2), and two hours (alert3). The between-subjects variable is dosage, with dose==0 when subjects have had no drug, dose==1 when they have had a single dose, dose==2 when they have had a double dose. My intuition says to do the following: alert - cbind(alert1,alert2,alert3) %*% contr.poly(3) contrasts(dose) - matrix(c(2,-1,-1,0,1,-1),3,2) m - manova(alert ~ dose) ...what I want is two main effects (dose and alert) and one interaction (dose by alert), but also main effect and interaction for the two individual contrasts for dose. For the main effect for alert, and all of the dose*alert interactions, I need the discriminant function loadings of my two alertness contrasts in order to interpret the manner in which alertness is varying (e.g., is it varying in a linear or quadratic way). m2 - manova (alert ~ dose) summary(m2) ...gives me a test for the dose * alertness interaction. Good! But I can't seem to find the contrasts I asked for for dose. In univariate ANOVA, I usually just call summary.lm() which gives me t-test coefficients for each level of the dose contrast...but calling summary.lm on a manova object returns t-tests on three unnamed coefficients, with 27 error degrees of freedom (when it should be 26, as I am intending to compute both dosage contrasts simultaneously). Also, I cannot tell whether it is the linear or quadratic contrast that is contributing to the differentiation of dosage levels--this is why I need the discriminant function loadings. m2 - lm( apply(cbind(alert1,alert2,alert3),1,mean) ~ dose) summary(m2) ...gives me a test for the two contrasts, which can be pooled to get a main effect. Excellent! ...finally, for the main effect of alertness, I'm more or less at a loss. The question is whether the three alertness conditions differ from each other, or whether some linear combination of the linear and quadratic contrast columns is significantly different from zero...and then the relative weightings of the linear and quadratic contrasts. Any suggestions? Thanks, Adam On Mon, 5 Feb 2007, Adam D. I. Kramer wrote: Hello, I've been playing with the manova() function to do some pretty straightforward multivariate analyses, and I can't for the life of me figure out how to get at the discriminant functions used. When predicting several variables simultaneously, it's important to be able to gauge how much each variable is contributing to the analysis...a simple p-value isn't really enough. I find examination of the discriminant function loadings to be a good indicator of this. Thanks, Adam Kramer __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] ar function in stats
I had a couple of questions about the ar function that i was hoping someone could answer. I have the structure below testSeries-structure(c(-3.88613620955214e-05, 0, -7.77272551011343e-05, 0, -0.000194344573539562, -0.000116624876218163, -3.88779814601281e-05, 0, 3.88779814601281e-05, -0.000155520995647807, -0.000116656621367561, -3.5648225368e-05, -3.88900772017586e-05, 7.77786420242954e-05, 0, 7.77725929772544e-05, 0, 0, -3.88855404165889e-05, -0.00017284283514, 0.000116670231722849, 7.77725929772544e-05, 0, 0, 3.88840283903069e-05, -0.000116656621367561, -7.77786420242954e-05, 0.000233317779873343, -0.000155539137849048, 0, 0, -3.5648225368e-05, 0, 0, 0.000116661157799791, 3.88840283903069e-05, 0, -3.88840283903069e-05, 7.77665448717935e-05, 7.77604977061919e-05, 0.000155502857678291, 0, 0, 7.77423618523176e-05, -7.77423618523176e-05, 3.88719364105006e-05, 3.88704254418171e-05, -3.88704254418171e-05, 3.88704254418171e-05, 0.0002331908288839, -7.77242344552342e-05, 0, -7.7730275981791e-05, -7.77363184468749e-05, -7.77423618523176e-05, 0, -0.000116624876218163, -3.88779814601281e-05, -0.00023329963240, 7.77725929772544e-05, 7.77665448717935e-05, 0.00011663847916632, 7.7751428721684e-05, 0, 3.88734474964791e-05, 3.88719364105006e-05, 7.77393400321347e-05, 3.88674038565573e-05, -3.88674038565573e-05, 0, 7.77332970969269e-05, -3.88658932403696e-05, -3.88674038565573e-05, 0, 0, 3.88674038565573e-05, 7.7730275981791e-05, -7.7730275981791e-05, 0, 7.7730275981791e-05, 0, 0, 0.000233154582543582, 0.000194253968248181, 3.88462659076660e-05, 7.76880050110673e-05, -7.76880050110673e-05, 0, 7.76880050110673e-05, -3.88432480773471e-05, 0, 3.88432480773471e-05, 0, 0, 0, -3.88432480773471e-05, -0.000194238875579067, 0, -3.88523029751786e-05, -3.88538125353222e-05, -0.000116570496139390, -3.8859851948958e-05, 0, 0, 0.000155430348088348, 0, 3.88538125353222e-05, 0, 3.88523029751786e-05, 0, 3.88507935322746e-05, 3.88492842067212e-05, 0, 0, -7.77000777389958e-05, 0, 0, -3.88523029751786e-05, -3.88538125353222e-05, 0, 0.000155406193249497, 0, -0.000155406193249497, -0.000116570496139390, -3.8859851948958e-05, -7.77242344552342e-05, -3.88643827414215e-05, 3.88643827414215e-05, 3.88628723597129e-05, -7.77272551011343e-05, -3.88658932403696e-05, 0.000116593148341504, 0, 7.77212140444794e-05, 0, 0, 0, 3.88583419195232e-05, 7.77121542198667e-05, 0, 0, 7.77061155105008e-05, 0, 7.77000777389958e-05, 0, 0, -7.77000777389958e-05, 7.77000777389958e-05, 0, -7.77000777389958e-05, 3.88507935322746e-05, 3.88492842067212e-05, -7.77000777389958e-05, 7.77000777389958e-05, -7.77000777389958e-05, 7.77000777389958e-05, -3.88492842067212e-05, 3.88492842067212e-05, 0, 0, 0, 3.88477749986849e-05, -3.88477749986849e-05, 0, 0, -3.88492842067212e-05, 0, -3.88507935322746e-05, 0, 0, -0.000155418269730367, 0, 3.88568320072724e-05, -3.88568320072724e-05, 0, 0, 0, 0, 0, -7.77181938684812e-05, -7.77242344552342e-05, 7.77242344552342e-05, 0, 7.77181938684812e-05, 0, -7.77181938684812e-05, 3.8859851948958e-05, 0, 0, -3.8859851948958e-05, 0, 0, 0, -7.77242344552342e-05, -0.000233208956280984, -0.000155502857678291, 0.000155502857678291, -3.88734474964791e-05, 0, 3.88734474964791e-05 ), index = structure(c(1115056920, 1115056980, 1115057040, 1115057100, 1115057160, 1115057220, 1115057280, 1115057340, 1115057400, 1115057460, 1115057520, 1115057580, 1115057640, 1115057700, 1115057760, 1115057820, 1115057880, 1115057940, 1115058000, 1115058060, 1115058120, 1115058180, 1115058240, 1115058300, 1115058360, 1115058420, 1115058480, 1115058540, 1115058600, 1115058660, 1115058720, 1115058780, 1115058840, 1115058900, 1115058960, 1115059020, 1115059080, 1115059140, 1115059200, 1115059260, 1115059320, 1115059380, 1115059440, 1115059500, 1115059560, 1115059620, 1115059680, 1115059740, 1115059800, 1115059860, 1115059920, 1115059980, 1115060040, 1115060100, 1115060160, 1115060220, 1115060280, 1115060340, 1115060400, 1115060460, 1115060520, 1115060580, 1115060640, 1115060700, 1115060760, 1115060820, 1115060880, 1115060940, 1115061000, 1115061060, 1115061120, 1115061180, 1115061240, 1115061300, 1115061360, 1115061420, 1115061480, 1115061540, 1115061600, 1115061660, 1115061720, 1115061780, 1115061840, 1115061900, 1115061960, 1115062020, 1115062080, 1115062140, 1115062200, 1115062260, 1115062320, 1115062380, 1115062440, 1115062500, 1115062560, 1115062620, 1115062680, 1115062740, 1115062800, 1115062860, 1115062920, 1115062980, 1115063040, 1115063100, 1115063160, 1115063220, 1115063280, 1115063340, 1115063400, 1115063460, 1115063520, 1115063580, 1115063640, 1115063700, 1115063760, 1115063820, 1115063880, 1115063940, 1115064000, 1115064060, 1115064120, 1115064180, 1115064240, 1115064300, 1115064360, 1115064420, 1115064480, 1115064540, 1115064600, 1115064660, 1115064720, 1115064780, 1115064840, 1115064900, 1115064960, 1115065020, 1115065080, 1115065140, 1115065200, 1115065260, 1115065320,
Re: [R] Confidence intervals of quantiles
On 05-Feb-07 Mike White wrote: Can anyone please tell me if there is a function to calculate confidence intervals for the results of the quantile function. Some of my data is normally distributed but some is also a squewed distribution or a capped normal distribution. Some of the data sets contain about 700 values whereas others are smaller with about 100-150 values, so I would like to see how the confidence intervals change for the different distributions and different data sizes. As well as the bootstrap suggestion (which may do what you want) I'd like to suggest calcualting exact CIs for the distribution quantiles. I don't know of an R function which does this, though the principle is straightforward enough (I once implemented it for octave/matlab). I'm assuming you're after a truly distribution-free CI (as your query suggests). In that case, the sample quantiles provide the CI limits for the distribution quantiles, with the proviso that you will not in general get an exact match for the confidence level P that you desire for your confidence interval, so you need to use P as a lower bound for the confidence level. I'll illustrate with an equi-tailed 95% CI. Notation: x[r] (r = 1:n) is the r-th order statistic of a sample of n values of a random variable X, drawn from a continuous distribution. X[r] is the corresponding random variable. X(p) is the p-th quantile of the distribution in question, i.e. the value of X such that P(X = X[p]) = p. 0 p 1. Objective: You want a 95% CI (X(p)L,X(p).R) for the quantile X(p) for given p. Principle: P( X[r] = X(p) ) = pbinom(r, n, p) [*] (i.e. the probability that you get at least r of the x's below X(p)). Now, for the upper limit X(p).R of the CI, you want the smallest value of X(p) such that the probability [*] is not less than 0.925 (i.e. 1 - (1-P)/2 = 1 - (1-0.95)/2 ). This is achieved by X(p).R = x[s] where s = min(which(pbinom((0:n),n,p) = 0.025)) and, similalry, for the lower limit, X(p).L = x[r] where r = max(which(pbinom((0:n),n,p) = 0.025)) (Note that the which counts the binomial case r=0 as number 1) If I've got my head around the above right, the following function does the above job, and caould be fairly easily modified for asymmetric confidence intervals (e.g. a 95% confidence interval with 96% for inclusion below the upper limit and 99% for inclusion above the lower limit). q.CI-function(x,p,P){ # x is the sample, p (0p1) the quantile, P the confidence level x-sort(x) n-length(x) s - min(which(pbinom((0:n),n,p) = 1-(1-P)/2)) r - max(which(pbinom((0:n),n,p) = (1-P)/2)) c(x[r],x[s]) # x[r] is the lower limit, x[s] the upper limit, of the CI } Note that it gives a confidence level P at least equal to P, not in general exactly equal to P. I've tested it as follows (1 simulations with samples of size 101 from a Normal distribution -- why not, after all? No loss of generality!): p-0.5; Xq-qnorm(p); P-0.95 N-1; incls-numeric(N) for(i in (1:N)){ x-rnorm(101) CI-q.CI(x,p,P) if((CI[1]=Xq)(CI[2]=Xq)){ incls[i]-1 } }; sum(incls)/N # [1] 0.9564 # [1] 0.9548 p-0.75; Xq-qnorm(p); P-0.95 [etc. ... ] # [1] 0.9631 # [1] 0.9596 p-0.90; Xq-qnorm(p); P-0.95 [etc. ... ] # [1] 0.9540 # [1] 0.9533 p-0.95; Xq-qnorm(p); P-0.95 [etc. ... ] # [1] 0.9840 # [1] 0.9826 p-0.99; Xq-qnorm(p); P-0.95 [etc. ... ] Error in if ((CI[1] = Xq) (CI[2] = Xq)) { : missing value where TRUE/FALSE needed showing that for extreme values of p relative to the sample size, trouble occurs (as is to be expected)! The solution is to test for NA in CI[1] and/or CI[2], so I modified my test routine as follows, to give notional lower confidence limit -Inf if CI[1] is NA, and/or upper confidence limit +Inf if CI[2] is NA (of course this could be done in the function q.CI() itself, but perhaps it offers more flexibility for the user to do something else with it, if it is left as NA). p-0.99; Xq-qnorm(p); P-0.95 N-1; incls-numeric(N) for(i in (1:N)){ x-rnorm(101) CI-q.CI(x,p,P) if(is.na(CI[1])){ CI[1]-(-Inf) } if(is.na(CI[2])){ CI[2]-(+Inf) } if((CI[1]=Xq)(CI[2]=Xq)){ incls[i]-1 } }; sum(incls)/N # [1] 0.9841 # [1] 0.9821 Comments welcome!!! Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 05-Feb-07 Time: 23:40:23 -- XFMail -- __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] ar function in stats
Try: ar(testSeries, demean = FALSE, method = burg, var.method = 2) Call: ar(x = testSeries, method = burg, demean = FALSE, var.method = 2) Coefficients: 123456 0.0888 0.0063 0.0654 -0.0169 0.0215 0.0950 Order selected 6 sigma^2 estimated as 5.194e-09 On 2/5/07, Leeds, Mark (IED) [EMAIL PROTECTED] wrote: I had a couple of questions about the ar function that i was hoping someone could answer. I have the structure below testSeries-structure(c(-3.88613620955214e-05, 0, -7.77272551011343e-05, 0, -0.000194344573539562, -0.000116624876218163, -3.88779814601281e-05, 0, 3.88779814601281e-05, -0.000155520995647807, -0.000116656621367561, -3.5648225368e-05, -3.88900772017586e-05, 7.77786420242954e-05, 0, 7.77725929772544e-05, 0, 0, -3.88855404165889e-05, -0.00017284283514, 0.000116670231722849, 7.77725929772544e-05, 0, 0, 3.88840283903069e-05, -0.000116656621367561, -7.77786420242954e-05, 0.000233317779873343, -0.000155539137849048, 0, 0, -3.5648225368e-05, 0, 0, 0.000116661157799791, 3.88840283903069e-05, 0, -3.88840283903069e-05, 7.77665448717935e-05, 7.77604977061919e-05, 0.000155502857678291, 0, 0, 7.77423618523176e-05, -7.77423618523176e-05, 3.88719364105006e-05, 3.88704254418171e-05, -3.88704254418171e-05, 3.88704254418171e-05, 0.0002331908288839, -7.77242344552342e-05, 0, -7.7730275981791e-05, -7.77363184468749e-05, -7.77423618523176e-05, 0, -0.000116624876218163, -3.88779814601281e-05, -0.00023329963240, 7.77725929772544e-05, 7.77665448717935e-05, 0.00011663847916632, 7.7751428721684e-05, 0, 3.88734474964791e-05, 3.88719364105006e-05, 7.77393400321347e-05, 3.88674038565573e-05, -3.88674038565573e-05, 0, 7.77332970969269e-05, -3.88658932403696e-05, -3.88674038565573e-05, 0, 0, 3.88674038565573e-05, 7.7730275981791e-05, -7.7730275981791e-05, 0, 7.7730275981791e-05, 0, 0, 0.000233154582543582, 0.000194253968248181, 3.88462659076660e-05, 7.76880050110673e-05, -7.76880050110673e-05, 0, 7.76880050110673e-05, -3.88432480773471e-05, 0, 3.88432480773471e-05, 0, 0, 0, -3.88432480773471e-05, -0.000194238875579067, 0, -3.88523029751786e-05, -3.88538125353222e-05, -0.000116570496139390, -3.8859851948958e-05, 0, 0, 0.000155430348088348, 0, 3.88538125353222e-05, 0, 3.88523029751786e-05, 0, 3.88507935322746e-05, 3.88492842067212e-05, 0, 0, -7.77000777389958e-05, 0, 0, -3.88523029751786e-05, -3.88538125353222e-05, 0, 0.000155406193249497, 0, -0.000155406193249497, -0.000116570496139390, -3.8859851948958e-05, -7.77242344552342e-05, -3.88643827414215e-05, 3.88643827414215e-05, 3.88628723597129e-05, -7.77272551011343e-05, -3.88658932403696e-05, 0.000116593148341504, 0, 7.77212140444794e-05, 0, 0, 0, 3.88583419195232e-05, 7.77121542198667e-05, 0, 0, 7.77061155105008e-05, 0, 7.77000777389958e-05, 0, 0, -7.77000777389958e-05, 7.77000777389958e-05, 0, -7.77000777389958e-05, 3.88507935322746e-05, 3.88492842067212e-05, -7.77000777389958e-05, 7.77000777389958e-05, -7.77000777389958e-05, 7.77000777389958e-05, -3.88492842067212e-05, 3.88492842067212e-05, 0, 0, 0, 3.88477749986849e-05, -3.88477749986849e-05, 0, 0, -3.88492842067212e-05, 0, -3.88507935322746e-05, 0, 0, -0.000155418269730367, 0, 3.88568320072724e-05, -3.88568320072724e-05, 0, 0, 0, 0, 0, -7.77181938684812e-05, -7.77242344552342e-05, 7.77242344552342e-05, 0, 7.77181938684812e-05, 0, -7.77181938684812e-05, 3.8859851948958e-05, 0, 0, -3.8859851948958e-05, 0, 0, 0, -7.77242344552342e-05, -0.000233208956280984, -0.000155502857678291, 0.000155502857678291, -3.88734474964791e-05, 0, 3.88734474964791e-05 ), index = structure(c(1115056920, 1115056980, 1115057040, 1115057100, 1115057160, 1115057220, 1115057280, 1115057340, 1115057400, 1115057460, 1115057520, 1115057580, 1115057640, 1115057700, 1115057760, 1115057820, 1115057880, 1115057940, 1115058000, 1115058060, 1115058120, 1115058180, 1115058240, 1115058300, 1115058360, 1115058420, 1115058480, 1115058540, 1115058600, 1115058660, 1115058720, 1115058780, 1115058840, 1115058900, 1115058960, 1115059020, 1115059080, 1115059140, 1115059200, 1115059260, 1115059320, 1115059380, 1115059440, 1115059500, 1115059560, 1115059620, 1115059680, 1115059740, 1115059800, 1115059860, 1115059920, 1115059980, 1115060040, 1115060100, 1115060160, 1115060220, 1115060280, 1115060340, 1115060400, 1115060460, 1115060520, 1115060580, 1115060640, 1115060700, 1115060760, 1115060820, 1115060880, 1115060940, 1115061000, 1115061060, 1115061120, 1115061180, 1115061240, 1115061300, 1115061360, 1115061420, 1115061480, 1115061540, 1115061600, 1115061660, 1115061720, 1115061780, 1115061840, 1115061900, 1115061960, 1115062020, 1115062080, 1115062140, 1115062200, 1115062260, 1115062320, 1115062380, 1115062440, 1115062500, 1115062560, 1115062620, 1115062680, 1115062740, 1115062800, 1115062860, 1115062920, 1115062980, 1115063040, 1115063100, 1115063160, 1115063220, 1115063280, 1115063340, 1115063400, 1115063460,
[R] Metapost device driver
Hi All, I've started work on a MetaPost device driver (please don't hold your breath). I've copied the XFig driver and renamed everything and this works, I can open the new metapost() and it works exactly like the xfig driver. Now all I have to do is the actual work! Just one question. There is a magic number in ExtEntries as follows: static const R_ExternalMethodDef ExtEntries[] = { EXTDEF(PicTeX, 6), EXTDEF(PostScript, 16),EXTDEF(XFig, 11), EXTDEF(MetaPost, 12),/* Is 12 is OK */ EXTDEF(PDF, 13), I just picked 12, is this Ok, or does it have some special significance? Cheers, Geoff Russell. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] rpart
man, oh, man Surely you can use bagging, or probably boosting. But that doesn't answer your question, does it? Believe me, even you use bagging, the result will vary, depending on set.seed(). On 2/5/07, Aimin Yan [EMAIL PROTECTED] wrote: Yes, I use the same setting, and I calculate MSE and CC as prediction accuracy measure. Someone told me I should not trust one tree and should do bagging. Is this correct? Aimin At 03:11 PM 2/5/2007, Wensui Liu wrote: are you sure you are using the same setting, tree size, and so on? On 2/5/07, Aimin Yan [EMAIL PROTECTED] wrote: Hello, I have a question for rpart, I try to use it to do prediction for a continuous variable. But I get the different prediction accuracy for same training set, anyone know why? Aimin __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. -- WenSui Liu A lousy statistician who happens to know a little programming (http://spaces.msn.com/statcompute/blog) -- WenSui Liu A lousy statistician who happens to know a little programming (http://spaces.msn.com/statcompute/blog) __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] Reshaping wide form to long form of repeated measure data
Hello R-users: I am new to the R-world. I am trying to reshape the wide longitudinal data into the long form. I have used the following codes for the attached data file xyw1.rda: long=reshape(xyw1, idvar=Subject, varying=list(names(xyw1)[9:15]), v.names=Ddimer, timevar=time, direction=long) I was expecting 10 clusters but when I run the geeglm it is analyzing many more clusters(70) with cluster size =1. How can I modify this code so that there would be only ten (10) clusters and size of the each clusters would be seven (7)? Any help would be sincerely appreciated. Best Regards, Sattar The fish are biting. Get more visitors on your site using Yahoo! Search Marketing. http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php__ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] sample size calculations
Greetings, I have experimented with the MBESS and pwr packages for the estimation of sample size for a given CV, precision, and confidence interval. Thus far I have found the ss.aipe.cv {MBESS} (Sample size planning for the coefficient of variation given the goal of Accuracy in Parameter Estimation approach to sample size planning.) function to be best suited for my needs. However, the data from which I am calculating my CV is approximately log-normally distributed- and thus has a large CV (1.4). Using this CV, precision (20% within the pop mean) and confidence interval (95%) parameters I obviously get a suggested sample size that is very large (n = 1182). By reducing my precision and confidence interval requirements to something like: ss.aipe.cv(C.of.V=1.4, width=0.5, conf.level=0.9) ... the function still suggests about 230 samples which is near the upper limit of feasibility. I would like to deduce an optimal number of samples, however the log-normal distribution of this data suggests that the above approach is not well suited to this task. Are there any better approaches or references which might send me in the right direction? Thanks in advance, -- Dylan Beaudette Soils and Biogeochemistry Graduate Group University of California at Davis 530.754.7341 __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] sort dataframe
Hello sir: How can I sort a dataframe by sorting one of its column? e.g. dataframe: id x y a 0.1 3 b 0.5 1 c 0.2 9 d 05 I want the dataframe sorted according to y accending,the result is: id xy b 0.5 1 a 0.1 3 d 05 c 0.2 9 Thanks a lot! My best __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] sort dataframe
d-data.frame(id=1:4,x=c(0.1,0.5,0.2,0),y=c(3,1,9,5)) d id x y 1 1 0.1 3 2 2 0.5 1 3 3 0.2 9 4 4 0.0 5 d[order(d$y),] id x y 2 2 0.5 1 1 1 0.1 3 4 4 0.0 5 3 3 0.2 9 On 2/6/07, XinMeng [EMAIL PROTECTED] wrote: Hello sir: How can I sort a dataframe by sorting one of its column? e.g. dataframe: id x y a 0.1 3 b 0.5 1 c 0.2 9 d 05 I want the dataframe sorted according to y accending,the result is: id xy b 0.5 1 a 0.1 3 d 05 c 0.2 9 Thanks a lot! My best __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] Question on computing mv-norm density
Hi, I am trying to figure out how to evaluate the density function of multivariate normal efficiently for a large data set, the data set should look like this (take d=2 for example): datamean sigma 2.131, 3.000 1.000,1.000 1 0 0 1 1.231,5.1412.000,2.000 .5 -.1 . . -.1 .4 . that is , I need SUM_i (log(dmvnorm(d[i], mu[i], sigma[i])). tried to rewrite the dmvnorm function from mvtnorm package, but could not find a satisfactory method to avoid using loops. ( using those apply functions seem to be slower than loops) . May I get some suggestion on this ? Thanks a lot in advance. best __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Re: [R] Rconsole - setting the size and location of Windows help files (Rgui)
For size, maybe: # Dimensions(in characters) of the internal pager. #pgrows = 25 #pgcolumns = 80 pgrows = 48 pgcolumns = 128 in Rconsole, but location cannot be handled. On 2/6/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, Using the Rconsole file I can specify the size and location of the Rgui windows on NT. e.g. # Dimensions (in characters) of the console. rows = 51 columns = 100 How can I specify the size of the help windows that popups when I ask for help? e.g. '?help' I would like the popup window to have say rows = 51 and columns = 100, just like the main window but a different location on the screen. In my .Rprofile file I have set 'options(winhelp=FALSE)'. platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 4.1 year 2006 month 12 day18 svn rev40228 language R version.string R version 2.4.1 (2006-12-18) Regards, John. John Gavin [EMAIL PROTECTED], Commodities, FIRC, UBS Investment Bank, 2nd floor, 100 Liverpool St., London EC2M 2RH, UK. Phone +44 (0) 207 567 4289 This communication is issued by UBS AG and/or affiliates to institutional investors; it is not for private persons. This is a product of a sales or trading desk and not the Research Dept. Opinions expressed may differ from those of other divisions of UBS, including Research. UBS may trade as principal in instruments identified herein and may accumulate/have accumulated a long or short position in instruments or derivatives thereof. UBS has policies designed to negate conflicts of interest. This e-mail is not an official confirmation of terms and unless stated, is not a recommendation, offer or solicitation to buy or sell. Any prices or quotations contained herein are indicative only. Communications may be monitored. (c) 2006 UBS. All rights reserved. Intended for recipient only and not for further distribution without the consent of UBS. UBS Limited is a company registered in England Wales under company number 2035362, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. UBS AG (London Branch) is registered as a branch of a foreign company under number BR004507, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. UBS Clearing and Execution Services Limited is a company registered in England Wales under company number 03123037, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
[R] ANOVA Table for Full Linear Model?
Hello, I have spent a good deal of time searching for an answer to this but have come up empty-handed; I apologize if I missed something that is common knowledge. I am trying to figure out how to get an ANOVA table that shows the sum of squares. degrees of freedom, etc, for the full model versus the error (aka residuals). Here is an example of the kind of table I'd like to get: Analysis of Variance Source DF SS MS FP Regression1 8654.7 8654.7102.350.000 Error75 6342.184.6 Total76 14996.8 This kind of table is prevalent throughout my statistics textbook, and can apparently be easily obtained in other statistical software tools. I'm not saying this as a gripe, but just as evidence that I'm not trying to do something obviously bizarre. Here is an example of the only kind of ANOVA table for a single linear model that I've been able to get using R: regression9 - lm(y ~ x1 + x2 + x3, data=data9) anova.lm(regression9) Analysis of Variance Table Response: y Df Sum Sq Mean Sq F valuePr(F) x1 1 8275.4 8275.4 81.8026 2.059e-11 *** x2 1 480.9 480.9 4.7539 0.03489 * x3 1 364.2 364.2 3.5997 0.06468 . Residuals 42 4248.8 101.2 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Is there a way to get an ANOVA table with the full linear regression model considered as a whole rather than broken down into each additional predictor variable? In other words, is there a way to get the former kind of table? Again, apologies if I'm missing something basic. thanks very much, ~jason PS - I am on Mac OSX 10.4.8 using R 2.4.1 GUI 1.18 (4038) ~ Jason R. Finley Graduate Student, Department of Psychology Cognitive Division University of Illinois, Urbana-Champaign [EMAIL PROTECTED] [EMAIL PROTECTED] http://www.jasonfinley.com/ ~ __ R-help@stat.math.ethz.ch 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, minimal, self-contained, reproducible code.