Announcement

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

  • merge 1:1 pidp with keepusing(.....)

    Dear Stata Forum,

    this seems to be a rather straightforward task, but I receive an error message for whatever reason.
    I use the UKHLS or Understanding Society. It seems to me that e_englang should be the only variable used from the using dataset, instead I receive the error message below.
    Any ideas anyone?

    I would as usual appreciate your help.

    Best wishes.


    use pidp a_englang using "$Stata11_se/a_indresp_protect", clear // master data set

    merge 1:1 pidp using "$Stata11_se/e_indresp_protect.dta" , keepusing(e_englang) nogen // merge master with using dataset while only using the variable e_englang.

    Error message in red:
    no room to add more variables
    Up to 2,048 variables are allowed with this version of Stata. Versions are available that allow up to 32,767 variables.

  • #2
    for each of the two files, please show the result of
    Code:
    describe, short
    and put the command and the results in CODE blocks (as I have done here) - see the FAQ if you don't understand

    Comment


    • #3
      I appreciate your prompt reply. I hope this is what you wanted.

      Thank you.


      Code:
      use "$Stata11_se/a_indresp_protect", clear
      Code:
      desribe, short
      Contains data from F:\UnderstandingSocietyData\Data\stata\stata11_se/a_indresp_protect.dta
      obs: 50,994
      vars: 1,417
      size: 95,103,810
      Sorted by:
      Code:
      use "$Stata11_se/e_indresp_protect", clear
      Code:
      desribe, short
      no room to add more variables
      Up to 2,048 variables are allowed with this version of Stata. Versions are available that allow up to 32,767 variables.





      Comment


      • #4
        it sounds like your second file has too many variables for your version of Stata; try using the second syntax in the help file
        Code:
        describe using filename, short
        replacing my "filename" with your actual filename

        Comment


        • #5
          Code:
          describe using "$Stata11_se/e_indresp_protect", short
          Code:
          Contains data                                 
            obs:        44,903                          
           vars:         2,621                          
           size:   135,786,672                          
          Sorted by:
          Really appreciate your help. Thanks.

          Comment


          • #6
            Seems the limits of your version of Stata will not allow loading the 2621 variables from the using dataset.

            You can still load a smaller selection of variables form the using dataset doing e.g,:
            Code:
             
             use  pidp e_englang using "$Stata11_se/e_indresp_protect"
            ​​​​​​​then save this set, and use that as the using dataset for your merge command

            Comment


            • #7
              Done and dusted. It worked.

              Thank you very much Jorrit and Rich.

              Have a great day.

              Comment

              Working...
              X