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

Re: st: RE: Stata's logistic vs. SAS CATMOD WLS model.


From   Ricardo Ovaldia <[email protected]>
To   [email protected]
Subject   Re: st: RE: Stata's logistic vs. SAS CATMOD WLS model.
Date   Thu, 23 Oct 2003 09:09:41 -0700 (PDT)

Thank you Paul. Following your advised I get:

. logit meter time intervention it, cluster(id)

Iteration 0:   log pseudo-likelihood = -277.17887
Iteration 1:   log pseudo-likelihood = -268.85134
Iteration 2:   log pseudo-likelihood = -268.84209
Iteration 3:   log pseudo-likelihood = -268.84209

Logit estimates                                  
Number of obs   =        400
                                                  Wald
chi2(3)    =      23.65
                                                  Prob
> chi2     =     0.0000
Log pseudo-likelihood = -268.84209               
Pseudo R2       =     0.0301

                               (standard errors
adjusted for clustering on id)
------------------------------------------------------------------------------
             |               Robust
       meter |      Coef.   Std. Err.      z    P>|z| 
   [95% Conf. Interval]
-------------+----------------------------------------------------------------
        time |   .0800427   .1964444     0.41   0.684 
  -.3049812    .4650666
intervention |  -.3672695   .2872475    -1.28   0.201 
  -.9302643    .1957252
          it |   1.075455   .3101891     3.47   0.001 
   .4674952    1.683414
       _cons |  -.0800427   .2006625    -0.40   0.690 
  -.4733339    .3132485
------------------------------------------------------------------------------

Which is not exactly what SAS produces, but like SAS,
it gives a significant interaction and a
non-significant intervention effect. How do I
interpret the interaction in this context?

Thank you again,
Ricardo.


--- VISINTAINER PAUL <[email protected]>
wrote:
> I haven't' tried this, but I think it will work.  
> 
> Set up your data as:
> 
> Meter usage:  0 - no, 1 - yes
> Time:	0 pre, 1 is post
> Intervention: 0 - no; 1 yes
> 
>      	   meter      time        intervn   id
>   1.         0          1          1 	1
>   2.         0          0          0	1
>   3.         0          1          0	2
>   4.         1          0          0	2
> 
> 		 . . . etc.
> 
> Then, use either xtlogit or logit with cluster(id). 
> You can generate an
> interaction term between intervention and time. 
> Something like:
> 
> .gen it = intern*time
> .logit meter time intervention it, cluster(id)
> 
> 
> 
> Paul Visintainer
> 
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On
> Behalf Of Ricardo Ovaldia
> Sent: Thursday, October 23, 2003 9:29 AM
> To: [email protected]
> Subject: st: Stata's logistic vs. SAS CATMOD WLS
> model.
> 
> Dear all,
> 
> Last week I posted a question and did not received
> any
> replies. I would I appreciate any comments regarding
> the logistic model that I used. Is there a better
> way
> to do this in Stata. I rather not have to use SAS.
> Thank you in advance. Ricardo
> 
> In an intervention study geared to teach diabetics
> about glucose monitoring, 100 patients were
> randomized
> to receive a standard educational method, and 100
> patients to receive a new method. One of the
> outcomes
> of interest is whether or not the patient could use
> the glucose-meter correctly or not, as determined by
> comparing their reported values with those obtained
> by
> a trained laboratory tech. 
> 
> Each patient was tested twice; before the
> intervention
> and two weeks after the intervention. Here is some
> of
> the data excluding covariates.
> 
> . cl
> 
>      interve~n     before      after
>   1.         0          1          1
>   2.         0          0          0
>   3.         0          1          0
>   4.         1          0          0
>   5.         1          1          1
>   6.         1          0          1
>  
> 
> I analyzed this data using -logistic- by including
> -before- as a RHS variable:
> 
>   . logistic after before intervention
> 
> Logistic regression                              
> Number of obs   =        200
>                                                   LR
> chi2(2)      =      46.68
>                                                  
> Prob
> > chi2     =     0.0000
> Log likelihood = -112.38704                      
> Pseudo R2       =     0.1720
> 
>
----------------------------------------------------------------------------
> --
>        after | Odds Ratio   Std. Err.      z   
> P>|z| 
>    [95% Conf. Interval]
>
-------------+--------------------------------------------------------------
> --
>       before |   8.061982    2.90929     5.78  
> 0.000 
>    3.974411    16.35351
> intervention |   2.971752   1.009034     3.21  
> 0.001 
>    1.527546    5.781374
>
----------------------------------------------------------------------------
> --
> 
> 
> which indicates to me that the new method is
> superior
> to the standard method. When I presented the results
> one of the researchers suggested I use SAS's CATMOD
> Weighted Least Squares procedure to analyze these
> data. Following an example in the SAS manual I
> obtained:
> 
>              Analysis of Weighted Least Squares
> Estimates
> 
>                                            Standard 
>  
>     Chi- 
> Effect             Parameter    Estimate      Error 
>  
>   Square    Pr > ChiSq
>  
> Intercept               1         0.5100     0.0293 
>  
>   302.44        <.0001
> intervention            2        -0.0200     0.0293 
>  
>     0.47        0.4952
> time                    3        -0.0750     0.0184 
>  
>    16.63        <.0001
> intervention*time       4         0.0650     0.0184 
>  
>    12.49        0.0004 
> 
> Now, the time-by-intervention is significant but not
> the intervention term. Not being a SAS user, or
> familiar with CATMOD, I am not sure whether or not
> these results contradict my prior analysis. Is there
> any way to do what SAS is doing using STATA? Any
> help
> would be greatly appreciated. Here is the SAS code I
> used:
> 
> proc catmod order=data;
> response marginals;
> model before*after=intervention| _response_;
> repeated time;
> 
> Thank you,
> Ricardo.
> 
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product
> search
> http://shopping.yahoo.com
> *
> *   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/
> *
> *   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/


=====
Ricardo Ovaldia, MS
Statistician 
Oklahoma City, OK

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
*
*   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