Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9119415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:23:27+00:00 2026-06-17T05:23:27+00:00

I am using the party package in R. I would like to get various

  • 0

I am using the party package in R.

I would like to get various statistics (mean, median, etc) from various nodes of the resultant tree, but I cannot see how to do this. For example

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

results in a tree with 4 terminal nodes. How would I get the mean airquality for each of those nodes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T05:23:28+00:00Added an answer on June 17, 2026 at 5:23 am

    This is surprisingly harder than I thought. Try something like this:

    a <- by(airq,where(airct),colMeans) #or whatever function you desire for colMeans
    a
    a$"3" #access at node three
    a[["3"]] #same thing
    

    You might find some other useful examples with ?`BinaryTree-class`.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible in IE8 without using third party plugin like Java?
I just started using the R package called RMySQL in order to get around
I am developing a package using Rcpp and another third party C++ library. When
When using third-party libraries such as jquery, yui-reset, swfobject and so on, do you
Hi we are using third party tool 'ooyala' for our video in site, Ooyala
What is the simplest way (preferably without using third party frameworks) in objective c,
Am using below third party API in my project development http://undesigned.org.za/2007/10/22/amazon-s3-php-class I have done
We are using a Third-Party assembly that seems to be compiled as AnyCPU. However,
I'm using a third party library which has a blocking function, that is, it
I am using some third party library to connect to a server via async

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.