Last data update: 2014.03.03

R: Occurrences of selected transition by age
TransitionABR Documentation

Occurrences of selected transition by age

Description

Determines for a given transition the number of transitions by age

Usage

TransitionAB(Bdata, transition,keep)

Arguments

Bdata

Biograph object

transition

Selected transition

keep

Logical variable indicating whether observations (subjects) with the selected transition missing should be kept (TRUE) or removed (FALSE). Default: keep=FALSE

Value

case

The transition

n

Number of subjects in the sample experiencing the selected transition (transition count).

id

Identification number of subjects that experienced the transition

pos

Position of the selected transition in the state sequence (path variable Bdata$path of the Biograph object). If transition = "*N" and N is the first state, then that state is skipped. If a subject experienced several of the selected transition, the first transition is considered.

date

For each subject experiencing the transition, date of transition

age

For each subject experiencing the transition, age at transition

year

For each subject experiencing the transition, year of transition (year is real variable, including fraction of year)

cohort

For each subject experiencing the transition, birth cohort

Author(s)

Frans Willekens

Examples

# Example 1: Transition NJ in GLHS data set
  data (GLHS)
  z <- TransitionAB (GLHS,"NJ",keep=TRUE)

# Example 2: Transition HM in NLOG98 data set
  data (NLOG98)
  z <- TransitionAB (NLOG98,"HM")

# Example 3: Transition 'Leaving parental home", irrespective of destination state
  data (NLOG98)
  z <- TransitionAB (NLOG98,"H*")

# Example 4: First marriage, irrespective of origin state
  data (NLOG98)
  z <- TransitionAB (NLOG98,"*M")

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/TransitionAB.Rd_%03d_medium.png", width=480, height=480)
> ### Name: TransitionAB
> ### Title: Occurrences of selected transition by age
> ### Aliases: TransitionAB
> 
> ### ** Examples
> 
> # Example 1: Transition NJ in GLHS data set
>   data (GLHS)
>   z <- TransitionAB (GLHS,"NJ",keep=TRUE)
[1] Age profile: Number of individuals with transition NJ is 201
> 
> # Example 2: Transition HM in NLOG98 data set
>   data (NLOG98)
>   z <- TransitionAB (NLOG98,"HM")
[1] Age profile: Number of individuals with transition HM is 172
> 
> # Example 3: Transition 'Leaving parental home", irrespective of destination state
>   data (NLOG98)
>   z <- TransitionAB (NLOG98,"H*")
[1] Age profile: Number of individuals with transition H* is 456
> 
> # Example 4: First marriage, irrespective of origin state
>   data (NLOG98)
>   z <- TransitionAB (NLOG98,"*M")
[1] Age profile: Number of individuals with transition *M is 339
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>