Skip to content
Back to formatted view

Raw Message

Message-ID: <4761A85B.2090300@vanderbilt.edu>
Date: 2007-12-13T21:47:07Z
From: Frank E Harrell Jr
Subject: Calculating Rsquared values in rpart
In-Reply-To: <BAY127-W24D76891A88364C2ACFD93DE660@phx.gbl>

Andrew Park wrote:
> Hi there
> 
> In rpart, one can get a graph of R-squared (using rsq.rpart (fit)), in which the x axis is the number of splits, and which contains two lines - an "apparent" R squared and an Rsquared based on the x error.
> 
> I would like to caclulate these R-squared values, but cannot work out from the output how it is done. Is there any way to access the values that underpin this graph? Alternatively, is there any way to calculate them from the summary data?
> 
> Thanks in advance,
> 
> Andy Park

Beware.  Yi in his JASA paper about generalized degrees of freedom 
showed that to get an unbiased estimate of R^2 from recursive 
partitioning you have to use the formula for adjusted R^2 with number of 
parameters far exceeding the number of final splits.  He showed how to 
estimate the d.f.   Recursive partitioning seems to result in simple 
prediction models but this is mainly an illusion.

Frank Harrell

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