Announcement

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

  • Why am I getting error on using power twomeans,cluster?

    Hi statalist,

    I'm using power twomeans,cluster to calculate cluster size. In particular, based on stata manual here I'm using following code
    Code:
    power twomeans 0 4, kratio(1) k1(50) power(0.8) sd(1.01) rho(0.5) alpha(0.05) table
    But i'm getting the following error
    Code:
    option kratio(1) not allowed
    r(198);
    I've tried this on versions 13 and 14, if it's relevant.

    Can anyone suggest what's the problem here.

    Thanks

  • #2
    The documentation you refer to is for
    Code:
    power twomeans, cluster
    which was not introduced until Stata 15. The documentation here for the
    Code:
    power twomeans
    command that you ran does not include the ktratio option.

    Note that all Stata manual PDFs are (since Stata 11) included in your Stata installation and are accessible from Stata's Help menu. The combination of the output of help, and in the help output following the link to open the full PDF documentation, is the most reliable description of the capabilities of your installation of Stata.
    Last edited by William Lisowski; 21 Feb 2022, 11:50.

    Comment


    • #3
      Originally posted by William Lisowski View Post
      The documentation you refer to is for
      Code:
      power twomeans, cluster
      which was not introduced until Stata 15. The documentation here for
      Code:
      power twomeans
      does not include the ktratio option.

      Note that all Stata manual PDFs are (since Stata 11) included in your Stata installation and are accessible from Stata's Help menu. The combination of the output of help, and in the help output following the link to open the full PDF documentation, is the most reliable description of the capabilities of your installation of Stata.
      Thanks William for writing back.

      This poses a vexing problem for me. Can you suggest if there might be an workaround for version 14?

      Comment


      • #4
        You could implement a sample size calculation by hand and forego the candy features of power. Surely you would have done this anyway and not solely rely on a software routine.

        Comment


        • #5
          I'm sorry to say I have no expertise in power and sample size calculations. My answer was based on the confirming that the features you wanted were introduced more recently than the version you were using; this required no knowledge of the specific commands.

          For the one example you gave this is what you can expect to see in Stata 15 or later.
          Code:
          . power twomeans 0 4, cluster kratio(1) k1(50) power(0.8) sd(1.01) rho(0.5) alpha(0.05) table
          
          Performing iteration ...
          
          Estimated cluster sizes for a two-sample means test
          Cluster randomized design, z test assuming sd1 = sd2 = sd
          H0: m2 = m1  versus  Ha: m2 != m1
          
            +-----------------------------------------------------------------------------------------+
            |   alpha   power      K1      K2      M1      M2   delta      m1      m2      sd     rho |
            |-----------------------------------------------------------------------------------------|
            |     .05      .8      50      50       1       1       4       0       4    1.01      .5 |
            +-----------------------------------------------------------------------------------------+

          Comment


          • #6
            Originally posted by Leonardo Guizzetti View Post
            You could implement a sample size calculation by hand and forego the candy features of power. Surely you would have done this anyway and not solely rely on a software routine.
            yes I could. However, I need to produce the do files and log files for all my analyses so it would have been helpful to get it done on the software. I think I'll need to upgrade.

            Comment


            • #7
              Originally posted by William Lisowski View Post
              I'm sorry to say I have no expertise in power and sample size calculations. My answer was based on the confirming that the features you wanted were introduced more recently than the version you were using; this required no knowledge of the specific commands.

              For the one example you gave this is what you can expect to see in Stata 15 or later.
              Code:
              . power twomeans 0 4, cluster kratio(1) k1(50) power(0.8) sd(1.01) rho(0.5) alpha(0.05) table
              
              Performing iteration ...
              
              Estimated cluster sizes for a two-sample means test
              Cluster randomized design, z test assuming sd1 = sd2 = sd
              H0: m2 = m1 versus Ha: m2 != m1
              
              +-----------------------------------------------------------------------------------------+
              | alpha power K1 K2 M1 M2 delta m1 m2 sd rho |
              |-----------------------------------------------------------------------------------------|
              | .05 .8 50 50 1 1 4 0 4 1.01 .5 |
              +-----------------------------------------------------------------------------------------+
              Thanks William. I think I'll just upgrade to a more latest version.

              Comment

              Working...
              X