Hi, I am trying to generate the index "z" in Stata, so that Z has the same value for all Xs and Ys. For example:
x y z
1 1 1
1 2 1
1 3 1
2 4 2
2 5 3
2 6 3
4 7 4
5 2 1
6 3 1
7 8 5
Any help would be much appreciated. Thanks!
Related Posts with generating an index
Time Series: how to obtain a date variable collapsing year and month (dm)?I have time series data of an index of employment in Brazilian industries. Part of the data is repro…
Merge 2 datasets by range of datesHi, I would like to merge 2 datasets by range of dates and with an identifier (gvkey). So far, I ha…
Is Durbin–Wu–Hausman test a valid test when using generated regressor without any declaration of IVs?Dear All, Recently I have an exactly the same question with an old faq on Stata about Durbin–Wu–Hau…
Bar Graph with datesDear Statalist, I have a list of several countries with dates of COVID-19 lockdown. I would like to…
Alternative to inlist() - expression too longHi, Relatively basic question: I am looking for a concise (1 line) alternative to inlist that would…
Subscribe to:
Post Comments (Atom)
0 Response to generating an index
Post a Comment