[R] barplot and pca plot in mvpart/rpart
Gavin Simpson
gavin.simpson at ucl.ac.uk
Fri Feb 29 23:14:50 CET 2008
On Fri, 2008-02-29 at 16:46 -0500, shu zhang wrote:
> Hello,
> I'm using the R package called mvpart, which is about the multivariate
> regression trees.
>
> The function I wrote is:
> mrt1<- mvpart(coefmat~sChip+sScreen+sMem,data=mixdata, xv="pick",
> plot.add=TRUE,uniform=TRUE,which=4,all=TRUE,xadj=2,yadj=2,rsq=TRUE,big.pts=TRUE,wgt.ave.pca=TRUE,legend=TRUE,bars=F,
> pca=TRUE)
>
> where "coefmat" is a matrix(of dimension N*K) to store the coefficients of
> my functional data object; and the predictors in the formula are all
> vectors of length N.
>
> Since I set the option "bars=T" and "pca = T", I get the barplot at the
> node of each leaves on my tree, and a pca plot. My question is that what
> is the barplot about? Is it the histogram of the rows of "coefmat" in the
> node, or the value for any predictor?
The barplots represent the mean "value" for each of the responses in the
given node.
>
> Also I get a messy pca plot. I guess each "square" (it's not quite square)
> in the pca plot represents a node in the tree; but what are the squres
> representing?
I have no idea what you are plotting, the mvpart wrapper is very
complicated as it tries to do so much and I don't have your data and so
can't run your exact call. I have run the examples to try to see what
sort of things you are talking about with the PCA plots.
The large points are the node centroids in the PCA space displayed (i.e.
the mean of the PCA axis 1 and axis 2 scores of the observations in that
node. These are joined by a spanning tree that represent the heights on
the tree itself - the longer the line the more important the split.
The smaller points that are enclosed by the coloured polygons represent
the observations in each node. The coloured polygons are convex hulls,
which enclose the observations in a give node.
Does this answer your question?
G
>
>
> Many thanks for any help on this.
>
> -Shu
>
> ______________________________________________
> 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.
--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Dr. Gavin Simpson [t] +44 (0)20 7679 0522
ECRC, UCL Geography, [f] +44 (0)20 7679 0565
Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/
UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
More information about the R-help
mailing list