Re: [R] Binning Data and Event rates

2017-04-17 Thread David L Carlson
ity -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jim Lemon Sent: Monday, April 17, 2017 4:59 PM To: prateek pande <prtkpa...@gmail.com> Cc: r-help mailing list <r-help@r-project.org> Subject: Re: [R] Binning Data and Event rates Hi Pateek,

Re: [R] Binning Data and Event rates

2017-04-17 Thread Jim Lemon
Hi Pateek, Try this: ppdat<-read.table(text="Values Churn 21 1 22 1 31.2 1 32 1 35 0 43 1 45 0 67 1 67 0 76 0 89 1", header=TRUE)

[R] Binning Data and Event rates

2017-04-17 Thread prateek pande
I have a data, in the form mentioned below. Values Churn 21 1 22 1 31.2 1 32 1 35 0 43 1 45 0 67 1 67 0 76 0 89 1 Now i want to bin the values variables into bins and corresponding that want the

Re: [R] binning by frequency

2012-11-27 Thread Rui Barradas
Hello, I'm not sure I ubderstand but, h - hist(b1,brea=100) which.max(h$counts) # max frequency findInterval(b1, h$breaks) Hope this helps, Rui Barradas Em 27-11-2012 14:59, Santosh escreveu: Dear Rxperts, is there way to identify intervals from continuous data (having some kind of a

Re: [R] binning by frequency

2012-11-27 Thread Mark Lamias
You might find the binning function in the sm package helpful here. --Mark Lamias From: Santosh santosh2...@gmail.com To: r-help r-help@r-project.org Sent: Tuesday, November 27, 2012 9:59 AM Subject: [R] binning by frequency Dear Rxperts, is there way

Re: [R] binning by frequency

2012-11-27 Thread Santosh
. --Mark Lamias -- *From:* Santosh santosh2...@gmail.com *To:* r-help r-help@r-project.org *Sent:* Tuesday, November 27, 2012 9:59 AM *Subject:* [R] binning by frequency Dear Rxperts, is there way to identify intervals from continuous data (having some kind

Re: [R] binning by frequency

2012-11-27 Thread William Dunlap
...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Santosh Sent: Tuesday, November 27, 2012 11:59 AM To: r-help Subject: Re: [R] binning by frequency Thanks for your response. Was wondering if there are any R functions/packages to perform optimal binning of continuous data

Re: [R] binning dates by decade for simulated data

2012-03-09 Thread David Winsemius
On Mar 8, 2012, at 7:37 PM, Jeff Garcia wrote: I have a simulated matrix of dates that I generated from a probability function. Each column represents a single iteration. I would like to bin each run _separately_ by decades and dump them into a new matrix where each column is the length

[R] binning dates by decade for simulated data

2012-03-08 Thread jtgarcia
I have a simulated matrix of dates that I generated from a probability function. Each column represents a single iteration. I would like to bin each run _separately_ by decades and dump them into a new matrix where each column is the length of all decades a single run with the number dates binned

[R] binning dates by decade for simulated data

2012-03-08 Thread Jeff Garcia
I have a simulated matrix of dates that I generated from a probability function. Each column represents a single iteration. I would like to bin each run _separately_ by decades and dump them into a new matrix where each column is the length of all decades a single run with the number dates

[R] Binning continuous data

2012-02-29 Thread Faryabi, Robert (NIH/NCI) [F]
Hi there, Here is the scenario: I have a measurement of some sort for two variables, I would like to figure out a rough pattern between them. Let say if the values of the first variable are low, middle, high, and extremely high, then what would be the corresponding pattern of the second

Re: [R] Binning continuous data

2012-02-29 Thread David Winsemius
On Feb 29, 2012, at 5:01 PM, Faryabi, Robert (NIH/NCI) [F] wrote: Hi there, Here is the scenario: I have a measurement of some sort for two variables, I would like to figure out a rough pattern between them. Let say if the values of the first variable are low, middle, high, and extremely

[R] Binning a 2 column matrix by avarages of rows.

2011-12-17 Thread ali_protocol
Newbie here. Many apologies in advance for using the incorrect lingo. I'm new to statistics and VERY new to R. I have a nx2 matrix , I want to sort the values based on the average of 2 columns and put k lowest (or highest) values in bin1, second k high/low values in bin2, and so on (bins would

Re: [R] Binning a 2 column matrix by avarages of rows.

2011-12-17 Thread David Winsemius
On Dec 17, 2011, at 2:47 AM, ali_protocol wrote: Newbie here. Many apologies in advance for using the incorrect lingo. I'm new to statistics and VERY new to R. I have a nx2 matrix , I want to sort the values based on the average of 2 columns and put k lowest (or highest) values in bin1,

[R] Binning the data based on a value

2011-12-05 Thread Diviya Smith
Hello there, I have a matrix with some data and I want to split this matrix based on the values in one column. Is there a quick way of doing this? I have looked at cut but I am not sure how to exactly use it? for example: I would like to split the matrix a based on the spending such that the

Re: [R] Binning the data based on a value

2011-12-05 Thread R. Michael Weylandt
I'd so something like split(a, a$spending) and you can include a round(a$spending, -2) or something similar if you want to group by the 100's. Michael On Mon, Dec 5, 2011 at 3:37 PM, Diviya Smith diviya.sm...@gmail.com wrote: Hello there, I have a matrix with some data and I want to split

Re: [R] Binning the data based on a value

2011-12-05 Thread R. Michael Weylandt
Just a clarification: I can't get round to work as I first expected so if you want to do bins by 100's you'd probably want: split(a, cut(a$spending, breaks = (0:5)*100)) Michael On Mon, Dec 5, 2011 at 3:41 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: I'd so something like

Re: [R] Binning the data based on a value

2011-12-05 Thread Diviya Smith
Thank you very much Michael. This is very helpful. However, if there is any way to exclude zero length bins. Lets imagine that the matrix was as follows - a - data.frame(patient=1:7, charges=c(100,500,200,90,400,500,600), age=c(0,3,5,7,10,16,19), spending=c(10, 60, 110, 200, 400, 450, 500))

Re: [R] Binning the data based on a value

2011-12-05 Thread R. Michael Weylandt
Add the drop = TRUE command to split ?split split(a, cut(a$spending, breaks = (0:5)*100), drop = TRUE) Michael On Mon, Dec 5, 2011 at 4:06 PM, Diviya Smith diviya.sm...@gmail.com wrote: Thank you very much Michael. This is very helpful. However, if there is any way to exclude zero length

[R] binning runtimes

2011-10-24 Thread Giovanni Azua
Hello, Suppose I have the dataset shown below. The amount of observations is too massive to get a nice geom_point and smoother on top. What I would like to do is to bin the data first. The data is indexed by Time (minutes from 1 to 120 i.e. two hours of System benchmarking). Option 1) group

