Announcement

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

  • Difference of two means significantly different to zero

    Hey guys, I need your help. So I calculated the mean of 2 groups and then calculated the difference of these two means in excel and know I want to know if this difference is significantly different than zero. But I had to do preserve and restore before calculating the second mean. So I did summarize to see the result of the two means but because of restore the variable are not in the dataset anymore. So for example I want to know if the difference of the two means, e.g. 0,4 ist sig. different to zero. How to I calculate this? And to I have to do this for every single value or is there a faster way? I hope you understand my problem.
    Code:
    preserve
    calculation of the mean of a given variable (e.g. the return) of every stock for condition 1
    calulation of first mean (the mean of all means)
    summarize
    restore (in order to not shorten the dataset)

    preserve
    calculation of the mean of a given variable (e.g. the return) of every stock for condition 2
    calculation of second mean (the mean of all means)
    summarize
    restore

    then because of restore the mean variable 1 and 2 do not exist anymore in the dataset. Now I want to know if the difference of mean 1 and 2 ist sig. different to the value zero. Another problem ist that the standard deviation of the means is zero because I calculated both means from the means of every stock in my dataset.

    Thanks!
    Last edited by John Lei; 06 Dec 2018, 07:19.

  • #2
    I'm not clear on exactly what you're doing to manipulate your dataset or why, but what's wrong with a two-group t-test?

    Comment


    • #3
      I am dropping observations that do not have the dummy==1 for example so I have to do the presverve restore stuff so that the original dataset is restored. So I gave every fund the dummy value of 1 if it occurs the first time (same as a tagvariable) and then I calculate the mean of the returns of every fund and drop it if it has the dummy value 0 so that every fund is only one time in my dataset. and then I calculate the mean of all means of the funds. So my standard deviation of the mean of means will be zero and with zero SD I can not calculate the ttest or p-value

      Comment

      Working...
      X