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: Plotting estimated survival functions from two different models


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Plotting estimated survival functions from two different models
Date   Fri, 1 Apr 2011 12:23:57 +0100

You are using syntax for Stata's -graph- command as it existed before
Stata 8 in a more recent Stata.

You want something more like

line hazard_weibull hazard_dursel _t in 23902/47000,
sort ytitle("pop hazard") legend(order(1 "Weibull") 2("log normal"))

Incidentally, in your call to -connect()-

11

wa a typo for

ll

Think of "l" standing for _l_ine and you will see that "1" (the
numeral one) makes no sense.

Weibull was a person and so his surname should be capitalised.

Nick

On Fri, Apr 1, 2011 at 12:10 PM, Dami Olajide <damiolajide@gmail.com> wrote:

> I need help to plot estimated survival functions from two different
> models (weibull and weibull+selection (dursel)) on a single graph,
> with the latter using the approach proposed by Boehmke et al (2005). I
> have estimated the two models and the respective predicted hazards
> saved respectively. I tried to use a sytax from Gutierrez (2002)
> comparing 'parametric fraility and shared fraility survival models,
> but it did not work. I have 23,901 observations. I followed the idea
> of 'set obs'
>
> set obs 47000
> replace _t = _n - 23901 in 23902/47000
>
> then
>
> from the weibull model;
> predict hazard_weibull in 23902/47000, hazard
>
> and from the duration with selection model;
> predict hazard_dursel  in 23902/47000, hazard
>
> then
>
> graph hazard_weibull hazard_dursel _t in 23902/47000, c(11[-]) s(ii) sort ///
>     l1title ("pop hazard") ///
>     key1(c(1) "weibull") key2(c(1[-]) "log normal")
>
> I received an error message that "class member function not found".

> References:
>
> Boehmke, F., Morey, D., and Shannon, M. (2005). Selection bias and
> continuous-time duration models: consequences anf proposed solution.
> American Journal of Political Science. Vol. 50 (1): 192-207.
>
> Gutierrez, R.G. (2002). Parametric fraility and shared fraility
> survival models. The Stata Journal, 2 (1):22-44.

*
*   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