Re: [R] Counting confidence intervals

2013-03-20 Thread David Winsemius
You should look at findInterval. Used with as.numeric it could do what you request although it has a much wider range of uses. -- David Sent from my iPhone On Mar 20, 2013, at 5:15 PM, Greg Snow <538...@gmail.com> wrote: > The TeachingDemos package has %<% and %<=% functions that can be chain

Re: [R] Counting confidence intervals

2013-03-20 Thread Greg Snow
The TeachingDemos package has %<% and %<=% functions that can be chained simply, so you could do something like: sum( 5:1 %<=% 1:5 %<=% 10:14 ) and other similar approaches. The idea is that you can do comparisons as: lower %<% x %<% upper instead of lower < x & x < upper On Mon, Mar 18, 2

Re: [R] Counting confidence intervals

2013-03-19 Thread S Ellison
> There _is_ a function ?within. Drat! of course there is. I even use it, though not often. > Maybe your function can be > named 'between' Good thought - thanks Steve E *** This email and any attachments are confidential. Any u

Re: [R] Counting confidence intervals

2013-03-18 Thread Rui Barradas
Hello, There _is_ a function ?within. Maybe your function can be named 'between' Rui Barradas Em 18-03-2013 16:16, S Ellison escreveu: I want to cont how many times a number say 12 lies in the interval. Can anyone assist? Has anyone else ever wished there was a moderately general 'inside' or

Re: [R] Counting confidence intervals

2013-03-18 Thread S Ellison
> > I want to cont how many > > times a number say 12 lies in the interval. Can anyone assist? Has anyone else ever wished there was a moderately general 'inside' or 'within' function in R for this problem? For example, something that behaves more or less like within <- function(x, interval=N

Re: [R] Counting confidence intervals

2013-03-18 Thread Jorge I Velez
# user system elapsed > # 0.500 0.000 0.502 > res1 > #[1] 80070 > > > A.K. > > > > > > > ____________ > From: Jim Silverton > To: arun > Sent: Monday, March 18, 2013 10:08 AM > Subject: Re: [R] Counting confidence intervals > > > t

Re: [R] Counting confidence intervals

2013-03-18 Thread arun
user  system elapsed  # 0.500   0.000   0.502  res1 #[1] 80070 A.K. From: Jim Silverton To: arun Sent: Monday, March 18, 2013 10:08 AM Subject: Re: [R] Counting confidence intervals thanks arun!! On Mon, Mar 18, 2013 at 10:06 AM, arun wrote: Hi,

Re: [R] Counting confidence intervals

2013-03-18 Thread Jorge I Velez
> > ____ > From: Jim Silverton <> > To: r-help@r-project.org > Sent: Monday, March 18, 2013 9:03 AM > Subject: Re: [R] Counting confidence intervals > > Hi, > I have a 2 x 1 matrix of confidence intervals. The first column is the > lower

Re: [R] Counting confidence intervals

2013-03-18 Thread Jim Silverton
Thanks. Jeff On Mon, Mar 18, 2013 at 9:30 AM, Jeff Newmiller wrote: > sum(M[1]<12 & 12<=M[2]) untested, no data > --- > Jeff NewmillerThe . . Go Live... > DCN:Basics: ##.#.

Re: [R] Counting confidence intervals

2013-03-18 Thread arun
[,1] [,2] #[1,]    7   29 #[2,]   11   30 #[3,]    3   30 #[4,]    2   26 #[5,]   10   22 #[6,]    6   22 A.K. From: Jim Silverton To: r-help@r-project.org Sent: Monday, March 18, 2013 9:03 AM Subject: Re: [R] Counting confidence intervals Hi, I have a

Re: [R] Counting confidence intervals

2013-03-18 Thread Jeff Newmiller
sum(M[1]<12 & 12<=M[2]) untested, no data --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#.. Dea

Re: [R] Counting confidence intervals

2013-03-18 Thread Jorge I Velez
Hi Jim, Try either of the following (untested): sum( x[1, ] < 12 & x[2, ] > 12) sum(apply(x, 2, function(x) x[1] < 12 & x[2] > 12)) where "x" is your 2x1000 matrix. HTH, Jorge.- On Tue, Mar 19, 2013 at 12:03 AM, Jim Silverton <> wrote: > Hi, > I have a 2 x 1 matrix of confidence interva

Re: [R] Counting confidence intervals

2013-03-18 Thread Jim Silverton
Hi, I have a 2 x 1 matrix of confidence intervals. The first column is the lower and the next column is the upper. I want to cont how many times a number say 12 lies in the interval. Can anyone assist? -- Thanks, Jim. [[alternative HTML version deleted]]