Announcement

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

  • assign number of pooled data

    Apologies for cross posting

    Hi all,

    I need assign a number to pooled data, here i attach an example to my request.

    Please any advice i would appreciate.

    Thanks in advance.

    regards

  • #2
    The question is more readable, but no less mysterious, at http://stackoverflow.com/questions/2...to-pooled-data

    As pointed out there,

    What the rule is here is unclear. With ranking rules, it is standard that the same values get the same ranks, so you want something else.

    On a different note, the etiquette for cross-posting is to say where you also posted, so that people can check whether the question has been answered in the other place(s).


    See also the comment in your other recent thread about using full real names. That's the standard practice here, unlike talkstats and Stack Overflow, where you also ask questions.
    Last edited by Nick Cox; 08 May 2014, 04:22.

    Comment


    • #3
      Dear Nick,

      thanks for you reply, yes i know that i dont have rule to pool o cluster my data pooled lamentably pooled data are events in diferents date and are randomly across my datasheet.

      I did tried to be polite with the sentntence: Apologies for cross posting.

      Really I did try to change my nick name, but lamentably is not possible, if you know how make it, I am ready to change it.

      regards

      Comment


      • #4
        What I understand is that you want to assign ordered numbers to subsets of observations formed by contiguous non-missing values of another variable. If this is the case, part of the answer in a more recent question you posted should work:

        Code:
        clear all
        set more off
        
        *------  example data -----
        
        input ///
        pred1 pred2 pred3
        . . .
        . 3 .
        . 2 .
        . . .
        5 . .
        7 . .
        . . 4
        . . 4
        1 . .
        3 . .
        2 . .
        . 1 .
        . 8 .
        . . .
        . . .
        . 6 .
        . 9 .
        . . .
        end
        
        list, sep(0)
        
        *------ what you want -----
        
        gen ord = _n
        foreach v of varlist pred1-pred3 {
        
            * create a variable that flags each "group"
            gen `v'i = sum(!missing(`v') & missing(`v'[_n-1]))
            replace `v'i = 0 if missing(`v')
            
            * sort back to original order to work on next variable
            sort ord
        }
        
        drop ord
        list, sep(0)
        Yet an additional post you made at Stack Overflow seems to be about the same thing, except there, you called the variable of interest "rank" which can cause confusion since there is no ranking involved. (You should probably try to fix that post to clarify whatever needs clarification; or simply delete it. It is "on hold".)
        You should:

        1. Read the FAQ carefully.

        2. "Say exactly what you typed and exactly what Stata typed (or did) in response. N.B. exactly!"

        3. Describe your dataset. Use list to list data when you are doing so. Use input to type in your own dataset fragment that others can experiment with.

        4. Use the advanced editing options to appropriately format quotes, data, code and Stata output. The advanced options can be toggled on/off using the A button in the top right corner of the text editor.

        Comment


        • #5
          Hi, yes you answered this question in a past post i did try to solve my problem in diferent ways, you solve that. thanks again

          Comment

          Working...
          X