similar to: summary statistics for grouped data

Displaying 20 results from an estimated 7000 matches similar to: "summary statistics for grouped data"

2010 Feb 15
1
tree-drawing in R ?
Hello, I wonder whether binary (rooted) trees with simple labels (say, integers) can be drawn by some R-package? Couldn't find one. Just to make sure (since "trees" can be many things): I mean those computer-science creatures, with roots and subtrees. Thanks for your consideration in any case Oliver P.S. Perhaps there is some graph-drawing package? (Here a "graph"
2010 Feb 15
1
Error analysis for circular data
Dear R users, I would like to know if it is possible to calculate the Mean Error (ME), the Root Mean-squared error (RMSE) and absolute error (MAE) for two temporal series of directional data. Where Can I get documentation about it? Thanks in advance [[alternative HTML version deleted]]
2009 Jan 11
3
summary with variance / sd
Hi, I have a data frame and would like to have summary statistics for grouped data. With summary() I get the central tendencies for the overall data. How can I get descriptive statistics with variances and standard deviations? for example my data.frame: group x y exp 2 4 exp 3 5 exp 2 4 control 1 2 control 2 3 control 1 2 now I want tables with summary statistics (variances
2010 Mar 06
2
Plot interaction in multilevel model
I am trying to plot an interaction in a multilevel model. Here is some sample data. In the following example, it is longitudinal (i.e., repeated measures), so the outcome, score (at each of the three time points), is nested within the individual. I am interested in the interaction between gender and happiness predicting score. id <- c(1,1,1,2,2,2,3,3,3) age <-
2009 Nov 08
3
Obtaining midpoints of class intervals produced by cut and table
Hello list: I am using "cut" and "table" to obtain a frequency table from a numeric sample vector.  The idea is to calculate mean and standard deviation on grouped data.  However, I can't extract the midpoints of the class intervals, which seem to be strings treated as factors.  How do i extract the midpoint? Thanks, jose loreto [[alternative HTML version deleted]]
2008 Aug 27
5
Integrate a 1-variable function with 1 parameter (Jose L. Romero)
Hey fellas: I would like to integrate the following function: integrand <- function (x,t) { exp(-2*t)*(2*t)^x/(10*factorial(x)) } with respect to the t variable, from 0 to 10. The variable x here works as a parameter: I would like to integrate the said function for each value of x in 0,1,..,44. I have tried Vectorize to no avail. Thanks in advance, jose romero
2008 Nov 20
5
summary statistics into table/data base, many factors to analyse
Dear list, I reduced my data to the following: x <- c(1,4,2,6,8,3,4,2,4,5,1,3) y <- as.factor(c(2,2,1,1,1,2,2,1,1,2,1,2)) z <- as.factor(c(1,2,2,1,1,2,2,3,3,3,3,3)) I can produce the statistical summary just fine. s1 <- tapply(x, y, summary) d1 <- tapply(x, y, sd) s2 <- tapply(x, z, summary) d2 <- tapply(x, z, sd) First thing: I have 100 plus factors to analyse. Theirs
2008 Aug 15
1
Vectorization of duration of the game in the gambler ruin's problem
Hey fellas: In the context of the gambler's ruin problem, the following R code obtains the mean duration of the game, in turns: # total.capital is a constant, an arbitrary positive integer # initial.capital is a constant, an arbitrary positive integer between, and not including # 0 and total.capital # p is the probability of winning 1$ on each turn # 1-p is the probability of loosing 1$ # N
2009 Jan 22
2
Frequency and summary statistics table with different variables and categories
Hello helpers, This is probably quite simple, but I'm stuck. I want to create a summary statistics table with frequencies and summary statistics for a large number of variables. The problem here is that (1) there are two different classes of categories (sex, type of substance abuse and type of treatent) which overlap, (2) the data for different variables should be presented in different
2011 Feb 01
5
(no subject)
Hello I am trying to find a way to find the max value, for only a subset of a dataframe, depending on how the data is grouped for example, How would I find the maxmium responce, for all the GPR119a condition below: responce,mouce,condition 0.105902,KO,con 0.232018561,KO,con 0.335008375,KO,con 0.387025433,KO,GPR119a 0.576769897,KO,GPR119a 0.645120419,KO,GPR119a 0.2538608,KO,GPR119b
2013 Jan 17
3
how to use "..."
Dear users, I'm trying to learn how to use the "...". I have written a function (simplified here) that uses doBy::summaryBy(): # 'dat' is a data.frame from which the aggregation is computed # 'vec_cat' is a integer vector defining which columns of the data.frame should be use on the right side of the formula # 'stat_fun' is the function that will be run to
2010 Dec 13
7
descriptive statistics
Hi. In a data set I have a variable that takes values from 1 to 14. For each subgroup of values of this variable, I would like to obtain some descriptive statistics of other variables present in the data set. I've been trying with a "for" loop but I couldn't get nothing. Could you please suggest me some lines? -- View this message in context:
2006 Feb 24
3
Summarize by two-column factor, retaining original factors
I am having trouble doing the following. I have a data.frame like this, where x and y are a variable that I want to do calculations on: Name Year x y ab 2001 15 3 ab 2001 10 2 ab 2002 12 8 ab 2003 7 10 dv 2002 10 15 dv 2002 3 2 dv 2003 1 15 Before I do all the other things I need to do with this data, I need to summarize or collapse the data by name and year. I've
2005 Nov 08
5
Using split and sapply to return entire lines
Hello, I have a data manipulation problem that I can easily resolve by using perl or python to pre-process the data, but I would prefer to do it directly in R. Given, for example: month length ratio monthly1 monthly2 1 Jan 23 0.1 9 6 2 Jan 45 0.2 9 6 3 Jan 16 0.3 9 6 4 Feb 14 0.2 1 9 5 Mar 98 0.4 2 2 6 Mar 02 0.6
2008 Dec 22
3
Summary information by groups programming assitance
All - I have data that looks like psd Species Lake Length Weight St.weight Wr Wr.1 vol 432 substock SMB Clear 150 41.00 0.01 95.12438 95.10118 0.0105 433 substock SMB Clear 152 39.00 0.01 86.72916 86.70692 0.0105 434 substock SMB Clear 152 40.00 3.11 88.95298 82.03689 3.2655 435 substock SMB Clear
2010 Mar 17
2
Using nrow with summaryBy
Hello Everyone- I'm calculating summary statistics on a dataset (~4000 records, observations are not uniformly distributed) using summaryBy and trying to add a column with the number of observations to the output as well. What occurs to me is to use nrow(), but this doesn't appear to be working I'm able to replicate the same results with an example from the summaryBy docs:
2012 Apr 02
2
summaryBy: transformed variable on RHS of formula?
Hi Folks, I'm trying to cut my data inside the summaryBy function. Perhaps formulas don't work that way? I'd like to avoid adding another column if possible, but if I have to, I have to. Any ideas? Thanks, Allie require(doBy) df = dataframe(a <- rnorm(100), b <-rnorm(100)) summaryBy(a ~ cut(b,c(-100,-1,1,100)), data=df) # preferred solution, but it throws an
2011 Jan 17
2
Using summaryBy with weighted data
Dear Soren and R users: I am trying to use the summaryBy function with weights. Is this possible? An example that illustrates what I am trying to do follows: library(doBy) ## make up some data response = rnorm(100) group = c(rep(1,20), rep(2,20), rep(3,20), rep(4,20), rep(5,20)) weights = runif(100, 0, 1) mydata = data.frame(response,group,weights) ## run summaryBy without weights:
2010 Mar 19
1
Sweave and " object of type 'closure' is not subsettable" error
Hello folks: I have a data frame which includes two numeric vectors: "Pa1" and "Ingr" (which represents income).  I run the following code on the R console: ingreso <- factor(ifelse(Ingr<=3000,"bajo","alto")) tapply(Pa1,ingreso,summary) boxplot(Pa1~ingreso) and it works fine.  However, when I "Sweave" through an rnw file containing that
2010 May 07
4
Any way to apply TWO functions with tapply()?
I need to compute the mean and the standard deviation of a data set and would like to have the results in one table/data frame. I call tapply() two times and do then merge the resulting tables to have them all in one table. Is there any way to tell tapply() to use the functions mean and sd within one function call? Something like tapply(data$response, list(data$targets, data$conditions), c(mean,