Function to plot a regression trunk.

Description

Results in a plot a regression trunk.

Usage

1
2
## S3 method for class 'rt'
plot(x,digits=2,...)

Arguments

x

an object of class rt, typically the result of stima using the option model="regtrunk".

digits

number of decimal places used in the plot. Default value is 2.

...

additional arguments to be passed.

Details

The output is a plot of a regression trunk. Exception: If the first splitting predictor is categorical with more than 2 categories, the output will be multiple plots: for each category one plot of a regression trunk.

Note

The number of digits of the mean y value displayed in each node can be adjusted using the command options(digits =..) before the plot command.

Known bug: If a splitting variable (not the first one) in the regression trunk is categorical, the values of the categories are not displayed in the plot.

See Also

stima,stima.control,summary.rt

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(employee)
fit1<-stima(employee,2,first=3,vfold=0)

##adjust the number of decimal places used in the plot
plot(fit1,digits=1)

#categorical first split 
fit2<-stima(employee,3,first=9,vfold=0)
plot(fit2)    
#click on the plot to see the next one 
#for each category of variable "jobcat" the subtree is shown in a separate plot