Re: [R] binning runtimes

2011-10-24 Thread Dennis Murphy
Hi: On Mon, Oct 24, 2011 at 2:01 AM, Giovanni Azua brave...@gmail.com wrote: Hello, Suppose I have the dataset shown below. The amount of observations is too massive to get a nice geom_point and smoother on top. What I would like to do is to bin the data first. The data is indexed by Time

Re: [R] Binning numbers into integer-valued intervals (or: a version of cut or cut2 that makes sense)

2011-07-26 Thread Karl Ove Hufthammer
William Dunlap wrote: $ cut(c(20.8, 21.3, 21.7, 23, 25), 2, dig.lab=1) [1] (21,23] (21,23] (21,23] (23,25] (23,25] Levels: (21,23] (23,25] So the first number, 20.8, get put in the interval (21,23], which seem strange. I can see why this could happen, though, as perhaps the 20.8 is

[R] Binning numbers into integer-valued intervals (or: a version of cut or cut2 that makes sense)

2011-07-25 Thread Karl Ove Hufthammer
Dear list members, I’m looking for a way to divide numbers into simple (i.e., integer-valued) intervals, and thought the ‘cut’ function in ‘base’ or the ‘cut2’ function in ‘Hmisc’ would, er, cut it. However, they seem to give rather surprising results. Since I want the endpoints of the

Re: [R] Binning numbers into integer-valued intervals (or: a version of cut or cut2 that makes sense)

