binomial pvalue-function broken?
by Sven Schreiber
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
19 years, 2 months
Re: importing data
by Sven Schreiber
[btw, you've only replied to me, not to the list]
Florent Bresson schrieb:
> I send you a small csv file as exemple. It is tab
> delimited and commas are used for decimals. The csv
> has been produced with OpenOffice 2. Thanks for the
> help
>
Well the import works for me... When commas are used for decimals, I think you need to enable
locale-setting (Preferences - General, obvious checkbox), and answer correctly to the import dialogs.
Another thing: It seems you have panel data. The way the csv file is imported, the panel structure
is screwed up, but I believe the error is with the input format, not with gretl. But I don't have
experience with that, so you need somebody else to help you with that.
good luck,
sven
19 years, 2 months
importing data
by Florent Bresson
I really have problems to import data in gretl. I red
the manual and respected the folowing contraint for
CSV files
- NA string for missing values (I also tried with
blank cells and single dots)
- header with no more than height characterters
- no number in the headers, no space
- no header for the column of observations code
I tries with different data files, with xls and dta
files. Gretl always reply that he can't open the file.
So what's the problem ?
___________________________________________________________________________
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com
19 years, 2 months
getting errors with pvalue-function
by Sven Schreiber
Hi,
I stumbled over a problem with the pvalue-function in gretl, I suspect it could be related to the
fact that the German decimal separator is the comma, but see for yourself:
(This is about gretl 1.5.0 on a German Windows 2000.)
If I execute the exact command given on p.14 of the command reference in the following two-liner,
<script>
nulldata 10
genr p2 = pvalue(X, 3, 5.67)
</script>
I get the following error output:
<error>
gretl-Version 1.5.0
Aktuelle Session: 2006/01/05 15:57
? nulldata 10
periodicity: 1, maxobs: 10,
observations range: 1-10
? genr p2 = pvalue(X, 3, 5.67)
Syntax-Fehler in Befehlszeile
Error executing script: halting
> genr p2 = pvalue(X, 3, 5.67)
</error>
The same thing happens if I type 5,67 instead of 5.67.
Workaround: if instead I modify the script as follows,
<script>
nulldata 10
scalar x = 5.67
genr p2 = pvalue(X, 3, x)
</script>
then everything seems ok. (Ok also with a comma as in "scalar x = 5,67")
Any ideas, or better workarounds?
Thanks,
Sven
19 years, 2 months