[R] Predicting classification error from rpart

Anthony Staines anthony.staines at gmail.com
Fri Oct 14 19:43:35 CEST 2005


Hi,

I think I'm missing something very obvious, but I am missing it, so I
would be very grateful for help. I'm using rpart to analyse data on
skull base morphology, essentially predicting sex from one or several
skull base measurements. The sex of the people whose skulls are being
studied is known, and lives as a factor (M,F) in the data. I want to
get back predictions of gender, and particularly misclassification
rates.

rpart produces output like this :-

> printcp(rpart.LFM)
Classification tree:                                      
rpart(formula = Sex ~ LFM, data = Brides2)
Variables actually used in tree construction:  LFM
Root node error: 44/104 = 0.42308                n= 104

        CP nsplit rel error  xerror    xstd
1 0.227273      0   1.00000 1.00000 0.11451
2 0.113636      1   0.77273 0.95455 0.11372
3 0.022727      2   0.65909 0.95455 0.11372
4 0.010000      5   0.59091 0.95455 0.11372
>

Presumably 'root node error' and 'rel error' are something to do with
error but what? 'Root node error ' seems to be some sort of deviance,
and I have no idea what 'rel error' is. the tree library does produce
a simple estimate of misclassification, but rpart doesn't seem to.

Any ideas?

Thanks,
Anthony Staines
--
Dr. Anthony Staines, Senior Lecturer in Epidemiology.
School  of Public Health and Population Sciences, UCD, Earlsfort
Terrace, Dublin 2, Ireland.
Tel:- +353 1 716 7345. Fax:- +353 1 716 7407 Mobile:- +353 86 606 9713
Web:- http://phm.ucd.ie




More information about the R-help mailing list