Last data update: 2014.03.03

R: Plots cumulative transition rates
plot.cumratesR Documentation

Plots cumulative transition rates

Description

Plots cumulative transition rates by origin, destination, and age estimated by Cumrates. The required input data are provided by the Cumrates function.

Usage

## S3 method for class 'cumrates'
plot(x,ptrans,title,...)

Arguments

x

An object of class cumrates, produced by the Cumrates function.

ptrans

Selection of transitions to be plotted

title

Title

...

Further arguments to plot

Details

The function plots cumulative transition rates (cumulative hazard rates). If irate = 1 or irate = 3 it plots the Nelson-Aalen estimator at each birthday and adds lower and upper confidence intervals. If irate = 2 or irate = 3, it plots the cumulative occurrence-exposure rates. If irate = 3, the function plots both the Nelson-Aalen estimator (with confidence intervals) and the cumulative occurrence-exposure rate. The variable irate is an argument of the Cumrates function and included in the object produced by Cumrates.

Author(s)

Frans Willekens

Examples

    data(GLHS)
    Bdata.a <- date_b (GLHS,format.out="age",covs=c("marriage","LMentry"))
    cumrates <- Cumrates (irate = 3,Bdata=Bdata.a)
    z<- plot (x=cumrates,ptrans=c("NJ","JN")) 
  

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(Biograph)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Biograph/plot.cumrates.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plot.cumrates
> ### Title: Plots cumulative transition rates
> ### Aliases: plot.cumrates
> 
> ### ** Examples
> 
>     data(GLHS)
>     Bdata.a <- date_b (GLHS,format.out="age",covs=c("marriage","LMentry"))
cmc_as_age: negative ages are replaced by NA
>     cumrates <- Cumrates (irate = 3,Bdata=Bdata.a)
[1] ". . . . . .  Removing intrastate transitions . . . . . "
[1] . . . . . .   Removes intrastate transitions . . . .
[1] . . . . Intrastate transitions removed. Recalculating transitions . . . . 
[1] ". . . . Running function Parameters . . . . "
[1] "Exploring types of transitions"
[1] A new Biograph object without intrastate transitions is returned.
[1] ". . . . . . Estimating rates . . . . ."
[1] "  "
[1] "Cumrates: calls function Biograph.mvna  . . . "
  ID born start      end    sex edu marriage  LMentry  cohort path      Tr1
1  1  351     0 52.66667   Male  17 27.33333 17.00000 1929-31   NJ 17.00000
2  2  357     0 52.16667 Female  10 33.75000 19.66667 1929-31  NJN 19.66667
3  3  473     0 42.50000 Female  11 33.08333 17.91667 1939-41  NJN 17.91667
4  4  604     0 31.58333 Female  13 22.33333 22.33333 1949-51  NJN 22.33333
5  5  377     0 50.50000   Male  11 27.00000 17.16667 1929-31   NJ 17.16667
       Tr2 Tr3 Tr4 Tr5 Tr6 Tr7 Tr8 Tr9 Tr10 Tr11 Tr12
1       NA  NA  NA  NA  NA  NA  NA  NA   NA   NA   NA
2 44.66667  NA  NA  NA  NA  NA  NA  NA   NA   NA   NA
3 29.66667  NA  NA  NA  NA  NA  NA  NA   NA   NA   NA
4 26.91667  NA  NA  NA  NA  NA  NA  NA   NA   NA   NA
5       NA  NA  NA  NA  NA  NA  NA  NA   NA   NA   NA
[1] No intra-state transitions present in the data.
[1] "      Biograph.mvna: Calls function Biograph.long . . . "
[1] . . . . .  Creating long format  . . . . . .
[1] . . . . .  running reshape  . . . . . 
[1]  . . . . Sort data in long format  . . . . 
[1]  . . . . Adjust long format for survival package etc . . .  
[1]      Biograph.mvna completed: Object produced by Biograph.mvna: .$mvna 
[1] "Cumrates 88"
[1] ". . . . . . . . . . . . "
[1] ". . . . Running mvna . . . . . . "
[1] Computing occurrence-exposure rates
[1] Running Sequences.ind
[1] Running Occup
[1] The number of age groups is 54
[1] ". . . . Running function Parameters . . . . "
[1] "Exploring types of transitions"
[1] ". . . .  Running Occup . . . . "
[1] ". . . . Running function Parameters . . . . "
[1] "Exploring types of transitions"
[1] "state_time: compute state.n"
[1] Running Trans
[1] Running RateTable
[1] Running Rates
>     z<- plot (x=cumrates,ptrans=c("NJ","JN")) 
[1] "No plot of Nelson-Aalen estimator since the computation of the estimator was skipped."
[1] 1
[1] 2
>   
> 
> 
> 
> 
> dev.off()
null device 
          1 
>