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

st: RE: swaic for model selection with AIC

From   "Steichen, Thomas J." <>
To   <>
Subject   st: RE: swaic for model selection with AIC
Date   Thu, 23 Sep 2004 15:09:57 -0400

Listers -

Further investigation into -swaic- reveals that it makes version 6 assumptions about the variable names generated by -xi-.  In
particular, it assumes that -xi- generates variables with a capital "I". But, as the Stata commands below show, in Version 7 and
later -xi- generates variables starting with "_I". (This is NOT documented under -help version-.)

.. version 8.2
.. xi i.expose
i.expose          _Iexpose_1-3        (naturally coded; _Iexpose_1 omitted)

.. version 7
.. xi i.expose
i.expose          _Iexpose_1-3        (naturally coded; _Iexpose_1 omitted)

.. version 6
.. xi i.expose
i.expose              Iexpos_1-3   (naturally coded; Iexpos_1 omitted)

For this reason, caution needs to be used when mixing -xi- and -swaic-.  For those interested, I now have a version of -swaic- that
works correctly with Version 7 and later -xi-.


Thomas J. Steichen
   "If your result needs a statistician then you should design a better experiment."
     - Ernest Lord Rutherford: physicist, chemist & mathematician extraordinaire

-----Original Message-----
From: [] On Behalf Of Paul Silcocks
Sent: Thursday, September 23, 2004 12:10 PM
Subject: st: swaic for model selection with AIC

I'm desperately seeking some help from an experienced Stata programmer!  I am using the Stata insert swaic for an automatic model
selection (findit swaic will direct you to the program and help file).

However for my purposes I need to extract the names of the variables chosen for the final best-fitting model (as a string, say).
Unfortunately the swaic procedure doesn't seem to save the results and the variables used in the final model seem to be buried in
various local macros and I've not been successful at modifying the ado-file, even though it looks as if a single line at the right
place would do the job.  Ideally I'd extract the minimum AIC value as well, but I can live with running the "best" model one extra
time to calculate the AIC.
Can anybody help me please? I've tried contacting the author, Dr Zhiqiang Wang at Australia's Menzies University, but without
success (he may not even be there now) and I've run out of ideas.

Paul Silcocks BM BCh, MSc, FRCPath, FFPH, CStat
Clinical Senior Lecturer
Trent Institute for Health Services Research
Room B39
School of Community Health Sciences
University of Nottingham Medical School

tel +44 (0) 115 9709765

This message has been scanned but we cannot guarantee that it and any attachments are free from viruses or other damaging content:
you are advised to perform your own checks.  Email communications with the University of Nottingham may be monitored as permitted by
UK legislation.

*   For searches and help try:

CONFIDENTIALITY NOTE:  This e-mail message, including any  attachment(s),
contains information that may be confidential,  protected by the attorney-
client or other legal privileges, and/or  proprietary non-public
information.  If you are not an intended  recipient of this message or an
authorized assistant to an intended  recipient, please notify the sender by
replying to this message and  then delete it from your system.  Use,
dissemination, distribution,  or reproduction of this message and/or any of
its attachments (if  any) by unintended recipients is not authorized and
may be unlawful.

*   For searches and help try:

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