Announcement

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

  • weights are not allowed r(101) HEEEEELP!!!!

    Ive been trying to add dato to a new file but it keeps coming the error weights are not allowed r (101) if someone can help me ill appreciate it.

  • #2
    Welcome to Statalist. More info is needed. We really need to see some code and output in order to advise you. If possible, provide part of your data using dataex. See pt. 12 of the FAQ.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    Stata Version: 17.0 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Welcome to Statalist.

      Richard is correct - without seeing what you've told Stata, we cannot tell you what was wrong with what you told it. We can only guess.

      My guess is that you have misinterpreted Stata documentation. In the documentation the convention in describing command syntax is to put "square brackets" ("[" and "]") around optional command arguments. For example, the output of help input tells us
      Code:
      Syntax
      
             input [varlist] [, automatic label]
      telling us that the varlist is optional, as are the comma and all the options following it.

      You are not intended to type the square brackets. Those characters, when typed as part of a command, are used to designate weights. Given the error message you received, I think you typed square brackets on whatever command you used to try to add data to the file.

      With that said, to improve future posts, please review the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post. See especially sections 9-12 on how to best pose your question.

      Comment


      • #4
        Thank you very much!! the error is gone. Next time ill put the codes. Im new in the Stataworld….Thank you both once again!!

        Comment


        • #5
          Can someone please help me, I am new at stata (less than a month). I am in the process of declaring the survey data and tabulating the survey data. But I keep getting an error.
          Below is my command:

          svyset psu [pweight=person_wgt], strata(prov) //declare survey data
          svy:tabulate sex [aw=person_wgt] //tabulate survey data
          svy:tabulate agecategories [aw=person_wgt] //tabulate survey data
          svy:tabulate race [aw=person_wgt] //tabulate survey data

          and the error I keep getting is as follows:

          svy:tabulate sex [aw=person_wgt] //tabulate survey data
          weights not allowed with the svy prefix;
          the svy prefix assumes survey weights were already specified using svyset
          r(101);


          Can someone maybe tell me where I am going wrong?

          Comment


          • #6
            in your -svyset- command above, you have told Stata what to use for weights and how to use them; then, when you ask for an analysis using the -svy- prefix, you do not need to, in fact are not allowed to, mention the weights again - which is what the error message is telling you; in particular, you are not allowed to change the type of weighting (as you attempted to do); so, try again but do NOT include the "[aw=person_wgt]" part of your commands

            Comment


            • #7
              Thank you Rich Goldstein. I am no longer getting that error.

              Comment

              Working...
              X