Displaying 20 results from an estimated 4000 matches similar to: "count the cumulative for each subject"
2013 Nov 28
1
Relative Cumulative Frequency of Event Occurence
Hi,
My objective is to calculate "Relative (Cumulative) Frequency of Event
Occurrence" - something as follows:
Sample.Number 1st.Fly 2nd.Fly Did.E.occur? Relative.Cum.Frequency.of.E
1 G B No 0.000
2 B B Yes 0.500
3 B G No 0.333
4 G B No 0.250
5 G G Yes 0.400
6 G B No 0.333
7 B B Yes 0.429
8 G G Yes 0.500
9 G B No 0.444
10 B B Yes 0.500
Please refer to the code below:
2008 Jan 05
2
Cumulative sum of vector
Hi,
Maybe I have not been looking in the right spot, but, I have not been
able to fine a command to automatically calculate the running
cumulative sum of a vector. Is there such a command?
Example of current code:
> eig$values
[1] 678.365651 6.769697 2.853783
> prop<-eig$values/sum(eig$values)
> prop
[1] 0.986012163 0.009839832 0.004148005
>
2008 May 12
2
Cumulative lattice histograms
An embedded and charset-unspecified text was scrubbed...
Name: inte tillg?nglig
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080512/9533b31f/attachment.pl>
2009 Jun 17
2
cumulative sum in data frame
Dear R-Help List,
I have a question about data manipulation. I tried to make code myself but too much for me. I would greatly appreciate your help.
I have data set consisting of site (from 1 to N1) and distance and there are several variables (1 to N2) collected from each sampling site. I am interested in looking at cumulative sums of each variable based on site and distance like below.
Can
2010 Dec 07
3
understanding output of tapply/by cumsum
Dear R-users,
I have a dataset with categories and numbers.
I would like to compute and add cumulative numbers
to the dataset.
I do not understand the structure of by(...) or
tapply(...) output enough to handle it.
Here a small example
--------------
d<-expand.grid(a=1:5,b=1:3,c=1:2)
d$n = 10 * d$a + d$b +0.1* d$c
Sn<-by(d$n,list(d$a,d$c),cumsum)
str(Sn)
---------
List of 10
$ : num
2006 Aug 31
2
cumulative growth rates indexed to a common starting point over n series of observations
What is the R way of computing cumulative growth rates given a series of
discrete values indexed .
For instance, given a matrix of 20 observations for each of 5 series (zz),
what is the most straight forward technique in R for computing cumulative
growth (zzcum) ?
It seems for the solution I'm after might be imbedding the following cum
growth rate calc as a function into a function call
2004 Jun 11
1
lattice: cumsum and xyplot
I want to display cumulative summary functions with lattice.
First I tried to get cumulated data:
library(lattice)
data(barley)
d.cum <- with( barley, by( yield, INDICES=list(site=site,year=year), FUN=cumsum ) )
I got a list of vectors.
I tried to get a dataframe which I could use in xyplot.
But neither of the following functions led to the goal:
d.cum.df1 <-
2007 Oct 26
5
help
hello,
please can anyone help me out. Am a new user of R
program. Am having problem
with this code below, not getting the expected
results.
1. Each m, the cumulative sum should be 1.000 but the
2nd and 3rd m returned 2.000 and 3.000
instead of 1.000.
2. to get the LCL(m) and UCL(m) for each m base on
these instructions
if out.cum > 0.025 then LCL(m)= y-1
if out.cum >0.975
2007 Mar 12
1
How to avoid a for-loop?
Hi all,
as I am trying to move slowly from just "working" to "good" code, I'd
like to ask if there's a smarter way than using a for-loop in tasks like
the example below.
I need to obtain the extrema of the cumulated sum of a detrended time
series. The following code is currently used, please have a look at the
comments for my questions and remarks:
system.time({
X
2005 Jan 07
2
Getting empirical percentiles for data
Dear List,
I have some discrete data and want to calculate the percentiles and the
percentile ranks for each of the unique scores. I can calculate the
percentiles with quantile().
I know that "ecdf" can be used to calculate the empirical cumulative
distribution. However, I don't know how to exact the cumulative
probabilities for each unique element. The requirement is similar
2009 Nov 21
2
how to ignore NA when using cumsum?
I would like to cumulatively sum rows in a matrix, in which each row has 1
NA value. The usual "na.rm=TRUE" does not seem to work with the command
cumsum. Is there another way to ignore the NAs or do I need to figure out a
different way to do this?
Here's an example matrix of title "proportion":
Ntrail Strail NFJD Baldy Onion Crane
[1,]
2011 Jul 23
2
sum part of a vector
Dear colleagues, I have a data set that looks roughly like this;
mydat<-data.frame(state=c(rep("Alabama", 5), rep("Delaware", 5), rep("California", 5)), news=runif(15, min=0, max=8), cum.news=rep(0, 15))
For each state, I'd like to cumulatively sum the value of "news" and make that put that value in cum.news.
I'm trying as follows but I get
2007 Oct 29
2
help please
hello,
please can anyone help me out. Am a new user of R
program. Am having problem
with this code below, not getting the expected
results.
Each m, the cumulative sum should be 1.000 but the
2nd and 3rd m returned 2.000 and 3.000
instead of 1.000.
thanks
Aruike
pp=function(x,n,M){z=1.0;a=2.3071430;b=7.266064;H=3
out.h=c()
out.y=c()
out.m=c()
out.prob=c()
2017 Jan 20
1
NaN behavior of cumsum
Hi!
I noticed that cumsum behaves different than the other cumulative functions wrt. NaN values:
> values <- c(1,2,NaN,1)
> for ( f in c(cumsum, cumprod, cummin, cummax)) print(f(values))
[1] 1 3 NA NA
[1] 1 2 NaN NaN
[1] 1 1 NaN NaN
[1] 1 2 NaN NaN
The reason is that cumsum (in cum.c:33) contains an explicit check for ISNAN.
Is that intentional?
IMHO, ISNA would be better
2011 Dec 30
3
vertically stacked area plot?
Dear all,
I would like to create a vertically stacked area chart in R. The data are
presented in the attached text file.
I would like to see the trend in values for the different groups with
sediment depth (that's why I would like to create a vertically stacked
chart; normally sed_depth should be = x, but I want it plotted on the
y-axis). In the packages available to create stacked area
2005 May 23
1
Can't reproduce clusplot princomp results.
Dear R folk:
Perhaps I'm just dense today, but I am having trouble reproducing the
principal components plotted and summarized by clusplot. Here is a brief
example using the pluton dataset. clusplot reports that the first two
principal components explain 99.7% of the variability. But this is not what
princomp is reporting. I would greatly appreciate any advice.
With best regards,
-- Tom
2007 Mar 01
4
How to read in this data format?
Hi,
I recieved an ascii file, containing following information:
$$ Experiment Number:
$$ Associated Data:
FUNCTION 1
Scan 1
Retention Time 0.017
399.8112 184
399.8742 0
399.9372 152
....
Scan 2
Retention Time 0.021
399.8112 181
399.8742 1
399.9372 153
.....
I would like to import this data in R into a dataframe, where there is a
column time, the first numbers as column names, and the
2009 Aug 06
2
opration / dates in R
Hi,
how can i use operation + , - , / with veriable format DATES?
for example i have two variable a <- 18/08/2008 and b <- 18/09/2010 and i want to calculate a-b ??
thank you?
[[alternative HTML version deleted]]
2005 Nov 08
3
how to draw cumulative histogram
Hello there,
I am using R to plot some cumulative histogram for my data. Please help
in this case.
Thank you
Lisa Wang
Princess Margaret Hospital
Toronto
phone 416 946 4501 ext.4883
2003 Nov 17
4
cumulative distribution functions
hi y'all,
I am wondering if there is any special command, function,
package, etc to help me doing a cumulative distribution function,
with y-scale - probability scale.
I tried the help in R and i got the following answers:
cumsum(base) Cumulative Sums, Products, and Extremes
ecdf(stepfun) Empirical Cumulative Distribution Function
cpgram(ts) Plot