plotlba: Plotlba objects using the approach suggested by van der Ark...

View source: R/plotlba.R

plotlbaR Documentation

Plotlba objects using the approach suggested by van der Ark (1999).

Description

S3 methods for lba objects.

Usage


## S3 method for class 'lba.1d'
plotlba(x,
        height.line    = NULL,
        xlab           = NULL,
        ylab           = NULL,
        ylim           = NULL,
        args.legend    = NULL,
        labels.points  = NULL,
        col.points     = par('col'),
        col.lines      = par('col'),
        lty.lines      = par('lty'),
        lwd.lines      = par('lwd'),
        pch.budget     = par('pch'),
        col.budget     = par('fg'),
        lty.budget     = par('lty'),
        lwd.budget     = par('lwd'),
        colline.budget = NULL, 
        with.ml        = c("mix","lat"), 
        ...) 

## S3 method for class 'lba.2d'
plotlba(x,
        axis.labels    = NULL,
        labels.points  = NULL,
        col.points     = par('fg'),
        pch.budget     = par('pch'),
        col.budget     = par('fg'),
        lty.budget     = par('lty'),
        lwd.budget     = par('lwd'),
        colline.budget = par('fg'), 
        args.legend    = NULL, 
        with.ml        = c("mix","lat"), 
        ...) 

Arguments

x

A object of lba class.

height.line

Is a vector with the lines height when K = 2.

xlab

A title for the x axis.

ylab

A title for the y axis.

ylim

The y limits of the plot.

args.legend

List of additional arguments to be passed to legend; names of the list are used as argument names. The default is NULL.

axis.labels

Labels for the three axes in the order left, right, bottom. Defaults to the column names.

labels.points

A character vector or expression specifying the text to be written. The default is NULL.

col.points

A vector of colour representing the points of the mixing parameters. The default is par('fg').

col.lines

A vector of colour representing the lines of the mixing parameters. The default is par('fg').

lty.lines

A vector of line types representing the mixing parameters. The default is par('lty').

lwd.lines

A vector of line width representing the mixing parameters. The default is par('lwd').

pch.budget

A vector of plotting characters or symbols representing the budget proportion. The default is par('pch').

col.budget

A vector of colour representing the budget proportion. The default is par('fg').

lty.budget

A vector of line types representing the budget proportion. The default is par('lty').

lwd.budget

A vector of line width representing the budget proportion. The default is par('lwd').

colline.budget

The colors for line budget. The default is par('fg').

with.ml

What's parameters do you like to plot? The default is mixing parameters ('mix').

...

Other graphical parameters may also be passed as arguments to these functions.

Details

The plotlba function, was suggested at de Leeuw et all (1990) and at van der Ark (1999) thesis. Those types of plots have only graphical views for K = 2 and K = 3. When K = 2, either the latent budgets or the mixing parameters are displayed on a (one dimensional) line segment. When K = 3, either the latent budgets or the mixing parameters are displayed in a equilateral triangle using a barycentric coordinate system where the budgets are represented by the vertices and the plot is made with help of triax.plot and triax.points function of plotrix package.

Author(s)

Enio G. Jelihovschi (eniojelihovs@gmail.com)
Ivan Bezerra Allaman (ivanalaman@gmail.com)

References

de Leeuw, J., van der Heijden, P.G.M., and Verboon, P. 1990. "A latent time budget model". Statistica Neerlandica. 44, 1, 1-21.

van der Ark, A. L. 1999. Contributions to Latent Budget Analysis, a tool for the analysis of comositional data. Ph.D. Thesis University of Utrecht.

See Also

triax.plot, triax.points.

Examples

data('votB')

#K = 2
ex1 <- lba(parties ~ city,
           data=votB,
           K = 2) 

plotlba(ex1)

#It's very simple. With colors!
plotlba(ex1,
        col.points = 1:6,
        col.lines  = 1:6)        

#Add title in plot!
plotlba(ex1,
        main='Mixing parameters')

#Change budget proportion!
plotlba(ex1,
        pch.budget = 23,
        col.budget = 9,
        colline.budget = 8,
        lwd.budget = 2,
        lty.budget = 2)

#A little more!
plotlba(ex1,
        xlab = 'Lb2 -> Lb1',
        height.line = rep(0.5,6),
        lty.lines = 2,
        args.legend = list(ncol=3))


## Not run: 
#K = 3
data(MANHATAN)

tbm <- xtabs(value ~ socecon+health, 
             MANHATAN) 

ex2 <- lba(tbm,
           K = 3) 

plotlba(ex2)

#A little more!
plotlba(ex2,
        labels.points = rownames(tbm),
        col.points    = 2:7,
        args.legend   = list(plot=F))

plotlba(ex2,
        col.points     = 3:8,
        col.budget     = 2,
        pch.budget     = 20,
        lty.budget     = 2,
        lwd.budget     = 3,
        colline.budget = 3,
        axis.labels    = c('Lba1','Lba2','Lba3'))


## End(Not run)

ivanalaman/lba documentation built on Sept. 9, 2023, 11:31 a.m.