Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Mixed Model (SAS to Stata)


From   "Raphael Fraser" <[email protected]>
To   [email protected]
Subject   Re: st: Mixed Model (SAS to Stata)
Date   Fri, 20 Apr 2007 19:54:54 -0500

You are correct. Model 2 is a typo. I managed to figure out the code
though.  The last line in Model 2 is testing an hypothesis. After
running xtmixed we could use the post estimation command -test-: test
year - age = 0. Model 3 likewise,
test sex*year - 10*age*year = 0.

I am some what disappointed though that Stata cannot run Model 1. I
hope you are wrong.

Thank you.

Raphael

On 4/20/07, Philip Ender <[email protected]> wrote:
Raphael Fraser wrote:

  Thanks Phil. It worked. I have three more model to imitate in Stata if
  any one is able to:

  1) I tried using -xtregar- but didn't work and it appear xtmixed does
  not have the AR(1) option.
  proc mixed data=cholst;
      class newid;
      model cholst = year / s;
      random intercept year / type=un subject=newid g;
      repeated / type=ar(1) subject=newid;
  run;

  2) don't understand the last line of code.
  proc mixed data=cholst;
      class newid;
      model cholst = year / s;
      random intercept year / type=un subject=newid g;
      repeated / type=vc subject=newid;
      estimate "long-cross" year 1 age -1;
  run;

  3) again, don't understand last line.
  proc mixed data=cholst;
      class newid;
      model cholst = sex age year sex*year age*year  / s;
      random intercept year / type=un subject=newid g;
      repeated / type=vc subject=newid;
      estimate "rate-diff" sex*year 1 age*year -10;
  run;

Stata will not run model 1).  The -xtregar- does not do random slopes.
 Maybe level 1 covariance structures for -xtmixed- will be available
in a future release.  Model 2) makes no sense because age does not
appear in the model statement. I think the last line model 3) is
trying to get an estimate for a particular combination of levels but I
can't tell from the SAS code exactly what is wanted.   I suspect that
in Stata this would be handled by -lincom- but the exact specification
eludes me.

--
Phil Ender
Statistical Consulting Group
UCLA  Academic Technology Services
*
*   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/



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