[R] Generating data with a certain correlation length
Hi, Can anyone help me with following? I want to write a program which does following: for a 2dim surface generate random data, for certain points on that surface, for which a certain correlation length exists. Thanx, Roy -- The information contained in this communication and any atta...{{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
[R] Forum of Mac questions (Was: loading packages - mac user)
On Tue, 2005-10-18 at 13:13 -0700, Thomas Lumley wrote: Both for this and for working out why Tcl/Tk isn't installed you might be better off trying R-sig-mac rather than r-help This is a very common piece of advice. However, this is not what you would imagine if you read the description of R-SIG-mac on the R home page: R-SIG-Mac R Special Interest Group on Mac Development This is very similar to the description of R-devel: This list is intended for questions and discussion about code development in R. And that description is even more intimidating when you read further: Questions likely to prompt discussion unintelligible to non-programmers or topics that are too technical for R-help's audience should go to R-devel Would it make sense to change the description of R-SIG-mac so that it would welcome question on R usage in Mac, instead of being a Mac Devolepment forum that sounds like being unintelligible to non-programmers? cheers, jari oksanen -- Jari Oksanen [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
Re: [R] Forum of Mac questions (Was: loading packages - mac user)
On Wed, 19 Oct 2005, Jari Oksanen wrote: On Tue, 2005-10-18 at 13:13 -0700, Thomas Lumley wrote: Both for this and for working out why Tcl/Tk isn't installed you might be better off trying R-sig-mac rather than r-help This is a very common piece of advice. However, this is not what you would imagine if you read the description of R-SIG-mac on the R home page: It is not actually on the R home page or even on www.r-project.org. I think you mean https://stat.ethz.ch/mailman/listinfo/r-sig-mac This arises because the purpose of the list has changed from R Special Interest Group on Macintosh Development and Porting, both for MacOS 8.6 - 9.x and MacOS X I think a wording like R-sig-debian namely R Special Interest Group for MacOS X ports of R would be better. R-SIG-Mac R Special Interest Group on Mac Development This is very similar to the description of R-devel: This list is intended for questions and discussion about code development in R. And that description is even more intimidating when you read further: Questions likely to prompt discussion unintelligible to non-programmers or topics that are too technical for R-help's audience should go to R-devel Would it make sense to change the description of R-SIG-mac so that it would welcome question on R usage in Mac, instead of being a Mac Devolepment forum that sounds like being unintelligible to non-programmers? Which seems quite reasonable to me. The topics which provoke this response usually are questions unintelligible except to Mac sysadmins/programmers and definitely `too technical for R-help's audience'. -- 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
[R] Unix proxy and firewall problems
I was trying to install R on a unix server. Because of a firewall i can't install biocLite for working with Bioconductor. With windows it wasn't a problem. I used the option '--internet2' to bypass the firewall. I don't have any idea, how to do it with unix. I tried to set my proxy Sys.putenv(http_proxy=http...:8080) Sys.getenv(http_proxy) http_proxy http://...:8080; http://by-cache.bayer-ag.com:8080/ but than by try to use the source command to download the bioC.R script I'm getting the message: source(http:/bioconductor.org/getBioC.R) Error in file(file, r, encoding = encoding) : unable to open connection In addition: Warning message: cannot open file 'http:/bioconductor.org/getBioC.R' Is there a possibility to change the proxy setting after the programm is already running or do i need to do it before? THX Assa -- Assa Yeroslaviz Loetzenerstr. 15 51373 Leverkusen __ 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
[R] Wavelet recunstruction
Hi There, I tried to find a function in {waveslim} or {wavethresh} in order to recunstruct the decomposed signals. As far as I found there is no function in {waveslim} to recunstruct decomposed data. The function wr{wavethresh} recunstructs the results of wd function. Apart from its limitations ( for example the length of vector must be power of 2 ) it apparently doesn't work with the functions and objects in waveslim. What could help ? So many thanks for your any idea. Amir Safari - [[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
Re: [R] Unix proxy and firewall problems
From ?download.file These environment variables must be set before the download code is first used: they cannot be altered later by calling 'Sys.putenv'. Also, Sys.putenv(http_proxy=http...:8080) sets that to the value in and not the value of a variable named that: for the latter you must use `` quoting. This is I suspect the actual failure cause. On Wed, 19 Oct 2005, Assa Yeroslaviz wrote: I was trying to install R on a unix server. Because of a firewall i can't install biocLite for working with Bioconductor. With windows it wasn't a problem. I used the option '--internet2' to bypass the firewall. I don't have any idea, how to do it with unix. I tried to set my proxy Sys.putenv(http_proxy=http...:8080) Sys.getenv(http_proxy) http_proxy http://...:8080; http://by-cache.bayer-ag.com:8080/ but than by try to use the source command to download the bioC.R script I'm getting the message: source(http:/bioconductor.org/getBioC.R) Error in file(file, r, encoding = encoding) : unable to open connection In addition: Warning message: cannot open file 'http:/bioconductor.org/getBioC.R' Is there a possibility to change the proxy setting after the programm is already running or do i need to do it before? THX Assa -- Assa Yeroslaviz Loetzenerstr. 15 51373 Leverkusen __ 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 -- 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
[R] Wavelet reconstruction
Hi There, I tried to find a function in {waveslim} or {wavethresh} in order to reconstruct the decomposed signals. As far as I found there is no function in {waveslim} to reconstruct decomposed data. The function wr{wavethresh} reconstructs the results of wd function. Apart from its limitations ( for example the length of vector must be power of 2 ) it apparently doesn't work with the functions and objects in waveslim. What could help ? So many thanks for your any idea. Amir Safari - [[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
[R] www.krankenversicherung.ch News - Krankenkassen - Information Newsletter
Guten Tag Die Krankenkassen-Praemien 2006 sind bereit zum Vergleichen! Gerne informieren wir Sie ueber die aktuellen Sparmoeglichkeiten fuer das Jahr 2006. VERGLEICHEN SIE JETZT Unter http://vergleich.krankenversicherung.ch vergleichen Sie Ihre Praemien fuer das Jahr 2006. PRAEMIEN DES MARKTLEADERS Die Helsana und Ihre Partner-Kassen finden Sie im Helsana-Vergleich unter http://helsanapraemien.krankenversicherung.ch . Profitieren Sie jetzt von den attraktiven Praemien und erhalten Sie innert Sekunden Ihre persoenliche Offerte via E-Mail zugestellt. VOTING - BEWERTEN SIE JETZT IHRE KRANKENKASSE Bewerten Sie jetzt Ihre Krankenkasse unter http://voting.krankenversicherung.ch WETTBEWERB - GEWINNEN SIE EINE REISE 100 Sofortpreise und eine Flugreise sind zu gewinnen unter http://wettbewerb.krankenversicherung.ch . Viel Glueck! KUENDIGUNGSTERMIN Nicht vergessen! Der Kuendigungstermin fuer die Grundversicherung ist der 30.11.2005. NAECHSTE INFORMATION Gerne zeigen wir Ihnen im November den aktuellen Trend und informieren Sie mit den aktuellsten News. INFORMATION - Kein Spam Sie erhalten diesen Newsletter aufgrund einer Bestellung oder Eintrages auf www.krankenversicherung.ch oder www.help.ch. Sie koennen diesen Newsletter jederzeit sofort abbestellen mit Nutzung des untenstehenden Links. ABMELDUNG http://www.krankenversicherung.ch/unsubscribe.cfm Mit freundlichen Gruessen und viel Erfolg beim Wettbewerb www.krankenversicherung.ch und www.help.ch Ihr Newsletter-Team ___ Die Schweizer Firmen-Suchmaschine HELP Searchengines AG - Badenerstrasse 75 - 8004 Zuerich www.help.ch - www.firmenscout.ch - www.produktesuche.ch mailto:[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
[R] error open .RData
Dear R-list, I have a problem to open my R workspace. When I try to open my file .Rdata with double-clik on windows explore I get the error like this: Error in load(name, envir = .GlobalEnv) : error reading from connection and on windows error: Fatal error: unable to restore saved data in .RData I try with, load(CaseStudyHouseID50.RData, .GlobalEnv) Error in load(CaseStudyHouseID50.RData, .GlobalEnv) : error reading from connection load(CaseStudyHouseID50.RData) Error in load(CaseStudyHouseID50.RData) : error reading from connection I have done to save my R workspace like this: save(list = ls(all=TRUE), file = CaseStudyHouseID50.RData) What is wrong? Is there anyway to open .RData? Regards, Muhammad Subianto R.version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major2 minor2.0 year 2005 month10 day 06 svn rev 35749 language R __ 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
[R] forrest plot
Hi, can you tel me how can I make a Forrest Plot with R? It is possible and easy or are there a more practical free software available? Than you Mic [[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
[R] Access to matrix values from labels
Hi everybody: I've a output interpolation matrix files, and my question is if are there anybody that could tell me how access to particular values of this matrix from labels. Thnaks in advance. -- Antoni Viúdez Mora Dept. Dinámica de Contaminantes Fundación CEAM Paterna (Valencia)-Spain tel: 961318190. ext: 216 e-mail: [EMAIL PROTECTED] [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
Re: [R] error open .RData
Hi Your .Rdata file is probably corrupted. Unless you have a working copy of it elsewhere or sources of your data together with history of your commands you are probably in deep trouble .Rdata is a binary format and it is not recommended to safe and reliable saving of your work as you have only limited, if any, possibilities to recover it if anything goes wrong. I usually have all my important source data in txt or xls format and I frequently save history in separate files (on daily basis or sometimes several times a day) to be able to repeat everything I have done. Cheers Petr On 19 Oct 2005 at 11:58, Muhammad Subianto wrote: Date sent: Wed, 19 Oct 2005 11:58:11 +0200 From: Muhammad Subianto [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Subject:[R] error open .RData Dear R-list, I have a problem to open my R workspace. When I try to open my file .Rdata with double-clik on windows explore I get the error like this: Error in load(name, envir = .GlobalEnv) : error reading from connection and on windows error: Fatal error: unable to restore saved data in .RData I try with, load(CaseStudyHouseID50.RData, .GlobalEnv) Error in load(CaseStudyHouseID50.RData, .GlobalEnv) : error reading from connection load(CaseStudyHouseID50.RData) Error in load(CaseStudyHouseID50.RData) : error reading from connection I have done to save my R workspace like this: ## ## save(list = ls(all=TRUE), file = CaseStudyHouseID50.RData) ## ## What is wrong? Is there anyway to open .RData? Regards, Muhammad Subianto R.version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major2 minor2.0 year 2005 month10 day 06 svn rev 35749 language R __ 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 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
[R] FIGARCH
Hi All, Does R have the function for FIGARCH? SUMANTA BASAK. --- This e-mail may contain confidential and/or privileged infor...{{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
Re: [R] Subsetting a list
Dennis Try TEST[-3] [[1]] [1] A1 A2 [[2]] [1] B1 B2 for removing more than one element from the list (say 2 3) -- TEST[-c(2,3)] [[1]] [1] A1 A2 HTH John Dennis Fisher wrote--- Colleagues, I have created a list in the following manner: TEST- list(c(A1, A2), c(B1, B2), c(C1, C2)) I now want to delete one element from the list, e.g., the third. The command TEST[[3]] yields (as expected): [1] C1 C2 The command TEST[[-3]] yields: Error: attempt to select more than one element How can I accomplish delete one or more elements from this list? I am running R2.2.0 on a Linux platform. Dennis __ 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
Re: [R] Forum of Mac questions (Was: loading packages - mac user)
BDR == Prof Brian Ripley [EMAIL PROTECTED] on Wed, 19 Oct 2005 08:58:20 +0100 (BST) writes: BDR On Wed, 19 Oct 2005, Jari Oksanen wrote: On Tue, 2005-10-18 at 13:13 -0700, Thomas Lumley wrote: Both for this and for working out why Tcl/Tk isn't installed you might be better off trying R-sig-mac rather than r-help This is a very common piece of advice. However, this is not what you would imagine if you read the description of R-SIG-mac on the R home page: BDR It is not actually on the R home page or even on BDR www.r-project.org. I think you mean BDR https://stat.ethz.ch/mailman/listinfo/r-sig-mac BDR This arises because the purpose of the list has changed BDR from BDRR Special Interest Group on Macintosh Development BDR and Porting, both for MacOS 8.6 - 9.x and MacOS X BDR I think a wording like R-sig-debian namely BDRR Special Interest Group for MacOS X ports of R BDR would be better. yes, thank you both IFF this is really the intention. Stefano Iacus is the maintainer (and initiator) of the list and should say (and maybe ask on the R-SIG-Mac list) what he (and the subscribers) really wants. R-SIG-Mac R Special Interest Group on Mac Development This is very similar to the description of R-devel: This list is intended for questions and discussion about code development in R. And that description is even more intimidating when you read further: Questions likely to prompt discussion unintelligible to non-programmers or topics that are too technical for R-help's audience should go to R-devel Would it make sense to change the description of R-SIG-mac so that it would welcome question on R usage in Mac, instead of being a Mac Devolepment forum that sounds like being unintelligible to non-programmers? BDR Which seems quite reasonable to me. The topics which BDR provoke this response usually are questions BDR unintelligible except to Mac sysadmins/programmers and BDR definitely `too technical for R-help's audience'. I agree. We shouldn't let R users on the Mac think that all their questions should go to R-SIG-Mac. Regular R questions should continue to come to R-help (or R-devel) just as per the posting guide. Martin Maechler BDR -- Brian D. Ripley, [EMAIL PROTECTED] Professor of BDR Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ BDR University of Oxford, Tel: +44 1865 272861 (self) 1 BDR South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, BDR UK Fax: +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
Re: [R] forrest plot
Hello, 2005/10/19, Michela Ballardini [EMAIL PROTECTED]: Hi, can you tel me how can I make a Forrest Plot with R? It is possible and easy or are there a more practical free software available? Maybe this will help you to find an answer: http://finzi.psych.upenn.edu/R/library/rmeta/html/metaplot.html regards 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
Re: [R] error open .RData
Your .Rdata file is probably corrupted. I will investigate. Thanks for you info. Because of my file .RData very large about 75MB. Best wishes, Muhammad Subianto On this day 19/10/2005 12:21 PM, Petr Pikal wrote: Hi Your .Rdata file is probably corrupted. Unless you have a working copy of it elsewhere or sources of your data together with history of your commands you are probably in deep trouble .Rdata is a binary format and it is not recommended to safe and reliable saving of your work as you have only limited, if any, possibilities to recover it if anything goes wrong. I usually have all my important source data in txt or xls format and I frequently save history in separate files (on daily basis or sometimes several times a day) to be able to repeat everything I have done. Cheers Petr On 19 Oct 2005 at 11:58, Muhammad Subianto wrote: Date sent:Wed, 19 Oct 2005 11:58:11 +0200 From: Muhammad Subianto [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Subject: [R] error open .RData Dear R-list, I have a problem to open my R workspace. When I try to open my file .Rdata with double-clik on windows explore I get the error like this: Error in load(name, envir = .GlobalEnv) : error reading from connection and on windows error: Fatal error: unable to restore saved data in .RData I try with, load(CaseStudyHouseID50.RData, .GlobalEnv) Error in load(CaseStudyHouseID50.RData, .GlobalEnv) : error reading from connection load(CaseStudyHouseID50.RData) Error in load(CaseStudyHouseID50.RData) : error reading from connection I have done to save my R workspace like this: ## ## save(list = ls(all=TRUE), file = CaseStudyHouseID50.RData) ## ## What is wrong? Is there anyway to open .RData? Regards, Muhammad Subianto R.version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major2 minor2.0 year 2005 month10 day 06 svn rev 35749 language R __ 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 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 __ 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
[R] anova with models from glmmPQL
Hi ! I try to compare some models obtained from glmmPQL. model1 - glmmPQL(y~red*yellow+I(red^2)+I(yellow^2)+densite8+I(densite8^2)+freq8_4 +I(freq8_4^2), random=~1|num, binomial); model2 - glmmPQL(y~red*yellow+I(red^2)+I(yellow^2)+densite8+I(densite8^2)+freq8_4 , random=~1|num, binomial); anova(model1, model2) here is the answer : Erreur dans anova.lme(model1, model2) : Objects must inherit from classes gls, gnls lm,lmList, lme,nlme,nlsList, or nls Yet, according to ?glmmPQL, glmmPQL gives an object of class lme: Value: A object of class 'lme': see 'lmeObject'. What should I do to be able to compare my models? Thank you. Emmanuelle Emmanuelle TASTARD UMR 5174 'Evolution et Diversité Biologique' Université Paul Sabatier Bat 4R3 31062 TOULOUSE CEDEX 9 France tel : 05 61 55 67 59 [[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
[R] Error in opening .RData containing a genefilter object
Hi, I discover that when I save a workspace containing a genefilter (pkg from Bioconductor) object I cannot open no more after. I have to restore the .RData file from a backup to be able to start R again. I didn't upgrade to Version 2.2 but I'm not sure that it will solve the problem. Did anyone have encounter the same problem? Below is a short r session to reproduce the error: ... [Previously saved workspace restored] library(genefilter) Loading required package: Biobase Loading required package: tools Welcome to Bioconductor Vignettes contain introductory material. To view, simply type: openVignette() For details on reading vignettes, see the openVignette help page. Loading required package: survival Loading required package: splines f1 - kOverA(5, 60) q() Save workspace image? [y/n/c]: y [computer:admin]$ r R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. Error in .initContents() : couldn't find function isGeneric Error: .onLoad failed in 'loadNamespace' for 'Biobase' Fatal error: unable to restore saved data in .RData [gaia:admin]$ --- I am working under OS X 10.3.9. David __ 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
[R] Help needed with ks.test
Hello to everybody, I'd like to submit a problem I'm dealing with, and I can't get an answer to by myself. I have to test if my data come from a specific probability distribution, of which I know the analytic form both of the p.d.f. and the c.d.f. Namely, it is the hypoexponential distribution, sum of two exponentials with different parameters. Is there any way I can manage the task with ks.test? It's not straightforward to compute the inverse of the c.d.f in order to simulate data from that distribution... Thank you very much in advance for your kind answers! See you EM __ 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
[R] how to test poisson distribution
Dear All, I am wonderng how to test whether the data follows poisson distribution. Thank you so much! [[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
[R] Problem with na in nls
I'm trying to run a nls on a subset of a data.frame. In the subset, one observation is NA. So I drop the observation but when I ask for : sm - nls(machin$revcum ~ Lc.singh(machin$popcum,p), start=list(p=c(2,3))) I get : Erreur dans parse(file, n, text, prompt) : syntax error in ~ If I put some value for the non available observation instead of droping it, it works. So what's the problem ? __ 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
Re: [R] Error in opening .RData containing a genefilter object
On 10/19/2005 8:37 AM, David Ruau wrote: Hi, I discover that when I save a workspace containing a genefilter (pkg from Bioconductor) object I cannot open no more after. I have to restore the .RData file from a backup to be able to start R again. I didn't upgrade to Version 2.2 but I'm not sure that it will solve the problem. Did anyone have encounter the same problem? Below is a short r session to reproduce the error: ... [Previously saved workspace restored] library(genefilter) Loading required package: Biobase Loading required package: tools Welcome to Bioconductor Vignettes contain introductory material. To view, simply type: openVignette() For details on reading vignettes, see the openVignette help page. Loading required package: survival Loading required package: splines f1 - kOverA(5, 60) q() Save workspace image? [y/n/c]: y [computer:admin]$ r R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. Error in .initContents() : couldn't find function isGeneric Error: .onLoad failed in 'loadNamespace' for 'Biobase' Fatal error: unable to restore saved data in .RData Looks like it might be a bug in Biobase. I'd first confirm that it happens in a current release of R, then post again to the Bioconductor list. 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
Re: [R] forrest plot
Le 19.10.2005 13:56, Thomas Schönhoff a écrit : Hello, 2005/10/19, Michela Ballardini [EMAIL PROTECTED]: Hi, can you tel me how can I make a Forrest Plot with R? It is possible and easy or are there a more practical free software available? Maybe this will help you to find an answer: http://finzi.psych.upenn.edu/R/library/rmeta/html/metaplot.html regards Thomas Hello Thomas, Pretty interresting. You just pointed to a good candidate for r graph gallery. A 3D plot of that kind can be done with the scatterplot3d package. See Figure 5 page 14 of : Ligges, U., and Maechler, M. (2003): Scatterplot3d – an R Package for Visualizing Multivariate Data. /Journal of Statistical Software/ 8(11), 1–20. http://www.jstatsoft.org/ Romain -- visit the R Graph Gallery : http://addictedtor.free.fr/graphiques ~ ~~ Romain FRANCOIS - http://addictedtor.free.fr ~~ Etudiant ISUP - CS3 - Industrie et Services ~~http://www.isup.cicrp.jussieu.fr/ ~~ Stagiaire INRIA Futurs - Equipe SELECT ~~ http://www.inria.fr/recherche/equipes/select.fr.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
Re: [R] Finding code for R functions
If you're really interested in reading the source for functions and aren't interested in tracking down various methods (possibly hidden in namespaces) at the R prompt, I think it's much easier to download the R source code from CRAN and go through the original source files. -roger Wolfrum, Ed wrote: Greetings, I am trying to figure out how to find the source code for R functions. I am specifically interested in finding the code for the prcomp function. I know that typing the function name without parenthesis will lead to the code (or to a .Internal or .FORTRAN or .C call). However, I don't really understand what is going on. For example, typing mean gives a UseMethod response, while typing mean.default give the actual code: mean function (x, ...) UseMethod(mean) environment: namespace:base mean.default function (x, trim = 0, na.rm = FALSE, ...) ---SNIP--- } environment: namespace:base Why is this? What does mean.default mean? I tried the same thing with prcomp. With the stats package loaded, I cannot get to the source code for prcomp. require(stats) [1] TRUE prcomp function (x, ...) UseMethod(prcomp) environment: namespace:stats prcomp.default Error: object prcomp.default not found How do I find the prcomp code? Are there general rules for finding the source code for functions that I should know? Thanks in Advance, Edward J. Wolfrum, Ph.D. National Renewable Energy Laboratory Golden, Colorado __ 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 -- Roger D. Peng http://www.biostat.jhsph.edu/~rpeng/ __ 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
[R] npmc package
Hi Does anyone know where is the package: npmc (Nonparametric Multiple Comparisons). I found the reference on R Site Search, but not the package itself on CRAN as suggested. Thanks Mauricio __ 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
Re: [R] npmc package
Carlos Mauricio Cardeal Mendes wrote: Hi Does anyone know where is the package: npmc (Nonparametric Multiple Comparisons). I found the reference on R Site Search, but not the package itself on CRAN as suggested. The packages is ORPHANED and removed from the CRAN main repository. You can get older versions from the archives, though: your-CRAN-mirror/src/contrib/Archive/N/npmc_1.0-1.tar.gz Uwe Ligges Thanks Mauricio __ 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 __ 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
Re: [R] forrest plot
Le 19.10.2005 15:11, Romain Francois a écrit : Le 19.10.2005 13:56, Thomas Schönhoff a écrit : Hello, 2005/10/19, Michela Ballardini [EMAIL PROTECTED]: i, can you tel me how can I make a Forrest Plot with R? It is possible and easy or are there a more practical free software available? Maybe this will help you to find an answer: http://finzi.psych.upenn.edu/R/library/rmeta/html/metaplot.html regards Thomas Hello Thomas, Pretty interresting. You just pointed to a good candidate for r graph gallery. (..) Included. I just added : R par(lend=square) so it is nicer. Maybe a change to make in the function code ? Romain -- visit the R Graph Gallery : http://addictedtor.free.fr/graphiques ~ ~~ Romain FRANCOIS - http://addictedtor.free.fr ~~ Etudiant ISUP - CS3 - Industrie et Services ~~http://www.isup.cicrp.jussieu.fr/ ~~ Stagiaire INRIA Futurs - Equipe SELECT ~~ http://www.inria.fr/recherche/equipes/select.fr.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
Re: [R] anova with models from glmmPQL
I try to compare some models obtained from glmmPQL. model1 - glmmPQL(y~red*yellow+I(red^2)+I(yellow^2)+densite8+I(densite8^ 2)+freq8_4 +I(freq8_4^2), random=~1|num, binomial); model2 - glmmPQL(y~red*yellow+I(red^2)+I(yellow^2)+densite8+I(densite8^ 2)+freq8_4 , random=~1|num, binomial); anova(model1, model2) You try to compare models that differ in their fixed parts. This is not possible with the default method 'REML'. This would only be possible if you fitted your models using method 'ML' (see Pinheiro Bates, 2000). In addition, if I understood a remark by José Pinheiro during one of his courses correctly, the anova comparisons are not save with a distribution other than normal. Thus, one should rely on the function intervals () to see whether confidence intervals of the parameters overlap zero or not. Perhaps someone else can comment on this issue? Regards, Lorenz - Lorenz Gygax Centre for proper housing of ruminants and pigs Swiss Federal Veterinary Office agroscope FAT Tänikon, CH-8356 Ettenhausen / Switzerland __ 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
Re: [R] ... Job Openings .. on R-help
BertG == Berton Gunter [EMAIL PROTECTED] on Wed, 12 Oct 2005 10:47:40 -0700 writes: BertG I hope that this job posting does not offend BertG anyone. My sincere apologies if it is inappropriate BertG -- blame me, not my company. since you ask for it .. ;-) BertG -- Bert Gunter BertG Genentech Nonclinical Statistics BertG South San Francisco, CA Genentech has an opening ... ... ... a job advertisement with a word count of (50 352 2486) [lines,words,chars] which is a bit too long, but ok, but with a final paragraph which can be read as a blatant advertisement for your company. That (last paragraph) was not appropriate in my opinion. People have contacted me (as mailing list maintainer) and asked about the appropriateness of such postings, and I've usually explained that it is ok, as long as it remains short, is explicitly related to R, to the point, and refers to a URL for further information. Hence Bert's add was close to the target. The other anonymous add which only gave an anonymous e-mail address for contact (see above; of course we really should e-bomb it :-) was *VERY* inappropriate though. Martin Maechler, ETH Zurich as R mailing lists maintainer. __ 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
Re: [R] Error in opening .RData containing a genefilter object
Thanks a lot Professor Ripley, it works that way. I will upgrade to v 2.2 one day when I have time and see if it still happen. David On Oct 19, 2005, at 15:58, Prof Brian Ripley wrote: On Wed, 19 Oct 2005, Duncan Murdoch wrote: On 10/19/2005 8:37 AM, David Ruau wrote: Hi, I discover that when I save a workspace containing a genefilter (pkg from Bioconductor) object I cannot open no more after. I have to restore the .RData file from a backup to be able to start R again. I didn't upgrade to Version 2.2 but I'm not sure that it will solve the problem. Did anyone have encounter the same problem? Below is a short r session to reproduce the error: ... [Previously saved workspace restored] library(genefilter) Loading required package: Biobase Loading required package: tools Welcome to Bioconductor Vignettes contain introductory material. To view, simply type: openVignette() For details on reading vignettes, see the openVignette help page. Loading required package: survival Loading required package: splines f1 - kOverA(5, 60) q() Save workspace image? [y/n/c]: y [computer:admin]$ r R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. Error in .initContents() : couldn't find function isGeneric Error: .onLoad failed in 'loadNamespace' for 'Biobase' Fatal error: unable to restore saved data in .RData Looks like it might be a bug in Biobase. I'd first confirm that it happens in a current release of R, then post again to the Bioconductor list. Something in that workspace requires the Biobase namespace, and that needs to import the methods namespace. It does not in the version I have. A solution is to use R --vanilla and then load(.RData). -- 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
[R] schoenfeld residuals in the cox.zph function
To R-project help I work with a clinical dataset including about 27,000 patients and I wanted to do some model diagnostics on cox regression models with frailty effects (for every patient). But in this case the cox.zph function did not work. I always got the following error message: Fehler in residuals.coxph(fit, schoenfeld) : NA/NaN/Inf in externem Funktionsaufruf (arg 5) Does anyone know what's wrong? I did the same without using frailty effects and everything was o.k. What could I do? __ 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
Re: [R] forrest plot
On Wed, 19 Oct 2005, Romain Francois wrote: Pretty interresting. You just pointed to a good candidate for r graph gallery. There is an example on the R home page, and has been for some time. I have an improved version based on grid code by Paul Murrell, but it's not on a nearby computer. The other meta-analysis package also has a forest-plot function. Incidentally, I was just motivated to track down whether it is Forrest or forest [ie for\^et], as I had assumed. Both spellings appear on meta-analyses, even in the top medical journals (which, unlike most academic journals, have moderately aggresive copy-editors). A feedback archive for the Cochrane Collaboration style guide says The plot was not called a forest plot in print for some time, and the origins of this title are obscured by history and myth. At the September 1990 meeting of the breast cancer overview, Richard Peto jokingly mentioned the the plot was named after the breast cancer researcher Pat Forrest, and, at times, the names has been spelt forrest plot. However, the phrase actually originates from the idea that the typical plot appears as a forest of lines. Lewis S, Clarke M. Forest plots: trying to see the wood and the trees. BMJ 2001;322:1479-80. -thomas 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
[R] diag() problem
Hi I have a matrix u, for which diag() gives an error: u - structure(c(5.42334674128216, -2.31319389204264, -5.83059042218476, -1.64112369640695, -2.31319389212801, 3.22737617646609, 1.85200668021569, -0.57102273078531, -5.83059042231881, 1.85200668008156, 11.9488923894962, -3.5525537165941, -1.64112369587405, -0.571022730886046, -3.55255371755604, 10.0989829379577), .Dim = c(4, 4), .Dimnames = list(c(constant, NA, NA, NA), c(constant, NA, NA, NA))) u constant NA NA NA constant 5.423347 -2.3131939 -5.830590 -1.6411237 NA -2.313194 3.2273762 1.852007 -0.5710227 NA -5.830590 1.8520067 11.948892 -3.5525537 NA -1.641124 -0.5710227 -3.552554 10.0989829 is.matrix(u) [1] TRUE diag(u) Error in if (is.list(nms) !any(sapply(nms, is.null)) all((nm - nms[[1]][1:m]) == : missing value where TRUE/FALSE needed What's going on here? R.version _ platform powerpc-apple-darwin8.2.0 arch powerpc os darwin8.2.0 system powerpc, darwin8.2.0 status major2 minor2.0 year 2005 month10 day 06 svn rev 35749 language R -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ 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
Re: [R] Problem with na in nls
maybe you should keep your NA but deal with the na.action option of the nls() function ? HTH. Florence. On 10/19/05, Florent Bresson [EMAIL PROTECTED] wrote: I'm trying to run a nls on a subset of a data.frame. In the subset, one observation is NA. So I drop the observation but when I ask for : sm - nls(machin$revcum ~ Lc.singh(machin$popcum,p), start=list(p=c(2,3))) I get : Erreur dans parse(file, n, text, prompt) : syntax error in ~ If I put some value for the non available observation instead of droping it, it works. So what's the problem ? __ 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 [[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
Re: [R] Subsetting a list
Jose == José Ernesto Jardim [EMAIL PROTECTED] on Tue, 18 Oct 2005 15:30:59 +0100 writes: Jose Dennis Fisher wrote: Colleagues, I have created a list in the following manner: TEST- list(c(A1, A2), c(B1, B2), c(C1, C2)) I now want to delete one element from the list, e.g., the third. The command TEST[[3]] yields (as expected): [1] C1 C2 The command TEST[[-3]] yields: Error: attempt to select more than one element How can I accomplish delete one or more elements from this list? I am running R2.2.0 on a Linux platform. Dennis Jose TEST[[3]] - NULL Jose Lists are not subsetable like data.frames or arrays, see the manuals. yes, they are, almost, see other replies and the manuals : Lists can have 'dim' attributes and hence be treated as arrays; Note that this is pretty rarely used and not too well supported by some tools, one could say even 'print()' : set.seed(0); L0 - L - lapply(rpois(12, lambda=3), seq); dim(L) - 3:4; L [,1] [,2] [,3] [,4] [1,] Integer,5 Integer,3 Integer,5 Integer,3 [2,] Integer,2 Integer,5 Integer,6 1 [3,] Integer,2 Integer,2 Integer,4 Integer,2 str(L) List of 12 $ : int [1:5] 1 2 3 4 5 $ : int [1:2] 1 2 $ : int [1:2] 1 2 $ : int [1:3] 1 2 3 $ : int [1:5] 1 2 3 4 5 $ : int [1:2] 1 2 $ : int [1:5] 1 2 3 4 5 $ : int [1:6] 1 2 3 4 5 6 $ : int [1:4] 1 2 3 4 $ : int [1:3] 1 2 3 $ : int 1 $ : int [1:2] 1 2 - attr(*, dim)= int [1:2] 3 4 L[2,3] [[1]] [1] 1 2 3 4 5 6 L[-(1:10)] ## treated matrix ``as vector'' [[1]] [1] 1 [[2]] [1] 1 2 __ 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
Re: [R] diag() problem
It has to do with the NAs in dimnames, but I don't know why this is a problem. If you either got rid of dimnames or assigned actual names, this works fine. Ravi. -Original Message- From: [EMAIL PROTECTED] [mailto:r-help- [EMAIL PROTECTED] On Behalf Of Robin Hankin Sent: Wednesday, October 19, 2005 10:55 AM To: RHelp Subject: [R] diag() problem Hi I have a matrix u, for which diag() gives an error: u - structure(c(5.42334674128216, -2.31319389204264, -5.83059042218476, -1.64112369640695, -2.31319389212801, 3.22737617646609, 1.85200668021569, -0.57102273078531, -5.83059042231881, 1.85200668008156, 11.9488923894962, -3.5525537165941, -1.64112369587405, -0.571022730886046, -3.55255371755604, 10.0989829379577), .Dim = c(4, 4), .Dimnames = list(c(constant, NA, NA, NA), c(constant, NA, NA, NA))) u constant NA NA NA constant 5.423347 -2.3131939 -5.830590 -1.6411237 NA -2.313194 3.2273762 1.852007 -0.5710227 NA -5.830590 1.8520067 11.948892 -3.5525537 NA -1.641124 -0.5710227 -3.552554 10.0989829 is.matrix(u) [1] TRUE diag(u) Error in if (is.list(nms) !any(sapply(nms, is.null)) all((nm - nms[[1]][1:m]) == : missing value where TRUE/FALSE needed What's going on here? R.version _ platform powerpc-apple-darwin8.2.0 arch powerpc os darwin8.2.0 system powerpc, darwin8.2.0 status major2 minor2.0 year 2005 month10 day 06 svn rev 35749 language R -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ 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 __ 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
Re: [R] diag() problem
On 10/19/2005 10:55 AM, Robin Hankin wrote: Hi I have a matrix u, for which diag() gives an error: u - structure(c(5.42334674128216, -2.31319389204264, -5.83059042218476, -1.64112369640695, -2.31319389212801, 3.22737617646609, 1.85200668021569, -0.57102273078531, -5.83059042231881, 1.85200668008156, 11.9488923894962, -3.5525537165941, -1.64112369587405, -0.571022730886046, -3.55255371755604, 10.0989829379577), .Dim = c(4, 4), .Dimnames = list(c(constant, NA, NA, NA), c(constant, NA, NA, NA))) u constant NA NA NA constant 5.423347 -2.3131939 -5.830590 -1.6411237 NA -2.313194 3.2273762 1.852007 -0.5710227 NA -5.830590 1.8520067 11.948892 -3.5525537 NA -1.641124 -0.5710227 -3.552554 10.0989829 is.matrix(u) [1] TRUE diag(u) Error in if (is.list(nms) !any(sapply(nms, is.null)) all((nm - nms[[1]][1:m]) == : missing value where TRUE/FALSE needed What's going on here? It's trying to check whether the row names match the column names, in which case it will assign those names to the diagonal elements. But the writer didn't figure someone would have NA names, so the test all((nm - nms[[1]][1:m]) == nms[[2]][1:m]) fails. It could be fixed by putting na.rm=TRUE into the all(), but that's probably not right: all(c(1, NA) == c(1, 2), na.rm = TRUE) [1] TRUE I think we want to wrap the values in paste, to convert to non-missing characters. That would be all(paste((nm - nms[[1]][1:m])) == paste(nms[[2]][1:m])) and would give diag(u) constant NA NA NA 5.423347 3.227376 11.948892 10.098983 Any objections to me committing this change? 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
Re: [R] diag() problem
On 10/19/2005 10:55 AM, Robin Hankin wrote: Hi I have a matrix u, for which diag() gives an error: u - structure(c(5.42334674128216, -2.31319389204264, -5.83059042218476, -1.64112369640695, -2.31319389212801, 3.22737617646609, 1.85200668021569, -0.57102273078531, -5.83059042231881, 1.85200668008156, 11.9488923894962, -3.5525537165941, -1.64112369587405, -0.571022730886046, -3.55255371755604, 10.0989829379577), .Dim = c(4, 4), .Dimnames = list(c(constant, NA, NA, NA), c(constant, NA, NA, NA))) u constant NA NA NA constant 5.423347 -2.3131939 -5.830590 -1.6411237 NA -2.313194 3.2273762 1.852007 -0.5710227 NA -5.830590 1.8520067 11.948892 -3.5525537 NA -1.641124 -0.5710227 -3.552554 10.0989829 is.matrix(u) [1] TRUE diag(u) Error in if (is.list(nms) !any(sapply(nms, is.null)) all((nm - nms[[1]][1:m]) == : missing value where TRUE/FALSE needed What's going on here? It's trying to check whether the row names match the column names, in which case it will assign those names to the diagonal elements. But the writer didn't figure someone would have NA names, so the test all((nm - nms[[1]][1:m]) == nms[[2]][1:m]) fails. It could be fixed by putting na.rm=TRUE into the all(), but that's probably not right: all(c(1, NA) == c(1, 2), na.rm = TRUE) [1] TRUE I think we want to wrap the values in paste, to convert to non-missing characters. That would be all(paste((nm - nms[[1]][1:m])) == paste(nms[[2]][1:m])) and would give diag(u) constant NA NA NA 5.423347 3.227376 11.948892 10.098983 Any objections to me committing this change? I object: it can't tell the difference between the name NA and a missing name. A better fix is to wrap the all() in isTRUE(). This leaves the names off the result (since we don't know if the rownames and colnames match). 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
[R] nlme Singularity in backsolve at level 0, block 1
Hi, I am hoping some one can help with this. I am using nlme to fit a random coefficients model. It ran for hours before returning Error: Singularity in backsolve at level 0, block 1 The model is plavix.nlme-nlme(PLX_NRX~loglike(PLX_NRX,PD4_42D,GAT_34D,VIS_42D,MSL_42D,SPE_ROL,XM2_DUM,THX_DUM,b0,b1,b2,b3,b4,b5,b6,b7,alpha), + data=data, + fixed=list(b0 + b1+b2+b3+b4+b5+b6+b7+alpha~1), + random=b0+b1+b2+b3+b4+b5+b6+b7~1|menum, + + start=c(b0=0,b1=0,b2=0,b3=0,b4=0,b5=0,b6=0,b7=0,alpha=5) + ) Can anyone tell me what this error means and how I can run the model? Thanks, Elizabeth Lawson - [[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
Re: [R] diag() problem
On Wed, 19 Oct 2005, Duncan Murdoch wrote: On 10/19/2005 10:55 AM, Robin Hankin wrote: Hi I have a matrix u, for which diag() gives an error: u - structure(c(5.42334674128216, -2.31319389204264, -5.83059042218476, -1.64112369640695, -2.31319389212801, 3.22737617646609, 1.85200668021569, -0.57102273078531, -5.83059042231881, 1.85200668008156, 11.9488923894962, -3.5525537165941, -1.64112369587405, -0.571022730886046, -3.55255371755604, 10.0989829379577), .Dim = c(4, 4), .Dimnames = list(c(constant, NA, NA, NA), c(constant, NA, NA, NA))) u constant NA NA NA constant 5.423347 -2.3131939 -5.830590 -1.6411237 NA -2.313194 3.2273762 1.852007 -0.5710227 NA -5.830590 1.8520067 11.948892 -3.5525537 NA -1.641124 -0.5710227 -3.552554 10.0989829 is.matrix(u) [1] TRUE diag(u) Error in if (is.list(nms) !any(sapply(nms, is.null)) all((nm - nms[[1]][1:m]) == : missing value where TRUE/FALSE needed What's going on here? It's trying to check whether the row names match the column names, in which case it will assign those names to the diagonal elements. But the writer didn't figure someone would have NA names, so the test all((nm - nms[[1]][1:m]) == nms[[2]][1:m]) fails. It could be fixed by putting na.rm=TRUE into the all(), but that's probably not right: all(c(1, NA) == c(1, 2), na.rm = TRUE) [1] TRUE I think we want to wrap the values in paste, to convert to non-missing characters. That would be all(paste((nm - nms[[1]][1:m])) == paste(nms[[2]][1:m])) and would give diag(u) constant NA NA NA 5.423347 3.227376 11.948892 10.098983 Any objections to me committing this change? Yes, you don't want NA to match NA. If you think NA names should match, use identical. Otherwise (and I think this would be more consistent with other parts of R), do something like eq - (nm - nms[[1]][1:m]) == nms[[2]][1:m] if(all(!is.na(eq) eq)) ... -- 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
Re: [R] diag() problem
On 10/19/2005 11:37 AM, Prof Brian Ripley wrote: On Wed, 19 Oct 2005, Duncan Murdoch wrote: On 10/19/2005 10:55 AM, Robin Hankin wrote: Hi I have a matrix u, for which diag() gives an error: u - structure(c(5.42334674128216, -2.31319389204264, -5.83059042218476, -1.64112369640695, -2.31319389212801, 3.22737617646609, 1.85200668021569, -0.57102273078531, -5.83059042231881, 1.85200668008156, 11.9488923894962, -3.5525537165941, -1.64112369587405, -0.571022730886046, -3.55255371755604, 10.0989829379577), .Dim = c(4, 4), .Dimnames = list(c(constant, NA, NA, NA), c(constant, NA, NA, NA))) u constant NA NA NA constant 5.423347 -2.3131939 -5.830590 -1.6411237 NA -2.313194 3.2273762 1.852007 -0.5710227 NA -5.830590 1.8520067 11.948892 -3.5525537 NA -1.641124 -0.5710227 -3.552554 10.0989829 is.matrix(u) [1] TRUE diag(u) Error in if (is.list(nms) !any(sapply(nms, is.null)) all((nm - nms[[1]][1:m]) == : missing value where TRUE/FALSE needed What's going on here? It's trying to check whether the row names match the column names, in which case it will assign those names to the diagonal elements. But the writer didn't figure someone would have NA names, so the test all((nm - nms[[1]][1:m]) == nms[[2]][1:m]) fails. It could be fixed by putting na.rm=TRUE into the all(), but that's probably not right: all(c(1, NA) == c(1, 2), na.rm = TRUE) [1] TRUE I think we want to wrap the values in paste, to convert to non-missing characters. That would be all(paste((nm - nms[[1]][1:m])) == paste(nms[[2]][1:m])) and would give diag(u) constant NA NA NA 5.423347 3.227376 11.948892 10.098983 Any objections to me committing this change? Yes, you don't want NA to match NA. If you think NA names should match, use identical. Otherwise (and I think this would be more consistent with other parts of R), do something like eq - (nm - nms[[1]][1:m]) == nms[[2]][1:m] if(all(!is.na(eq) eq)) ... I agree with your objection; I realized the same thing just after I posted my original. The solution I came up with was putting the all() in isTRUE(). I think that achieves an identical result to your solution. Can you see any reason to prefer one over the other? 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
Re: [R] Lattice graphics strip labels for shingles
On 10/18/05, Kiermeier, Andreas (PIRSA - SARDI) [EMAIL PROTECTED] wrote: Dear all, back in 2002 Martin Henry H. Stevens wrote (https://stat.ethz.ch/pipermail/r-help/2002-May/019851.html) How do I control the text in strips? Specifically, I want to put in the ranges generated in shingle(x) where x is continuous. with an answer from Deepyan Sarkar (see strip.new towards the end of this message). I assume that the answer worked back then, but I've tried to implement it today, with little success. I think that it may have to do with namespaces - but I'm not sure. It does have to do with namespaces. grid.rect etc are in the grid namespace which is not attached when you are calling strip.new. The simplest solution is to attach it first, e.g. by library(grid) (or put 'require(grid)' inside strip.new). Deepayan __ 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
Re: [R] how to test poisson distribution
Hi, 2005/10/19, Wensui Liu [EMAIL PROTECTED]: Dear All, I am wonderng how to test whether the data follows poisson distribution. Thank you so much! Did you notice the PDF on distribution tests using R by Vito Ricci, its found at CRAN in the docs contrib section, called FITTING DISTRIBUTIONS WITH R Maybe this could be of some help for you, especially look at page 7 (poisson dsitribution example). __ 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
Re: [R] how to test poisson distribution
To be pedantic (I'm feeling cranky today): One can never test whether the data follow [data is plural] a Poisson distribution -- only whether there is sufficient evidence to cast that assumption into doubt. Perhaps a better shorthand is whether the data are consistent with Poisonness . This correctly leaves open the possibility that the data are consistent with lots of other distribution-nesses, too. I welcome alternatives, perhaps privately to reduce the list noise level. (And,yes, I'm sure that Thomas knows this perfectly well). I do think that we should be a bit less sloppy about such things even here, lest we continue to promulgate already widespread misunderstandings, even at the cost of slightly increased bandwidth. After all, precision is supposed to be a major concern or ours. As I've been cranky, others are free to return the favor. Sauce for the goose ... -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA The business of the statistician is to catalyze the scientific learning process. - George E. P. Box -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Thomas Schönhoff Sent: Wednesday, October 19, 2005 10:00 AM To: r-help@stat.math.ethz.ch Subject: Re: [R] how to test poisson distribution Hi, 2005/10/19, Wensui Liu [EMAIL PROTECTED]: Dear All, I am wonderng how to test whether the data follows poisson distribution. Thank you so much! Did you notice the PDF on distribution tests using R by Vito Ricci, its found at CRAN in the docs contrib section, called FITTING DISTRIBUTIONS WITH R Maybe this could be of some help for you, especially look at page 7 (poisson dsitribution example). __ 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 __ 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
[R] matching two plots
Hi, I have a problem about graphics. I would like to plot two graphs: a barplot and curve. Here is the code: barplot(dpois(0:45,20),xlim=c(0,45),names=0:45) curve(dnorm(x,20,sqrt(20)),from=0,to=45,add=T) Both graphs are drawn in the same figure, however the scale in both graphs dooes not match. For some reason the second plot is shifted to left. I think there is a problem concerning the axis scale. Thanks a lot. Rui __ 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
Re: [R] how to test poisson distribution
On Wed, 19 Oct 2005 10:18:02 -0700 Berton Gunter wrote: To be pedantic (I'm feeling cranky today): One can never test whether the data follow [data is plural] a Poisson distribution -- only whether there is sufficient evidence to cast that assumption into doubt. Perhaps a better shorthand is whether the data are consistent with Poisonness . This correctly leaves open the possibility that the data are consistent with lots of other distribution-nesses, too. I welcome alternatives, perhaps privately to reduce the list noise level. ...now that Berton mentioned `checking distribution-nesses': the function distplot() in the package vcd implements various plots for distribution-nesses that can be used for graphical checking. Ord_plot() is made for a similar purpose. Finally, there is also a function goodfit() that computes goodness-of-fit tests for such hypotheses. All three functions are written following Chapter 2 `Fitting and Graphing Discrete Distributions' in Michael Friendly's book `Visualizing Categorical Data'. hth, Z (And,yes, I'm sure that Thomas knows this perfectly well). I do think that we should be a bit less sloppy about such things even here, lest we continue to promulgate already widespread misunderstandings, even at the cost of slightly increased bandwidth. After all, precision is supposed to be a major concern or ours. As I've been cranky, others are free to return the favor. Sauce for the goose ... -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA The business of the statistician is to catalyze the scientific learning process. - George E. P. Box -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Thomas Schönhoff Sent: Wednesday, October 19, 2005 10:00 AM To: r-help@stat.math.ethz.ch Subject: Re: [R] how to test poisson distribution Hi, 2005/10/19, Wensui Liu [EMAIL PROTECTED]: Dear All, I am wonderng how to test whether the data follows poisson distribution. Thank you so much! Did you notice the PDF on distribution tests using R by Vito Ricci, its found at CRAN in the docs contrib section, called FITTING DISTRIBUTIONS WITH R Maybe this could be of some help for you, especially look at page 7 (poisson dsitribution example). __ 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 __ 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 __ 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
Re: [R] Subsetting a list
Le 19 Octobre 2005 11:09, Martin Maechler a écrit : [...] Lists can have 'dim' attributes and hence be treated as arrays; For me, this is an amazing feature that I discovered almost by accident (I tried it an it worked)! This creates a sort of three-dimensional object --- much like an array --- where the third dimension is of varying length. Wow. I agree, though, that the result of 'print' on such an object is not crystal clear (but does make sense). [...] -- Vincent Goulet, Associate Professor École d'actuariat Université Laval, Québec [EMAIL PROTECTED] http://vgoulet.act.ulaval.ca __ 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
Re: [R] npmc package
So, is there another package to substitute those functions described on ORPHANED npmc package ? Regards, Mauricio Brazil Uwe Ligges escreveu: Carlos Mauricio Cardeal Mendes wrote: Hi Does anyone know where is the package: npmc (Nonparametric Multiple Comparisons). I found the reference on R Site Search, but not the package itself on CRAN as suggested. The packages is ORPHANED and removed from the CRAN main repository. You can get older versions from the archives, though: your-CRAN-mirror/src/contrib/Archive/N/npmc_1.0-1.tar.gz Uwe Ligges Thanks Mauricio __ 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 __ 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
[R] how to compare a null model with a model with NAs?
Hi, I make a model: m.null - glm(y~1) m.comp - glm(y~x1+x2+x3) I try make a anova like this anova(m.null,m.comp,test=F) The result: Erro em anova.glmlist(c(list(object), dotargs), dispersion = dispersion, : models were not all fitted to the same size of dataset The problem is that I have some NAs in x1, x2 and x3 and is not teh same row fo NAs. How to set is in a null model without I need to remove these rows? Thansk Ronaldo -- Quem cedo madruga, fica com sono o dia todo. -- | // | \\ [***] | ( õ õ ) [Ronaldo Reis Júnior] | V [UFV/DBA-Entomologia] |/ \ [36570-000 Viçosa - MG ] | /(.''`.)\ [Fone: 31-3899-4007 ] | /(: :' :)\ [EMAIL PROTECTED]] |/ (`. `'` ) \[ICQ#: 5692561 | LinuxUser#: 205366 ] |( `- ) [***] | _/ \_Powered by GNU/Debian Woody/Sarge __ 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
[R] Range plots (lattice or base?)
I am looking to create what I would call a simple variation on the boxplot. What I would like to do is to be able to plot the upper and lower confidence limits as the box and the 10th and 90th percentile as the whiskers. What I have done is write the code to create a dataframe, the columns of which are the mean, sd, 10th percentile, 90th percentile, lower confidence limit of the mean, and upper confidence limit of the mean, the rows are the groups. I have exported this to excel and get the graph I want by using the stock graphs in excel that plot open, close, high and low but I would much prefer to do this in R for reason too numerous to enumerate. I have looked high and low and even took a brief look at the bwplot code in the lattice package. Given my experience level it would take quite a while for me to modify the bwplot code to get what I want and create a new graph type, assuming I could get it to work at all. Does anyone know of an easier way to get what I want, with and example? Lattice, grid, base, whatever, I don't especially care what tools I need to use. My only constrante is that I feed it the values required as a dataframe rather than calculate it on the fly so if we change our minds about UCL method or percentiles there is no problem. Thanks in advance, Mike Michael Bock PhD ENVIRON International Corporation 136 Commerical Street, Suite 402 Portland, ME 04101 phone: not active yet fax: not active yet [[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
Re: [R] Range plots (lattice or base?)
Hi Mike Bock wrote: I am looking to create what I would call a simple variation on the boxplot. What I would like to do is to be able to plot the upper and lower confidence limits as the box and the 10th and 90th percentile as the whiskers. What I have done is write the code to create a dataframe, the columns of which are the mean, sd, 10th percentile, 90th percentile, lower confidence limit of the mean, and upper confidence limit of the mean, the rows are the groups. I have exported this to excel and get the graph I want by using the stock graphs in excel that plot open, close, high and low but I would much prefer to do this in R for reason too numerous to enumerate. I have looked high and low and even took a brief look at the bwplot code in the lattice package. Given my experience level it would take quite a while for me to modify the bwplot code to get what I want and create a new graph type, assuming I could get it to work at all. Does anyone know of an easier way to get what I want, with and example? Lattice, grid, base, whatever, I don't especially care what tools I need to use. My only constrante is that I feed it the values required as a dataframe rather than calculate it on the fly so if we change our minds about UCL method or percentiles there is no problem. Can you put the Excel-generated version up somewhere for us to see the final output you want? Then we could make some specific suggestions. Paul -- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 [EMAIL PROTECTED] http://www.stat.auckland.ac.nz/~paul/ __ 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
Re: [R] error open .RData
hi It seems that, in some cases, saving a .RData containing objects from some packages and later trying to start R (or load the .RData) before loading the package could cause this error. See http://finzi.psych.upenn.edu/R/Rhelp02a/archive/46910.html If the .RData contains objects from some specific packages, try loading the package first and then load the .RData file. Also, RSiteSearch(.RData corrupted) results in lots of hits. hope this helps, horacio montenegro --- Muhammad Subianto [EMAIL PROTECTED] wrote: Dear R-list, I have a problem to open my R workspace. When I try to open my file .Rdata with double-clik on windows explore I get the error like this: Error in load(name, envir = .GlobalEnv) : error reading from connection and on windows error: Fatal error: unable to restore saved data in .RData I try with, load(CaseStudyHouseID50.RData, .GlobalEnv) Error in load(CaseStudyHouseID50.RData, .GlobalEnv) : error reading from connection load(CaseStudyHouseID50.RData) Error in load(CaseStudyHouseID50.RData) : error reading from connection I have done to save my R workspace like this: save(list = ls(all=TRUE), file = CaseStudyHouseID50.RData) What is wrong? Is there anyway to open .RData? Regards, Muhammad Subianto __ 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
Re: [R] Range plots (lattice or base?)
The first example on this page is pretty close to what I want, but the x-axis would be a category (like location), and the true range anotations are left out. I don't; have a place to post but can e-mail a pdf of my excel version by request. http://www.stockcharts.com/education/IndicatorAnalysis/indic_ATR.html Mike -Original Message- From: Paul Murrell [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 19, 2005 3:04 PM To: Mike Bock Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Range plots (lattice or base?) Hi Delete orginal message for brevity Can you put the Excel-generated version up somewhere for us to see the final output you want? Then we could make some specific suggestions. Paul -- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 [EMAIL PROTECTED] http://www.stat.auckland.ac.nz/~paul/ __ 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
Re: [R] Range plots (lattice or base?)
Using base graphics you can use the bxp function. This is what boxplot calls to do the actual plotting. Look at the return value for boxplot in the help for boxplot to see the form of the data that needs to be passed to bxp (also look at the help for bxp) You could write a simple function that takes your data frame and extracts the appropriate numbers into a matrix within a list to pass to bxp. hope this helps, Greg Snow, Ph.D. Statistical Data Center, LDS Hospital Intermountain Health Care [EMAIL PROTECTED] (801) 408-8111 Mike Bock [EMAIL PROTECTED] 10/19/05 12:53PM I am looking to create what I would call a simple variation on the boxplot. What I would like to do is to be able to plot the upper and lower confidence limits as the box and the 10th and 90th percentile as the whiskers. What I have done is write the code to create a dataframe, the columns of which are the mean, sd, 10th percentile, 90th percentile, lower confidence limit of the mean, and upper confidence limit of the mean, the rows are the groups. I have exported this to excel and get the graph I want by using the stock graphs in excel that plot open, close, high and low but I would much prefer to do this in R for reason too numerous to enumerate. I have looked high and low and even took a brief look at the bwplot code in the lattice package. Given my experience level it would take quite a while for me to modify the bwplot code to get what I want and create a new graph type, assuming I could get it to work at all. Does anyone know of an easier way to get what I want, with and example? Lattice, grid, base, whatever, I don't especially care what tools I need to use. My only constrante is that I feed it the values required as a dataframe rather than calculate it on the fly so if we change our minds about UCL method or percentiles there is no problem. Thanks in advance, Mike Michael Bock PhD ENVIRON International Corporation 136 Commerical Street, Suite 402 Portland, ME 04101 phone: not active yet fax: not active yet [[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 __ 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
Re: [R] Range plots (lattice or base?)
On 10/19/05, Mike Bock [EMAIL PROTECTED] wrote: I am looking to create what I would call a simple variation on the boxplot. What I would like to do is to be able to plot the upper and lower confidence limits as the box and the 10th and 90th percentile as the whiskers. What I have done is write the code to create a dataframe, the columns of which are the mean, sd, 10th percentile, 90th percentile, lower confidence limit of the mean, and upper confidence limit of the mean, the rows are the groups. I have exported this to excel and get the graph I want by using the stock graphs in excel that plot open, close, high and low but I would much prefer to do this in R for reason too numerous to enumerate. I have looked high and low and even took a brief look at the bwplot code in the lattice package. Given my experience level it would take quite a while for me to modify the bwplot code to get what I want and create a new graph type, assuming I could get it to work at all. Does anyone know of an easier way to get what I want, with and example? Lattice, grid, base, whatever, I don't especially care what tools I need to use. My only constrante is that I feed it the values required as a dataframe rather than calculate it on the fly so if we change our minds about UCL method or percentiles there is no problem. Is your UCL method guaranteed to work separately on groups (e.g. if the s.d. is estimated per group) or does it share information across groups (e.g. some sort of pooled estimate of s.d.)? In the former case, you could try writing a replacement for boxplot.stats and use that in panel.bwplot. Deepayan __ 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
Re: [R] matching two plots
Le 19.10.2005 19:27, Rui Cardoso a écrit : Hi, I have a problem about graphics. I would like to plot two graphs: a barplot and curve. Here is the code: barplot(dpois(0:45,20),xlim=c(0,45),names=0:45) curve(dnorm(x,20,sqrt(20)),from=0,to=45,add=T) Both graphs are drawn in the same figure, however the scale in both graphs dooes not match. For some reason the second plot is shifted to left. I think there is a problem concerning the axis scale. Thanks a lot. Rui Hello, The problem is barplot. To see that : R (barplot(dpois(0:45,20),xlim=c(0,45),names=0:45)) R axis(3) Try something like : R plot(0:45, dpois(0:45,20), type=h, lwd=4, col=gray) R curve(dnorm(x,20,sqrt(20)),from=0,to=45,add=T) Romain -- visit the R Graph Gallery : http://addictedtor.free.fr/graphiques ~ ~~ Romain FRANCOIS - http://francoisromain.free.fr ~~ Doctorant INRIA Futurs / EDF ~ __ 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
Re: [R] matching two plots
On Wed, 2005-10-19 at 18:27 +0100, Rui Cardoso wrote: Hi, I have a problem about graphics. I would like to plot two graphs: a barplot and curve. Here is the code: barplot(dpois(0:45,20),xlim=c(0,45),names=0:45) curve(dnorm(x,20,sqrt(20)),from=0,to=45,add=T) Both graphs are drawn in the same figure, however the scale in both graphs dooes not match. For some reason the second plot is shifted to left. I think there is a problem concerning the axis scale. Thanks a lot. Rui This came up this past summer and Gabor and I had a couple of different approaches to the solution. You can see the posts here: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/57431.html and http://finzi.psych.upenn.edu/R/Rhelp02a/archive/57432.html Using my approach with barplot(), what you need to do is to set the 'space' argument to 0 so that there is no space between the bars. This will then place the bar centers at increments of 0.5, in your case seq(0.5, 45.5, 5). Knowing this, you can then adjust the x axis position in curve() by +0.5 to coincide with the bars. So you end up with this: barplot(dpois(0:45, 20), names = 0:45, space = 0, ylim = c(0, .1)) curve(dnorm(x, 20 + 0.5, sqrt(20)), add = TRUE) HTH, Marc Schwartz __ 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
[R] Automatic rounding of values after factors , converted to numeric, are multipled by a real number
I am wondering if someone would have any suggestion about my issue? I have the following code: wgts-aggregate(subset(lendata,select=c(Length)),list(lendata$Cruise,len data$Station,lendata$Region,lendata$Total),mean) wgts-wgts[order(wgts$Group.3,wgts$Group.1,wgts$Group.1),] names(wgts)-c(Cruise,Station,Region,Total,MLen) wgts$Total-as.numeric(levels(wgts$Total))[wgts$Total] wgts$swmean-with(wgts,wgts$Total*wgts$MLen) When I run it, I get: Cruise Station Region Total MLen swmean 32350 256 1 2 70.5141 52350 254 1 3 73.3220 62350 287 1 3 65.7197 92350 232 1 4 75.25000301 10 2350 294 1 4 56.0224 12 2350 301 1 5 70.2351 14 2350 316 1 6 67.3404 15 2350 255 1 7 55.0385 17 2350 285 1 8 73.5588 19 2350 212 110 57.5575 20 2350 250 110 61.5615 27 2350 221 124 95.29167 2287 33 2350 229 135 55.62857 1947 37 2350 293 147 53.82979 2530 38 2350 203 150 55.54000 2777 39 2350 248 155 63.30909 3482 41 2350 246 163 95.82540 6037 42 2350 265 168 55.54412 3777 43 2350 251 182 62.60976 5134 44 2350 234 185 57.21176 4863 Every value is correct except that the swmeans are rounded and I can't get values with the decimals fractions. I have tried as.double and have change the options(digits=7), but nothing seems to work. I have spent several hours combing manuals and archives. Any suggestions would be appreciated. * Gary A. Nelson Massachusetts Division of Marine Fisheries 30 Emerson Avenue Gloucester, MA 01930 Phone: (978) 282-0308 x114 Fax: (617) 727-3337 Email: [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
[R] Weights in survReg
Dear R users, I am trying to find out what the function survReg does exactly with the Weights parameters. I looked in Terry Therneau documentations and other places and couldn't find anything. I tried to make an analogy with weighted OLS and assumed that the scale parameter Sigma in the accelerated failure-time model log(Time)= X*betas +Sigma*E, is of the form Sigma(i) = Sigma/Weights(i). Can anyone confirm that or point me in the direction where I can find out for sure? Thank you, Sasha __ 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
Re: [R] Forum of Mac questions (Was: loading packages - mac user)
On 19/ott/05, at 13:36, Martin Maechler wrote: BDR == Prof Brian Ripley [EMAIL PROTECTED] on Wed, 19 Oct 2005 08:58:20 +0100 (BST) writes: BDR On Wed, 19 Oct 2005, Jari Oksanen wrote: On Tue, 2005-10-18 at 13:13 -0700, Thomas Lumley wrote: Both for this and for working out why Tcl/Tk isn't installed you might be better off trying R-sig-mac rather than r-help This is a very common piece of advice. However, this is not what you would imagine if you read the description of R-SIG-mac on the R home page: BDR It is not actually on the R home page or even on BDR www.r-project.org. I think you mean BDR https://stat.ethz.ch/mailman/listinfo/r-sig-mac BDR This arises because the purpose of the list has changed BDR from BDRR Special Interest Group on Macintosh Development BDR and Porting, both for MacOS 8.6 - 9.x and MacOS X BDR I think a wording like R-sig-debian namely BDRR Special Interest Group for MacOS X ports of R Brian's definition seems appropriate to me nowadays and the (extended) disclaimer should include both development issues specific to OS X (ports, etc) and user feedback on R.app GUI (we don't want R.app bugs go into the R-bugs list), but NOT general R- help topics which should go to R-help indeed. I think we should keep the devel part in R-sig-Mac. I'm including Simon Urbanek and waiting for some reaction before taking actions on R-sig-mac. stefano BDR would be better. yes, thank you both IFF this is really the intention. Stefano Iacus is the maintainer (and initiator) of the list and should say (and maybe ask on the R-SIG-Mac list) what he (and the subscribers) really wants. R-SIG-Mac R Special Interest Group on Mac Development This is very similar to the description of R-devel: This list is intended for questions and discussion about code development in R. And that description is even more intimidating when you read further: Questions likely to prompt discussion unintelligible to non-programmers or topics that are too technical for R-help's audience should go to R-devel Would it make sense to change the description of R-SIG-mac so that it would welcome question on R usage in Mac, instead of being a Mac Devolepment forum that sounds like being unintelligible to non-programmers? BDR Which seems quite reasonable to me. The topics which BDR provoke this response usually are questions BDR unintelligible except to Mac sysadmins/programmers and BDR definitely `too technical for R-help's audience'. I agree. We shouldn't let R users on the Mac think that all their questions should go to R-SIG-Mac. Regular R questions should continue to come to R-help (or R-devel) just as per the posting guide. Martin Maechler BDR -- Brian D. Ripley, [EMAIL PROTECTED] Professor of BDR Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ BDR University of Oxford, Tel: +44 1865 272861 (self) 1 BDR South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, BDR UK Fax: +44 1865 272595 !DSPAM:43562fae226121420620285! __ 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
[R] clustering algorithm detail
Hi all, I wanted to run the hclust (or any other clustering algorithm) on a distance matrix. I have formed the distance matrix as: distmat: ab c de a0.000.961.601.601.68 b0.960.000.961.802.64 c 1.600.960.000.841.80 d 1.601.800.840.000.96 e 1.682.641.800.960.00 Now, I would like to run a clustering algorithm on it. I tried: newclust = hclust(distmat) and got the following error: Error in if (n 2) stop(Must have n = 2 objects to cluster) : argument is of length zero I understand that the documentation says that the matrix ' d: a dissimilarity structure as produced by 'dist''. Does that mean that I need to convert it into a lower triangle matrix? I also tried: newclust = hclust(vech(distmat)) but this gave a similar error. Where am I going wrong? Also, will hclust be able to handle 'NA' in the dissimilarity matrix? many thanks, Tim - [[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
Re: [R] Automatic rounding of values after factors , converted to numeric, are multipled by a real number
Nelson, Gary (FWE) [EMAIL PROTECTED] writes: I am wondering if someone would have any suggestion about my issue? I have the following code: wgts-aggregate(subset(lendata,select=c(Length)),list(lendata$Cruise,len data$Station,lendata$Region,lendata$Total),mean) wgts-wgts[order(wgts$Group.3,wgts$Group.1,wgts$Group.1),] names(wgts)-c(Cruise,Station,Region,Total,MLen) wgts$Total-as.numeric(levels(wgts$Total))[wgts$Total] wgts$swmean-with(wgts,wgts$Total*wgts$MLen) When I run it, I get: Cruise Station Region Total MLen swmean 32350 256 1 2 70.5141 52350 254 1 3 73.3220 62350 287 1 3 65.7197 92350 232 1 4 75.25000301 10 2350 294 1 4 56.0224 12 2350 301 1 5 70.2351 14 2350 316 1 6 67.3404 15 2350 255 1 7 55.0385 17 2350 285 1 8 73.5588 19 2350 212 110 57.5575 20 2350 250 110 61.5615 27 2350 221 124 95.29167 2287 33 2350 229 135 55.62857 1947 37 2350 293 147 53.82979 2530 38 2350 203 150 55.54000 2777 39 2350 248 155 63.30909 3482 41 2350 246 163 95.82540 6037 42 2350 265 168 55.54412 3777 43 2350 251 182 62.60976 5134 44 2350 234 185 57.21176 4863 Every value is correct except that the swmeans are rounded and I can't get values with the decimals fractions. I have tried as.double and have change the options(digits=7), but nothing seems to work. I have spent several hours combing manuals and archives. as far as I can see, the issue is that Total*MLen just *are* pretty close to being integers, e.g. 4863/85 [1] 57.21176 z - x$Total*x$MLen z - round(z) [1] 0.0 -0.1 0.1 0.0 0.0 0.0 -0.2 0.0 [9] 0.0 0.0 0.0 0.8 -0.5 0.00013 0.0 -0.5 [17] 0.00020 0.00016 0.00032 -0.00040 -- 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
Re: [R] Optim with two constraints
Hello, I have a follow-up from Jens's question and Professor Ripley's response. Jens wants to do quadratic optimization with 2 constraints: # I need two constraints: # 1. each element in par needs to be between 0 and 1 # 2. sum(par)=1, i.e. the elements in par need to sum to 1 how does one set both constraints in quadprog, per Prof. Ripley's suggestion? i know how to get quadprog to handle the second constraint, but not BOTH, since quadprog only takes as inputs the constraint matrix A and constraint vector b-- unlike in ipop (kernlab), there is no additional option for box constraints. apologies if i am not seeing something obvious here. thanks in advance, alexis On 10/19/05, Jens Hainmueller [EMAIL PROTECTED] wrote: -Ursprüngliche Nachricht- Von: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Gesendet: Thursday, October 13, 2005 2:46 AM An: Jens Hainmueller Cc: r-help@stat.math.ethz.ch Betreff: Re: [R] Optim with two constraints This is actually quadratic programming, so why do you want to use optim()? There are packages specifically for QP, e.g. quadprog. A more general approach is to eliminate one variable, which gives you an inequality constrained problem in n-1 variables to which you could apply contrOptim(). Other re-parametrizations (e.g. of weights as a log-linear model) will work provided none of the parameters are going to be zero at the optimum (one cannot be one without all the others being zero). On Wed, 12 Oct 2005, Jens Hainmueller wrote: Hi R-list, I am new to optimization in R and would appreciate help on the following question. I would like to minimize the following function using two constraints: ## fn - function(par,H,F){ fval - 0.5 * t(par) %*% H %*% par + F%*% par fval } # matrix H is (n by k) # matrix F is (n by 1) # par is a (n by 1) set of weights # I need two constraints: # 1. each element in par needs to be between 0 and 1 # 2. sum(par)=1 i.e. the elements in par need to sum to 1 ## I try to use optim res - optim(c(runif(16),fn, method=L-BFGS-B, H=H, F=f ,control=list(fnscale=-1), lower=0, upper=1) ## If I understand this correctly, using L-BFGS-B with lower=0 and upper=1 should take care of constraint 1 (box constraints). What I am lacking is the skill to include constraint no 2. I guess I could solve this by reparametrization but I am not sure how exactly. I could not find (i.e. wasn't able to infer) the answer to this in the archives despite the many comments on optim and constrained optimization (sorry if I missed it there). I am using version 2.1.1 under windows XP. Thank you very much. Jens __ 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 -- 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
Re: [R] clustering algorithm detail
Have you tried as.dist(distmat)? Christian On Wed, 19 Oct 2005, Tim Smith wrote: Hi all, I wanted to run the hclust (or any other clustering algorithm) on a distance matrix. I have formed the distance matrix as: distmat: ab c de a0.000.961.601.601.68 b0.960.000.961.802.64 c 1.600.960.000.841.80 d 1.601.800.840.000.96 e 1.682.641.800.960.00 Now, I would like to run a clustering algorithm on it. I tried: newclust = hclust(distmat) and got the following error: Error in if (n 2) stop(Must have n = 2 objects to cluster) : argument is of length zero I understand that the documentation says that the matrix ' d: a dissimilarity structure as produced by 'dist''. Does that mean that I need to convert it into a lower triangle matrix? I also tried: newclust = hclust(vech(distmat)) but this gave a similar error. Where am I going wrong? Also, will hclust be able to handle 'NA' in the dissimilarity matrix? many thanks, Tim - [[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 *** --- *** Christian Hennig University College London, Department of Statistical Science Gower St., London WC1E 6BT, phone +44 207 679 1698 [EMAIL PROTECTED], www.homepages.ucl.ac.uk/~ucakche __ 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
[R] sqlQuery and string selection
Dear alls, Could someone tell me how to select a subset of string observations (e.g. females in a sex column) with sqlQuery in the RODBC library? Indeed, I'm trying to select a subset of observations on my access database with: female-sqlQuery(mychannel,SELECT Micromammiferes.sex FROM Micromammiferes WHERE (((Micromammiferes.sex)=females));) The sql works well in access but in R, I keep getting: Error: syntax error. Any help would be very appreciated, Thanks a lot Jérôme Lemaître Ph.D. student Départment of biology, University Laval Quebec, Canada __ 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
[R] adding error bars to lattice plots
Dear R-Users, how to include error bars within lattice? How should the panel = function(x,y,...){ looks like? Does panel.arrows works here as well? I appreciate any help on this. Regards, Mario AT [[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
[R] Filter design in R?
Dr. Williams, I ran across your inquiry on one of the R-help mailing lists regarding digital filter design and implementation. I found no response to your email in the archives and was wondering if you were able to find anything. Thanks, Israel -- Israel Christie, Ph.D. Email: [EMAIL PROTECTED] Phone: 865.766.0214 Mobile: 865.406.4615 __ 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
Re: [R] sqlQuery and string selection
Jérôme Lemaître wrote: Dear alls, Could someone tell me how to select a subset of string observations (e.g. females in a sex column) with sqlQuery in the RODBC library? Indeed, I'm trying to select a subset of observations on my access database with: female-sqlQuery(mychannel,SELECT Micromammiferes.sex FROM Micromammiferes WHERE (((Micromammiferes.sex)=females));) The sql works well in access but in R, I keep getting: Error: syntax error. R is likely to have problems with nested quote characters. Ie: x = SELECT Micromammiferes.sex FROM Micromammiferes WHERE (((Micromammiferes.sex)=females)); also results in a syntax error (my mailer split the line). __ 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
Re: [R] sqlQuery and string selection
(sorry if a duplicate pops through ...) Jérôme Lemaître wrote: Dear alls, Could someone tell me how to select a subset of string observations (e.g. females in a sex column) with sqlQuery in the RODBC library? Indeed, I'm trying to select a subset of observations on my access database with: female-sqlQuery(mychannel,SELECT Micromammiferes.sex FROM Micromammiferes WHERE (((Micromammiferes.sex)=females));) The sql works well in access but in R, I keep getting: Error: syntax error. Most computer software has problems with nested quote characters. Ie: x = SELECT Micromammiferes.sex FROM Micromammiferes WHERE (((Micromammiferes.sex)=females)); also results in a syntax error (my mailer split the line). __ 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
Re: [R] adding error bars to lattice plots
?llines, lsegments and the like can be used in the panel functions to draw any sort of error bar that you can compute from the x,y,... data of the panel. -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA The business of the statistician is to catalyze the scientific learning process. - George E. P. Box -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mario Aigner-Torres Sent: Wednesday, October 19, 2005 2:34 PM To: r-help@stat.math.ethz.ch Subject: [R] adding error bars to lattice plots Dear R-Users, how to include error bars within lattice? How should the panel = function(x,y,...){ looks like? Does panel.arrows works here as well? I appreciate any help on this. Regards, Mario AT [[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 __ 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
Re: [R] sqlQuery and string selection
The syntax error is that you have unescaped quotes inside quotes. You also do not need a semicolon, nor to refer to columns in this table.column form. Try 'select sex from Micromammiferes where sex=females' (I suspect you do not need quotes, but keep forgetting the quirks of various DBMSs.) On Wed, 19 Oct 2005, Jérôme Lemaître wrote: Dear alls, Could someone tell me how to select a subset of string observations (e.g. females in a sex column) with sqlQuery in the RODBC library? Indeed, I'm trying to select a subset of observations on my access database with: female-sqlQuery(mychannel,SELECT Micromammiferes.sex FROM Micromammiferes WHERE (((Micromammiferes.sex)=females));) The sql works well in access but in R, I keep getting: Error: syntax error. Any help would be very appreciated, Thanks a lot Jérôme Lemaître Ph.D. student Départment of biology, University Laval Quebec, Canada __ 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 -- 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
Re: [R] Weights in survReg
Sasha, This is R, which has survreg with weights (no caps). You can find out for sure from the source code, but the help file says these are `observation weights'. I take that to mean weight=2 says `I have two cases like this' in forming the likelihood. The C code says `case weights', the usual term for that meaning. On Wed, 19 Oct 2005, Alexander Antonyuk wrote: Dear R users, I am trying to find out what the function survReg does exactly with the Weights parameters. I looked in Terry Therneau documentations and other places and couldn't find anything. I tried to make an analogy with weighted OLS and assumed that the scale parameter Sigma in the accelerated failure-time model log(Time)= X*betas +Sigma*E, is of the form Sigma(i) = Sigma/Weights(i). Can anyone confirm that or point me in the direction where I can find out for sure? Thank you, Sasha -- 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
[R] mid-p CIs for common odds ratio
mantelhaen.test() gives the exact conditional p-value (for independence) and confidence intervals (CIs)for the common odds ratio for a stratified 2x2 table. The epitools package by Tomas Aragon (available via CRAN) contains functions which use fisher.test() to calculate mid-p exact p-values and CIs for the CMLE odds ratio for a single 2x2 table. The mid-p p-value for independence for a stratified 2x2 table is easy to calculate using mantelhaen.test(), but can anyone suggest a method for calculation of mid-p CIs for the common odds ratio? A search in the usual places draws a blank (but I am sure someone will immediately prove me wrong on that point...). Thanks to Andy Dean (of Epi-Info fame), I have a copy of public domain Pascal code from 1991 by David Martin and Harland Austin which calculates mid-p CIs for the common odds ratio by finding polynomial roots. Before trying to replicate that code in R (or C), I was wondering if anyone could suggest a better or easier way? Tim C __ 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
[R] Plotting more than one series on the same graph
I'm new to R and have searched for help and consulted the the pdf manuals, but I can't seem to figure out how to plot more than one series on the same graph. I've tried using multiple par(new=TRUE) statements such as plot(series1, ci.type=line, col=red, lwd=2, ci.lty=0, ci.col=red) par(new=TRUE) plot(series2, ci.type=line, col=green, lwd=2, ci.lty=0, ci.col=green) par(new=TRUE) plot(series3, ci.type=line, col=blue, lwd=2, ci.lty=0, ci.col=blue) and this does plot the three series on one graph, but makes a mess of the y-axis. There must be a more elegant solution. Also, I wonder why the final series (series 3) doesn't plot until I manually hit enter? Thanks for any help, Mark __ 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
Re: [R] Plotting more than one series on the same graph
[EMAIL PROTECTED] wrote: I'm new to R and have searched for help and consulted the the pdf manuals, but I can't seem to figure out how to plot more than one series on the same graph. I've tried using multiple par(new=TRUE) statements such as plot(series1, ci.type=line, col=red, lwd=2, ci.lty=0, ci.col=red) par(new=TRUE) plot(series2, ci.type=line, col=green, lwd=2, ci.lty=0, ci.col=green) par(new=TRUE) plot(series3, ci.type=line, col=blue, lwd=2, ci.lty=0, ci.col=blue) and this does plot the three series on one graph, but makes a mess of the y-axis. There must be a more elegant solution. Also, I wonder why the final series (series 3) doesn't plot until I manually hit enter? Thanks for any help, Mark Hi, Mark, In general, see ?lines. However, your use of ci.type suggests you're using ?plot.acf, which may require you describe what you are trying to do in more detail. Thanks, --sundar __ 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
[R] creating a derived variable in a data frame
Hello, I have read through the manuals and can't seem to find an answer. I have a categorical, character variable that has hundreds of values. I want to group the existing values of this variable into a new, derived (categorical) variable by applying conditions to the values in the data. For example, suppose I have a data frame with variables: date, country, x, y, and z. x,y,z are numeric and country is a 2-digit character string. I want to create a new derived variable named continent that would also exist in the data frame. The Continent variable would have values of Asia, Europe, North America, etc... How would this best be done for a large dataset (10MB) ? I have tried many variations on following without success (note in a real example I would have a longer list of countries and continent values): mydata$continent - mydata[ mydata$country==list('US','CA','MX'), ] - North America I have read about factors, but I am not sure how they apply here. Can anyone help me with the syntax? I am sure it is trivial and a common thing to do. The ultimate goal is to compute percentages of x by continent. Thanks for any help in advance. -Avram __ 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
[R] RE : sqlQuery and string selection
Dear Prof Ripley, I tried what you suggested and it worked perfectly well! I also appreciated your corrections about my SQL formulation. However, it seems that quotes are indeed needed to get string observations (but my access software is in french...). Finally, do you think that it might be worth to add an example for sqlQuery using string variables in a later version of RODBC, just in case others encounter the same problem as me? I thank you very much for your help, Jérôme Lemaître Ph.D. student Départment of biology, University Laval Quebec, Canada -Message d'origine- De : Prof Brian Ripley [mailto:[EMAIL PROTECTED] Envoyé : 19 octobre 2005 18:23 À : Jérôme Lemaître Cc : R-help@stat.math.ethz.ch Objet : Re: [R] sqlQuery and string selection The syntax error is that you have unescaped quotes inside quotes. You also do not need a semicolon, nor to refer to columns in this table.column form. Try 'select sex from Micromammiferes where sex=females' (I suspect you do not need quotes, but keep forgetting the quirks of various DBMSs.) On Wed, 19 Oct 2005, Jérôme Lemaître wrote: Dear alls, Could someone tell me how to select a subset of string observations (e.g. females in a sex column) with sqlQuery in the RODBC library? Indeed, I'm trying to select a subset of observations on my access database with: female-sqlQuery(mychannel,SELECT Micromammiferes.sex FROM Micromammiferes WHERE (((Micromammiferes.sex)=females));) The sql works well in access but in R, I keep getting: Error: syntax error. Any help would be very appreciated, Thanks a lot Jérôme Lemaître Ph.D. student Départment of biology, University Laval Quebec, Canada __ 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 -- 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
Re: [R] creating a derived variable in a data frame
I suggest you use the recode function in car package to do your job. === 2005-10-20 08:09:08 您在来信中写道:=== Hello, I have read through the manuals and can't seem to find an answer. I have a categorical, character variable that has hundreds of values. I want to group the existing values of this variable into a new, derived (categorical) variable by applying conditions to the values in the data. For example, suppose I have a data frame with variables: date, country, x, y, and z. x,y,z are numeric and country is a 2-digit character string. I want to create a new derived variable named continent that would also exist in the data frame. The Continent variable would have values of Asia, Europe, North America, etc... How would this best be done for a large dataset (10MB) ? I have tried many variations on following without success (note in a real example I would have a longer list of countries and continent values): mydata$continent - mydata[ mydata$country==list('US','CA','MX'), ] - North America I have read about factors, but I am not sure how they apply here. Can anyone help me with the syntax? I am sure it is trivial and a common thing to do. The ultimate goal is to compute percentages of x by continent. Thanks for any help in advance. -Avram __ 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 = = = = = = = = = = = = = = = = = = = = 2005-10-20 -- Deparment of Sociology Fudan University My new mail addres is [EMAIL PROTECTED] Blog:http://sociology.yculblog.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