versity
-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
Cc: r-help mailing list
Subject: Re: [R] Binning Data and Event rates
Hi Pateek,
Try this:
ppdat<-read.table(text="Values Churn
21
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)
ppdat$Valbin<-cut(ppdat$Values,breaks=c(20.9,43.7,66.3,89
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 ch
--Original Message-
> From: r-help-boun...@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
rk Lamias
>
> --
> *From:* Santosh
> *To:* r-help
> *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
> of
You might find the binning function in the sm package helpful here.
--Mark Lamias
From: Santosh
To: r-help
Sent: Tuesday, November 27, 2012 9:59 AM
Subject: [R] binning by frequency
Dear Rxperts,
is there way to identify intervals from continuous data
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 pa
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 of
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 bin
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
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
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 variab
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,
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
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 wrote:
> Thank you very much Michael. This is very helpful. However, if there is any
> way to exclude zero length bins. Lets imagine that t
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))
bi
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
wrote:
> I'd so something like
>
> split(a, a$spending)
>
> and y
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 wrote:
> Hello there,
>
> I have a matrix with some data and I want to split this matrix based on
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
da
Hi:
On Mon, Oct 24, 2011 at 2:01 AM, Giovanni Azua 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 (minutes from
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 th
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
> -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
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 interva
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
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 an
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 A
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
http://finzi.psych.upenn.edu/R/library/rattle/html/binning.html
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( 2
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 coun
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
modi
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:
head(data)
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 r
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 res
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 with
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
> examp
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
> examp
Personally, I prefer the recode() in package of car.
Ronggui
2009/6/4 Philipp Pagel :
>> 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 data for illustrative purposes.
>>
>> Pat
You want cut and tapply, perhaps along these lines:
## Your data frame:
a <- data.frame(patient=1:6, charges=c(100,500,200,90,400,500),
age=c(0,3,5,7,10,16),
race=c("black","white","hispanic","asian","hispanic","black"))
## Add an age category:
a <- cbind(a, age_category=cut(a$age, breaks=c(-
> 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 data for illustrative purposes.
>
> Patient ID | Charges |Age | Race
> 1 | 100 |0 | Bla
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 data for illustrative p
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. CSSE
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]]
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),
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$b
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 SampleDate
see
?findIntervals
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, 19, 19,
> 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, 1
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,
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,
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,
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, 22
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
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?
>
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
___
55 matches
Mail list logo