Announcement

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

  • T-test on weighted mean - error weights not allowed

    I need to do a test on the weighted average. I get an error message saying "weights not allowed". What are my options. How can I do a test on weighted average in Stata 13?

    Thanks,

    ​Josh

  • #2
    I assume you mean that the data are weighted and that you have individual data; in that case you can use a regression; if you want a two-sample t-test that is a regression where the only two right-hand side variables are the constant and the indicator variable for the group; all 4 kinds of weights that Stata recognizes are allowed with regression

    Comment


    • #3
      I am not sure how to run the regression to do the t-test. Here is my sample data.

      GROUP_ID MV_EQUITY RETURN
      1 303 0.13
      1 1338 0.10
      1 1994 -0.03
      1 191 0.19
      1 418 0.00
      1 925 0.01
      2 758 -0.02
      2 196 0.05
      2 1045 -0.01
      2 537 0.18
      2 151 0.07
      3 2364 0.00
      3 635 0.08
      3 198 0.02
      3 430 0.08
      3 315 0.03
      3 911 0.18
      3 9796 0.13
      4 551 0.00
      4 521 0.05
      4 1320 0.09
      4 3971 0.10
      4 1294 0.06
      4 334 0.11
      4 892 0.04
      5 5865 0.04
      5 1251 -0.01
      5 847 -0.01
      5 1755 0.02
      5 461 0.00
      5 330 0.14
      5 1870 0.07
      I need to find the following:

      1) For each group I need to calculate the weighted average return (using mv_equity as weights) and obtain the "Newey and West" adjusted t-statistic for the weighted average return == 0 .

      2) I need to test for the difference in the weighted average return between group 1 and 5. Here again I need to obtain the "Newey and West" adjusted t-statistic.

      I have read in the stata archives that the regression approach can be used when we are using weights to obtain the mean. I am not sure how to set up the regression and get the "Newey and West" adjusted t-statistic.

      Thank you,

      Josh













      Comment


      • #4
        have you investigated the -newey- command in Stata; start with the help file

        Comment

        Working...
        X