[R] differences between survival models between STATA and R

Joshua Wiley jwiley.psych at gmail.com
Sat Jul 7 04:32:06 CEST 2012

Hi J,

You have not provided nearly enough information for us to evaluate
whether the results should be similar.  You are talking about two
completely different packages, with no information on your data, only
a small amount of information about your model ("the same analysis")
but clearly the analysis is *not* the same or you would get the same
results, so really you have "I think I am running the same analysis
but either the underlying code/model, the data, or my syntax is
actually running a different model and what I really want is someone
to help me synchronize the results from R and Stata so I feel more
confident, but please do this without data, code, or output".

Please do not take this the wrong way, I am not trying to be harsh,
just point out the difficulty of the question you have asked us.  I
primarily use R, but I work at a consulting center and have access to
Stata and some interest in survival models, so if you sent us your
data (or found/created some example data that replicated the
discrepancy you note), I would try to check out both your R and Stata
code, but I can only do this with some help from you.  Otherwise, I
have to find my own data, examine the functions in R and Stata to
compare what they are doing, and try many tests on my own to hopefully
try to replicate what you might be seeing and then see if I can
actually get the same output.

Perhaps a more saintly version of myself would do that, but unlike my
officemate, there is no special place waiting for me in heaven, or
perhaps I have yet to find my wings.  More detailed help provided when
you provide a reproducible example as the posting guide requests.



On Fri, Jul 6, 2012 at 2:12 PM, JPF <xpfenech at gmail.com> wrote:
> Dear Community,
> I have been using two types of survival programs to analyse a data set.
> The first one is an R function called aftreg. The second one an STATA
> function called streg.
> Both of them include the same analyisis with a weibull distribution. Yet,
> results are very different.
> Shouldn't the results be the same?
> Kind regards,
> J
> --
> View this message in context: http://r.789695.n4.nabble.com/differences-between-survival-models-between-STATA-and-R-tp4635670.html
> Sent from the R help mailing list archive at Nabble.com.
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

it's this bit right here I am referring to:

> and provide commented, minimal, self-contained, reproducible code.
                 -------------------------->                      ^^^^^^^^^^^^^

Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, Statistical Consulting Group
University of California, Los Angeles

More information about the R-help mailing list