Re: [R] Issues with R3.5.2
Thanks! On Mon, Dec 24, 2018 at 8:38 PM prof.amitmittal wrote: > you can just use libpath to specify which packages to use instead of > deleting libraries > > also use sessionInfo () at the beginning to see what is loaded > > > > Sent from my Samsung device > > > Original message > From: Jeff Newmiller > Date: 25/12/2018 4:39 am (GMT+05:30) > To: Janh Anni > Cc: r-help@r-project.org > Subject: Re: [R] Issues with R3.5.2 > > Yes, that would be the personal library. > > There is one question in the installer that asks if you would like to > create a personal library... I have always said yes, but I could imagine > that saying no could lead to problems. > > On December 24, 2018 2:43:24 PM PST, Janh Anni wrote: > >I am sorry I forgot to mention - I just looked in the > >Documents\R\win-Library directory and only found folders for previous R > >versions, specifically R3.0, 3.1 and 3.4. So I must have deleted the > >R3.5 > >folder as you initially advised or it was removed during the > >un-installation. Unless I am misunderstanding what you mean by the > >R3.5 > >personal package library? Thanks again > > > >On Mon, Dec 24, 2018 at 4:28 PM Jeff Newmiller > > > >wrote: > > > >> > >> > >> On December 24, 2018 11:14:40 AM PST, Janh Anni > >> wrote: > >> >Hello Jeff, Martin, > >> > > >> >I deleted 3.5.2 as suggested and tried 3.5.1 but still had the same > >> >problems. I still couldn't use read.table to load a data file and > >> >still > >> >had an error message when I tried to install a package. Usually > >after > >> >installing a new version of R, I would go to the R icon on the > >desktop, > >> >right click on it, click on Properties and then specify the folder > >that > >> >contains my data files in the "Start in" box, so that R > >automatically > >> >has > >> >access to my data files. Could that possibly be causing problems > >with > >> >these newer versions of R? > >> > >> No. > >> > >> > Also, there’s never a prompt during the > >> >installation to Run as Administrator, so that could not possibly be > >the > >> >cause > >> > >> Yes, you have to go out of your way to Run As Administrator (RAA). > >> However, regardless of how you initially encountered a problem, once > >you > >> did that there could be any number of files contaminated with > >permissions > >> issues. > >> > >> Specifically, I said to delete your 3.5 personal package library, but > >your > >> description is not specific so I suspect you may not have done that. > >> However, any file modified by you intentionally or not while using > >RAA > >> could be causing your problems now, so now it is up to you to find > >those > >> files somehow. > >> > >> > > >> > I also just tried Version 3.4.4, and had no problems whatsoever > >either > >> >with using read.table to load data files or downloading packages. > >So > >> >there > >> >must be some changes from version 3.5 onward that created the > >issues. > >> >Hopefully this will be looked at more closely by the team with a > >view > >> >to > >> >resolving the issues > >> > >> I doubt the "team" will spend much time looking at this based on your > >> descriptions so far. They need something reproducible, and the fact > >that > >> you already used RAA to "fix" the problem makes anything you did > >prior to > >> that almost impossible to reproduce. > >> > >> fortunes:::fortune(337) > >> > >> > > >> >Thanks, > >> > > >> >Janh > >> > > >> >On Sun, Dec 23, 2018 at 1:31 AM Jeff Newmiller > >> > > >> >wrote: > >> > > >> >> You could delete your 3.5 personal package library (using the File > >> >> Explorer with Run as Admin if necessary) and re-install your > >packages > >> >> without running as Admin. If that does not work try uninstalling R > >> >and > >> >> re-installing 3.5.1. > >> >> > >> >> On December 22, 2018 8:16:11 PM PST, Janh Anni > > > >> >wrote: > >> >> >This issue only came up after I installed R3.5.2. Never had any > >&g
Re: [R] Issues with R3.5.2
Oddly enough, I must have done a dozen installations and re-installations since this issue arose but don't recall ever being asked if I wished to create a personal library. I do recall being offered the option to install R to a different folder other than the usual Program Files folder, or to choose custom installation rather than the usual defaults, or to create a desk shortcut or quick launch shortcut and so on. But this whole RAA issue is sobering - the fact that clicking Run as Administrator at some point or the other, either intentionally or inadvertently can suddenly render R inoperable ... On Mon, Dec 24, 2018 at 6:09 PM Jeff Newmiller wrote: > Yes, that would be the personal library. > > There is one question in the installer that asks if you would like to > create a personal library... I have always said yes, but I could imagine > that saying no could lead to problems. > > On December 24, 2018 2:43:24 PM PST, Janh Anni wrote: > >I am sorry I forgot to mention - I just looked in the > >Documents\R\win-Library directory and only found folders for previous R > >versions, specifically R3.0, 3.1 and 3.4. So I must have deleted the > >R3.5 > >folder as you initially advised or it was removed during the > >un-installation. Unless I am misunderstanding what you mean by the > >R3.5 > >personal package library? Thanks again > > > >On Mon, Dec 24, 2018 at 4:28 PM Jeff Newmiller > > > >wrote: > > > >> > >> > >> On December 24, 2018 11:14:40 AM PST, Janh Anni > >> wrote: > >> >Hello Jeff, Martin, > >> > > >> >I deleted 3.5.2 as suggested and tried 3.5.1 but still had the same > >> >problems. I still couldn't use read.table to load a data file and > >> >still > >> >had an error message when I tried to install a package. Usually > >after > >> >installing a new version of R, I would go to the R icon on the > >desktop, > >> >right click on it, click on Properties and then specify the folder > >that > >> >contains my data files in the "Start in" box, so that R > >automatically > >> >has > >> >access to my data files. Could that possibly be causing problems > >with > >> >these newer versions of R? > >> > >> No. > >> > >> > Also, there’s never a prompt during the > >> >installation to Run as Administrator, so that could not possibly be > >the > >> >cause > >> > >> Yes, you have to go out of your way to Run As Administrator (RAA). > >> However, regardless of how you initially encountered a problem, once > >you > >> did that there could be any number of files contaminated with > >permissions > >> issues. > >> > >> Specifically, I said to delete your 3.5 personal package library, but > >your > >> description is not specific so I suspect you may not have done that. > >> However, any file modified by you intentionally or not while using > >RAA > >> could be causing your problems now, so now it is up to you to find > >those > >> files somehow. > >> > >> > > >> > I also just tried Version 3.4.4, and had no problems whatsoever > >either > >> >with using read.table to load data files or downloading packages. > >So > >> >there > >> >must be some changes from version 3.5 onward that created the > >issues. > >> >Hopefully this will be looked at more closely by the team with a > >view > >> >to > >> >resolving the issues > >> > >> I doubt the "team" will spend much time looking at this based on your > >> descriptions so far. They need something reproducible, and the fact > >that > >> you already used RAA to "fix" the problem makes anything you did > >prior to > >> that almost impossible to reproduce. > >> > >> fortunes:::fortune(337) > >> > >> > > >> >Thanks, > >> > > >> >Janh > >> > > >> >On Sun, Dec 23, 2018 at 1:31 AM Jeff Newmiller > >> > > >> >wrote: > >> > > >> >> You could delete your 3.5 personal package library (using the File > >> >> Explorer with Run as Admin if necessary) and re-install your > >packages > >> >> without running as Admin. If that does not work try uninstalling R > >> >and > >> >> re-installing 3.5.1. > >> >> > >> >&
Re: [R] Issues with R3.5.2
I am sorry I forgot to mention - I just looked in the Documents\R\win-Library directory and only found folders for previous R versions, specifically R3.0, 3.1 and 3.4. So I must have deleted the R3.5 folder as you initially advised or it was removed during the un-installation. Unless I am misunderstanding what you mean by the R3.5 personal package library? Thanks again On Mon, Dec 24, 2018 at 4:28 PM Jeff Newmiller wrote: > > > On December 24, 2018 11:14:40 AM PST, Janh Anni > wrote: > >Hello Jeff, Martin, > > > >I deleted 3.5.2 as suggested and tried 3.5.1 but still had the same > >problems. I still couldn't use read.table to load a data file and > >still > >had an error message when I tried to install a package. Usually after > >installing a new version of R, I would go to the R icon on the desktop, > >right click on it, click on Properties and then specify the folder that > >contains my data files in the "Start in" box, so that R automatically > >has > >access to my data files. Could that possibly be causing problems with > >these newer versions of R? > > No. > > > Also, there’s never a prompt during the > >installation to Run as Administrator, so that could not possibly be the > >cause > > Yes, you have to go out of your way to Run As Administrator (RAA). > However, regardless of how you initially encountered a problem, once you > did that there could be any number of files contaminated with permissions > issues. > > Specifically, I said to delete your 3.5 personal package library, but your > description is not specific so I suspect you may not have done that. > However, any file modified by you intentionally or not while using RAA > could be causing your problems now, so now it is up to you to find those > files somehow. > > > > > I also just tried Version 3.4.4, and had no problems whatsoever either > >with using read.table to load data files or downloading packages. So > >there > >must be some changes from version 3.5 onward that created the issues. > >Hopefully this will be looked at more closely by the team with a view > >to > >resolving the issues > > I doubt the "team" will spend much time looking at this based on your > descriptions so far. They need something reproducible, and the fact that > you already used RAA to "fix" the problem makes anything you did prior to > that almost impossible to reproduce. > > fortunes:::fortune(337) > > > > >Thanks, > > > >Janh > > > >On Sun, Dec 23, 2018 at 1:31 AM Jeff Newmiller > > > >wrote: > > > >> You could delete your 3.5 personal package library (using the File > >> Explorer with Run as Admin if necessary) and re-install your packages > >> without running as Admin. If that does not work try uninstalling R > >and > >> re-installing 3.5.1. > >> > >> On December 22, 2018 8:16:11 PM PST, Janh Anni > >wrote: > >> >This issue only came up after I installed R3.5.2. Never had any > >> >problems > >> >with previous installations. So it is likely a bug in the current > >> >version. Any suggestions what to do now? > >> > > >> >On Sat, Dec 22, 2018 at 11:06 PM Jeff Newmiller > >> > > >> >wrote: > >> > > >> >> That normally only occurs if you have at some time used elevated > >> >> permissions, beyond which point you fall into a downward spiral of > >> >more > >> >> permissions trouble. You are apparently already in trouble, > >whether > >> >it was > >> >> of your own making or due to a bug in the installer. > >> >> > >> >> Also, never update the system R package library... always use a > >> >personal > >> >> library. > >> >> > >> >> On December 22, 2018 6:01:44 PM PST, Janh Anni > > > >> >wrote: > >> >> >Hi Jeff, > >> >> > > >> >> >No, during the installation, there was not an option to Run as > >> >> >Administration. But *after *installation, I found that if I > >> >selected > >> >> >Run > >> >> >as Administrator, then I could install packages using > >> >install.packages > >> >> >as > >> >> >usual without problems. > >> >> > > >> >> >Thanks > >> >> >Janh > >> >> > > >> >> >On Sat, Dec 22, 2018 at 8:26 PM Jeff Newmiller > >>
Re: [R] Issues with R3.5.2
Hello Jeff, Martin, I deleted 3.5.2 as suggested and tried 3.5.1 but still had the same problems. I still couldn't use read.table to load a data file and still had an error message when I tried to install a package. Usually after installing a new version of R, I would go to the R icon on the desktop, right click on it, click on Properties and then specify the folder that contains my data files in the "Start in" box, so that R automatically has access to my data files. Could that possibly be causing problems with these newer versions of R? Also, there’s never a prompt during the installation to Run as Administrator, so that could not possibly be the cause I also just tried Version 3.4.4, and had no problems whatsoever either with using read.table to load data files or downloading packages. So there must be some changes from version 3.5 onward that created the issues. Hopefully this will be looked at more closely by the team with a view to resolving the issues Thanks, Janh On Sun, Dec 23, 2018 at 1:31 AM Jeff Newmiller wrote: > You could delete your 3.5 personal package library (using the File > Explorer with Run as Admin if necessary) and re-install your packages > without running as Admin. If that does not work try uninstalling R and > re-installing 3.5.1. > > On December 22, 2018 8:16:11 PM PST, Janh Anni wrote: > >This issue only came up after I installed R3.5.2. Never had any > >problems > >with previous installations. So it is likely a bug in the current > >version. Any suggestions what to do now? > > > >On Sat, Dec 22, 2018 at 11:06 PM Jeff Newmiller > > > >wrote: > > > >> That normally only occurs if you have at some time used elevated > >> permissions, beyond which point you fall into a downward spiral of > >more > >> permissions trouble. You are apparently already in trouble, whether > >it was > >> of your own making or due to a bug in the installer. > >> > >> Also, never update the system R package library... always use a > >personal > >> library. > >> > >> On December 22, 2018 6:01:44 PM PST, Janh Anni > >wrote: > >> >Hi Jeff, > >> > > >> >No, during the installation, there was not an option to Run as > >> >Administration. But *after *installation, I found that if I > >selected > >> >Run > >> >as Administrator, then I could install packages using > >install.packages > >> >as > >> >usual without problems. > >> > > >> >Thanks > >> >Janh > >> > > >> >On Sat, Dec 22, 2018 at 8:26 PM Jeff Newmiller > >> > > >> >wrote: > >> > > >> >> Did you by any chance use Run As Administrator to install R? If so > >> >then > >> >> you need to uninstall it and delete all files created by it (e.g. > >> >> Documents/R/win-lib/3.5/) and re-install using UAC as prompted. > >> >> > >> >> On December 22, 2018 5:10:27 PM PST, Janh Anni > > > >> >wrote: > >> >> >Dear R Experts, > >> >> > > >> >> >I use Windows 10 and just installed the new R version, R3.5.2 but > >> >when > >> >> >I > >> >> >tried to load a data file using read.table, I got an error > >message > >> >like > >> >> >this: > >> >> > > >> >> >*Error in file(file, "rt") : cannot open the connection* > >> >> >*In addition: Warning message:* > >> >> >*In file(file, "rt") :* > >> >> >* cannot open file 'StreamPCB.dat': No such file or directory* > >> >> > > >> >> >Also, I couldn't install packages using install.packages as > >usual, > >> >> >unless I > >> >> >run R as Administrator > >> >> > > >> >> >I wonder if anyone else had the same issues and any suggestions > >how > >> >to > >> >> >fix? > >> >> > > >> >> >Thanks a lot > >> >> >Janh > >> >> > > >> >> > [[alternative HTML version deleted]] > >> >> > > >> >> >__ > >> >> >R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > >> >> >https://stat.ethz.ch/mailman/listinfo/r-help > >> >> >PLEASE do read the posting guide > >> >> >http://www.R-project.org/posting-guide.html > >> >> >and provide commented, minimal, self-contained, reproducible > >code. > >> >> > >> >> -- > >> >> Sent from my phone. Please excuse my brevity. > >> >> > >> > >> -- > >> Sent from my phone. Please excuse my brevity. > >> > > -- > Sent from my phone. Please excuse my brevity. > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Issues with R3.5.2
This issue only came up after I installed R3.5.2. Never had any problems with previous installations. So it is likely a bug in the current version. Any suggestions what to do now? On Sat, Dec 22, 2018 at 11:06 PM Jeff Newmiller wrote: > That normally only occurs if you have at some time used elevated > permissions, beyond which point you fall into a downward spiral of more > permissions trouble. You are apparently already in trouble, whether it was > of your own making or due to a bug in the installer. > > Also, never update the system R package library... always use a personal > library. > > On December 22, 2018 6:01:44 PM PST, Janh Anni wrote: > >Hi Jeff, > > > >No, during the installation, there was not an option to Run as > >Administration. But *after *installation, I found that if I selected > >Run > >as Administrator, then I could install packages using install.packages > >as > >usual without problems. > > > >Thanks > >Janh > > > >On Sat, Dec 22, 2018 at 8:26 PM Jeff Newmiller > > > >wrote: > > > >> Did you by any chance use Run As Administrator to install R? If so > >then > >> you need to uninstall it and delete all files created by it (e.g. > >> Documents/R/win-lib/3.5/) and re-install using UAC as prompted. > >> > >> On December 22, 2018 5:10:27 PM PST, Janh Anni > >wrote: > >> >Dear R Experts, > >> > > >> >I use Windows 10 and just installed the new R version, R3.5.2 but > >when > >> >I > >> >tried to load a data file using read.table, I got an error message > >like > >> >this: > >> > > >> >*Error in file(file, "rt") : cannot open the connection* > >> >*In addition: Warning message:* > >> >*In file(file, "rt") :* > >> >* cannot open file 'StreamPCB.dat': No such file or directory* > >> > > >> >Also, I couldn't install packages using install.packages as usual, > >> >unless I > >> >run R as Administrator > >> > > >> >I wonder if anyone else had the same issues and any suggestions how > >to > >> >fix? > >> > > >> >Thanks a lot > >> >Janh > >> > > >> > [[alternative HTML version deleted]] > >> > > >> >__ > >> >R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > >> >https://stat.ethz.ch/mailman/listinfo/r-help > >> >PLEASE do read the posting guide > >> >http://www.R-project.org/posting-guide.html > >> >and provide commented, minimal, self-contained, reproducible code. > >> > >> -- > >> Sent from my phone. Please excuse my brevity. > >> > > -- > Sent from my phone. Please excuse my brevity. > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Issues with R3.5.2
Hi Jeff, No, during the installation, there was not an option to Run as Administration. But *after *installation, I found that if I selected Run as Administrator, then I could install packages using install.packages as usual without problems. Thanks Janh On Sat, Dec 22, 2018 at 8:26 PM Jeff Newmiller wrote: > Did you by any chance use Run As Administrator to install R? If so then > you need to uninstall it and delete all files created by it (e.g. > Documents/R/win-lib/3.5/) and re-install using UAC as prompted. > > On December 22, 2018 5:10:27 PM PST, Janh Anni wrote: > >Dear R Experts, > > > >I use Windows 10 and just installed the new R version, R3.5.2 but when > >I > >tried to load a data file using read.table, I got an error message like > >this: > > > >*Error in file(file, "rt") : cannot open the connection* > >*In addition: Warning message:* > >*In file(file, "rt") :* > >* cannot open file 'StreamPCB.dat': No such file or directory* > > > >Also, I couldn't install packages using install.packages as usual, > >unless I > >run R as Administrator > > > >I wonder if anyone else had the same issues and any suggestions how to > >fix? > > > >Thanks a lot > >Janh > > > > [[alternative HTML version deleted]] > > > >__ > >R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > >https://stat.ethz.ch/mailman/listinfo/r-help > >PLEASE do read the posting guide > >http://www.R-project.org/posting-guide.html > >and provide commented, minimal, self-contained, reproducible code. > > -- > Sent from my phone. Please excuse my brevity. > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Issues with R3.5.2
Dear R Experts, I use Windows 10 and just installed the new R version, R3.5.2 but when I tried to load a data file using read.table, I got an error message like this: *Error in file(file, "rt") : cannot open the connection* *In addition: Warning message:* *In file(file, "rt") :* * cannot open file 'StreamPCB.dat': No such file or directory* Also, I couldn't install packages using install.packages as usual, unless I run R as Administrator I wonder if anyone else had the same issues and any suggestions how to fix? Thanks a lot Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Monte Carlo Simulations for Human Health & Ecological Risk Assessment
Dear R Experts! I would really love to perform probabilistic risk assessment for human health and ecological using Monte Carlo. I am knowledgeable in the risk assessment part but have no idea how to incorporate Monte Carlo simulation using R. Is there anyone out there in the wide wide world of R who has actually used Monte Carlo for this type of risk assessment and kind enough to show me the way? Many thanks in anticipation! Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Bootstrapping One- and Two-Sample Hypothesis Tests of Proportion
Hi Marc, I see what you are saying. I will try re-running the* boot.two.per* function using 1's and 0's for the data and specifying mean as the parameter and see what happens. I will report back. Thanks so much for your kind assistance! Janh On Thu, Nov 29, 2018 at 7:07 PM Marc Schwartz wrote: > Hi, > > I don't see Duncan's reply in the archive, but consider: > > > 1 / 4 > [1] 0.25 > > > mean(c(1, 0, 0, 0)) > [1] 0.25 > > > > 3 / 9 > [1] 0.333 > > > mean(c(1, 1, 1, 0, 0, 0, 0, 0, 0)) > [1] 0.333 > > > Regards, > > Marc Schwartz > > On Nov 29, 2018, at 6:57 PM, Janh Anni wrote: > > Hi Bert, > > You mean, just compute the test specifying the mean as the parameter but > using 1's and 0's for the data? Also I don't get how a proportion is a > mean of 0/1 responses. Could you please elaborate? Thanks! > > Janh > > On Thu, Nov 29, 2018 at 6:45 PM Bert Gunter > wrote: > > ... but as Duncan pointed out already, I believe, a proportion **is** a > mean -- of 0/1 responses. > > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along and > sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > > On Thu, Nov 29, 2018 at 3:30 PM Janh Anni wrote: > > Hi Rui, > > Thanks a lot for responding and I apologize for my late response. I tried > using the *boot.two.per* function in the wBoot package which stated that > it > could bootstrap 2-sample tests for both means and proportions but it > turned > out that it only works for the mean. > > Thanks again, > Janh > > On Wed, Nov 28, 2018 at 12:38 PM Rui Barradas > wrote: > > Hello, > > What have you tried? > Reproducible example please. > > http://adv-r.had.co.nz/Reproducibility.html > > > > https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example > > https://www.r-bloggers.com/minimal-reproducible-examples/ > > > Rui Barradas > > Às 22:33 de 27/11/2018, Janh Anni escreveu: > > Hello R Experts! > > Does anyone know of a relatively straightforward way to bootstrap > hypothesis tests for proportion in R? > > Thanks in advance! > > Janh > > > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Bootstrapping One- and Two-Sample Hypothesis Tests of Proportion
Hi Bert, You mean, just compute the test specifying the mean as the parameter but using 1's and 0's for the data? Also I don't get how a proportion is a mean of 0/1 responses. Could you please elaborate? Thanks! Janh On Thu, Nov 29, 2018 at 6:45 PM Bert Gunter wrote: > ... but as Duncan pointed out already, I believe, a proportion **is** a > mean -- of 0/1 responses. > > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along and > sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > > On Thu, Nov 29, 2018 at 3:30 PM Janh Anni wrote: > >> Hi Rui, >> >> Thanks a lot for responding and I apologize for my late response. I tried >> using the *boot.two.per* function in the wBoot package which stated that >> it >> could bootstrap 2-sample tests for both means and proportions but it >> turned >> out that it only works for the mean. >> >> Thanks again, >> Janh >> >> On Wed, Nov 28, 2018 at 12:38 PM Rui Barradas >> wrote: >> >> > Hello, >> > >> > What have you tried? >> > Reproducible example please. >> > >> > http://adv-r.had.co.nz/Reproducibility.html >> > >> > >> https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example >> > https://www.r-bloggers.com/minimal-reproducible-examples/ >> > >> > >> > Rui Barradas >> > >> > Às 22:33 de 27/11/2018, Janh Anni escreveu: >> > > Hello R Experts! >> > > >> > > Does anyone know of a relatively straightforward way to bootstrap >> > > hypothesis tests for proportion in R? >> > > >> > > Thanks in advance! >> > > >> > > Janh >> > > >> > > [[alternative HTML version deleted]] >> > > >> > > __ >> > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >> > > https://stat.ethz.ch/mailman/listinfo/r-help >> > > PLEASE do read the posting guide >> > http://www.R-project.org/posting-guide.html >> > > and provide commented, minimal, self-contained, reproducible code. >> > > >> > >> >> [[alternative HTML version deleted]] >> >> __ >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Bootstrapping One- and Two-Sample Hypothesis Tests of Proportion
Hi Rui, Thanks a lot for responding and I apologize for my late response. I tried using the *boot.two.per* function in the wBoot package which stated that it could bootstrap 2-sample tests for both means and proportions but it turned out that it only works for the mean. Thanks again, Janh On Wed, Nov 28, 2018 at 12:38 PM Rui Barradas wrote: > Hello, > > What have you tried? > Reproducible example please. > > http://adv-r.had.co.nz/Reproducibility.html > > https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example > https://www.r-bloggers.com/minimal-reproducible-examples/ > > > Rui Barradas > > Às 22:33 de 27/11/2018, Janh Anni escreveu: > > Hello R Experts! > > > > Does anyone know of a relatively straightforward way to bootstrap > > hypothesis tests for proportion in R? > > > > Thanks in advance! > > > > Janh > > > > [[alternative HTML version deleted]] > > > > __ > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Bootstrapping One- and Two-Sample Hypothesis Tests of Proportion
Hello R Experts! Does anyone know of a relatively straightforward way to bootstrap hypothesis tests for proportion in R? Thanks in advance! Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] wBoot Package
Hello David, Peter, Thank you so much for taking the trouble to look into this. The user guide for the *boot.two.per* function contains this statement: *Obtains an independent-samples confidence interval and (optionally) performs an independent samples* *hypothesis test for the difference between two population means, medians, proportions,* *or some user-defined function, using the percentile bootstrap method*. That was why I assumed it could handle the bootstrapped two-sample test for proportions as well. I actually tried to contact the author before bringing the issue to R-Help, but found that unfortunately he passed away in 2016. Assuming there's no resolution to this problem, would you know of any other package or function that can bootstrap one- and two-sample proportion tests? Thanks again! Janh On Sun, Nov 25, 2018 at 7:06 PM David Winsemius wrote: > Look at the function's help page: > > No help there. The "parameter" argument is not defined in any > substantive manner, and no examples other than `parameter=mean` appear > in the help page. > > (Now) Look at the code. The parameter argument is expected to be a > function. There is no function named `proportion` in base R that I know > of and: > > > wBoot::proportion > Error: 'proportion' is not an exported object from 'namespace:wBoot' > > wBoot:::proportion > Error in get(name, envir = asNamespace(pkg), inherits = FALSE) : >object 'proportion' not found > > > The code in the function you are asking about does begin with: > > { > > proportion <- mean > > However, that named entity, `proportion`, is never referenced in code > that follows, so it appears that the package author started down one > path and then abandoned that line of code and did something else. I > suspect that the code was written so that `mean` was inteended to > deliver a test of equal proportions using the normal approximation to a > binomial test. There is a waring in the help page that would apply to > situations where the proportion is far from 0.5. You are advised that > not all packages are written with scrupulous quality control and peer > review. > > You should have read the posting guide. It would have told you that you > should have addressed your concerns to the package author first, and > also posted in plain text. > > -- > > David > > On 11/25/18 12:59 PM, Janh Anni wrote: > > Hello R Experts! > > > > I wonder if anyone is familiar with the wBoot package written by Neil > > Weiss. I was trying to use the *boot.two.per* function in that package to > > compute a bootstrapped two-sample hypothesis test for proportion. Here"s > > the *boot.two.per* script: > > > > boot.two.per(x, y, parameter, stacked = TRUE, variable = NULL, > > > > null.hyp = NULL, alternative = c("two.sided", "less", "greater"), > > > > conf.level = 0.95, type = NULL, R = ) > > > > The problem is that if I specify *mean* or *median *as the parameter for > > the test, the script runs fine, but if I specify *proportion*, I get an > > error message that *proportion* not found > > > > Is there another way to specify proportion as the test parameter? > > > > Thanks a lot! > > > > Janh > > > > [[alternative HTML version deleted]] > > > > __ > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] wBoot Package
Hello R Experts! I wonder if anyone is familiar with the wBoot package written by Neil Weiss. I was trying to use the *boot.two.per* function in that package to compute a bootstrapped two-sample hypothesis test for proportion. Here"s the *boot.two.per* script: boot.two.per(x, y, parameter, stacked = TRUE, variable = NULL, null.hyp = NULL, alternative = c("two.sided", "less", "greater"), conf.level = 0.95, type = NULL, R = ) The problem is that if I specify *mean* or *median *as the parameter for the test, the script runs fine, but if I specify *proportion*, I get an error message that *proportion* not found Is there another way to specify proportion as the test parameter? Thanks a lot! Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Bootstrapped Regression
Hello Rui, It was perfect! Thank you so much for your kindness. It is greatly appreciated. All the best, Janh On Sun, Oct 15, 2017 at 3:25 AM, Rui Barradas <ruipbarra...@sapo.pt> wrote: > Hello, > > Much clearer now, thanks. > It's a matter of changing the function boot calls to return the predicted > values at the point of interess, education = 50, income = 75. > > I have changed the way the function uses the indices a bit, the result is > the same, it's just the way I usually do it. > > pred.duncan.function <- function(data, indices) { > mod <- lm(prestige ~ education + income, data = data[indices, ]) > new <- data.frame(education = 50, income = 75) > predict(mod, newdata = new) > } > > set.seed(94)# make the results reproducible > > Predicted <- boot(Duncan, pred.duncan.function , 1000) > head(Predicted) > Predicted$t0 > boot.ci(Predicted, index = 1, conf = 0.95, type=c("basic", "norm", > "perc", "bca")) > > > Hope this helps, > > Rui Barradas > > Em 15-10-2017 02:22, Janh Anni escreveu: > >> Hello Rui, >> >> Thanks for your helpful suggestions. Just for illustration, let's use the >> well known Duncan dataset of prestige vs education + income that is >> contained in the "car" package. Suppose I wish to use boot function to >> bootstrap a linear regression of prestige ~ education + income and use the >> following script: >> >> duncan.function <- function(data, indices) {data = data[indices,] >> >> mod <- lm(prestige ~ education + income, data=data,) >> >> coefficients(mod)} >> >> Results <- boot(Duncan, duncan.function , 1000) >> Results >> >> So the 1000 bootstrapped coefficients are contained in Results and I can >> use the boot.ci function in the same boot package to obtain the >> confidence >> intervals for the, say, education coefficient with something like: >> >> boot.ci(Results, index=2, conf = 0.95, type=c("basic", "norm", "perc", >> "bca")) >> >> Then, suppose I am interested in getting a confidence interval for the >> predicted prestige at, say, education = 50 and income = 75. The question >> is how do I get boot to compute 1000 values of the predicted prestige at >> education = 50 and income = 75, so that I can subsequently (hopefully) >> have >> boot.ci compute the confidence intervals as it did for the bootstrapped >> coefficients? As for prediction intervals, it wouldn't seem conceptually >> feasible in this context? Thanks again for all your help. >> >> Janh >> >> On Sat, Oct 14, 2017 at 11:12 AM, Bert Gunter <bgunter.4...@gmail.com> >> wrote: >> >> R-help is not a free coding service. We expect users to make the effort to >>> learn R and *may* provide help when they get stuck. Pay a local R >>> programmer if you do not wish to make such an effort. >>> >>> Cheers, >>> Bert >>> >>> >>> On Oct 14, 2017 7:58 AM, "Janh Anni" <annij...@gmail.com> wrote: >>> >>> Greetings! >>> >>> We are trying to obtain confidence and prediction intervals for a >>> predicted >>> Y value from bootstrapped linear regression using the boot function. Does >>> anyone know how to code it? Greatly appreciated. >>> >>> Janh >>> >>> [[alternative HTML version deleted]] >>> >>> __ >>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >>> https://stat.ethz.ch/mailman/listinfo/r-help >>> PLEASE do read the posting guide http://www.R-project.org/posti >>> ng-guide.html >>> and provide commented, minimal, self-contained, reproducible code. >>> >>> >>> >>> >> [[alternative HTML version deleted]] >> >> __ >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posti >> ng-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> >> [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Bootstrapped Regression
Hello Rui, Thanks for your helpful suggestions. Just for illustration, let's use the well known Duncan dataset of prestige vs education + income that is contained in the "car" package. Suppose I wish to use boot function to bootstrap a linear regression of prestige ~ education + income and use the following script: duncan.function <- function(data, indices) {data = data[indices,] mod <- lm(prestige ~ education + income, data=data,) coefficients(mod)} Results <- boot(Duncan, duncan.function , 1000) Results So the 1000 bootstrapped coefficients are contained in Results and I can use the boot.ci function in the same boot package to obtain the confidence intervals for the, say, education coefficient with something like: boot.ci(Results, index=2, conf = 0.95, type=c("basic", "norm", "perc", "bca")) Then, suppose I am interested in getting a confidence interval for the predicted prestige at, say, education = 50 and income = 75. The question is how do I get boot to compute 1000 values of the predicted prestige at education = 50 and income = 75, so that I can subsequently (hopefully) have boot.ci compute the confidence intervals as it did for the bootstrapped coefficients? As for prediction intervals, it wouldn't seem conceptually feasible in this context? Thanks again for all your help. Janh On Sat, Oct 14, 2017 at 11:12 AM, Bert Gunter <bgunter.4...@gmail.com> wrote: > R-help is not a free coding service. We expect users to make the effort to > learn R and *may* provide help when they get stuck. Pay a local R > programmer if you do not wish to make such an effort. > > Cheers, > Bert > > > On Oct 14, 2017 7:58 AM, "Janh Anni" <annij...@gmail.com> wrote: > > Greetings! > > We are trying to obtain confidence and prediction intervals for a predicted > Y value from bootstrapped linear regression using the boot function. Does > anyone know how to code it? Greatly appreciated. > > Janh > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posti > ng-guide.html > and provide commented, minimal, self-contained, reproducible code. > > > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Bootstrapped Regression
Greetings! We are trying to obtain confidence and prediction intervals for a predicted Y value from bootstrapped linear regression using the boot function. Does anyone know how to code it? Greatly appreciated. Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Infinite Series
Hello Jeff, Thanks a lot. I tried it and see that it prints out the entire 100 partial sums, so I can take the last value as the partial sum for the first 100 terms. Would there be any way cumsum can print only the nth partial sum, i.e. the last value in the array, instead of printing the entire array? Thanks again. Joseph On Fri, Jul 24, 2015 at 2:02 PM, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote: Please reply-all so the mailing list stays in the loop. cumsum(1/(1:100)^2) gives you the partial sums up through i=100. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. On July 24, 2015 10:30:09 AM PDT, Janh Anni annij...@gmail.com wrote: Hello Jeff, Thank you so much for the suggestion, I searched cumsum as suggested but not sure it is what I had in mind. For instance if I had the infinite series:[image: Inline image 1] and want to compute the sum of the, say, first 100 terms, how could I use cusum to do that? Thanks again, Janh On Thu, Jul 23, 2015 at 11:51 PM, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote: ?cumsum --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. On July 23, 2015 8:23:39 PM PDT, Janh Anni annij...@gmail.com wrote: Dear All, Does anyone know of any R functions that compute partial sums of series? Thanks in advance! Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Infinite Series
Thanks Bert! On Fri, Jul 24, 2015 at 7:57 PM, Bert Gunter bgunter.4...@gmail.com wrote: Janh: It sounds like you really need to go through an R tutorial or two before posting further, as this is a pretty basic query. Or am I wrong about this? An answer: Just use indexing cumsum(1/seq_len(100)^2)[seq(10, to = 100,by = 10)] ## keeps every 10th [1] 1.549768 1.596163 1.612150 1.620244 1.625133 1.628406 1.630750 1.632512 1.633884 [10] 1.634984 But beware FAQ 7.31 for long series. Cheers, Bert Bert Gunter Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. -- Clifford Stoll On Fri, Jul 24, 2015 at 4:37 PM, Janh Anni annij...@gmail.com wrote: Hello Jeff, Thanks a lot. I tried it and see that it prints out the entire 100 partial sums, so I can take the last value as the partial sum for the first 100 terms. Would there be any way cumsum can print only the nth partial sum, i.e. the last value in the array, instead of printing the entire array? Thanks again. Joseph On Fri, Jul 24, 2015 at 2:02 PM, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote: Please reply-all so the mailing list stays in the loop. cumsum(1/(1:100)^2) gives you the partial sums up through i=100. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. On July 24, 2015 10:30:09 AM PDT, Janh Anni annij...@gmail.com wrote: Hello Jeff, Thank you so much for the suggestion, I searched cumsum as suggested but not sure it is what I had in mind. For instance if I had the infinite series:[image: Inline image 1] and want to compute the sum of the, say, first 100 terms, how could I use cusum to do that? Thanks again, Janh On Thu, Jul 23, 2015 at 11:51 PM, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote: ?cumsum --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. On July 23, 2015 8:23:39 PM PDT, Janh Anni annij...@gmail.com wrote: Dear All, Does anyone know of any R functions that compute partial sums of series? Thanks in advance! Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Infinite Series
Wow! So many (simpler) ways to skin a cat. Thanks! On Fri, Jul 24, 2015 at 8:07 PM, David Winsemius dwinsem...@comcast.net wrote: On Jul 24, 2015, at 4:37 PM, Janh Anni wrote: Hello Jeff, Thanks a lot. I tried it and see that it prints out the entire 100 partial sums, so I can take the last value as the partial sum for the first 100 terms. Would there be any way cumsum can print only the nth partial sum, i.e. the last value in the array, instead of printing the entire array? Thanks again. Wouldn't that just mean using sum instead of cumsum? Can even check the error from the analytical limit. sum(1/(1:100)^2) - pi^2/6 [1] -0.009950167 Joseph On Fri, Jul 24, 2015 at 2:02 PM, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote: Please reply-all so the mailing list stays in the loop. cumsum(1/(1:100)^2) gives you the partial sums up through i=100. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. On July 24, 2015 10:30:09 AM PDT, Janh Anni annij...@gmail.com wrote: Hello Jeff, Thank you so much for the suggestion, I searched cumsum as suggested but not sure it is what I had in mind. For instance if I had the infinite series:[image: Inline image 1] and want to compute the sum of the, say, first 100 terms, how could I use cusum to do that? Thanks again, Janh On Thu, Jul 23, 2015 at 11:51 PM, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote: ?cumsum --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. On July 23, 2015 8:23:39 PM PDT, Janh Anni annij...@gmail.com wrote: Dear All, Does anyone know of any R functions that compute partial sums of series? Thanks in advance! Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. David Winsemius Alameda, CA, USA [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Infinite Series
Dear All, Does anyone know of any R functions that compute partial sums of series? Thanks in advance! Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Trying to install NADA in R 3.0.0
Try contacting Dr Dennis Helsel, the developer at dhel...@practicalstats.com On Fri, Jun 7, 2013 at 1:47 PM, David Doyle kydaviddo...@gmail.com wrote: Hello folks, Im trying to install the NADA package in R 3.0.0 It has been archived so I tried to downloading it and installing it locally. I get utils:::menuInstallLocal() package NADA successfully unpacked and MD5 sums checked But then when I load it I get library(NADA) Error in library(NADA) : NADA is not a valid installed package Any sugestions [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] wilcox_test function in coin package
Hello Henric, Thank you so much for the detailed responses and helpful information. Much appreciated. Regards Janh On Mon, Jun 3, 2013 at 6:15 AM, Henric Winell nilsson.hen...@gmail.comwrote: Janh, Janh Anni skrev 2013-06-01 19:47: Hello All, Thanks a lot for the helpful suggestions. I wonder how ties are handled for the rank sum test by wilcox_test and wilcox.exact? For instance, Ties handling was mainly a problem back in the day when recursion formulas were used for the computation of exact p-values. (When no ties are present, the form of the exact null distribution of the Wilcoxon rank-sum statistic depends only on the total number of observations in the two groups.) other software such as Minitab correct for ties by adjusting the variance of the test statistic, and actually provide the p values before and after adjustment for ties. Adjusting the variance only matters when approximating the exact distribution with its asymptotic Gaussian distribution. And only when at least one tie is shared between the two groups. And yes, the standardized statistic in 'coin' accounts for ties. If ties are present, why would you want to know the unadjusted p-value? IIf neither wilcox_test nor wilcox.exact expressly corrects for ties in the Wilcoxon rank sum test, then perhaps one should just use the conventional wilcox.test which is the simplest of them all? Thanks again If this was true, the 'wilcox.exact' function would be completely pointless since 'wilcox.test' just falls back on the asymptotic approximation when ties are present. Software like 'StatXact', 'exactRankTests', and 'coin' use algorithms that compute the exact p-value for any ties configuration. Take a look at Torsten Hothorn's On Exact Rank Tests in R article from the very first issue of R News http://www.r-project.org/doc/**Rnews/Rnews_2001-1.pdfhttp://www.r-project.org/doc/Rnews/Rnews_2001-1.pdf . Henric Janh On Sat, Jun 1, 2013 at 8:41 AM, Henric Winell nilsson.hen...@gmail.com mailto:nilsson.henric@gmail.**com nilsson.hen...@gmail.com wrote: Janh, Janh Anni skrev 2013-06-01 04:27: Hello peter, Thanks for the comment. wilcox.exact is simpler as you pointed out but the fact that it is no longer being developed is somewhat concerning. Admittedly, 'coin' is being actively developed and has a lot more bells and whistles. But for something as simple as this, that wouldn't bother me at all. In any case, the 'exactRankTests' package still gets bug fixes and the algorithm used in the Wilcoxon case is exactly the same for both packages. However, if you want to stay with 'coin' you can just wrap up Greg's proposal in a function: wilcox_test.default - function(x, y, ...) { data - data.frame(values = c(x, y), group = rep(c(x, y), c(length(x), length(y wilcox_test(values ~ group, data = data, ...) } Assuming that both 'coin' and 'exactRankTests are loaded, we can now check that it works: set.seed(123) x - rpois(10, 3) y - rpois(11, 3.1) wilcox_test(x, y, alternative = less, distribution = exact) Exact Wilcoxon-Mann-Whitney Test data: values by group (x, y) Z = -0.0715, p-value = 0.4844 alternative hypothesis: true mu is less than 0 wilcox.exact(x, y, alternative = less) Exact Wilcoxon rank sum test data: x and y W = 54, p-value = 0.4844 alternative hypothesis: true mu is less than 0 HTH, Henric Regards Janh On Fri, May 31, 2013 at 6:50 PM, Peter Ehlers ehl...@ucalgary.ca mailto:ehl...@ucalgary.ca wrote: On 2013-05-30 20:20, Janh Anni wrote: Hello Greg, Thank you so much for your kind assistance. It looks like there's no way around using the formula format. I longed in vain for a simpler script more like the wilcox.test format. Thanks again. Janh I don't see why the formula syntax would be a problem, but to avoid it you could use exactRankTests::wilcox.exact() which, I believe, was written by the same author. It uses the same syntax as wilcox.test(). Note, though, that the package is no longer being developed. Peter Ehlers On Thu, May 30, 2013 at 6:21 PM, Greg Snow 538...@gmail.com mailto:538...@gmail.com wrote: Ok, it looks like the function mainly works through the formula syntax. It still would have been nice to have a reproducible example of what your
Re: [R] wilcox_test function in coin package
Hello peter, Thanks for the comment. wilcox.exact is simpler as you pointed out but the fact that it is no longer being developed is somewhat concerning. Regards Janh On Fri, May 31, 2013 at 6:50 PM, Peter Ehlers ehl...@ucalgary.ca wrote: On 2013-05-30 20:20, Janh Anni wrote: Hello Greg, Thank you so much for your kind assistance. It looks like there's no way around using the formula format. I longed in vain for a simpler script more like the wilcox.test format. Thanks again. Janh I don't see why the formula syntax would be a problem, but to avoid it you could use exactRankTests::wilcox.exact() which, I believe, was written by the same author. It uses the same syntax as wilcox.test(). Note, though, that the package is no longer being developed. Peter Ehlers On Thu, May 30, 2013 at 6:21 PM, Greg Snow 538...@gmail.com wrote: Ok, it looks like the function mainly works through the formula syntax. It still would have been nice to have a reproducible example of what your data may look like, but I can show an example with simulated x and y: x - rpois(10, 3) y - rpois(11, 3.1) mydf - data.frame( vals = c(x,y), + group=rep( c('x','y'), c( length(x), length(y) ) ) ) wilcox_test( vals ~ group, data=mydf ) Asymptotic Wilcoxon-Mann-Whitney Test data: vals by group (x, y) Z = -1.3718, p-value = 0.1701 alternative hypothesis: true mu is not equal to 0 Does that help? (maybe I am the heedlessness theorist after all) On Thu, May 30, 2013 at 4:14 PM, Janh Anni annij...@gmail.com wrote: I thought (hoped) wilcox_test(x,y) would do it but it doesn't and the package maintainer says the data have to be rearranged but does not specify how. Thanks Janh On Thu, May 30, 2013 at 6:05 PM, Greg Snow 538...@gmail.com wrote: What have you tried so far? Have you read the help page? have you run the examples on that page? I would expect that it is something as simple as library(coin) wilcox_test(x,y) or wilcox_test( y ~ group ) But you should trust the help page more than the expectations of someone who has not read it recently (see fortune(14)). If that does not answer your question then give us more detail on what you tried, what you expected the results to be, what the results actually were, and how they differed. Without that information we have to resort to mind reading and the current implementation of the esp package is still very pre-alpha, it suggests that the answer to your question is: esp() [1] selflessly vigilantly pigeon theorist heedlessness Which is either much to profound for the likes of me to understand or is complete gibberish (which is only slightly less helpful than an overly general question without a reproducible example). On Thu, May 30, 2013 at 2:07 PM, Janh Anni annij...@gmail.com wrote: Dear All, I have two simple data samples (no groups or factors, etc.) and would just like to compute the two-sample Wilcoxon Rank Sum test using the wilcox_test function contained in the coin package, which is reportedly better than the regular wilcox.test function because it performs some adjustment for ties. Would anyone know how to craft a script to perform this task? Much appreciated. Janh [[alternative HTML version deleted]] __** R-help@r-project.org mailing list https://stat.ethz.ch/mailman/**listinfo/r-helphttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/**posting-guide.htmlhttp://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Gregory (Greg) L. Snow Ph.D. 538...@gmail.com -- Gregory (Greg) L. Snow Ph.D. 538...@gmail.com [[alternative HTML version deleted]] __** R-help@r-project.org mailing list https://stat.ethz.ch/mailman/**listinfo/r-helphttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/** posting-guide.html http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Fwd: Your message to R-help awaits moderator approval
Hello, I don't understand why my mails are being held up. What could be the problem? Thanks Janh -- Forwarded message -- From: r-help-boun...@r-project.org Date: Sat, Jun 1, 2013 at 1:48 PM Subject: Your message to R-help awaits moderator approval To: annij...@gmail.com Your mail to 'R-help' with the subject Re: [R] wilcox_test function in coin package Is being held until the list moderator can review it for approval. The reason it is being held: The message headers matched a filter rule Either the message will get posted to the list, or you will receive notification of the moderator's decision. If you would like to cancel this posting, please visit the following URL: https://stat.ethz.ch/mailman/confirm/r-help/067afe28f7ead30dfea844b8a34449526cd665d8 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Fwd: Your message to R-help awaits moderator approval
Okay. Thanks! Janh On Sat, Jun 1, 2013 at 3:11 PM, Ted Harding ted.hard...@wlandres.netwrote: [See at end] On 01-Jun-2013 17:52:01 Janh Anni wrote: Hello, I don't understand why my mails are being held up. What could be the problem? Thanks Janh -- Forwarded message -- From: r-help-boun...@r-project.org Date: Sat, Jun 1, 2013 at 1:48 PM Subject: Your message to R-help awaits moderator approval To: annij...@gmail.com Your mail to 'R-help' with the subject Re: [R] wilcox_test function in coin package Is being held until the list moderator can review it for approval. The reason it is being held: The message headers matched a filter rule Either the message will get posted to the list, or you will receive notification of the moderator's decision. If you would like to cancel this posting, please visit the following URL: https://stat.ethz.ch/mailman/confirm/r-help/067afe28f7ead30dfea844b8a34449526c d665d8 This can happen to anyone, depending on the current sensitivity of the mail-server's spam-detection filter to potential triggers in the message. It is particularly likely to arise with mails posted from a gmail account, as your was. This is because gmail is a major source of spam emails, and the spam filter is alert to these. I have had a look at your message (which was duly approved), and I see that it is in reply to a message which itself is in a thread that includes several messages sent via gmail. From the headers of your message: In-Reply-To: 51a9291c.70...@ucalgary.ca References: cafcodddp64mfyvttb6b_o6kgotkyr41mcb2spcc4c6anqyw...@mail.gmail.com cafeqcdy6+nhk2hgcwqalymyxx1a0trqjthybxx-fub9oyff...@mail.gmail.com CAFCoDdBcm4B1tVW7BarkHXAgpqMpTCimmjhrLc3N7=yvsse...@mail.gmail.com CAFEqCdz_=YBeeDYLfpDYyTAwjr6a4n2OKTbQaBsb9UC=g9s...@mail.gmail.com CAFCoDdC1asW6JGK5huY_kLgCQQCduw8s=yjhhdp0pta_9ya...@mail.gmail.com 51a9291c.70...@ucalgary.ca so that's a total of 6 references to gmail (including your own message) which is probably why the spam filter felt a bit twitchy! Don't worry about it. As I say, it can happen to anyone (though more often to some than to others). If it is a proper message to R-help, one of the moderators will approve it (though quite possible not immediately). Hoping this helps, Ted (one of the moderators) - E-Mail: (Ted Harding) ted.hard...@wlandres.net Date: 01-Jun-2013 Time: 20:11:00 This message was sent by XFMail - [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] wilcox_test function in coin package
Hello All, Thanks a lot for the helpful suggestions. I wonder how ties are handled for the rank sum test by wilcox_test and wilcox.exact? For instance, other software such as Minitab correct for ties by adjusting the variance of the test statistic, and actually provide the p values before and after adjustment for ties. IIf neither wilcox_test nor wilcox.exact expressly corrects for ties in the Wilcoxon rank sum test, then perhaps one should just use the conventional wilcox.test which is the simplest of them all? Thanks again Janh On Sat, Jun 1, 2013 at 8:41 AM, Henric Winell nilsson.hen...@gmail.comwrote: Janh, Janh Anni skrev 2013-06-01 04:27: Hello peter, Thanks for the comment. wilcox.exact is simpler as you pointed out but the fact that it is no longer being developed is somewhat concerning. Admittedly, 'coin' is being actively developed and has a lot more bells and whistles. But for something as simple as this, that wouldn't bother me at all. In any case, the 'exactRankTests' package still gets bug fixes and the algorithm used in the Wilcoxon case is exactly the same for both packages. However, if you want to stay with 'coin' you can just wrap up Greg's proposal in a function: wilcox_test.default - function(x, y, ...) { data - data.frame(values = c(x, y), group = rep(c(x, y), c(length(x), length(y wilcox_test(values ~ group, data = data, ...) } Assuming that both 'coin' and 'exactRankTests are loaded, we can now check that it works: set.seed(123) x - rpois(10, 3) y - rpois(11, 3.1) wilcox_test(x, y, alternative = less, distribution = exact) Exact Wilcoxon-Mann-Whitney Test data: values by group (x, y) Z = -0.0715, p-value = 0.4844 alternative hypothesis: true mu is less than 0 wilcox.exact(x, y, alternative = less) Exact Wilcoxon rank sum test data: x and y W = 54, p-value = 0.4844 alternative hypothesis: true mu is less than 0 HTH, Henric Regards Janh On Fri, May 31, 2013 at 6:50 PM, Peter Ehlers ehl...@ucalgary.ca wrote: On 2013-05-30 20:20, Janh Anni wrote: Hello Greg, Thank you so much for your kind assistance. It looks like there's no way around using the formula format. I longed in vain for a simpler script more like the wilcox.test format. Thanks again. Janh I don't see why the formula syntax would be a problem, but to avoid it you could use exactRankTests::wilcox.exact() which, I believe, was written by the same author. It uses the same syntax as wilcox.test(). Note, though, that the package is no longer being developed. Peter Ehlers On Thu, May 30, 2013 at 6:21 PM, Greg Snow 538...@gmail.com wrote: Ok, it looks like the function mainly works through the formula syntax. It still would have been nice to have a reproducible example of what your data may look like, but I can show an example with simulated x and y: x - rpois(10, 3) y - rpois(11, 3.1) mydf - data.frame( vals = c(x,y), + group=rep( c('x','y'), c( length(x), length(y) ) ) ) wilcox_test( vals ~ group, data=mydf ) Asymptotic Wilcoxon-Mann-Whitney Test data: vals by group (x, y) Z = -1.3718, p-value = 0.1701 alternative hypothesis: true mu is not equal to 0 Does that help? (maybe I am the heedlessness theorist after all) On Thu, May 30, 2013 at 4:14 PM, Janh Anni annij...@gmail.com wrote: I thought (hoped) wilcox_test(x,y) would do it but it doesn't and the package maintainer says the data have to be rearranged but does not specify how. Thanks Janh On Thu, May 30, 2013 at 6:05 PM, Greg Snow 538...@gmail.com wrote: What have you tried so far? Have you read the help page? have you run the examples on that page? I would expect that it is something as simple as library(coin) wilcox_test(x,y) or wilcox_test( y ~ group ) But you should trust the help page more than the expectations of someone who has not read it recently (see fortune(14)). If that does not answer your question then give us more detail on what you tried, what you expected the results to be, what the results actually were, and how they differed. Without that information we have to resort to mind reading and the current implementation of the esp package is still very pre-alpha, it suggests that the answer to your question is: esp() [1] selflessly vigilantly pigeon theorist heedlessness Which is either much to profound for the likes of me to understand or is complete gibberish (which is only slightly less helpful than an overly general question without a reproducible example). On Thu, May 30, 2013 at 2:07 PM, Janh Anni annij...@gmail.com wrote: Dear All, I have two simple data samples (no groups or factors, etc.) and would just like to compute the two-sample Wilcoxon Rank Sum test using the wilcox_test function contained in the coin package, which is reportedly better than the regular
[R] wilcox_test function in coin package
Dear All, I have two simple data samples (no groups or factors, etc.) and would just like to compute the two-sample Wilcoxon Rank Sum test using the wilcox_test function contained in the coin package, which is reportedly better than the regular wilcox.test function because it performs some adjustment for ties. Would anyone know how to craft a script to perform this task? Much appreciated. Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] wilcox_test function in coin package
I thought (hoped) wilcox_test(x,y) would do it but it doesn't and the package maintainer says the data have to be rearranged but does not specify how. Thanks Janh On Thu, May 30, 2013 at 6:05 PM, Greg Snow 538...@gmail.com wrote: What have you tried so far? Have you read the help page? have you run the examples on that page? I would expect that it is something as simple as library(coin) wilcox_test(x,y) or wilcox_test( y ~ group ) But you should trust the help page more than the expectations of someone who has not read it recently (see fortune(14)). If that does not answer your question then give us more detail on what you tried, what you expected the results to be, what the results actually were, and how they differed. Without that information we have to resort to mind reading and the current implementation of the esp package is still very pre-alpha, it suggests that the answer to your question is: esp() [1] selflessly vigilantly pigeon theorist heedlessness Which is either much to profound for the likes of me to understand or is complete gibberish (which is only slightly less helpful than an overly general question without a reproducible example). On Thu, May 30, 2013 at 2:07 PM, Janh Anni annij...@gmail.com wrote: Dear All, I have two simple data samples (no groups or factors, etc.) and would just like to compute the two-sample Wilcoxon Rank Sum test using the wilcox_test function contained in the coin package, which is reportedly better than the regular wilcox.test function because it performs some adjustment for ties. Would anyone know how to craft a script to perform this task? Much appreciated. Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Gregory (Greg) L. Snow Ph.D. 538...@gmail.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] wilcox_test function in coin package
Hello Greg, Thank you so much for your kind assistance. It looks like there's no way around using the formula format. I longed in vain for a simpler script more like the wilcox.test format. Thanks again. Janh On Thu, May 30, 2013 at 6:21 PM, Greg Snow 538...@gmail.com wrote: Ok, it looks like the function mainly works through the formula syntax. It still would have been nice to have a reproducible example of what your data may look like, but I can show an example with simulated x and y: x - rpois(10, 3) y - rpois(11, 3.1) mydf - data.frame( vals = c(x,y), + group=rep( c('x','y'), c( length(x), length(y) ) ) ) wilcox_test( vals ~ group, data=mydf ) Asymptotic Wilcoxon-Mann-Whitney Test data: vals by group (x, y) Z = -1.3718, p-value = 0.1701 alternative hypothesis: true mu is not equal to 0 Does that help? (maybe I am the heedlessness theorist after all) On Thu, May 30, 2013 at 4:14 PM, Janh Anni annij...@gmail.com wrote: I thought (hoped) wilcox_test(x,y) would do it but it doesn't and the package maintainer says the data have to be rearranged but does not specify how. Thanks Janh On Thu, May 30, 2013 at 6:05 PM, Greg Snow 538...@gmail.com wrote: What have you tried so far? Have you read the help page? have you run the examples on that page? I would expect that it is something as simple as library(coin) wilcox_test(x,y) or wilcox_test( y ~ group ) But you should trust the help page more than the expectations of someone who has not read it recently (see fortune(14)). If that does not answer your question then give us more detail on what you tried, what you expected the results to be, what the results actually were, and how they differed. Without that information we have to resort to mind reading and the current implementation of the esp package is still very pre-alpha, it suggests that the answer to your question is: esp() [1] selflessly vigilantly pigeon theorist heedlessness Which is either much to profound for the likes of me to understand or is complete gibberish (which is only slightly less helpful than an overly general question without a reproducible example). On Thu, May 30, 2013 at 2:07 PM, Janh Anni annij...@gmail.com wrote: Dear All, I have two simple data samples (no groups or factors, etc.) and would just like to compute the two-sample Wilcoxon Rank Sum test using the wilcox_test function contained in the coin package, which is reportedly better than the regular wilcox.test function because it performs some adjustment for ties. Would anyone know how to craft a script to perform this task? Much appreciated. Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Gregory (Greg) L. Snow Ph.D. 538...@gmail.com -- Gregory (Greg) L. Snow Ph.D. 538...@gmail.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Bootstrapped 1-sided confidence intervals
Great! Thanks to all for your assistance. Regards Janh On Tue, May 7, 2013 at 11:37 PM, Pascal Oettli kri...@ymail.com wrote: Hello, You already asked that question on May 7, 2013. And David Winsemius already responded to you: https://stat.ethz.ch/**pipermail/r-help/2013-May/**353044.htmlhttps://stat.ethz.ch/pipermail/r-help/2013-May/353044.html Regards, Pascal On 05/08/2013 12:21 PM, Janh Anni wrote: Hello All, Does anyone know if theres a function for computing 1-sided confidence intervals for bootstrapped statistics (mean, median, percentiles, etc.)? Thanks in advance Janh [[alternative HTML version deleted]] __** R-help@r-project.org mailing list https://stat.ethz.ch/mailman/**listinfo/r-helphttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/** posting-guide.html http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Bootstrapped 1-sided confidence intervals
Hello All, Does anyone know if theres a function for computing 1-sided confidence intervals for bootstrapped statistics (mean, median, percentiles, etc.)? Thanks in advance Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Bootstrapped Non-Parametric 1-sided Confidence Intervals
Hello All, Is there a way for computing 1-sided confidence intervals for bootstrapped statistics (mean, median, percentiles, etc.)? It appears the boot.cifunction in the boot package only computes 2-sided intervals. Your assistance is greatly appreciated. Regards Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Q-Q Plot for comparing two unequal data sets
Hello All, Would anyone be able to help me understand how R computes a quantile-quantile plot for comparing two data samples with unequal sample sizes? Normally, the procedure should be to rearrange the larger data sample into n equally-spaced parts using interpolation, where n is the sample size of the smaller sample, and then plot the matching data pairs. I tried using different plotting position formulas for the interpolation but cannot reproduce what R is plotting. Thanks in advance. Regards Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Q-Q Plot for comparing two unequal data sets
Hello Michael, Thanks for that information. Regards Janh On Tue, Apr 16, 2013 at 9:13 PM, Michael Weylandt michael.weyla...@gmail.com wrote: On Apr 16, 2013, at 20:12, Janh Anni annij...@gmail.com wrote: Hello All, Would anyone be able to help me understand how R computes a quantile-quantile plot for comparing two data samples with unequal sample sizes? Normally, the procedure should be to rearrange the larger data sample into n equally-spaced parts using interpolation, where n is the sample size of the smaller sample, and then plot the matching data pairs. I tried using different plotting position formulas for the interpolation but cannot reproduce what R is plotting. Thanks in advance. If you type qqplot at the prompt you'll be given the code and can review it for yourself. It's also available online for your viewing pleasure. http://svn.r-project.org/R/trunk/src/library/stats/R/qqplot.R It seems the key is the approx (linear interpolation) function, but you can work out the details. Michael Regards Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] boxplot
Hello John, Thank you so much for your kind assistance and the detailed descriptions. I will play with the scripts and see which one is the easiest that serves the purpose.. Best regards, Janh On Sun, Mar 24, 2013 at 7:50 AM, John Kane jrkrid...@inbox.com wrote: ** Unless you have a really large number of wells I'd just use the brute force approach of reading in each data set with a simple read.table or read.csv like well1 - read.csv(well1.csv) type of statement and repeat for each well. Here is a simple example that may give you an idea of how to do the boxplots . I have done them two ways, one using base graphics and the other using ggplot2. You will probably have to install the ggplot2 package -- just issue the command install.packages(ggplot2) The base approach is initially a lot simpler but in the longer term, if you expect to do a lot of graphing work in R, the grid packages like ggplot2 or lattice seem to offer a lot more control for less actual typing, especially if you need publication/report quality graphics. ##===start code= set.seed(345) #reproducable sample # create three sample data sets, well_1 - data.frame(arsenic = rnorm(12)) well_2 - data.frame (arsenic = rnorm(10)) well_3 - data.frame (arsenic = rnorm(15)) wells - rbind(well_1, well_2, well_3) # create single data.frame #create an id value for each well well_id - c(rep(1,nrow(well_1)), rep(2, nrow(well_2)), rep(3, nrow(well_3))) #add the well identifier wells - cbind(wells , well_id) str(wells) # check to see what we have boxplot(arsenic ~ well_id, data = wells) # plot vertical boxplot boxplot(arsenic ~ well_id, data = wells, horizontal = TRUE,col=c(red,green,blue)) #horizontal box plot # vertical boxplot using ggplot2 library(ggplot2) p - ggplot(wells, aes(as.factor(well_id), arsenic)) + geom_boxplot() p # horizontal boxplot p1 - p + coord_flip() p1 p2 - ggplot(wells, aes(as.factor(well_id), arsenic, fill = as.factor(well_id) )) + geom_boxplot() + coord_flip() + scale_fill_discrete(guide=FALSE) ##===end code== John Kane Kingston ON Canada -Original Message- *From:* annij...@gmail.com *Sent:* Sat, 23 Mar 2013 10:22:02 -0400 *To:* jrkrid...@inbox.com *Subject:* Re: [R] boxplot Hello John, I apologize for the delayed response. Yes I am referring to the same type of data in the data sets. For example, the arsenic concentrations in individual groundwater monitoring wells at a groundwater contaminated site, where one well may have 12 concentration measurements, another well has 10, etc. Thanks Janh On Fri, Mar 22, 2013 at 5:31 PM, John Kane jrkrid...@inbox.com wrote: Hi Janh, When you say that you have multiple data sets of unequal sample sizes are you speaking of the same kind of data For example are you speaking of data from a set of experiments where the variables measured are all the same and where when you graph them you expect the same x and y scales? Or are you talking about essentilly independent data sets that it makes sense to graph in a grid ? John Kane Kingston ON Canada -Original Message- From: annij...@gmail.com Sent: Fri, 22 Mar 2013 10:46:21 -0400 To: dcarl...@tamu.edu Subject: Re: [R] boxplot Hello All, On the subject of boxplots, I have multiple data sets of unequal sample sizes and was wondering what would be the most efficient way to read in the data and plot side-by-side boxplots, with options for controlling the orientation of the plots (i.e. vertical or horizontal) and the spacing? Your assistance is greatly appreciated, but please try to be explicit as I am no R expert. Thanks Janh On Thu, Mar 21, 2013 at 9:19 AM, David L Carlson dcarl...@tamu.edu wrote: Your variable loc_type combines information from two variables (loc and type). Since you are subsetting on loc, why not just plot by type? boxplot(var1~type, data[data$loc==nice,]) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Jim Lemon Sent: Thursday, March 21, 2013 4:05 AM To: carol white Cc: r-h...@stat.math.ethz.ch Subject: Re: [R] boxplot On 03/21/2013 07:40 PM, carol white wrote: Hi, It must be an easy question but how to boxplot a subset of data: data = read.table(my_data.txt, header = T) boxplot(data$var1[data$loc == nice]~data$loc_type[data$loc == nice]) #in this case, i want to display only the boxplot loc == nice #doesn't display the boxplot of only loc == nice. It also displays loc == mice Hi Carol, It's them old factors sneakin' up on you.
Re: [R] boxplot
Hello John, I apologize for the delayed response. Yes I am referring to the same type of data in the data sets. For example, the arsenic concentrations in individual groundwater monitoring wells at a groundwater contaminated site, where one well may have 12 concentration measurements, another well has 10, etc. Thanks Janh On Fri, Mar 22, 2013 at 5:31 PM, John Kane jrkrid...@inbox.com wrote: Hi Janh, When you say that you have multiple data sets of unequal sample sizes are you speaking of the same kind of data For example are you speaking of data from a set of experiments where the variables measured are all the same and where when you graph them you expect the same x and y scales? Or are you talking about essentilly independent data sets that it makes sense to graph in a grid ? John Kane Kingston ON Canada -Original Message- From: annij...@gmail.com Sent: Fri, 22 Mar 2013 10:46:21 -0400 To: dcarl...@tamu.edu Subject: Re: [R] boxplot Hello All, On the subject of boxplots, I have multiple data sets of unequal sample sizes and was wondering what would be the most efficient way to read in the data and plot side-by-side boxplots, with options for controlling the orientation of the plots (i.e. vertical or horizontal) and the spacing? Your assistance is greatly appreciated, but please try to be explicit as I am no R expert. Thanks Janh On Thu, Mar 21, 2013 at 9:19 AM, David L Carlson dcarl...@tamu.edu wrote: Your variable loc_type combines information from two variables (loc and type). Since you are subsetting on loc, why not just plot by type? boxplot(var1~type, data[data$loc==nice,]) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Jim Lemon Sent: Thursday, March 21, 2013 4:05 AM To: carol white Cc: r-h...@stat.math.ethz.ch Subject: Re: [R] boxplot On 03/21/2013 07:40 PM, carol white wrote: Hi, It must be an easy question but how to boxplot a subset of data: data = read.table(my_data.txt, header = T) boxplot(data$var1[data$loc == nice]~data$loc_type[data$loc == nice]) #in this case, i want to display only the boxplot loc == nice #doesn't display the boxplot of only loc == nice. It also displays loc == mice Hi Carol, It's them old factors sneakin' up on you. Try this: boxplot(data$var1[data$loc == nice]~ as.character(data$loc_type[data$loc == nice])) Jim __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting- guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop! Check it out at http://www.inbox.com/earth [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] boxplot
Hello All, On the subject of boxplots, I have multiple data sets of unequal sample sizes and was wondering what would be the most efficient way to read in the data and plot side-by-side boxplots, with options for controlling the orientation of the plots (i.e. vertical or horizontal) and the spacing? Your assistance is greatly appreciated, but please try to be explicit as I am no R expert. Thanks Janh On Thu, Mar 21, 2013 at 9:19 AM, David L Carlson dcarl...@tamu.edu wrote: Your variable loc_type combines information from two variables (loc and type). Since you are subsetting on loc, why not just plot by type? boxplot(var1~type, data[data$loc==nice,]) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Jim Lemon Sent: Thursday, March 21, 2013 4:05 AM To: carol white Cc: r-h...@stat.math.ethz.ch Subject: Re: [R] boxplot On 03/21/2013 07:40 PM, carol white wrote: Hi, It must be an easy question but how to boxplot a subset of data: data = read.table(my_data.txt, header = T) boxplot(data$var1[data$loc == nice]~data$loc_type[data$loc == nice]) #in this case, i want to display only the boxplot loc == nice #doesn't display the boxplot of only loc == nice. It also displays loc == mice Hi Carol, It's them old factors sneakin' up on you. Try this: boxplot(data$var1[data$loc == nice]~ as.character(data$loc_type[data$loc == nice])) Jim __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting- guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] NADA
Hello Don, Jeff, Thanks a lot for the comments and suggestions. Best Janh On Thu, Mar 21, 2013 at 10:57 AM, MacQueen, Don macque...@llnl.gov wrote: According to ?ros, one of the arguments is: reverseT: A name of a function to use for reversing the transformation after performing the ROS fit. Defaults to 'exp'. And in the Details section: By default, 'ros' performs a log transformation prior to, and after operations over the data. Given those statements, perhaps the expectation should be a plot in original units? Keep in mind that a main purpose is summary statistics in the original units. After running the first example in ?ros, including the plot, try these: unclass(myros) abline(h=myros$modeled,col='blue') -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 3/20/13 5:48 PM, Janh Anni annij...@gmail.com wrote: Dear Users Regarding the NADA package, would anyone be able to help me understand what values are actually plotted on the Y axis of the plot obtained by using the *ros* function on the data and plotting the result with the plot() function? The Y axis is labeled Values. According to the NADA user manual, ros performs a log transformation of the data by default, but the user can specify no transformation, or some other transformation besides log, if desired. However the values plotted on the Y axis appear to be the raw data values, regardless of which transformation or no transformation was used. If the log transformation is used for instance, I would have expected the logs of the original data instead of the raw data to be plotted on the Y axis. Thanks for your help. Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] NADA
Dear Users Regarding the NADA package, would anyone be able to help me understand what values are actually plotted on the Y axis of the plot obtained by using the *ros* function on the data and plotting the result with the plot() function? The Y axis is labeled Values. According to the NADA user manual, ros performs a log transformation of the data by default, but the user can specify no transformation, or some other transformation besides log, if desired. However the values plotted on the Y axis appear to be the raw data values, regardless of which transformation or no transformation was used. If the log transformation is used for instance, I would have expected the logs of the original data instead of the raw data to be plotted on the Y axis. Thanks for your help. Janh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.