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. Strategic monetary policy in a monetary union with non-atomistic wage setters
2. STIMULATING COOPERATION AMONG FARMERS IN A POST-SOCIALIST ECONOMY: LESSONS FROM A PUBLIC-PRIVATE MARKETING PARTNERSHIP IN POLAND
3. Better policy analysis with better data. Constructing a Social Accounting Matrix from the European System of National Accounts.
4. Income Taxation when Markets are Incomplete
5. The storage and use of newborn babies’ blood spot cards: a public consultation
6. Economie de l’entrepreneur faits et théories (The economics of entrepreneur facts and theories)
7. The name is absent
8. Willingness-to-Pay for Energy Conservation and Free-Ridership on Subsidization – Evidence from Germany
9. Locke's theory of perception
10. The name is absent
11. The name is absent
12. The name is absent
13. ANTI-COMPETITIVE FINANCIAL CONTRACTING: THE DESIGN OF FINANCIAL CLAIMS.
14. Wirkung einer Feiertagsbereinigung des Länderfinanzausgleichs: eine empirische Analyse des deutschen Finanzausgleichs
15. The Formation of Wenzhou Footwear Clusters: How Were the Entry Barriers Overcome?
16. Momentum in Australian Stock Returns: An Update
17. Asymmetric transfer of the dynamic motion aftereffect between first- and second-order cues and among different second-order cues
18. Evaluating the Success of the School Commodity Food Program
19. The name is absent
20. On the origin of the cumulative semantic inhibition effect