Announcement

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

  • generate indicator for mother column

    .
    Last edited by ajay pasi; 23 Dec 2022, 05:13.

  • #2
    Code:
    foreach v of var NF* {
        gen `v'_is_max = `v' == max(NF12, NF32, NF52)
    }
    (1, .) indicators are more or less useless in practice, so the code creates (1, 0) indicators. If your real problem has many more original variables, it will be more practical to use egen first rather than max() on the fly. Contrariwise, if your real problem has 30 or 300 variables, 30 or 300 more variables as indicators isn't going to make analysis much easier.

    Comment


    • #3
      thank you sir. I figured it out.

      Comment


      • #4
        Why oh why are you deleting the original question?

        That is antisocial behaviour. I decline to answer any more of your questions until you learn how to use Statalist with respect.

        You are wasting my time and that of others. I provide answers in good faith and do not expect my answers to be rendered meaningless or hard to follow because the OP deleted the question. The main point of Statalist is that other people will have the same or similar problems: it is not to act as a personal helpline.

        There are three serious possibilities.

        1. Read the FAQ Advice in this particular case https://www.statalist.org/forums/help#closure on why you should not post and then quickly delete stuff without compelling reasons. Then reinstate the question.

        2. For some reason you are fearful that people will steal your work. This is usually exaggerated, but if it is what you fear, you need a private consultant, not to use and abuse public forums. Or if your data are confidential, well that is explained too in the FAQ Advice.

        3. If you continue to act in this way, active people will rapidly join me in ignoring your questions.

        Comment


        • #5
          I apologize, sir. But there was a difference of only milliseconds between deleting the post and your response to the post, so I could know that you responded to the post, only after the deletion. I would have never deleted the post to which you have responded, had I known. Yet, I agree I should be more aware of statalist user guide. I am learning to be highly respectful of community norms, every day. Moreover, the statalist community has proven to be very crucial to my research-journey by enabling me to apply tricky codes in stata, for that I am tankfull for all the support and encouragement. I am once again deeply apologetic if I have ever offended anyone because of my childish mistakes.

          regards,
          ajay

          Comment


          • #6
            Thanks very much for your apology.

            There is no scope now for editing #1. There is every scope for rewriting the question now as another post, so that the thread makes sense to future readers. Your question does not have to be a verbatim copy of your original, just close enough for an answer to make sense.

            After 3 years on the forum and over 100 posts it is fairly expected that you should be familiar with all the details of the FAQ Advice, both

            https://www.statalist.org/forums/help

            and

            https://www.statalist.org/forums/help#adviceextras

            -- much of which is relevant to points of procedure emphasised to you recently. None of what is advised is a rule to trip you up -- all points are requests arising from long collective experience on Statalist since 1994 about what works best for all.






            Comment


            • #7
              I get the point, sir. Thank you for guiding me in the right direction. Moreover, I deeply respect your contribution to the community.

              Comment

              Working...
              X