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

From |
"Eric A. Booth" <ebooth@ppri.tamu.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: AW: st: local containing (all) variables' names in a dataset |

Date |
Tue, 18 Aug 2009 09:39:01 -0500 |

Thanks, Eric __ Eric A. Booth Public Policy Research Institute Texas A&M University ebooth@ppri.tamu.edu Office: +979.845.6754 On Aug 17, 2009, at 3:15 PM, Nick Cox wrote:

Thanks to Eric and to other friends of -ds- for various plugs. There is some risk here of various small confusions. Let me clarify. 1. The official version of -ds- is the latest version there is. It incorporates all my contributions that have lasting value, in my view that is. 2. Otherwise this is the story: ds5 on SSC is for Stata 5. ds2 on SSC and in STB-56 is for Stata 6. ds2 in STB-60 is for Stata 7. ds3 on SSC is for Stata 7.So, unless you are using an ancient Stata, the previous versions areofno current interest. They aren't even of historic interest! The key point is that both the STB and SSC are archives, and thus inevitably contain some superseded and obsolete stuff. Nick n.j.cox@durham.ac.uk Eric A. Booth It's been updated to newer versions by Nick Cox--see -ds3- and -ds5- ssc install ds3 ssc install ds5 On Aug 17, 2009, at 1:06 PM, David Jacobs wrote:But -ds- still can be found after -help-Martin Weiss" a real hidden gem" Now demoted to "previously documented" status in Stata 11, though. Grrr....Augusto Cadenasthank you very much for these quick answers. -ds- seems todo a very fine job, a real hidden gem, as Martin wrote. (and yes,I'maware that I'm replacing the original dataset.)On Mon, Aug 17, 2009 at 3:49 PM, Martin Weiss<martin.weiss1@gmx.de> wrote:On -ds- also seehttp://www.stata-journal.com/article.html?article=dm0040 Scott MerrymanYou can use macro list. See -help macrolists- For example: . sysuse auto ,clear (1978 Automobile Data) . ds make mpg headroom weight turn gear_ratio price rep78 trunk lengthdisplacementforeign . local a = r(varlist) . local b make rep78 . local c:list a - b . disp "`c'" price mpg headroom trunk weight length turn displacementgear_ratio foreignOn Mon, Aug 17, 2009 at 8:38 AM, Augusto CadenasI have to collapse a series of datasets and I would appreciateyourhelp. The issue is that these datasets have different variables,butalways the same variable by which I want to collapse. So I haveto runthe following command: collapse (mean) id (sum) [all other variables here], by(name) And I would like to embed this in a foreach loop of the type local datasets `"dataset1 dataset2 dataset3"' foreach X of local datasets { use `X', clear collapse (mean) id (sum) [all other variables here], by(name) save, replace } The issue for me is how to create a local that contains thenames ofall variables in each dataset, except for "name" and "id". Any suggestions are appreciated!* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**RE: AW: st: local containing (all) variables' names in a dataset***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**Re: AW: st: local containing (all) variables' names in a dataset***From:*Ulrich Kohler <kohler@wzb.eu>

**References**:**st: local containing (all) variables' names in a dataset***From:*Augusto Cadenas <aug.cadenas@googlemail.com>

**Re: st: local containing (all) variables' names in a dataset***From:*Scott Merryman <scott.merryman@gmail.com>

**Re: st: local containing (all) variables' names in a dataset***From:*Augusto Cadenas <aug.cadenas@googlemail.com>

**AW: st: local containing (all) variables' names in a dataset***From:*"Martin Weiss" <martin.weiss1@gmx.de>

**Re: AW: st: local containing (all) variables' names in a dataset***From:*David Jacobs <jacobs.184@sociology.osu.edu>

**Re: AW: st: local containing (all) variables' names in a dataset***From:*"Eric A. Booth" <ebooth@ppri.tamu.edu>

**RE: AW: st: local containing (all) variables' names in a dataset***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

- Prev by Date:
**st: RE: AW: year is not regularly spaced** - Next by Date:
**st: RE: AW: year is not regularly spaced** - Previous by thread:
**RE: AW: st: local containing (all) variables' names in a dataset** - Next by thread:
**Re: AW: st: local containing (all) variables' names in a dataset** - Index(es):

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