This statistical program calculates n (# of observations) needed in a data set for 1 or 2 samples. (used for both means and proportions) ----begin documentation---- Program: Nfind Author: Dan Watkins (Goodman@Brahms.udel.edu) Size: 539 bytes This program calculates n (the # of observations) needed in a data sample; given: 1 or 2 samples Means or Proportions Width or Boundary z alpha/2 (from a table) If means: input mean and variance If proportions: Input pHAT ----end documentation---- ----begin ascii---- \START\ \COMMENT=Program file dated 03/11/93, 22:28 \NAME=Nfind \FILE=nfind.85P ClLCD Disp "1 or 2 samples" Input A Disp "1=Mean or 0=Prop" Input E Disp "1=W or 0=B" Input X If X Goto A Prompt B Lbl B Disp "z \LC-alpha\/2" Input C If A==1 Then If E Then Disp "\LC-sigma\\^2\ variance" Input Z (C\^2\*Z)/B\^2\\->\D Goto C Else Prompt pHAT (C\^2\(pHAT(1-pHAT))/B\^2\\->\D Goto C End Else If E Then Disp "\LC-sigma\\^2\1 variance" Input Z Disp "\LC-sigma\\^2\2 variance" Input Y (C\^2\(Z+Y))/B\^2\\->\D Goto C Else Prompt pHAT1 Prompt pHAT2 (C\^2\((pHAT1(1-pHAT1))+(pHAT2(1-pHAT2)))/B\^2\\->\D Goto C End Lbl A Prompt W W/2\->\B Goto B Lbl C If D>round(D,0) Then (D+1)\->\D round(D,0)\->\D Else round(D,0)\->\D End If A==1 Disp "N" If A==2 Disp "N (Per sample)" Disp D If A==2 Then Disp "N (Total)" (2*D)\->\D Disp D End Stop \STOP\ ----end ascii---- ----begin uue---- begin 644 nfind.85p M*BI423@U*BH:#`!0B"[+S(BUDEN<'5T($/6268@03T],=94:&5N MUDEF($765&AE;M9$:7-P("+'$B!V87)I86YC92+626YP=70@6M8H0Q(J6BDO M0A(<1-9';W1O($/616QS9=90