LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2003)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 17 Sep 2003 12:17:13 +0200
Reply-To:     Asesoría Bioestadística
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Asesoría Bioestadística
Subject:      Re: Sample Size Syntax (with finite population correction)
Content-Type: text/plain; charset=iso-8859-1

Hi again, Márcio

I got interested in the topic, so after a bit of Googling I got the formula you are seeking to compute and modified the macro:

DEFINE ciprop(p=!DEFAULT(0.5) !TOKENS(1) /eps=!TOKENS(1) /ci=!DEFAULT(95) !TOKENS(1)/ np=!DEFAULT(1000000) !TOKENS(1) ). * Sample size required for the CI for one proportion *. MATRIX. PRINT /TITLE ' SAMPLE SIZE: CONFIDENCE INTERVAL PRECISION: ONE PROPORTION'. COMPUTE np=!np. COMPUTE p=!p. COMPUTE eps=!eps. COMPUTE ci=!ci. DO IF ci=95. + COMPUTE zalfa=1.96. ELSE IF ci=99. + COMPUTE zalfa=2.576. ELSE IF ci=99.9. COMPUTE zalfa=3.09. END IF. PRINT ci /FORMAT="f8.1" /TITLE='Confidence level (%)'. PRINT eps /FORMAT="f8.2" /TITLE="Precision desired". PRINT p /FORMAT="f8.2" /TITLE="Estimated proportion". * Initial n value *. COMPUTE n=p*(1-p)*((zalfa/eps)**2). DO IF np LT 1000000. * Finite population correction *. + COMPUTE ncor=TRUNC(np*n/(np-1+n))+1. + PRINT np /FORMAT="f8.0" /TITLE="Population sample size". ELSE. * Infinite population assumed *. + COMPUTE ncor=TRUNC(n)+1. + PRINT /TITLE="Infinite Population". END IF. PRINT ncor /FORMAT="f8.0" /TITLE="Sample size required". END MATRIX. !ENDDEFINE.

CIPROP p=0.5 eps=0.02 ci=95. CIPROP p=0.5 eps=0.02 ci=95 np=1000.


Marta Garcia-Granero

Back to: Top of message | Previous page | Main SPSSX-L page