[R] R: print and ctree

Joshua Wiley jwiley.psych at gmail.com
Sun Jul 31 17:20:57 CEST 2011


Hi,

It *looks* to me like those are just 1 - criterion (from what is
printed).  I did not see a nice way to extract them manually.  Here is
what I did:

airq <- subset(airquality, !is.na(Ozone))
airct <- ctree(Ozone ~ ., data = airq,
  controls = ctree_control(maxsurrogate = 3))

round(1 - airct at tree$criterion$maxcriterion, 3)
round(1 - airct at tree$left$criterion$maxcriterion, 3)
round(1 - airct at tree$left$right$criterion$maxcriterion, 3)
round(1 - airct at tree$right$criterion$maxcriterion, 3)

I am not too familiar with the package so take what I said with a
grain or block of salt.

Cheers,

Josh

On Sun, Jul 31, 2011 at 6:40 AM,  <seanstclair at verizon.net> wrote:
>
>   I have run the ctree function, and my dependent variable is broken into 3
>   categories:  low cost, moderate cost and high cost.
>
>
>
>   When i plot the results (eg. using plot(test.ct)), the plot shows, at the
>   very  bottom  of  each node, the probability of falling into each cost
>   category.
>
>
>
>   When i print the actual results (eg. using print(test.ct)), i get all of the
>   backup information, but i do not get the probability of falling into each
>   cost category.
>
>
>
>   Is  there a way i can get these probabilities to show up on the actual
>   summary of results using print function?
>
>
>
>   THANKS.
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, ATS Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/



More information about the R-help mailing list