The name is absent



28


Stata Technical Bulletin


STB-22


Now, after creating dummies for the time period ...

. tabulate period, generate(per)

Time period I
period I

Freq.

Percent

Cum.

-SO I

14

42.42

42.42

[80-90 I

11

33.33

75.76

[90- I

8

24.24

100.00

Total I

33

100.00

and a censoring variable ...

. censor id age = activity==l activity==2, generate(jobi)

we can estimate a Cox regression model:

. cox Tjobl per2 per3, tvid(id) dead(jobl)

We suppress the output of cox because our example data are too artificial to make the results meaningful. We have, however,
illustrated the process of preparing data for Cox regression; you can apply it to authentic data of your own.

Combining files by time

tmerge is a utility to combine two files each containing ordered observations on one or more individuals. The syntax of
tmerge is

tmerge ident~var filenameA(time.varA) filenameB (time-varlT) new filename (new Jime _var)

tmerge combines filenameA and filenameB and stores the result in new filename (and in the current data set). Observations are
matched according to the values of
time-varA and time-varB, which must be expressed in the same scale.

As with the commands described above, tmerge is best understood by looking at an example. Suppose you have two files
containing different event histories for the same individual. One file, job.dta, contains the individual’s employment history:

. use job, clear

. list

id

birth

Tjob

prof

1.

2

63

80

3

2.

2

63

84

1

3.

2

63

85

2

4.

2

63

89

1

The other file, mar.dta, contains the individual’s marriage history:

. use mar, clear

. list

id

birth

carl

Tmar

car2

1.

2

63

1

78

4

2.

2

63

2

89

3

Time variables—Tjob in job.dta, Tmar in mar.dta—must be expressed in the same scale (here, in years). In each file the
censoring time is 89. tmerge will be interrupted and an error message will appear if the times at censoring are not the same in
both files. To combine the files, type

. drop _all

. tmerge id job(Tjob) mar(Tmar) job-mar(time)

set maxvar 19 width 29

Please wait...



More intriguing information

1. TINKERING WITH VALUATION ESTIMATES: IS THERE A FUTURE FOR WILLINGNESS TO ACCEPT MEASURES?
2. Linkages between research, scholarship and teaching in universities in China
3. Palkkaneuvottelut ja työmarkkinat Pohjoismaissa ja Euroopassa
4. Correlation Analysis of Financial Contagion: What One Should Know Before Running a Test
5. Modelling the Effects of Public Support to Small Firms in the UK - Paradise Gained?
6. Enterpreneurship and problems of specialists training in Ukraine
7. Quelles politiques de développement durable au Mali et à Madagascar ?
8. The name is absent
9. ISSUES AND PROBLEMS OF IMMEDIATE CONCERN
10. ¿Por qué se privatizan servicios en los municipios (pequeños)? Evidencia empírica sobre residuos sólidos y agua.