Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: argument with digits after decimal point?


From   "Martin Weiss" <[email protected]>
To   [email protected]
Subject   Re: st: argument with digits after decimal point?
Date   Fri, 01 Jan 2010 11:29:32 +0100

<>

Dirk`s post raises issues on several levels, the least of which pertain to the way -program- and -syntax- work. He can read up on precision issues in Nick`s post http://www.stata.com/statalist/archive/2003-09/msg00234.html.

Naming the -program- "test" would be a very bad idea indeed, although initially Stata would not complain about the conflict with the official -test-, unless it is currently loaded in memory. Any Wald -test- conducted after loading Dirk`s -program- would complain "varlist not allowed", as Dirk`s -program- only allows options...


***
cap pr drop test

program define test
   syntax [, ci(real 95)]
   set level `ci'
end

test, ci(95)

sysuse auto, clear
reg price weight length
test length
***

I could see a case for Dirk`s buying Kit`s http://www.stata-press.com/books/isp.html




HTH
Martin
-------- Original-Nachricht --------
> Datum: Fri, 01 Jan 2010 01:46:18 +0100
> Von: Dirk Enzmann <[email protected]>
> An: [email protected]
> Betreff: st: argument with digits after decimal point?

> Why does the following program not work as intended?
> 
> * --------------------------
> program define test
>    syntax [, ci(real 95)]
>    set level `ci'
> end
> * --------------------------
> 
> It is an example of a program that allows the optional argument "ci" to 
> specify the confidence level (the default should be 95). It works as 
> intended as long as I don't specify "ci" with digits after the decimal 
> point. But if I do, for example
> 
> * --------------------------
> test, ci(99.9)
> * --------------------------
> 
> I receive the error message "level() can have at most two digits after 
> the decimal point". What am I doing wrong, i.e. how can I avoid this 
> problem?
> 
> ***************************
> Dirk Enzmann
> [email protected]
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

-- 
Preisknaller: GMX DSL Flatrate für nur 16,99 Euro/mtl.!
http://portal.gmx.net/de/go/dsl02
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index