Statalist The Stata Listserver

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

st: RE: beginners problem with stata ado file and syntax of varlist

From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: beginners problem with stata ado file and syntax of varlist
Date   Thu, 6 Apr 2006 23:19:40 +0100

I really think you will be better off getting
to grips with interactive solutions here, 
before trying to write a program. This is 
a fairly odd problem, and you might as well
tackle it directly. 

Suppose you decide that the country in observation
42 is the critical one: 

foreach v of var <whatever> { 
	if `v'[42] < <cutoff> drop `v' 

That solves 1. You just plug in <whatever> you want. 

And 2. 

On your sidenote: 

help ds 
help unab 

[email protected] 

Steffen H. Gr´┐Żning
> I have countries in rows and the series in columns. what I 
> want it to do
> is to look through all my variables (which are too many to 
> list them all by
> hand) and drop those variables which have a smaller value 
> than the [if]
> for one country (in this case country 1 on the vertical axis when
> browsing).
> so far this thing works quite well, but what i cant figure out:
> 1. could I tell it not to take on certain variables/ make an exception
> for some variables? If so, how?
> 2. is there a way of specifying which country to look for when calling
> the program? (right now i would have to change the programm 
> if i wanted
> it to look for country 2, 3, 4 etc.)
> And just on a sidenote: how can i get stata to just make a list of all
> available variables?

*   For searches and help try:

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