Announcement

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

  • standardised differences for categorical and continuous variables

    I want to estimate standardised differences for categorical and continuous variables. I was able to do it out for categorical variables using command: stddiff i.predictor, by(outcome). How do I estimate standardised differences for continuous variables with a non parametric distribution. I have 2 groups- one with 20 and other with 600 samples.

  • #2
    You didn't get an answer because your question needs work. First, read the FAQ on asking questions. Providing code, Stata output, and data (using dataex) would help.

    I don't use this technique, but the documentation says it handles continuous variables.

    Comment


    • #3
      Thanks Phil. Stddiff works for continuous variables with a normal distribution. Standardized difference= (mean1-mean2) divided by square root [( square of standard deviation1+ square of standard deviation2)/2].

      For a skewed distribution (in my case standard deviation more than mean), we need to replace it by rank statistics. It would be mean of the rank sum and standard deviation of the mean ranks instead of mean and std deviation in the equation.

      stddiff givesonly a standardized difference based on the mean and std deviation, and not the ranks. Is there a command for standardized difference for skewed distribution?

      Comment


      • #4
        Here is an article on it.
        http://support.sas.com/resources/pap...2/335-2012.pdf
        (refer page 2, top section on continuous variables)

        Comment


        • #5
          Originally posted by john jose View Post
          For a skewed distribution (in my case standard deviation more than mean), we need to replace it by rank statistics. It would be mean of the rank sum and standard deviation of the mean ranks instead of mean and std deviation in the equation.
          egen can generate ranks of a variable. Maybe consider something like the following;
          Code:
          egen double rank = rank(var)
          stddiff rank, by(groupvar)
          See also this about user-written commands.

          Comment


          • #6
            Originally posted by Joseph Coveney View Post

            egen can generate ranks of a variable. Maybe consider something like the following;
            Code:
            egen double rank = rank(var)
            stddiff rank, by(groupvar)
            Thanks a lot. This really helped

            Comment


            • #7
              For those who visit this blog, note the user contributed package stddiff:
              Ahmed M. Bayoumi, 2016. "STDDIFF: Stata module to compute Standardized differences for continuous and categorical variables," Statistical Software Components S458275, Boston College Department of Economics, revised 09 Mar 2021.
              which can be installed from ssc:
              Code:
              ssc install stddiff , replace
              h stddiff
              One advantage is the option to calculate Cohen's d, adjusting for sample size as well as Hedges's g. Also stddiffi is included; an immediate form of stddiff.
              http://publicationslist.org/eric.melse

              Comment

              Working...
              X