Announcement

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

  • Chi2 test with iweights

    Hi,

    I am trying to do a chi2 test with weighted data (iweights), but I have not found a useful command.
    I do not know which variable to use for psu - is it possible to do weighted chi2 without a psu variable?

    Thank you in advance!

  • #2
    It's hard to see that chi-square tests -- presumably you're referring to analysis of counted frequencies in a contingency table -- make any sense unless you are dealing with such counted frequencies, directly or through frequency weights.

    There's, I guess, a more appropriate analysis for what you're doing -- but if it's survey data without survey details even the svy-savvy (not me) might struggle to advise.

    Comment


    • #3
      see
      Code:
      help svy_estimation
      which shows you that tab can be used with survey data

      Comment


      • #4
        what command are you using?

        Comment


        • #5
          Hi George

          I have tried some different commands including:
          Code: tabulate occupation belief [iweight= weights2], chi2
          Error: option chi2 not allowed

          Code: crosstab occupation belief [iweight=weights2], chi2
          Error: command crosstab is unrecognized

          AI recommended the following command, but as I wrote in my question I am not sure which psu variable to use, so if possible I would like to avoid this command:
          Code: svyset [weights2], psu([variable x])
          strata ([belief])
          svy: tabulate occupation, row chi2

          Comment


          • #6
            Two things.

            1) From -help weight-, you should take serious caution in using -iweights- unless you know that this is the correct approach. To quote from the documentation (emphasis mine):

            4. iweights, or importance weights, are weights that indicate the "importance" of the observation in some vague sense. iweights have no formal statistical definition; any command that supports iweights will define
            exactly how they are treated. Usually, they are intended for use by programmers who want to produce a certain computation.
            I've not seen iweights used with survey data, so I can't advise further.

            AI recommended the following command, but as I wrote in my question I am not sure which psu variable to use, so if possible I would like to avoid this command:
            2) It's my firm belief that using "AI" when you are not already an experienced user is asking for folly.

            If you have survey data, then you should be able to go to the producer of that survey for documentation on precisely how you need to account for its design. Again, we can't advise further since we don't know your survey.

            Comment


            • #7
              The mention of crosstab is a case in point about the limitations of AI. Unless someone knows otherwise, it appears to be an hallucination. Naturally, many people refer to cross-tabulation and more informally to a crosstab, and I found mention of a procedure with that name in SUDAAN, but as far as I know there is no such Stata command.

              Comment

              Working...
              X