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

From |
"Daniel Schultz" <schultzd@tcd.ie> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: Loop over variables with svyset |

Date |
Tue, 18 Nov 2008 16:26:37 +0000 |

Hej stata user.... Maybe this question is too easy for you, but i am kicking it around since a week ore so and couldn't find a proper solution. I have a dataset with 1200 variables of a survey. This survey was held over a couple of years. What I want to do is extracting a codebook of the dataset. Therefore every variable should be tabbed according to their surveyweight. The variable structure looks like this: Q0001_02 Q0001_07 Q0002_02 Q0002_03 Q0002_07 etc. Were the extension _0X indicates the year and the Prefix Qaaaa indicates the question number, which is the same over the years. Since I need the tables afterwards in an extrenal program (LaTex) all the Variables should be proceed in the correct order. The problem is, that not every question was asked in every year, that I really need to change the survey weight after every variable for the new variable, depending on the extension. I tried a lot, but couldn't get a proper solution. For only one Variable the syntax should be as followed: svyset Q1170_02 *this is the weight variable svy:tab Q0001_02 I tried to build a loop based on this, but all my tries didn't work. Maybe one of you has an idea. That would be great. Best Daniel * * 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: st: Loop over variables with svyset***From:*"Stas Kolenikov" <skolenik@gmail.com>

**Re: st: Loop over variables with svyset***From:*Steven Samuels <sjhsamuels@earthlink.net>

**Re: st: Loop over variables with svyset***From:*"Friedrich Huebler" <fhuebler@gmail.com>

- Prev by Date:
**st: RE: RE: RE: How to Export first-stage of IV (e.g. with ivreg2) to Latex (e.g. with outreg2) ?** - Next by Date:
**st: RE: -xi- and c(changed) [was: How to Export first-stage of IV (e.g. with ivreg2) to Latex (e.g. with outreg2) ?]** - Previous by thread:
**st: GLAMM and nested logit/probit** - Next by thread:
**Re: st: Loop over variables with svyset** - Index(es):

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