Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Li Zhang
    started a topic extract specific part of dataset

    extract specific part of dataset

    Hi All,
    I have such a dataset, I would like to extract the second-highest value in each auction to generate wb= bid`wn', but when I did this, I did not get luck. Any help would be appreciated! Thanks!
    Attached Files

  • Li Zhang
    replied
    Hi Ali and Rhys,

    Thank you both a lot. I will not post .dta file again. Sorry about any inconvenience.

    Best,
    Li

    Leave a comment:


  • Rhys Williams
    replied
    Hi Li,

    As per the FAQs (https://www.statalist.org/forums/help) you are asked not to post the .dta file but instead an excerpt of your data.

    Best,
    Rhys

    Leave a comment:


  • Ali Atia
    replied
    Code:
    reshape long bid, i(auction) j(new)
    drop if bid ==.
    bys auction_id: egen wb = max(cond(new==wn,bid,.))
    reshape wide
    Crossed with #3, with which I agree wholeheartedly. Please use -dataex- for ease of response.

    Leave a comment:

Working...
X