1. Emma is performing an experiment that requires individual handling of some animals. The sizes of the animals are lognormally distributed: The natural logarithms of their sizes has a normal distribution with mean 3 and standard deviation 0.4. The time (in minutes) it takes to handle each animal is given by 10 + s · 1.5 + eε for animals with s ≤ 20 20 + s · 0.8 + eε for animals with s > 20 where ε is a random variable that is normally distributed with expectation 1 and variance 0.3. For a randomly picked animal, what is the (approximate) probability that it can be handled in less than 30 minutes? We can solve this exercise using simulation, as follows: Simulate a vector S with the sizes of 10000 animals, by using the rnorm function and the “exp” function. Then, compute a vector Time of length 10000 with the times it takes to handle each of these 10000 animals: Remember that to separate between the two cases, you can use notation like for example “Time[S < 20]”. The random component eε can be added by combining the “exp” function with the “rnorm” function. Finally, you can find the proportion of simulated values below 30. Re-do the computations a couple of times to get an idea of the variability of the result. s <- c(10000) S <- exp(rnorm(s, 3, 0.4)) [1]# vector 10000, mean, sd Time <- 10+S*1.5 [1] # 10 + s · 1.5 + eε for animals with s ≤ 20 time <- 20+S*0.8 [1] # 20 + s · 0.8 + eε for animals with s > 20 can't get any further and i can't really find a good help page to solve the code. can you help me? Lotta ------------------------------------------------------------------------------------ Eva-Lotta Blom PhD student Dept. of BioEnv . Tjärnö University of Gothenburg 452 96 Strömstad Sweden [[alternative HTML version deleted]]
Hi, R-help is not a homework help list. If you're having trouble, you need to speak with your instructor instead. Best of luck, Sarah On Tue, May 15, 2012 at 8:04 AM, Eva-Lotta Blom <eva-lotta.blom at bioenv.gu.se> wrote:> > ?1. ?Emma is performing an experiment that requires individual handling of some animals. The sizes of the animals are lognormally distributed: The natural logarithms of their sizes has a normal distribution with mean 3 and standard deviation 0.4. The time (in minutes) it takes to handle each animal is given by > > 10 + s ? 1.5 + e? for animals with s ? 20 20 + s ? 0.8 + e? for animals with s > 20 > > where ? is a random variable that is normally distributed with expectation 1 and variance 0.3. > > For a randomly picked animal, what is the (approximate) probability that it can be handled in less than 30 minutes? > > We can solve this exercise using simulation, as follows: Simulate a vector S with the sizes of 10000 animals, by using the rnorm function and the ?exp? function. Then, compute a vector Time of length 10000 with the times it takes to handle each of these 10000 animals: Remember that to separate between the two cases, you can use notation like for example ?Time[S < 20]?. The random component e? can be added by combining the ?exp? function with the ?rnorm? function. Finally, you can find the proportion of simulated values below 30. Re-do the computations a couple of times to get an idea of the variability of the result. > > s <- c(10000) > S <- exp(rnorm(s, 3, 0.4)) [1]# vector 10000, mean, sd > Time <- 10+S*1.5 [1] # 10 + s ? 1.5 + e? for animals with s ? 20 > time <- 20+S*0.8 [1] # ? 20 + s ? 0.8 + e? for animals with s > 20 > > can't get any further and i can't really find a good help page to solve the code. > can you help me? > Lotta > > ------------------------------------------------------------------------------------ > Eva-Lotta Blom PhD student > Dept. of BioEnv . Tj?rn? > University of Gothenburg > 452 96 Str?mstad > Sweden > > > > > > > > ? ? ? ?[[alternative HTML version deleted]] > > > ______________________________________________ > R-help at 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. >-- Sarah Goslee http://www.stringpage.com http://www.sarahgoslee.com http://www.functionaldiversity.org
Cutting and pasting your entire homework problem verbatim into an rhelp posting and assigning it an uninformative subject line and then expecting a useful response is very hopeful on your part, but those hopes are unlikely to be realized. You might spend some time reading the Posting Guide and counting the number of recommendations and requests in it that you have apparently been ignorant of to this point in your academic life. -- David. On May 15, 2012, at 8:04 AM, Eva-Lotta Blom wrote:> > 1. Emma is performing an experiment that requires individual > handling of some animals. The sizes of the animals are lognormally > distributed: The natural logarithms of their sizes has a normal > distribution with mean 3 and standard deviation 0.4. The time (in > minutes) it takes to handle each animal is given by > > 10 + s ? 1.5 + e? for animals with s ? 20 20 + s ? 0.8 + e? for > animals with s > 20 > > where ? is a random variable that is normally distributed with > expectation 1 and variance 0.3. > > For a randomly picked animal, what is the (approximate) probability > that it can be handled in less than 30 minutes? > > We can solve this exercise using simulation, as follows: Simulate a > vector S with the sizes of 10000 animals, by using the rnorm > function and the ?exp? function. Then, compute a vector Time of > length 10000 with the times it takes to handle each of these 10000 > animals: Remember that to separate between the two cases, you can > use notation like for example ?Time[S < 20]?. The random > component e? can be added by combining the ?exp? function with > the ?rnorm? function. Finally, you can find the proportion of > simulated values below 30. Re-do the computations a couple of times > to get an idea of the variability of the result. > > s <- c(10000) > S <- exp(rnorm(s, 3, 0.4)) [1]# vector 10000, mean, sd > Time <- 10+S*1.5 [1] # 10 + s ? 1.5 + e? for animals with s ? 20 > time <- 20+S*0.8 [1] # 20 + s ? 0.8 + e? for animals with s > 20 > > can't get any further and i can't really find a good help page to > solve the code. > can you help me? > Lotta > > ------------------------------------------------------------------------------------ > Eva-Lotta Blom PhD student > Dept. of BioEnv . Tj?rn? > University of Gothenburg > 452 96 Str?mstad > Sweden > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.David Winsemius, MD West Hartford, CT
Please read the Posting Guide mentioned at the bottom of every message on this list. There is a "no homework" policy. Please refer to your assistance options available through your educational institution. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Eva-Lotta Blom <eva-lotta.blom at bioenv.gu.se> wrote:> >1. Emma is performing an experiment that requires individual handling >of some animals. The sizes of the animals are lognormally distributed: >The natural logarithms of their sizes has a normal distribution with >mean 3 and standard deviation 0.4. The time (in minutes) it takes to >handle each animal is given by > >10 + s ?? 1.5 + e?? for animals with s ??? 20 20 + s ?? 0.8 + e?? for >animals with s > 20 > >where ?? is a random variable that is normally distributed with >expectation 1 and variance 0.3. > >For a randomly picked animal, what is the (approximate) probability >that it can be handled in less than 30 minutes? > >We can solve this exercise using simulation, as follows: Simulate a >vector S with the sizes of 10000 animals, by using the rnorm function >and the ???exp??? function. Then, compute a vector Time of length 10000 >with the times it takes to handle each of these 10000 animals: Remember >that to separate between the two cases, you can use notation like for >example ???Time[S < 20]???. The random component e?? can be added by >combining the ???exp??? function with the ???rnorm??? function. >Finally, you can find the proportion of simulated values below 30. >Re-do the computations a couple of times to get an idea of the >variability of the result. > >s <- c(10000) >S <- exp(rnorm(s, 3, 0.4)) [1]# vector 10000, mean, sd >Time <- 10+S*1.5 [1] # 10 + s ?? 1.5 + e?? for animals with s ??? 20 >time <- 20+S*0.8 [1] # 20 + s ?? 0.8 + e?? for animals with s > 20 > >can't get any further and i can't really find a good help page to solve >the code. >can you help me? >Lotta > >------------------------------------------------------------------------------------ >Eva-Lotta Blom PhD student >Dept. of BioEnv . Tj??rn?? >University of Gothenburg >452 96 Str??mstad >Sweden > > > > > > > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at 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.
Lotta, If this isn't homework, then you need to read the posting guide (see link at bottom of each posting to the list), and ask a more specific question than "can't get any further." What have you tried? What didn't work? Where did it go wrong? What book are you working from? Etc. Even if not an ethics violation, your question is too vague to be easily answered unless you can find someone interested in working the entire problem from scratch. Since we're all busy volunteers, that's unlikely. You need to do the work of asking a well-formed question before you can expect much help. Sarah On Tue, May 15, 2012 at 10:10 AM, Eva-Lotta Blom <eva-lotta.blom at bioenv.gu.se> wrote:> Hello Sarah > this is not a homework, i am trying to understand R by doing some exercise > in my book. > I will however participate a course in R in august and thought it could be > good to have some > knowledge before. I hoped for help from you since i have no instructor to > ask, that would have been > my first choice. > Ill look for help somewhere else then. > thanks anyway > Lotta > > > > ------------------------------------------------------------------------------------ > Eva-Lotta Blom PhD student > Dept. of BioEnv . Tj?rn? > University of Gothenburg > 452 96 Str?mstad > Sweden > > > > > > > > 15 maj 2012 kl. 15:58 skrev Sarah Goslee: > > Hi, > > R-help is not a homework help list. If you're having trouble, you need > to speak with your instructor instead. > > Best of luck, > Sarah > > > On Tue, May 15, 2012 at 8:04 AM, Eva-Lotta Blom > <eva-lotta.blom at bioenv.gu.se> wrote: > > > ?1. ?Emma is performing an experiment that requires individual handling of > some animals. The sizes of the animals are lognormally distributed: The > natural logarithms of their sizes has a normal distribution with mean 3 and > standard deviation 0.4. The time (in minutes) it takes to handle each animal > is given by > > > 10 + s ? 1.5 + e? for animals with s ? 20 20 + s ? 0.8 + e? for animals with > s > 20 > > > where ? is a random variable that is normally distributed with expectation 1 > and variance 0.3. > > > For a randomly picked animal, what is the (approximate) probability that it > can be handled in less than 30 minutes? > > > We can solve this exercise using simulation, as follows: Simulate a vector S > with the sizes of 10000 animals, by using the rnorm function and the ?exp? > function. Then, compute a vector Time of length 10000 with the times it > takes to handle each of these 10000 animals: Remember that to separate > between the two cases, you can use notation like for example ?Time[S < 20]?. > The random component e? can be added by combining the ?exp? function with > the ?rnorm? function. Finally, you can find the proportion of simulated > values below 30. Re-do the computations a couple of times to get an idea of > the variability of the result. > > > s <- c(10000) > > S <- exp(rnorm(s, 3, 0.4)) [1]# vector 10000, mean, sd > > Time <- 10+S*1.5 [1] # 10 + s ? 1.5 + e? for animals with s ? 20 > > time <- 20+S*0.8 [1] # ? 20 + s ? 0.8 + e? for animals with s > 20 > > > can't get any further and i can't really find a good help page to solve the > code. > > can you help me? > > Lotta > > > ------------------------------------------------------------------------------------ > > Eva-Lotta Blom PhD student > > Dept. of BioEnv . Tj?rn? > > University of Gothenburg > > 452 96 Str?mstad > > Sweden > > > > > > > > > ? ? ? ?[[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help at 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. > > > > > > -- > Sarah Goslee > http://www.stringpage.com > http://www.sarahgoslee.com > http://www.functionaldiversity.org > >-- Sarah Goslee http://www.stringpage.com http://www.sarahgoslee.com http://www.functionaldiversity.org
To whom this may concern, I have been learing R software. Recently when I did the analysis of the associaiton of SNPs and disease, I have met one problem with Bonferroni correction. Is there a package I should download? What is the command I should use? I have been learning it for a long time however I have not figure it out. Thank you very much. Best wishes, Xiufen [[alternative HTML version deleted]]
Good plan. Also, please notice that you need to hit "reply all" to send your messages to the list and not just to me. Sarah On Tue, May 15, 2012 at 10:34 AM, Eva-Lotta Blom <eva-lotta.blom at bioenv.gu.se> wrote:> yes i should have done that, sorry for this i was just very frustrated and > could not solve it. I guess i only needed hint for commands and not the > solution. I will think a bit more and maybe > i get back too you with a more well formulated question. > I think this is a very good site and you are doing a fantastic job. > cheers > Lotta > > > > > > > 15 maj 2012 kl. 16:24 skrev Sarah Goslee: > > Lotta, > > If this isn't homework, then you need to read the posting guide (see > link at bottom of each posting to the list), and ask a more specific > question than "can't get any further." > > What have you tried? What didn't work? Where did it go wrong? What > book are you working from? Etc. Even if not an ethics violation, your > question is too vague to be easily answered unless you can find > someone interested in working the entire problem from scratch. Since > we're all busy volunteers, that's unlikely. You need to do the work of > asking a well-formed question before you can expect much help. > > Sarah > > On Tue, May 15, 2012 at 10:10 AM, Eva-Lotta Blom > <eva-lotta.blom at bioenv.gu.se> wrote: > > Hello Sarah > > this is not a homework, i am trying to understand R by doing some exercise > > in my book. > > I will however participate a course in R in august and thought it could be > > good to have some > > knowledge before. I hoped for help from you since i have no instructor to > > ask, that would have been > > my first choice. > > Ill look for help somewhere else then. > > thanks anyway > > Lotta > > > > > > > > > > > 15 maj 2012 kl. 15:58 skrev Sarah Goslee: > > > Hi, > > > R-help is not a homework help list. If you're having trouble, you need > > to speak with your instructor instead. > > > Best of luck, > > Sarah > > > > On Tue, May 15, 2012 at 8:04 AM, Eva-Lotta Blom > > <eva-lotta.blom at bioenv.gu.se> wrote: > > > > ?1. ?Emma is performing an experiment that requires individual handling of > > some animals. The sizes of the animals are lognormally distributed: The > > natural logarithms of their sizes has a normal distribution with mean 3 and > > standard deviation 0.4. The time (in minutes) it takes to handle each animal > > is given by > > > > 10 + s ? 1.5 + e? for animals with s ? 20 20 + s ? 0.8 + e? for animals with > > s > 20 > > > > where ? is a random variable that is normally distributed with expectation 1 > > and variance 0.3. > > > > For a randomly picked animal, what is the (approximate) probability that it > > can be handled in less than 30 minutes? > > > > We can solve this exercise using simulation, as follows: Simulate a vector S > > with the sizes of 10000 animals, by using the rnorm function and the ?exp? > > function. Then, compute a vector Time of length 10000 with the times it > > takes to handle each of these 10000 animals: Remember that to separate > > between the two cases, you can use notation like for example ?Time[S < 20]?. > > The random component e? can be added by combining the ?exp? function with > > the ?rnorm? function. Finally, you can find the proportion of simulated > > values below 30. Re-do the computations a couple of times to get an idea of > > the variability of the result. > > > > s <- c(10000) > > > S <- exp(rnorm(s, 3, 0.4)) [1]# vector 10000, mean, sd > > > Time <- 10+S*1.5 [1] # 10 + s ? 1.5 + e? for animals with s ? 20 > > > time <- 20+S*0.8 [1] # ? 20 + s ? 0.8 + e? for animals with s > 20 > > > > can't get any further and i can't really find a good help page to solve the > > code. > > > can you help me? > > > Lotta > >-- Sarah Goslee http://www.functionaldiversity.org
Package "mutoss" seems have Bonferroni correction. Sent from my iPhone On May 15, 2012, at 9:34 AM, ??? <yysky1202 at gmail.com> wrote:> To whom this may concern, > > I have been learing R software. Recently when I did the analysis of the > associaiton of SNPs and disease, I have met one problem with Bonferroni > correction. Is there a package I should download? What is the command I > should use? I have been learning it for a long time however I have > not figure it out. > > Thank you very much. > > Best wishes, > > Xiufen > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.
hi, i am a newbie to R using rocr package to find out accuracy of a model using rpart> perf.acc <- max(cust.rp.perf.acc at y.values[[1]])Error: unexpected symbol in ;perf.acc plot(cust.rp.perf.acc)>plot(cust.rp.perf.acc)how to interpret this graph on x-axis cutoff values and on y -values-accuracy values are given . thanks [[alternative HTML version deleted]]
I'd like to check the adherence of some data will lognormal distribution, using ks.test (x, "plognormal") However, not find the name of this lognormal function. Thank you -- Natália da Silva Martins Bacharel em Estatística - Universidade Estadual de Maringá/ UEM Mestranda em Estatística e Experimentação Agronômica - ESALQ/ USP Contato: (19) 8306-4743 [[alternative HTML version deleted]]