Announcement

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

  • #31
    Good morning, thanks for taking the time:

    Here I report a part of my base:



    input double SH26 int(SH26O_1 SH26T_1 SH26O_2 SH26T_2)
    . . . . .
    0 . . . .
    0 . . . .
    0 . . . .
    0 . . . .
    . . . . .
    . . . . .
    . . . . .
    0 . . . .
    . . . . .
    . . . . .
    0 . . . .
    0 . . . .
    0 . . . .
    1 2 1 . .
    . . . . .
    0 . . . .
    0 . . . .
    0 . . . .
    . . . . .
    0 . . . .
    . . . . .
    . . . . .
    . . . . .
    0 . . . .
    0 . . . .
    0 . . . .
    . . . . .
    . . . . .
    0 . . . .
    0 . . . .
    0 . . . .
    1 1 1 . .
    . . . . .
    . . . . .
    0 . . . .
    . . . . .
    0 . . . .
    0 . . . .
    . . . . .
    . . . . .
    0 . . . .
    . . . . .
    . . . . .
    . . . . .
    0 . . . .
    . . . . .
    1 1 1 . .
    0 . . . .
    . . . . .
    end
    Last edited by MIGUEL IPANAQUE; 22 Mar 2018, 09:11.

    Comment


    • #32
      Please re-read #30 and provide the other information requested. The data alone is not enough to help you.

      Also, this data example is not useful because you omitted the HHID variable from it.

      Comment


      • #33
        Good morning Clyde, thank you here I provide the error code and a sample with dataex:
        1. Error Code :
        tempfile copy
        save `copy'
        keep HHID SH27O* SH27T*
        gen long obs_no = _n
        reshape long SH27O_ SH27T_, i(obs_no) j(_j)
        rename *_ *
        assert missing(SH27O) == missing(SH27T)
        drop if missing(SH27O)
        drop obs_no _j
        rename SH27O V003
        merge 1:1 HHID V003 using `copy', assert(match using) generate(_mergeSH27T)
        order SH27T, after( SH27T_2)
        sort HHID V003
        drop SH27O_*SH27T_*
        drop SH27O_1 SH27T_1 SH27O_2 SH27T_2
        1. sample with dataex:
        Code:
        * Example generated by -dataex-. To install: ssc install dataex
        clear
        input str12 HHID double(V003 SH27) int(SH27O_1 SH27T_1 SH27O_2 SH27T_2)
        "     0002011" 2 . . . . .
        "     0002015" 2 1 2 2 . .
        "     0002019" 2 0 . . . .
        "     0002036" 2 0 . . . .
        "     0002040" 1 0 . . . .
        "     0002040" 3 . . . . .
        "     0002044" 3 . . . . .
        "     0002044" 2 . . . . .
        "     0002052" 2 1 2 2 . .
        "     0002052" 4 . . . . .
        "     0002052" 3 . . . . .
        "     0002060" 2 0 . . . .
        "     0002064" 2 0 . . . .
        "     0002069" 2 0 . . . .
        "     0002073" 1 0 . . . .
        "     0002073" 5 . . . . .
        "     0002077" 2 0 . . . .
        "     0002081" 2 0 . . . .
        "     0002089" 1 0 . . . .
        "     0002105" 2 . . . . .
        "     0002114" 2 0 . . . .
        "     0003006" 2 . . . . .
        "     0003014" 2 . . . . .
        "     0003022" 4 . . . . .
        "     0003034" 1 0 . . . .
        "     0003038" 2 0 . . . .
        "     0003046" 2 0 . . . .
        "     0003050" 3 . . . . .
        "     0003050" 2 . . . . .
        "     0003054" 2 1 2 1 . .
        "     0003058" 2 0 . . . .
        "     0003062" 2 0 . . . .
        "     0003066" 2 0 . . . .
        "     0003070" 2 . . . . .
        "     0003070" 8 . . . . .
        "     0003082" 2 0 . . . .
        "     0003082" 3 . . . . .
        "     0003094" 2 0 . . . .
        "     0003102" 1 0 . . . .
        "     0003110" 2 . . . . .
        "     0003122" 2 . . . . .
        "     0004003" 2 0 . . . .
        "     0004003" 5 . . . . .
        "     0004006" 6 . . . . .
        "     0004006" 3 . . . . .
        "     0004009" 2 0 . . . .
        "     0004013" 4 . . . . .
        "     0004016" 2 0 . . . .
        "     0004019" 3 1 3 1 . .
        "     0004019" 2 . . . . .
        end
        label values SH27 No_Si
        label def No_Si 0 "No", modify
        label def No_Si 1 "Si", modify
        label values SH27T_1 Si_No_Ns
        label values SH27T_2 Si_No_Ns
        label def Si_No_Ns 1 "Si", modify
        label def Si_No_Ns 2 "No", modify

        Comment


        • #34
          Running the code in #33 with the data in #33, I find the following errors:

          1. The statement -drop SH27O_*SH27T_*- requires a space between SH27O_* and SH27T_*.

          2. When that is corrected, the following statement, -drop SH27O_1 SH27T_1 SH27O_2 SH27T_2- is no longer appropriate because these variables have already been dropped by the preceding command. So just eliminate the last two drop commands and replace them with just this one:

          Code:
          drop SH27O_* SH27T_*
          Note also that the code does not produce an r(9) error message with this data. So if you continue to have that problem, you will need to find another subset of the data to show as an example that leads to that message. The data you currently show do not cause the code to have that problem.

          Comment

          Working...
          X