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

Re: st: selecting variables by their format

To   Stata _ <>
Subject   Re: st: selecting variables by their format
Date   Wed, 14 Sep 2005 16:08:50 -0400


Thanks much! The key new thing for me was -type-, which I thought only 
applies to whole datasets, not variables. This helped in sorting out 
the string from the numeric variables, which allows me to collapse the 
numeric part of the dataset. As to the string part, I am still 
wondering how I can collapse the original dataset, once purged of the 
numeric variables, according to some string criteria. I want to 
collapse them to give the highest "value" by some variable, say by 
location. That is, if I have:

location    var1  var2
place1      a      X
place1      b      m
place1      c      
place2      f      2
place2      F      5
place2      9      10
place3             k
place3             p

after collapsing that should give:

location   var1   var2
place1      c      m
place2      f      2
place3             p

The purpose of this is to see for which locations there are no 
observations (in this case, it is for place3 in the case of var1).


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