Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Assign highest value per group to all members of that group


From   Owen Corrigan <ocorrigan@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Assign highest value per group to all members of that group
Date   Fri, 4 Feb 2011 17:56:40 +0000

My data contains individual observations (taking a value 0-8 on indep
variable X) divided into small unequal groups, where each group is
uniquely identified by a grouping variable (G). I want to identify the
highest value on X in each group uniquely identified by G and generate
a new variable assigning that value to all members of that group. It
should be a simple task, but standard data manipulation commands don't
seem up to it, and I'm not versed in writing code or loops in Stata.

Any quick and simple solutions greatly appreciated.

Yours,
O. Corrigan
University of Dublin.
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index