Learn R Programming

Biograph (version 1.0)

p.SamplePath: Print samplepath for selected subjects

Description

Prints empirical lifepaths for selected subjects

Usage

p.SamplePath(data, timeunit, subjectsID, seq.ind, ages, path, file)

Arguments

data
Biograph object
timeunit
Time unit used in date expression (year or month)
subjectsID
Vector with IDs of selected subjects
seq.ind
Individual sequences or lifepaths
ages
Ages at transitions
path
Path to folder where sample paths should be saved.
file
Output file name

Details

Displays lifepaths for selection of individuals

Examples

Run this code
data (GLHS)
	z <- Parameters (GLHS)
   agetrans <- AgeTrans (GLHS)
   ist <- statesequence.ind (GLHS)
   timeunit <- "month"
   subjectsID <- c(1,6,7,19,136,208)
   path1 <- getwd() # save output in current directory
   samplepaths <- p.SamplePath (data=GLHS, timeunit=timeunit,subjectsID=subjectsID,
         seq.ind=ist,ages=agetrans$ages,path=path1,file="biograph.out")

Run the code above in your browser using DataLab