Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Feature of the -inlist- function


From   Roger Newson <roger.newson@kcl.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   st: Feature of the -inlist- function
Date   Thu, 18 Jul 2002 14:15:37 +0100

Hello all

A very minor query re the -inlist- function. I'm using Stata 7 with executable and ado-files as of 11 June 2002. According to -[U] 16.3 Functions-, the maximum number of arguments to -inlist- is 255 (either all reals or all strings). However, for some reason, -inlist- seems to fail for me with 6 string arguments. I might type as follows:

. disp inlist("bonferroni","hochberg","simes","yekutieli","krieger")
0

. disp inlist("bonferroni","hochberg","simes","yekutieli","krieger","liu")
expression too long
r(130);

When I click on r(130), I get error diagnostics as follows:

[P] error . . . . . . . . . . . . . . . . . . . . . . . . Return code 130
expression too long;
too many SUMs;
In the first case, you specified an expression that is too long
for Stata to process -- the expression contains more than 255 pairs
of nested parentheses or more than 66 dyadic operators. Break
the expression into smaller parts. In the second case, the
expression contains more than five sum() functions. This
expression, too, will have to be broken into smaller parts.

I can't see how -inlist("bonferroni","hochberg","simes","yekutieli","krieger","liu")- violates any of the limits on nested parentheses or dyadic operators, although I know how to break up the expression, eg

disp inlist("bonferroni","hochberg","simes")|inlist("bonferroni","yekutieli","krieger","liu")

seems to work, at the price of making the expression a bit more long-winded. Is this an unpublicised feature of -inlist-? And does it have any consequences apart from making long -inlist- calls a bit longer?

Thanks in advance

Roger

--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Email: roger.newson@kcl.ac.uk

Opinions expressed are those of the author, not the institution.

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* 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