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

RE: st: RE: intervals of equal width


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: intervals of equal width
Date   Thu, 18 Nov 2004 14:54:37 -0000

I wouldn't rule the possibility of 
a simpler solution just because I can't think 
of one. As one anthropologist said, 
absence of evidence is not evidence 
of absence. Other fields may have 
their own sayings. 

Nick 
[email protected] 
(not a Professor) 

Enzo Coviello

> >Alternatively do it directly. This
> >code (1) assumes an ordered numlist,
> >minimum first (2) is not tested much.
> >
> >tokenize "`numlist'"
> >local nn : word count `numlist'
> >local max = 0
> >local min = .
> >forval i = 2/`nn' {
> >         local j = `i' - 1
> >         local diff = ``i'' - ``j''
> >         local min = min(`diff',`min')
> >         local max = max(`diff',`max')
> >}
> >di "`min' `max'"
> 
> Many thanks Prof Cox, particularly for your "direct" advice.
> Actually I thought that a simpler solution would be possible.
> 
> Anyway it looks effective. I will adopt it.

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index