Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: -sampsi- command and exact tests

Subject   st: -sampsi- command and exact tests
Date   Tue, 01 Feb 2005 20:15:14 -0500

Dear Statalisters-

I understand from several previous posts that the command  -sampsi- uses
an approximate large sample test on proportion. power, and sample size
calculations.  Specifically, it uses the normal approximation (with
correction) as opposed to an exact test.  The advice in a previous post
was that the following equalities must hold in order for sampsi to work


(see post from entitled st:RE: calculation of
sample size,  dated 8 Oct 2004)

I am trying to use sampsi to estimate the required number of  samples as

sampsi 0.4 0.46, alpha(0.05) power(0.90) onesample

Stata indicates that 711 samples are required as indicated in the Stata
output below:

 sampsi 0.4 0.46, alpha(0.05) power(0.90) onesample

Estimated sample size for one-sample comparison of proportion
  to hypothesized value

Test Ho: p = 0.4000, where p is the proportion in the population


         alpha =   0.0500  (two-sided)
         power =   0.9000
 alternative p =   0.4600

Estimated required sample size:

             n =      711

This seems to meet the n1p1>=10 etc. requirements listed above to use
the -sampsi- command.  However,  I am told that the right answer using
NQuery Advisor and its  exact test for single proportions is 610
observations.  S-Plus gives 613 as an answer.  StatXact also gives a
similar answer to NQuery Advisor and S-Plus.

Does anyone know if Stata's use of the normal approximation  (with
continuity correction)  is indeed what is causing the 100+ discrepancy
here?  Is there is an exact test in Stata that can be used instead of
-sampsi-?  And are there additional criteria beyond the n1p1>=10 etc.
criteria listed in the  referenced previous post that should be checked
before using -sampsi- ?

  I have used the -findit- command to see if there is an exact test
available and looked at both Roger Newson's -powercal- command described
in the most recent Stata Journal (4th Quarter 2004) as well as Al
Feiveson's article entitled "Power by Simulation" (Stata Journal, 2nd
Quarter 2002) and wasn't able to find the answer to this question.   Is
the  -sampncti- command appropriate here?

thanks for any help.


David Miller, Senior Scientist
Health Effects Division
Office of Pesticide Programs
703-305-5352 (voice)
703 605-1289 (fax)


*   For searches and help try:

© Copyright 1996–2023 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index