Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Follow up: cox models in SAS and STATA



Thanks for your message.  I did try that, or at least I think I did.  I
believe Stata drops an observation if it has a missing value for one of
the independent variables in the model.  So I went back to SAS and
dropped those same observations.  So I get the same number of failures,
but the coefficients are still different ...

Tom

**********************************************
Thomas P. Moliterno
Graduate School of Management
University of California, Irvine
[email protected]
**********************************************


-----Original Message-----
From: Sarah Mustillo [mailto:[email protected]] 
Sent: Wednesday, June 05, 2002 12:47 PM
To: Moliterno, Thomas
Subject: Re: st: Follow up: cox models in SAS and STATA


Hi -

I am not well-versed in SAS, but have been dealing with similar 
translational issues lately. Could it have something to do with missing 
values?  I had a similar problem, and it turned out that in one program
I 
was treating missing as failure and the other I wasn't.

Just an idea...

Sarah





--On Wednesday, June 05, 2002 12:15 PM -0700 "Moliterno, Thomas" 
<[email protected]> wrote:

> This is a follow-up message to my recent post re: coding cox models in
> SAS and Stata (original message copied below).  Thanks to helpful
> feedback from the list regarding differences in how failure events are
> coded in the two programs (my original message below has been edited
to
> reflect this feedback), I am now showing the same number of failures
in
> the two programs.  But I'm still getting different values for the
> coefficients!  I've confirmed that the data has transferred properly
> from one program to the other, and that records with missing variables
> that are being dropped in Stata are also dropped in SAS.  What else
> could be the problem?!?
>
> Thanks, again, to anyone who knows both SAS and Stata code for taking
a
> 2nd look at this ...
>
> Tom
>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> ORIGINAL POST (posted to statalist on 5/28):
>
>
> I have data on companies' waiting time to different "milestones"
> (reaching $XX in revenue, having an IPO, etc.).  I inherited the data
> and code in SAS format, and I'm trying to recreate the SAS
proportional
> hazard (i.e. cox) models in Stata.  But I can't get the coefficients
to
> come out even remotely close (and I don't mean rounding errors ...
these
> values are way off).  Can someone who knows both SAS and Stata code
can
> take a look at the two versions, below, and tell me what might be
wrong
> with my Stata translation (since I'm to assume that the SAS version is
> correct)?  Below I note only what I think are the relevant lines, and
> simply list the independent variables as iv1, iv2, iv3 ... but I can
> provide more detail if needed.
>
> SAS version:
> proc phreg;
> model time10y*censor10 (1) =
> iv1 iv2 iv3;
>
> Stata version:
> stset time10y, failure(censor10==0)
> stcox iv1 iv2 iv3, nohr
>
> **********************************************
> Thomas P. Moliterno
> Graduate School of Management
> University of California, Irvine
> [email protected]
> **********************************************
> *
> *   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/
>



Sarah Mustillo, Ph.D
Center for Developmental Epidemiology
Department of Psychiatry and Behavioral Sciences
Duke University Medical Center

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