Learn R Programming

stima (version 1.2.4)

plot.rt: Function to plot a regression trunk.

Description

Results in a plot a regression trunk.

Usage

# S3 method for 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.

See Also

stima,stima.control,summary.rt

Examples

Run this code

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

Run the code above in your browser using DataLab