2011-07-25 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Karl Ove Hufthammer Sent: Monday, July 25, 2011 7:01 AM To: r-h...@stat.math.ethz.ch Subject: [R] Binning numbers into integer-valued intervals (or: a version of cut or cut2

[R] Binning data

2011-03-12 Thread johnbeamer
Hello I have a large series of data value -- effectivly say the point across the x-axis where a pitch crosses home plate. What I want to do is find the % of ground balls at various distances across home plate. I therefore need to 'bin' the two data sets I have - plate location for ground balls

Re: [R] Binning data

2011-03-12 Thread David Winsemius
On Mar 12, 2011, at 11:35 PM, johnbeamer wrote: Hello I have a large series of data value -- effectivly say the point across the x-axis where a pitch crosses home plate. What I want to do is find the % of ground balls at various distances across home plate. I therefore need to 'bin' the

[R] binning data from NMR

2011-01-31 Thread Marcelo Lima
Hey there, I have a matrix which is from NMR data (first column represents the ppm values and the subsequent their respective intensities for my various samples) that I would like to bin. Make every 10 points ( on my x axis) become one by averaging them out. Any suggestions? Thanks! -- Marcelo

[R] Binning function in R

2010-06-16 Thread bank trust
Is there some function in R that does what Interactive Grouping node in SAS Enterprise Miner does? It makes variable binning using WOE(weight of evidence) for scoring modeling. I’ve found 3 binning function in R : rattle::binning

Re: [R] Binning Question

2010-04-13 Thread David Winsemius
On Apr 13, 2010, at 12:02 AM, Noah Silverman wrote: David, That helps me a lot. Thanks!!! -N On 4/12/10 9:06 PM, David Winsemius wrote: dat - as.data.frame(matrix( rnorm(200), 100 , 2)) # bivariate normal n=100 ab - matrix( c(-5,-5,5,5), 2, 2) # interval [-5,5) x [-5,5) nbin - c( 20,

Re: [R] Binning Question

2010-04-12 Thread David Winsemius
On Apr 12, 2010, at 9:07 PM, Noah Silverman wrote: Hi, I'm trying to setup some complicated binning with statistics and could use a little help. I've found the bin2 function from the ash package, but it doesn't do everything I need. My intention is to copy some of their code and then

Re: [R] Binning Question

2010-04-12 Thread Noah Silverman
David, That helps me a lot. Thanks!!! -N On 4/12/10 9:06 PM, David Winsemius wrote: dat - as.data.frame(matrix( rnorm(200), 100 , 2)) # bivariate normal n=100 ab - matrix( c(-5,-5,5,5), 2, 2) # interval [-5,5) x [-5,5) nbin - c( 20, 20) # 400 bins bins - bin2(dat, ab, nbin) # bin

[R] Binning Question

2010-04-12 Thread Noah Silverman
Hi, I'm trying to setup some complicated binning with statistics and could use a little help. I've found the bin2 function from the ash package, but it doesn't do everything I need. My intention is to copy some of their code and then modify as needed. I have a vector of two columns:

[R] binning results

2009-08-05 Thread Noah Silverman
Hello, I asked this as part of a previous message, but never really figured out a usable solution. So this is a second attempt. I have an process containing an SVM. The end result is the probability that the class is true. That result is added back to the original data. So I wind up

Re: [R] binning results

2009-08-05 Thread Steve Lianoglou
Hi, On Aug 5, 2009, at 2:11 PM, Noah Silverman wrote: Hello, I asked this as part of a previous message, but never really figured out a usable solution. So this is a second attempt. I have an process containing an SVM. The end result is the probability that the class is true. That

Re: [R] binning results

2009-08-05 Thread Noah Silverman
Thanks Steve, I'm halfway there with: foo - cbind(foo, range_group=cut(foo$score, breaks=c(.9, .8, .7, .6, .5, .4, .3, .2, .1))) with(foo, tapply(score, list(range_group), mean)) This works, but I only get one of the 3 columns I need, mean(score). I'm not sure how to get the other two. It

Re: [R] Binning or grouping data

2009-06-04 Thread Glen Sargeant
alamoboy wrote: Newbie here. Many apologies in advance for using the incorrect lingo. I'm new to statistics and VERY new to R. I'm attempting to group or bin data together in order to analyze them as a combined group rather than as discrete set. I'll provide a simple example of the

Re: [R] Binning or grouping data

2009-06-04 Thread Glen Sargeant
alamoboy wrote: Newbie here. Many apologies in advance for using the incorrect lingo. I'm new to statistics and VERY new to R. I'm attempting to group or bin data together in order to analyze them as a combined group rather than as discrete set. I'll provide a simple example of the

[R] Binning

2009-03-30 Thread Santosh
Dear useRs... How do you all do binning of an independent variable using R? For example, observations of a dependent variable at times different from a nominal time. Are there any R functions that help with binning? Thanks much in advance! Santosh [[alternative HTML version deleted]]

Re: [R] Binning

2009-03-30 Thread Gad Abraham
Santosh wrote: Dear useRs... How do you all do binning of an independent variable using R? For example, observations of a dependent variable at times different from a nominal time. Are there any R functions that help with binning? Have a look at ?cut. -- Gad Abraham MEng Student, Dept.

Re: [R] Binning

2008-09-10 Thread Felipe Carrillo
Thanks Jim and S Ellison for your help This should do what you want. #--x - read.table('clipboard', header=TRUE, as.is=TRUE) # convert dates x$date - as.POSIXct(strptime(x$SampleDate, %m/%d/%Y)) # put ForkLength into bins x$bins - cut(x$ForkLength, breaks=c(32, 34, 37, 40),

[R] Binning

2008-09-09 Thread Felipe Carrillo
Dear List: I have a dataset with over 5000 records and I would like to put the Count in bins based on the ForkLength. e.g. Forklength Count 32-34? 35-37? 38-40? and so on... and lastly I would like to plot (scatterplot) including the

Re: [R] Binning

2008-09-09 Thread jim holtman
This should do what you want. #--x - read.table('clipboard', header=TRUE, as.is=TRUE) # convert dates x$date - as.POSIXct(strptime(x$SampleDate, %m/%d/%Y)) # put ForkLength into bins x$bins - cut(x$ForkLength, breaks=c(32, 34, 37, 40), include.lowest=TRUE) # count the bins tapply(x$Count, x$bins,

Re: [R] Binning groups

2008-05-24 Thread David Winsemius
On Thu, 22 May 2008, francogrex wrote: Hi, this is probably quite simple but I can't seem to do it correctly. I have a data frame of counts of infections in different ages; something like: count=c(1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 7, 8, 8, 9, 9, 10, 11, 15, 17, 17, 17, 17, 19,

[R] Binning groups

2008-05-22 Thread francogrex
Hi, this is probably quite simple but I can't seem to do it correctly. I have a data frame of counts of infections in different ages; something like: count=c(1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 7, 8, 8, 9, 9, 10, 11, 15, 17, 17, 17, 17, 19, 19, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22,

Re: [R] Binning groups

2008-05-22 Thread jim holtman
Is this what you want: count=c(1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 7, 8, 8, 9, 9, + 10, 11, 15, 17, 17, 17, 17, 19, 19, 19, 19, 20, 20, 20, 21, 21, + 21, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 25, 27, 31, 33 + ) age=c(3, 8, 9, 7, 56, 58, 10, 13, 53, 55, 11, 12, 14, 51, 54, + 15,

Re: [R] Binning groups

2008-05-22 Thread jim holtman
If you just want to bin the current ages: count=c(1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 7, 8, 8, 9, 9, + 10, 11, 15, 17, 17, 17, 17, 19, 19, 19, 19, 20, 20, 20, 21, 21, + 21, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 25, 27, 31, 33 + ) age=c(3, 8, 9, 7, 56, 58, 10, 13, 53, 55, 11, 12,

Re: [R] Binning groups

2008-05-22 Thread Anne York
On Thu, 22 May 2008, francogrex wrote: f f Hi, this is probably quite simple but I can't seem to do it correctly. I have f a data frame of counts of infections in different ages; something like: f count=c(1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 7, 8, 8, 9, 9, f 10, 11, 15, 17, 17,

Re: [R] binning data

2008-01-14 Thread Marc Schwartz
Robert Terwilliger wrote: I would like to 'bin' a vector of of values (10 values) in much the same way as 'hist' does for plotting, but I just want a result with the bins and the frequencies. Is there a 'quick and dirty' (built-in) way to do this, or do I need to write some code? Many

[R] binning data

2008-01-14 Thread Robert Terwilliger
I would like to 'bin' a vector of of values (10 values) in much the same way as 'hist' does for plotting, but I just want a result with the bins and the frequencies. Is there a 'quick and dirty' (built-in) way to do this, or do I need to write some code? Many thanks, Robert Terwilliger

Re: [R] binning data

2008-01-14 Thread Rolf Turner
On 15/01/2008, at 5:13 AM, Robert Terwilliger wrote: I would like to 'bin' a vector of of values (10 values) in much the same way as 'hist' does for plotting, but I just want a result with the bins and the frequencies. Is there a 'quick and dirty' (built-in) way to do this, or do I need