Re: CHI^2: 5% C.I. of the medians



5% confidence intervals of median/ mean (prgm SHERATIO)


___DF=10
___
__n=5___________[0.677; 1.198]
__n=7___________[0.709; 1.168]
__n=9___________[0.730; 1.144]
__n=11__________[0.750; 1.126]
__n=13__________[0.763; 1.113]
__n=15__________[0.772; 1.101]
__n=17__________[0.781; 1.092]
__n=19__________[0.787; 1.084]
__n=21__________[0.794; 1.078]

___DF=5
___
__n=5___________[0.525; 1.245]
__n=7___________[0.569; 1.206]
__n=9___________[0.595; 1.168]
__n=11__________[0.616; 1.146]
__n=13__________[0.634; 1.126]
__n=15__________[0.648; 1.108]
__n=17__________[0.658; 1.094]
__n=19__________[0.670; 1.083]
__n=21__________[0.680; 1.075]


________licas (Luís A. Afonso)

REM "SHERATIO"
CLS
DIM x(9001), o(2001)
PRINT "******** pgrm SHERATIO ******** "
PRINT " Chi-squared : 5% C.I. ":
PRINT " for MEDIAN/MEAN "
INPUT " df= "; df
INPUT " size="; size
DIM xb(size), xx(size)
all = 50000: pi = 4 * ATN(1)
FOR sample = 1 TO all
LOCATE 10, 10
PRINT USING "##############"; all - sample
FOR i = 1 TO size: she = 0
FOR ddf = 1 TO df
a = SQR(-2 * LOG(RND))
u = a * COS(2 * pi * RND)
she = she + u * u
NEXT ddf
xx(i) = she: xb(i) = she
NEXT i
FOR w = 1 TO size: min = 4E+07
FOR j = 1 TO size
IF xx(j) < min THEN GOTO 12
GOTO 20
12 min = xx(j): la = j
20 NEXT j: o(w) = min
xx(la) = 1E+10
NEXT w: mmd = INT(size / 2) + 1
median = o(mmd): mean = 0
FOR u = 1 TO size
mean = mean + xb(u) / size: NEXT u
xj = median / mean
xj = INT(1000 * xj + .5)
IF xj > 9000 THEN xj = 9000
x(xj) = x(xj) + 1
IF sample / 1000 <> INT(sample / 1000) THEN GOTO 33
RANDOMIZE TIMER
lmm(1) = .025 * sample: lmm(2) = .975 * sample
FOR g = 1 TO 2: s = 0
FOR i = 0 TO 9000
s = s + x(i)
IF s > lmm(g) THEN GOTO 4
NEXT i
4 PRINT USING "##.### #.### "; i / 1000; s / sample
NEXT g
33 NEXT sample
END
.



Relevant Pages

  • CHI^2: 5% C.I. of the medians
    ... DIM x, xx, o ... for the MEDIAN " ... FOR ddf = 1 TO df ... IF xx< min THEN GOTO 12 ...
    (sci.stat.math)
  • Re: Automation of a mail merge in access 2003
    ... Message As String ... Dim objQDF As DAO.QueryDef ... Set objWORD = New Word.Application ... ' On Error GoTo ErrorHandler ...
    (microsoft.public.access.modulesdaovba)
  • Re: Avoiding GoTo Statements
    ... Dim fWord As String ... Dim oVar As Variable ... vbYesNoCancel, "Restore All") ... edit out the "w...spam" in gmaxey@whamspammvps.org Jezebel wrote:> Your example highlights delightfully the problem of GOTO ... ...
    (microsoft.public.word.vba.general)
  • Re: Comparing text?
    ... Dim str1, str2 As String ... Set tCell = Cells ... Dim per, status, err_msg As String ... GoTo prn_abnorm_result ...
    (microsoft.public.excel.programming)
  • Re: Avoiding GoTo Statements
    ... two IF Statements rather than one IF statement, an ELSE and a GoTo. ... Dim bExists As Boolean ... Dim cMoreItems As VbMsgBoxResult ... A peer in "peer to peer" support ...
    (microsoft.public.word.vba.general)