Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
Nick Cox <njcoxstata@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Need help with working across variables |

Date |
Sun, 10 Feb 2013 10:50:23 +0000 |

See http://www.stata.com/support/faqs/data-management/listing-observations-in-group/ -egen- is not needed here. bysort id (whatever) : gen same = whatever == whatever[1] | missing(whatever) Any non-missing numeric values are sorted to the beginning of each group. This is really is an FAQ: e.g. http://www.stata.com/statalist/archive/2013-01/msg00502.html Nick On Sun, Feb 10, 2013 at 5:57 AM, Cory Smith <corybsmith@gmail.com> wrote: > You'll need the "by" command if you have used it before. > > Cory > > On Sun, Feb 10, 2013 at 12:56 AM, Cory Smith <corybsmith@gmail.com> wrote: >> All non-missing observations will be the same iff the minimum value >> equals the maximum value. You can fill in the rest given the previous >> code, I think. >> On Sun, Feb 10, 2013 at 12:53 AM, Michael Stewart >> <michaelstewartresearch@gmail.com> wrote: >>> Dear Cory, >>> This works, >>> Thanks a lot >>> on the same lines have another question >>> >>> id var >>> 1 2 >>> 1 2 >>> 1 3 >>> 1 2 >>> 2 1 >>> 2 1 >>> 2 1 >>> 2 . >>> 2 1 >>> 3 1 >>> 3 2 >>> 3 4 >>> >>> How do I check of all(nonmissing) observations for a particular id are the same * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/

**References**:**st: Need help with working across variables***From:*Michael Stewart <michaelstewartresearch@gmail.com>

**Re: st: Need help with working across variables***From:*Alison Connor <alison.connor@gmail.com>

**Re: st: Need help with working across variables***From:*Cory Smith <corybsmith@gmail.com>

**Re: st: Need help with working across variables***From:*Michael Stewart <michaelstewartresearch@gmail.com>

**Re: st: Need help with working across variables***From:*Cory Smith <corybsmith@gmail.com>

**Re: st: Need help with working across variables***From:*Cory Smith <corybsmith@gmail.com>

- Prev by Date:
**Re: st: reshaping database with dates ordered in wide format to long format** - Next by Date:
**Re: st: Need help with working across variables** - Previous by thread:
**Re: st: Need help with working across variables** - Next by thread:
**Re: st: Need help with working across variables** - Index(es):