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

st: selecting all variables but a few

From   Ada Ma <>
Subject   st: selecting all variables but a few
Date   Tue, 11 May 2004 19:29:18 +0100

Hello Statalist,

I want to do something like this:

foreach var of varlist * {
replace `var'=`var'[_n-1] if pid==pid[_n-1] & `var'==.
replace `var'=`var'[_n+1] if pid==pid[_n+1] & `var'==.

My problem is that I have a large number of variables in my dataset and I don't want my commands to be applied to ALL variables. What commands can I use to select all variables but a few?

Many thanks in advance.


Ada Ma
Research Assistant
Department of Economics
University of Aberdeen Business School
Edward Wright Building F55
Tel: +44 1224 273417
Fax: +44 1224 272181

* For searches and help try:

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