Announcement

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

  • P-value from table1mc table

    Hello,

    I made a table using the table1mc command and have three columns, a total, respondents who have undergone an intervention, and those who have not. Table1mc displays a p-value for those 2 different groups.
    However, I cannot use survey weights with the table 1 command, so I would like to re-do the table manually (unless someone knows how say would work with table1mc).
    The problem I have is that I dont know how to calculate the p value for the difference between intervention/non intervention (it is a variable with either 0 = no for the ones who have not been part of the program or 1 = yes for the ones who have) using the svy command.
    I feel like this should be pretty simple to do but I am new to Stata and couldnt figure this out so would appreciate any help!

  • #2
    What command are you using with the -svy- prefix? Do you have stratification?

    Comment


    • #3
      the -table1_mc- command (note spelling) from SSC (as you are asked to explain - see the FAQ), accepts pweights and that is how you should use this command with survey data; see
      Code:
      h table1_mc

      Comment


      • #4
        Originally posted by Rich Goldstein View Post
        the -table1_mc- command (note spelling) from SSC (as you are asked to explain - see the FAQ), accepts pweights and that is how you should use this command with survey data; see
        Code:
        h table1_mc
        My help file says that only fweights are allowed, not pweights (which I use)

        Is it correct that the p value from the output of table1_mc is from Pearson's chi square? If so, is there a way to use that with the svy: prefix? Whenever I try that, it tells me that chi2 is not allowed with svy. Or could I instead do a t-test? Basically, I want to test for statistical significance between the two values my intervention variable has

        Comment


        • #5
          is this the version of table1_mc you have?
          Code:
          . which table1_mc.ado
          /Users/rich/Library/Application Support/Stata/ado/plus/t/table1_mc.ado
          *! -table1_mc- version 3.3 Mark Chatfield    2022-05-05
          the basis of the p-value is the test you requested, which in some cases is Pearson's chi-squared - but you did not show your command so I can't answer re: what you received; what test you should be using depends on what your data are - and you haven't told us that

          Comment


          • #6
            Originally posted by Rich Goldstein View Post
            is this the version of table1_mc you have?
            Code:
            . which table1_mc.ado
            /Users/rich/Library/Application Support/Stata/ado/plus/t/table1_mc.ado
            *! -table1_mc- version 3.3 Mark Chatfield 2022-05-05
            the basis of the p-value is the test you requested, which in some cases is Pearson's chi-squared - but you did not show your command so I can't answer re: what you received; what test you should be using depends on what your data are - and you haven't told us that
            yes, that is the version I have.

            my table1_mc code is:
            table1_mc, by (interventionvar) vars(list of all the other variables) total(before)
            and when I try to use weights, it tells me "option pweight not allowed"

            interventionvar is a variable that has 2 values, 0 for no, 1 for yes

            I just found out though that using the tab command with svy automatically gives values for chi2, so that might solve my problem.

            Comment

            Working...
            X