similar to: Hmisc::summarize with a dataframe as input?

Displaying 20 results from an estimated 10000 matches similar to: "Hmisc::summarize with a dataframe as input?"

2010 Apr 16
3
problem with FUN in Hmisc::summarize
Hi all, I'd like to use the Hmisc::summarize function, but it uses a function (FUN) of a single vector argument to create the statistical summaries. Consider an easy case: I'd like to compute the correlation between two variables in my dataframe, grouped according to other variables in the same dataframe. For exemple, consider the following dataframe D: V1 V2 V3 A 1 -1 A 1
2006 Dec 28
2
Aggregation using list with Hmisc summarize function
Hi All, I'm using the Hmisc summarize function and used list instead of llist to provide the by variables. It generated an error message. Is this a bug, or do I misunderstand how Hmisc works with lists? The program below demonstrates the error message. Thanks, Bob x<-1:8 group <- c(1,1,1,1,2,2,2,2) gender<- c(1,2,1,2,1,2,1,2) mydata<-data.frame(x,group,gender)
2009 Jun 13
1
Hmisc summarize() with level "" in by variable
I was using summarize() in a data set in which one of the levels of the by variable was "". The summary statistic was consistently off by one level and the "" level was not in the output data frame. I tried to report it as a bug, but I could not log into the Hmisc bug reporting website to do so. I searched for this in the email archives. If it's there, I failed to find
2006 Apr 19
1
Hmisc + summarize + quantile: Why only quantiles for first variable in data frame?
Hi, I'm working on a data set that contains a couple of factors and a number of dependent variables. From all of these dependent variables I would like to calculate mean, standard deviation and quantiles. With the function FUN I get all the means and stdev that I want but quantiles are only calculated for the first of the dependent variables (column 8 in the summarize command). What do I
2009 Apr 24
0
By= levels with the Hmisc summarize function.
Hi, All I have a data frame as follows: > attach(mf) > names(mf) [1] "centre" "complex" "appl" "pool" "month" "alloc_gb" I want to summarize this as follows: agg<-summarize(alloc_gb,by=llist(centre,complex,appl,month),FUN=sum, na.rm=TRUE) That seems to run fine but there something odd about the output. The
2005 Dec 21
2
Newbie - Summarize function
Dear R Users, I have searched through the archives but I am still struggling to find a way to process the below dataset. I have a dataset that has stratum and plot identifier. Within each plot there is variable (Top) stating the number of measurments that should be used to to calculate the mean to the largest "top" elements within one of the vectors (X). I would like to process
2004 Oct 21
0
Hmisc: Using stratified weighted means (wtd.mean) within a function
Hello list, I have the following function which, as you can see, uses mean: meanratings <- round(apply(stack03[,c(102:121)],2,function(x) (tapply(x ,actcode, mean, na.rm=T))), digits=1) The above function yields the following output: q27a q27b q27c q27d q27e q27f q27g q27h q27i q27j q27k q27l q27m q27o q27p 1 7.8 8.1 7.7 7.9 7.9 NaN NaN 8.4 7.8 7.0 7.6 NaN NaN 7.1 6.0 2
2007 Oct 17
1
passing arguments to functions within functions
Dear R Users, I am trying to write a wrapper around summarize and xYplot from Hmisc and am having trouble understanding how to pass arguments from the function I am writing to the nested functions. There must be a way, but I have not been able to figure it out. An example is below. Any advice would be greatly appreciated. Thanks, Dan # some example data df=expand.grid(rep=1:4,
2014 Nov 13
2
Help with ddply/summarize
I have a straightforward application of ddply() and summarize(): ddply(MyFrame, .(Treatment, Week), summarize, MeanValue=mean(MyVar)) This works just fine: Treatment Week MeanValue 1 MyDrug BASELINE 5.91 2 MyDrug WEEK 1 4.68 3 MyDrug WEEK 2 4.08 4 MyDrug WEEK 3 3.67 5 MyDrug WEEK 4 2.96 6 MyDrug WEEK 5 2.57 7 MyDrug
2007 Apr 21
0
possible bug in xYplot and smean.cl.normal
I'm using R (2.4.1) and Hmisc (3.3-1), and I'd like to plot confidence intervals using xYplot and smean.cl.normal (or smean.cl.boot) from Hmisc. You can do that using the summarize() to produce a new data.frame and then plot with xYplot, or by specifying method=smean.cl.normal in the xYplot. Both produce very similar graphs in all trivial examples I've tried, but not in the attached
2004 Jul 13
0
Is there a statistics that can summarize the correlation formore than two random variables?
This seems more like a STATS question than an R question - asking on a list like STAT-L or ALLSTAT may result in more replies Nevertheless, it seems to me that you need to describe (and maybe decide) what you mean by 'summarize' the correlations. Certainly the mean DOES summarize them, but is it the summary you want? Maybe, maybe not. Perhaps the median? Or a trimmed mean? Do you want
2005 May 13
5
Conflict between xtable and Hmisc when using Sweave?
Dear R users, The Sweave code below runs fine, as it is. However, an error occurs when the line 'library(xtable)' is uncommented: Error: chunk 1 Error in "label<-"(`*tmp*`, value = "month") : no applicable method for "label<-" Is anybody aware of this and knows a workaround? Thanks, Sander. *******************
2007 May 14
1
Nicely formatted summary table with mean, standard deviation or number and proportion
Dear all, The incredibly useful Hmisc package provides a method to generate summary tables that can be typeset in latex. The Alzola and Harrell book "An introduction to S and the Hmisc and Design libraries" provides an example that generates mean and quartiles for continuous variables, and numbers and percentages for count variables: summary() with method = 'reverse'. I
2007 Apr 24
0
Bug in xYplot() with method = 'filled bands'
Dear r-helpers, I have been bitten by a cryptic comment in the help page for xYplot(). Here is some code from Madeline Bauer, one of the authors, which is essentailly the code on the help page for xYplot(): # This example uses the summarize function in Hmisc to # compute the median and outer quartiles. The outer quartiles are # displayed using "filled bands" set.seed(111) dfr
2006 Feb 03
0
Cause of Error 1:nrow(X) : argument NA / NaN
Dear R Helpers I am trying to get function smedian.hilow to work using Hmisc summarize on variable conc in dataframe pkindivmtd by time and dose using: attach(pkindivmtd) sconc <- summarize(conc,llist(time,dose),smedian.hilow) I get the error message Erreur dans 1:nrow(X) : argument NA / NaN Contents of pkindivmtd is > contents(pkindivmtd) Data frame:pkindivmtd 1296 observations
2004 Jul 13
2
Is there a statistics that can summarize the correlation for more than two random variables?
Hi, R people, I wonder if there is a statistics than can measure the correlation for more than two random variables, instead of computing the correlation coefficient matrix. If so, what R package should I use? Right now I can only think of the mean of all pair-wise correlation coefficients, e.g., (corr(x,y) + corr(x,z) + corr(y,z)) / 3 for three random variables (x, y, z). Thanks a
2009 Sep 14
2
Function "Varcov" in Design (Ver. 2.2-0) package
Hi, I'm running into an error message for the "anova"-function I never got before with the Design (Version 2.2-0) package. There seems to be a missing function "Varcov", please check my function calls (it's in german but I think you get the error): > library(Design) ## attaching Design package and dependent packages Lade n?tiges Paket: Hmisc ## loading
2003 Aug 18
1
Would like to apply a weight variable to the summary function in Hmisc
Hello, In the Hmisc package, functions describe and summarize can explicitly take a weight variable. My question is can a weight variable be applied when using 'summary'? For example, using...summary(var1 ~ var2) I would like to weight the data by var 3 (same length). Is this possible? Thanks a lot. Greg Blevins The Market Solutions Group, Inc.
2004 Jan 17
3
Wish list
Kevin, I was glad to see your list. Some of the items were reasons for creating some of the functions in Hmisc. summarize and mApply in conjunction with llist handle labeling of output - this is actually quite tricky and the Hmisc solution isn't perfect. Dropping unused factor levels by default (with easy override) is an old battle and I agree with you completely that for everyday data
2011 Feb 10
2
Hmisc errbar color
Is there an easy way to make the error bars the same color as the points and lines they are plotted with. My example # fake data x=sample(1:10, 100, replace =T) y = rnorm(100) + runif(100) df=data.frame(x,y) # summarize data m = aggregate(df,list(x),mean) se = aggregate(df,list(x),sd)/sqrt(10) library(Hmisc) plot(x,y) errbar(m$x, m$y, m$y+1.96*se$y,