similar to: cumsum() by subgroup

Displaying 20 results from an estimated 3000 matches similar to: "cumsum() by subgroup"

2004 Nov 23
2
Quadratic curve on a loop
Dear R community, once again I request your generous help on an R issue I cannot seem to figure out. I am trying to do some analysis for multiple sites, in my example I am using only two, but the same will done on many sites. It's just ONE line, so I hope somebody can give a me a hand by email. Look at the loop to make the plot x ~ y. If the curve function is removed from the loop
2004 Jul 22
2
Standard error of a sum
Folks, This is so simple is driving me crazy. It's not really an R question is more an Statistics question. I applied a chemical in 3 different events during a growing season. I took 3 samples in each event to estimate mean applied chemical. Thus, I can easily estimate means and st.err by event. I can then estimate the total chemical applied for the whole season by adding the 3 means
2004 Nov 14
1
Combining expressions and objects within labels
Hello all, I am an R novice and I have a simple question and hope somebody can help me out. I need to place several labels in a plot, this labels are some kind of text and also some objects (which come from some more complicated R calculations). In one of this labels I'd like to place a superscript, however I cannot find a way to place both the expression and the object in the same
2005 Apr 01
1
Ordering scales in xYplot.Hmisc
Dear R community, I am using xYplot() from the Hmisc package. The package works great to plot means + CI. But I am having issues handling the scales. I am plotting "Soil Clay content" vs "Soil depth" by "land use". Usually in this type of graphs it is better to place the variable "soil depth" in the y-axis and it should be ordered downward by depth (0-5
2004 Mar 17
0
NLS question:Quadratic plus plateau fit
Dear R colleagues: Am trying to fit a simple NL model to determine Economical Optimum Nitrogen Rates. The segmented (quadratic + plateau) model only works with some y's, in some cases I get a "singular gradient" error. I'll appreciate any ideas in how to solve the singular gradient error. Thanks, Jose # The following code works using yield2 in the nls model but not using
2010 Jun 09
1
ordisurf (pkg vegan) gives implausible result
I'm having trouble with the ordisurf function in the vegan package. I have created an ordination plot (cmdscale) of 60 samples based on Bray-Curtis dissimilarities, and would like to overlay various soil edaphic characteristics as possible clues to the clustering I observe in my plot. However, I find that ordisurf creates a surface on the plot that is a perfect, even gradient - and
2012 Oct 31
2
R crashing after successfully running compiled code
I'm running R 2.15.1x64, though the same problem persists for 2.13.0x32 and 2.13.0x64. I am trying to run compiled C code using the .C convention. The code compiles without problems, dynamically loads within the R workspace with no problems, and even runs and gives correct results with no problems. However, R will randomly crash within a few minutes of successfully using the compiled
2009 Mar 10
2
perform subgroup meta-analysis and create forest plot displaying subgroups
Hello, I'm using the rmeta package to perform a meta analysis using summary statistics rather than raw data, and would like to analyze the effects in three different subgroups of my data. Furthermore, I'd like to plot this on one forest plot, with corresponding summary weighted averages of the effects displayed beneath each subgroup. I am able to generate the subgroup analyses by simply
2011 Jul 27
1
how to replace values in x by means in subgroups created in ... (not loops)
# Dear all, # how to replace values in x by means in subgroups created in ... # replace only these values where y=0 in continous sequence # replace by mean calculated locally for each subgroup created by # continous sequence of 0,0,0 in parallel y vector, i.e. # where there is continous sequence of 0 in data frame vector y # but we do not replace values in x[i], if y[i]!=0 # we do not want
2012 Mar 29
3
How to get the most frequent value of the subgroup
Dear Members of the R-Help, While using a R function - 'aggregate' that you developed, I become to have a question. In that function, > aggregate(x, by, FUN, ..., simplify = TRUE) I was wondering about what type of FUN I should write if I want to get "the most frequent value of the subgroup" as a summary statistics of the subgroups. I will appreciate if I can get
2007 Jan 25
0
Subgroup discovery in R
I would very much like to apply "subgroup discovery" techniques to some of the data I am analyzing at this moment. Subgroup discovery is an interesting approach and is quite well known in the Data Mining community, though in essence it is a purely statistical approach. To read an introductory article see "Subgroup discovery and visualization methods"
1999 Jan 18
0
Selecting a subgroup
I use the following function to select a subgroup from a data vector (usually to calculate descriptive stats). select.range<-function (groupvec, min, max, data) { if (nargs() > 3) { min.cond <- groupvec >= min max.cond <- groupvec < max cond <- min.cond & max.cond selected <- na.remove(ifelse(cond, data, NA))
2007 Feb 04
1
Java Bindings on a Mac
I had to make some changes (sorry no diff available) to "configure" in 0.9.9 of the bindings so that I could compile them for OS X 10.4.8. Essentially I replaced the the paths to jni.h with /System/Library/Frameworks/JavaVM.framework/Headers. It compiled without error and created both libxapian_jni.so and xapian_jni.jar in the "built" subdirectory when I ran "make
2009 Oct 22
2
How to find moving averages within each subgroup of a data frame
Dear all, If I have the following data frame: > set.seed(21) > df1 <- data.frame(col1=c(rep('a',5), rep('b',5), rep('c',5)), col4=rnorm(1:15)) col1 col4 1 a 0.793013171 2 a 0.522251264 3 a 1.746222241 4 a -1.271336123 5 a 2.197389533 6 b 0.433130777 7 b -1.570199630 8 b -0.934905667 9 b 0.063493345 10 b
2009 Aug 26
2
counting subgroup sums within a data frame
Hi, I'm sure there's an easy approach to this issue, I'm just not seeing it. I have a data frame of the following form: Date class subclass count 8/1/2009 A X 1 8/1/2009 B X 2 8/1/2009 A Y 9 8/1/2009 B Y 3 8/2/2009 A X 1 8/2/2009 B X 5 8/2/2009 A Y
2010 Mar 30
4
Code is too slow: mean-centering variables in a data frame by subgroup
Dear R-ers, I have a large data frame (several thousands of rows and about 2.5 thousand columns). One variable ("group") is a grouping variable with over 30 levels. And I have a lot of NAs. For each variable, I need to divide each value by variable mean - by subgroup. I have the code but it's way too slow - takes me about 1.5 hours. Below is a data example and my code that is too
2004 Nov 20
15
SAS or R software
Hi all there Can some one clarify me on this issue, features wise which is better R or SAS, leaving the commerical aspect associated with it. I suppose there are few people who have worked on both R and SAS and wish they would be able to help me in deciding on this. THank you for the help --------------------------------- [[alternative HTML version deleted]]
2011 Jul 28
0
_: how to replace values in x by means in subgroups created in ...(not loops)
Re:_: how to replace values in x by means in subgroups created in ...(not loops) Thanks, below some code and reply: #_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_# #------------------------------------------------------- # my slow function with loops: # replace_x_by_locallyMean_x_4_0s_in_y.f(x,y) #-------------------------------------------------------
2009 Feb 17
2
cumsum vs. sum
I recently traced a bug of mine to the fact that cumsum(s)[length(s)] is not always exactly equal to sum(s). For example, x<-1/(12:14) sum(x) - cumsum(x)[3] => 2.8e-17 Floating-point addition is of course not exact, and in particular is not associative, so there are various possible reasons for this. Perhaps sum uses clever summing tricks to get more accurate results? In some
2005 May 30
2
trouble with cumsum?
Dear R users, I am using R version 2.0.1 (2004/11/15) on an i386-pc-mingw32 platform. I encounter the following problem while using cumsum: > a <- rep(0.01, 100) > b <- cumsum(a) > sum(a) == 1 [1] TRUE > b[100] == 1 [1] FALSE Am I missing something? Should cumsum have such an outcome? Thanks in advance for any clarifications any of you can offer. Regards, Makram Talih --