Programming the statistical procedures from SAS

sample size calcs - why do these produce different results

Reply
Contributor
Posts: 30

sample size calcs - why do these produce different results

data a;

  input z p q e;

  cards;

1.96 0.95 0.05 0.05

;

data b;

  set a;

  n=(z*z*p*q)/(e*e);

  run;

  proc print; run;

proc power;

   onesamplefreq test=z method=normal

      sides          = 2

      alpha          = 0.05

      nullproportion = 0.90

      proportion     = 0.95

      ntotal         = .

      power          = 0.9;

run;

Valued Guide
Valued Guide
Posts: 684

Re: sample size calcs - why do these produce different results

Because your formula is not the one used by POWER. See the details at:

SAS/STAT(R) 9.3 User's Guide

Contributor
Posts: 30

Re: sample size calcs - why do these produce different results

right, I know, I understand that.  But one is confidence interval estimation and the 'proc power' is hypothesis testing.  They should be more in agreement, right?

Valued Guide
Valued Guide
Posts: 684

Re: sample size calcs - why do these produce different results

Not necessarily. These are different things.

Super User
Posts: 10,871

Re: sample size calcs - why do these produce different results

POWER is involved with Type II error. The other approach is not.

Ask a Question
Discussion stats
  • 4 replies
  • 308 views
  • 0 likes
  • 3 in conversation