It might help to clarify the research question a bit to the list. Someone
might be able to direct you to a more efficient path to your project's
objective that wouldn't involve tussling with -stset- over multiple episodes
of mastitis during successive periods of lacation, when it's a one-time
culling that you're ultimately interested in.
Joseph Coveney
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
st: probable error stset
--------------------------------------------------------------------------------
From: "Lucy Shum" <[email protected]>
Subject: st: probable error stset
Date: Wed, 17 Jan 2007 12:07:42 +1100
--------------------------------------------------------------------------------
Hi,
I'm tackling a probable error issue which I have partially solved. Issue is
that Stata views certain variables as identical over the same patient, with
multiple events recorded. Anybody knows of a command to "turn off" the
detection of such events?
I attach here one of the -stset- output.
stset dim, id(id) failure(censor) exit(time .)
id: id
failure event: censor != 0 & censor < .
obs. time interval: (dim[_n-1], dim]
exit on or before: time .
------------------------------------------------------------------------------
7033 total obs.
26 multiple records at same instant PROBABLE ERROR
(dim[_n-1]==dim)
------------------------------------------------------------------------------
7007 obs. remaining, representing
4226 subjects
1982 failures in multiple failure-per-subject data
1222502 total analysis time at risk, at risk from t = 0
earliest observed entry t = 0
last observed exit t = 785
Cheers
Lucy Shum
Lucy Shum
Bovine Resident
University of Sydney
University Veterinary Centre Camden
Tel: +61-2-46550777
Fax: +61-2-46551212
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
st: stsplit
--------------------------------------------------------------------------------
From: "Lucy Shum" <[email protected]>
Subject: st: stsplit
Date: Wed, 17 Jan 2007 14:15:52 +1100
--------------------------------------------------------------------------------
Hi,
I've got a dataset with multiple records per animal, multiple events per
record.
Here it is:
list
+----------------------------------------------------------+
| id xmast mast censor dim dimm1 dimm2 dimm3 |
|----------------------------------------------------------|
1. | 1 0 0 0 280 0 0 0 |
2. | 1 3 1 0 300 150 170 250 |
3. | 1 1 1 1 290 200 0 0 |
4. | 2 1 1 0 450 100 0 0 |
5. | 4 1 1 0 300 135 0 0 |
|----------------------------------------------------------|
6. | 4 2 1 0 210 200 208 0 |
7. | 5 3 1 0 350 31 50 200 |
8. | 5 2 1 0 324 280 300 0 |
9. | 5 0 0 1 299 0 0 0 |
+----------------------------------------------------------+
I need to examine the data with "xmast" as a time-dependent covariate since
the hazard of culling should logically alter with every additional episode
of mastitis in cows.
"dim" is the total number of days the cow is present in the milking herd.
"dimm1" is the day when the first disease event occurs, "dimm2" is the when
the second episode happens etc. Total episodes are defined by "xmast".
I can't specify to Stata when to split the data because these are biological
data. Further, I already KNOW when each event occurs. But how do I put it
all together, hopefully, using -stsplit- to split the records where
"xmast>1" and the corresponding dimm1/2 or 3 will be recorded?
Help is very appreciated!!
Lucy
Lucy Shum
Bovine Resident
University of Sydney
University Veterinary Centre Camden
Tel: +61-2-46550777
Fax: +61-2-46551212
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
st: stsplit
--------------------------------------------------------------------------------
From: "Lucy Shum" <[email protected]>
Subject: st: stsplit
Date: Thu, 18 Jan 2007 09:29:20 +1100
--------------------------------------------------------------------------------
Hi,
How do I go about -stsplit- a record which represents one animal, with
multiple events recorded within this line? The time when these events
occurred are not in any logical order and hence I don't think I can command
the stsplit with -stsplit newvar, at(0, 320) per se.
Here is one example:
How could I split the xmast event (number of episodes) into 2 rows? The
corresponding time is in dimm1, dimm2.
Input is much appreciated.
Lucy
*
* 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/