plot.occup.S: Plots state occupancies

Description Usage Arguments Details Value Author(s) Examples

Description

Plots state occupancies. It plots the state occupancies (counts in sample or population under observation) as estimated by Occup. The data are produced by the Occup function.

Usage

1
2
## S3 method for class 'occup.S'
plot(x,namstates.desired,colours,title,area,xmin,xmax,...)

Arguments

x

State occupancies in sample population, by age. An object of class occup.S produced by the Occup function.

namstates.desired

Desired sequence of states in plot. The argument is used to specify an informative ordering of the state occupancies or state probabilities to be stacked.

colours

Colours selected to distinguish the states in the state space.

title

title of plot

area

logical variable.If area is TRUE, area plot is displayed (using geom_area of ggplot2). If area is FALSE, a bar plot is displayed (using geom_bar of ggplot2)

xmin

Minimum age in plot

xmax

Maximum age in plot

...

Further arguments to plot

Details

The function uses the ggplot2 package

Value

occup.S

State occupancies

plot

The figure of state occupancies

Author(s)

Frans Willekens

Examples

1
2
3
4
5
6
7
8
9
    data(GLHS)
    Bdata.a <- date_b (GLHS,format.out="age",covs=c("marriage","LMentry"))
    occup <- Occup(Bdata.a)
    dd <- occup$state_occup
    t <- "States occupancies. GLHS"
    cc <- c("red","green","lightgrey")
    xx <- c("N","J","Censored")
    z<- plot (x=dd,namstates.desired=xx,colours=cc,title=t,area=TRUE,xmin=10,xmax=55) 
     

Biograph documentation built on May 1, 2019, 8:48 p.m.