Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: stset question


From   "Nikolaos Kanellopoulos" <[email protected]>
To   <[email protected]>
Subject   st: stset question
Date   Fri, 13 Apr 2007 13:55:01 +0100

Dear all,

I have a dataset which provides information in each year for the status of
an individual in each month of the previous year. I want to stset my data
but I am not sure how this can be done.

The following data are part of my dataset. Variable i is a person
identifier, t is a time identifier and var1-var12 are the status of
individual in the months of the previous year. Variable x is observed the
day of the interview. I want to try two alternatives. One in which the x
variable, which is observed in the day of the interview, remains constant
for all the months of the current year and another that the x variable
remains constant for the months of the previous year. In the first case for
the first individual in the first year -10 can be "linked" with var1-var12
of the second year and in the second case for the first individual in the
first year -10 can be "linked" with var1-var12 of the first year.

My question is how can I stset my data so that:
	1. Multiple spells are considered in the same year (individual 1
year 2)
	2. Gaps are taken care (individual 2 year 2-4 and individual 3)

Thanks in advance for any advice

Regards
Nikos

+---------------------------------------------------------------------------
-------------------------+
| i | t | var1 | var2 | var3 | var4 | var5 | var6 | var7 | var8 | var9 |
var10 | var11 | var12 |   x |
|---+---+------+------+------+------+------+------+------+------+------+----
---+-------+-------+-----|
| 1 | 1 |    1 |    1 |    1 |    1 |    1 |    1 |    1 |    1 |    1 |
1 |     1 |     1 | -10 |
| 1 | 2 |    1 |    1 |    0 |    0 |    0 |    0 |    0 |    1 |    1 |
1 |     1 |     0 |  36 |
| 1 | 3 |    0 |    0 |    1 |    1 |    1 |    1 |    1 |    1 |    1 |
1 |     1 |     1 |  14 |
| 1 | 4 |    1 |    1 |    1 |    1 |    1 |    1 |    1 |    1 |    1 |
1 |     1 |     1 |  26 |
|---+---+------+------+------+------+------+------+------+------+------+----
---+-------+-------+-----|
| 2 | 1 |    0 |    0 |    0 |    0 |    0 |    1 |    1 |    1 |    1 |
1 |     1 |     1 |  47 |
| 2 | 2 |    1 |    1 |    1 |    1 |    1 |    1 |    1 |    1 |    1 |
1 |     1 |     1 | -12 |
| 2 | 4 |    1 |    1 |    1 |    1 |    0 |    0 |    0 |    0 |    0 |
0 |     0 |     0 |  30 |
|---+---+------+------+------+------+------+------+------+------+------+----
---+-------+-------+-----|
| 3 | 1 |    1 |    1 |    1 |    1 |    1 |    0 |    0 |    0 |    0 |
0 |     0 |     0 | -15 |
| 3 | 4 |    0 |    0 |    0 |    0 |    0 |    0 |    0 |    1 |    1 |
1 |     1 |     1 |  13 |
+---------------------------------------------------------------------------
-------------------------+





*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index