Re: [R] Monte Carlo simulation for ratio and its CI

2019-03-26 Thread David L Carlson
e- From: R-help On Behalf Of Jeff Newmiller Sent: Tuesday, March 26, 2019 9:27 AM To: r-help@r-project.org; Marna Wagley ; Bert Gunter Cc: r-help mailing list Subject: Re: [R] Monte Carlo simulation for ratio and its CI Do you really not know how to use a for loop? The tutorial recommendat

Re: [R] Monte Carlo simulation for ratio and its CI

2019-03-26 Thread Jeff Newmiller
Do you really not know how to use a for loop? The tutorial recommendation seems apropos... On March 26, 2019 5:57:17 AM PDT, Marna Wagley wrote: >Dear Bert, >Thank you very much for the response. >I did it manually but I could not put them in a loop so that I created >the >table manually with

Re: [R] Monte Carlo simulation for ratio and its CI

2019-03-26 Thread Marna Wagley
Dear Bert, Thank you very much for the response. I did it manually but I could not put them in a loop so that I created the table manually with selecting the rows randomly several times. Here what I have done so far, please find it. I want to create the table 100 times and calculate its mean and

Re: [R] Monte Carlo simulation for ratio and its CI

2019-03-25 Thread Bert Gunter
> ratio1 <- with(dat, sum(v1,na.rm = TRUE)/sum(v3,na.rm=TRUE)) > ratio1 [1] 1.2 It looks like you should spend some more time with an R tutorial or two. This is basic stuff (if I understand what you wanted correctly). Also, this is not how a "confidence interval" should be calculated, but that

[R] Monte Carlo simulation for ratio and its CI

2019-03-25 Thread Marna Wagley
Hi R User, I was trying to calculate ratios with confidence interval using Monte Carlo simulation but I could not figure it out. Here is the example of my data (see below), I want to calculate ratios (dat$v1/dat$v3 & dat$v2/dat$v3) and its confidence intervals using a 100 randomly selected data