Announcement

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

  • Standard deviation of dummy variable

    I have a dummy variable called male which has 12 values equal to 1 and 12 values equal to 0 (total of 24 observations). The sum command on this variable gives a mean of 0.5 and a std. dev. of 0.5107539. Why is the std. dev. not equal to 0.5?

  • #2
    Stata uses sample size minus 1 in calculating SD, that is the estimator of SD is the root of the unbiased estimator for variance.

    Comment


    • #3
      Here is a demonstration:

      Code:
      . mata
      ------------------------------------------------- mata (type end to exit) -
      : x = J(12,1,0) \ J(12,1,1)
      
      : sqrt(sum((x :- 0.5):^2) :/ 24)
        .5
      
      : sqrt(sum((x :- 0.5):^2) :/ 23)
        .5107539185

      Comment

      Working...
      X