[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Re: xtmixed SAS to Stata

From   "Joseph Coveney" <>
To   <>
Subject   st: Re: xtmixed SAS to Stata
Date   Thu, 27 Aug 2009 01:36:49 +0900

Ricardo Ovaldia wrote:

I was give the following SAS code and want to replicate in Stata. I am not sure
how to do this.

SAS code:
      proc mixed data=nutrit.main covtest; 
      class  ParticipantID Gender feedgroup;
      model WeightAvgKg=Gender|feedgroup|Time GestAgeWks DietHxScore/solution ;
      repeated / type=un subject=ParticipantID;
      ods output Tests3=WeightAvgKg ;


Wouldn't it be something similar to the following?

xtmixed WeightAvgKg i.gender##i.feedgroup##c.Time c.GestAgeWks ///
    c.DietHxScore || ParticipantID: , residuals(unstructured) t(Time) ///
    variance nolrtest

For the Tests3 ODS option, you'll want to construct the contrasts yourself for
the so-called Type 3 tests of fixed effects.  You can see how they're done at .

I think that COVTEST also prints out Wald tests for the variance components in
addition to Wald-based confidence intervals.  I'm advised that these are best
considered as entertainment.

Joseph Coveney

*   For searches and help try:

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