Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: st: Interval Censored Data Formatting and Intcens


From   Ciril Bosch <cirilbosch@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: st: Interval Censored Data Formatting and Intcens
Date   Fri, 8 Jun 2012 01:25:01 -0700

Hi Steve,
as you can see I am new to the board and have made several mistakes
when trying to explain my problem.

The survival methodology is new to us (as opposed to logit, probit)
and are very unfamiliar with it, hence posting on the board. Our
observations are around 40 but will increase them during summer, so
hopefully we will have more than enough for intcens to work.

I really appreciate your help, code and mostly patience!

Ciril

On Mon, Jun 4, 2012 at 4:40 PM, Steve Samuels <sjsamuels@gmail.com> wrote:
> Correction: before the -scatter, insert:
> *************
> sort trunk
> *************
>
> I've made the correction below in the complete code.
>
> S.
>
> On Jun 4, 2012, at 7:23 PM, Steve Samuels wrote:
>
>
> I think you can omit the words "might have" in your statement "My example might have induced to confusion...". It did.  Also with only one observation per person
> the data are in long form.
>
> If you administered only one treatment per subject, then you have a standard
> bioassay problem, in which each organism has a latent threshold for response.
> Note that the log logistic & log-normal models fitted by -intcens- include
> a scale parameter, but the models in -logistic- and -probit- do not.
>
> If you use -intcens-, specify  the censoring interval for an
> observation with dose d as (0+,d]. Here 0+ is some small positive
> number like 0.01. That you have no events at dose = 3 is immaterial.
>
> However because there are few doses, -intcens- might have
> difficulty converging. Also, how are you going to plot the
> dose response curve and standard errors?
>
> I suggest that instead you use  -probit- and -logit-.
> You will have a better chance of obtaining convergence and can
> generate the plotted curves and standard errors, Here is code
> which shows how to interpolate absent doses for plotting.
>
> *************CODE BEGINS*************
> clear
> input trunk //fakes for auto data
> 0.01
> 1
> 2
> 3
> 4
> end
> gen fake=1
> tempfile t1
> save `t1'
> sysuse auto, clear
> gen domestic = foreign==0
> sum trunk // minimum is 5
> append using `t1'
> logistic domestic trunk if missing(fake)
> predict pr //predicts for fake data too
> sort trunk
> scatter pr trunk, c(direct) m(i)
> ***********CODE ENDS**************
>
> Steve
> sjsamuels@gmail.com
>
>
> On Jun 4, 2012, at 2:08 PM, Ciril Bosch wrote
> Hi Steve,
> thank you for your reply, I really appreciate it. Indeed intcens comes from SSC.
>
> My data is in a wide format and reads:
>
> id dose event session
>
> Where session stands for ordered session when doses where applied
>
> In my example:
>
> id   dose   event   session
> 1      13       1          1
> 2      13       0          2
> 3      21       1          1
> 4      21       1          2
>
> My example might have induced to confusion as I was unclear in my
> specification:
>
> 1) I don't actually apply two dosages to subjects. The t_0==1 and
> t_1==3 that I have for all subjects is actually a "dummy treatment"
> which never took place. I used it as a primitive way of telling Stata
> that there is left censoring and that it should take that into account
> (I do know that
> dose==3 will always have event==0 for all subjects).
>
> 2) Treatments are completely independent across subjects even if they
> are dosed in "batches". A dummy for session will be included in the
> analysis, but this is just for the sake of completeness (or so I
> hope!).
>
> So as you can see my design cannot be simpler; select a small set of
> doses to apply and then observe results on a series of subjects.
>
> I will try the code you sent once I get onto my computer and see if I
> can run it with intcens.
>
> Again, thanks for your help,
> Ciril
>
> On Sat, Jun 2, 2012 at 6:17 PM, Steve Samuels <sjsamuels@gmail.com> wrote:
>
>> You are asked in the FAQ to say where you obtained unofficial commands.
>> -intcens- can be downloaded from SSC.
>>
>> You say you want to transfer the structure of your data to Stata, but
>> you don't show that structure, so we have to guess. I'm guessing that
>> your basic data looked something like that after the input statement
>> below ( "wide form").
>> If not, it might look something like the listed data after the
>> -reshape- command (below), the "long form" If not that either, then
>> you will have to put  your data into one of the two forms.
>>
>> For the wide form: let i = 1,3,13, 21 index coses and let statusi =
>> observation just after dose i
>>
>> = 1 if death after dose i
>> = 0 if no death after dose i
>> = . no dose i given
>>
>> *************CODE BEGINS*************
>> input id status1 status3 status13 status21
>> 1 0 1 . .
>> 2 0 0 1 .
>> 3 0 0 0 1
>> 4 0 0 . 1
>> 5 0 . . 0
>> end
>>
>> reshape long status, i(id) j(dose)
>> drop if status==.
>> list, sepby(id)  // long form
>>
>> egen event = max(status), by(id)
>> gen t1 = dose if status==1
>>
>> bysort id: gen t0 = dose[_n-1] if status==1 bysort id: keep if _n==_N
>> replace t0 = dose if t0==.
>> list id t0 t1 status
>> ***********CODE ENDS***************
>>
>> This is an interesting application of -intcens-, but two points
>> concern me.
>>
>> 1. You apparently applied 2+
>> doses to the each subject. If the effect of former dosing persists in
>> any way, then the probability of an event will not depend only on
>> current dose.
>>
>> 2. Dosing in groups could result in dependent responses.
>>
>> I am curious: Can you provide a methodological reference for this
>> design?
>>
>> Steve
>> sjsamuels@gmail.com
>>
>> On Jun 1, 2012, at 5:12 PM, Ciril Bosch-Rosa wrote:
>>
>> Hello,
>> I am trying to apply survival analysis in an environment where I can
>> gather data in a very limited way. I have been looking at literature
>> on how to manage the data but am not being successful at transmitting
>> the structure of my data to Stata.
>>
>> It turns out that my data is very limited because I can only observe
>> once in time each subject. I am taking this as an interval censored
>> problem, where all subjects start being at risk at t_0 and then are
>> censored until I look at some of them at (say) t_13, where they are
>> either 1 (dead) or 0 (right censored). So, either the subject died at
>> some before (and including) t_13 or he survived in which case I will
>> never see him again (hence the right censoring).
>>
>> I looked at Cleves et al. but they are not clear on how I can tell
>> Stata that an even happened while "I was not looking". They tell me
>> how to tell stata I was not looking, but not how to tell I was not
>> looking & something
>> happened:
>>
>> id   t_0   t_1   event
>> 1     1      3      0
>> 1     13    15    1
>>
>> the example above I tell stata there is a censored interval from t=3
>> until
>> t=13 and then I observe id=1 until he gets a failure at t=15, but I am
>> not able to tell stata that they might have died in the t3-t13 interval:
>>
>> id   t_0   t_1   event
>> 1     1      3      0
>> 1     13    13    1
>> 2     1      3      0
>> 2     13    13     0
>>
>> In other words I observe you from t=1 to t=3 and then you get censored
>> until I get one  peek at t=13, where I can see if you died between 3
>> and 13 or not.
>>
>> I believe this can be done with ""intcens  depvar1 depvar2 " where
>> depvar are my t=3 and t=13 respectively, my problem though is that
>> there are different interval censoring for different subjects
>>
>> id   t_0   t_1   event
>> 1     1      3      0
>> 1     13    13    1
>> 2     1      3      0
>> 2     13    13     0
>> 3     1      3      0
>> 3     21    21    1
>> 4     1      3      0
>> 4     21    21     1
>>
>>
>> how can I tell intcens, "intcens depvar1 depvar2 if id=1|2 but depvar1
>> depvar3 if id=3|4" ??
>>
>> Any help/advice is welcome
>>
>> Ciril
>>
>> PS If you are wondering in what environment I get this kind of data;
>> this is a lab experiment where I apply a dose to groups of subjects
>> and get instantaneous results, hence my observing groups of them at
>> the same "time".
>> My X-axis is not time, but rather "dosage" and I am trying to plot the
>> survivor curve given the very limited observable outcomes for each dosage.
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index