Announcement

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

  • 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

  • #2
    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.

    Comment


    • #3
      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

      Comment


      • #4
        Hi Ali and Rhys,

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

        Best,
        Li

        Comment

        Working...
        X