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


Thomas P. Moliterno
Graduate School of Management
University of California, Irvine

-----Original Message-----
From: Sarah Mustillo [] 
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
was treating missing as failure and the other I wasn't.

Just an idea...


--On Wednesday, June 05, 2002 12:15 PM -0700 "Moliterno, Thomas" 
<> 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
> reflect this feedback), I am now showing the same number of failures
> 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
> 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
> hazard (i.e. cox) models in Stata.  But I can't get the coefficients
> come out even remotely close (and I don't mean rounding errors ...
> values are way off).  Can someone who knows both SAS and Stata code
> take a look at the two versions, below, and tell me what might be
> 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
> **********************************************
> *
> *   For searches and help try:
> *
> *
> *

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

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index