[R] summary.formula and continuous variables

Frank E Harrell Jr f.harrell at Vanderbilt.Edu
Mon Mar 22 22:28:12 CET 2010


Erik Iverson wrote:
> Hello,
> 
> I am using the summary.formula function in the Hmisc package to produce 
> tables.
> 
> With the "method" argument set to "response", the help says,
> 
> "Continuous independent variables (see the ‘continuous’ parameter below) 
> are automatically stratified into ‘g’ (see below) quantile groups".
> 
> By my reading, this makes it impossible to summarize a continuous 
> variable with, for example, its correlation with the response variable.
> 
> Is there some sort of functionality I'm missing here, or is this just 
> not possible with how summary.formula is written now?
> 
> Thanks,
> Erik Iverson
> 

That's an excellent question Erik.  I think that summary.formula's 
default treatment of continuous predictors for method='response' needs 
to be improved.  The table cell should be a loess plot and it could be 
summarized with a Spearman correlation coefficient.  Anyone wanting to 
work on the code should get the master code from our subversion repository.

Frank
-- 
Frank E Harrell Jr   Professor and Chairman        School of Medicine
                      Department of Biostatistics   Vanderbilt University



More information about the R-help mailing list