R language Access Menu

Title Text Both  

Parallel Coordinate Plot

Uses parcoord function of package MASS. The commands have been combined in a function for easy use:


> myparcoord = function(mydf, grpnum){
        parcoord(rn2numericdf(mydf), col=mydf[,grpnum], var.label=T, main=paste('Grouping by',names(mydf)[grpnum]))
        legend('topright',col=unique(mydf[,grpnum]),legend=unique(mydf[,grpnum]), lty=1, lwd=2)

> birthwt$low = 1+birthwt$low # 0 value produces no color on plot 
> myparcoord(birthwt, 1)      # column number 1 is the grouping variable

Output graph:


It can be seen that 'low' of 2 is associated with lower age and lwt, and of course, higher bwt (birth weight variable from which 'low' variable is derived).

    Comments & Feedback