.- help for ^grlexis2^ (STB-45: gr31) .- Graphical representation of follow-up by time bands --------------------------------------------------- This command is a graphical addition to the ^lexis^ command introduced in STB-27. The ^lexis^ command splits follow-up into different time bands and is used for the analysis of follow-up studies. It is more informative to draw the follow-up since all statistical analyses are incomplete without extensive preliminary analysis. Preliminary analysis usually can be plotting data or doing simple tabulations or summary statistics. This command has the same basic syntax as the ^lexis^ command with a few additions. Follow-up starts from ^timein^ to ^timeout^ and is usually graphically represented by a straight line. With no additional information, follow-up is assumed to start from the same point in time, graphically this is assumed to be time 0. This can be offset using the ^update()^ option by another variable, e.g. date of birth perhaps or date of entry into the cohort. For further information about Lexis diagrams, see Clayton and Hills (1993). Syntax ------ ^grlexis2^ timein fail fup [^if^ exp], ^up^date^(^varname^)^ ^ev^ent^(^evar^)^ ^saving(^string^) xlab(^#,...,#^)^ ^ylab(^#,$...,#^)^ ^lt^itle^(^string^)^ ^bt^itle^(^string^)^ ^ti^tle^(^string^)^ ^symb^ol^(^#^)^ ^nolines numbers^ ^noise b^ox^(^#,#,#,#^)^ The variable ^timein^ contains the entry time for the time scale on which the observations are being expanded. The variable ^fail^ contains the outcome at exit; this may be coded 1 for failure or a more specific code for type of failure (such as icd) may be used; it must be coded 0 for censored observations. The variable ^fup^ contains the observation times. Remarks ------- If there are missing values in the ^timein^ variable, that line is deleted. If there are missing values however in the ^update^ variable, then the ^update^ variable is set to zero. Proper handling of missing data values requires additional editing of the dataset or use of the ^if^ option. On occasion, the command will be unable to cope with large x or y axes values and will overwrite the axis the label is on. In this case it is suggested that the ^xlab^ or ^ylab^ options be used. Options ------- ^update()^ specifies variables which are entry times on alternative time scales. These variables will be appropriately incremented, thus allowing further expansion in subsequent calls. ^event()^ If the subjects are followed up for the entire time but the events do not stop follow-up then the ^event^ option suppresses the drawing of a symbol at the end of a line and instead uses the values in ^evar^ to draw the symbols. ^saving(^filename^)^ this will save the resulting graph in filename.gph. If the file already exists it is deleted and the new graph will be saved. ^xlab^ and ^ylab^ have the same syntax as in the ^graph^ command. If these options are not specified, the labels will contain the maximum and minimum values on the axes. ^btitle^ and ^ltitle^ are titles for the axes and top portions of the graph. The default is the variable name in brackets followed by follow-up or ^timein^ depending on the axes. ^symbol()^ controls the plotting symbol of the failed events. The integer provided corresponds to 0 dot 1 large circle 4 small circle 2 square 5 diamond 3 triangle 6 plus ^nolines^ omits the lines that represent the follow up time. ^box^ is the bounding box parameters. As usual, the lexis diagram has all the follow-up lines at 45 degrees from the horizontal. This can be achieved by setting up a square bounding box (for example ^box(2500,20000,2500,20000)^). The first number is top y-coordinate; second is bottom y-coordinate; third is left x-coordinate; and fourth is right x-coordinate. ^numbers^ gives the option that instead of the failure codes, the line number will be plotted. For small datasets this may give clarity. ^noise^ gives a little information about the two variables on the x and y axes. Examples -------- The simplest plot displays follow-up offset by some starting time/date in the y direction. The automatic labeling of axes is between minimum and maximum points and they are labeled as time in and follow-up. In brackets the actual variables used are displayed. . ^grlexis2 timein fail fup^ Taking the same dataset, the follow-up lines can now be offset in the x direction. Previously time-in may be the age of the person entering the cohort and datein may contain the dates that the subject entered the cohort. Now the follow-up times are more meaningful. . ^grlexis2 timein fail fup, up(datein)^ The following command just adds some of the options to improve the finished graph. ^xlab^ and ^ylab^ must have numbers as arguments to these options and no best guess system is used as in all other Stata graphs. The ^numbers^ option allows the drawing of text next to the events representing the line number in the dataset.The title options are similar to the usually graph options. . ^grlexis2 timein fail fup, up(datein) numbers xlab(0,30,60)^ ^ylab(0,20,40,60,10) ltitle(Time in) btitle(Follow-up) title(my graph)^ Taking the same dataset but this time timein are the event times and everyone entered the cohort at birth. This means that the x-axis is time and the y-axis is age. The trick here is to generate a variable of zeroes. This insures all follow-up times will start from the y-axis (y=0). Then each subjects' follow-up is offset in the x-direction by the entry time (in years). . ^grlexis zero fail fup, up(timein) lti(Age) bti(Time) saving(gr3)^ One possible disadvantage of the previous example is that after an event the subject may still be followed-up until the end of the study. However, previously if the follow-up is altered to the end of the study coverage time (in the command line this new variable is ^fup2^), then all the events will be assumed to be at the end of the study. If the event occurs at earlier times, then a new variable is created that contains the amount of follow-up since study-entry until the first event that the subject had. . ^grlexis zero fail fup2,up(timein) ev(event) lti(Age) bti(Time)^ ^saving(gr4)^ References ---------- Clayton, D. and M. Hills. 1993. Statistical Models in Epidemiology. Oxford: Oxford University Press. Author ------ Adrian Mander MRC Biostatistical Research Unit, Cambridge, adrian.mander@@mrc-bsu.cam.ac.uk Also see -------- STB: gr31 (STB-45)