Statalist


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

st: argument with digits after decimal point?


From   Dirk Enzmann <dirk.enzmann@uni-hamburg.de>
To   statalist@hsphsun2.harvard.edu
Subject   st: argument with digits after decimal point?
Date   Fri, 01 Jan 2010 01:46:18 +0100

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
dirk.enzmann@uni-hamburg.de
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index