Hi again,
here's another problem with the pvalue-function. This time the problem only (?)
applies to the
binomial variant and thus looks different from the one in my previous post. But again,
maybe some
underlying comma-vs.-period-as-decimal-and/or-list-separator issues?
The following little script demonstrates the first part of the problem:
<script>
nulldata 10
pvalue B 1 1 0
genr prob = pvalue(B, 1, 1, 0)
</script>
This gives me the following error output; note that the pvalue-command works fine, while
the
pvalue-function fails:
<output>
...
? pvalue B 1 1 0
Binomial (p = 1, n = 1):
Prob(x > 0) = 1
? genr prob = pvalue(B, 1, 1, 0)
Syntax-Fehler in Befehlszeile
Error executing script: halting
genr prob = pvalue(B, 1, 1, 0)
</output>
And then there are cases where there are no error messages, but the result of the
pvalue-function is
clearly wrong (in contrast to the output of the pvalue-command). Consider this script:
<script>
nulldata 10
scalar p = 0,5
scalar n = 2
scalar x = 1
pvalue B p n x
genr prob = pvalue(B, p, n, x)
</script>
which produces:
<output>
...
? pvalue B p n x
Binomial (p = 0,5, n = 2):
Prob(x > 1) = 0,25
? genr prob = pvalue(B, p, n, x)
Generiert skalar prob (ID 5) = 0
</output>
I'd also be interested in a quick workaround, since I want to access the function
return value for
teaching. The correct output from the pvalue-command doesn't help me there.
Tia for hints and suggestions,
Sven