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

Re: st: counting


From   Mario F Rueda Narváez <mfrueda@uma.es>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: counting
Date   Fri, 12 Dec 2003 18:59:09 +0100

Using -count- and assuming that your variable is called "var01", you could run this in the do-file editor. It seems to work fine on stata 7.

---
local i = 1.05
while `i' <= 3 {
display "Nº of obs. between `i' and " `i' + .05
count if var01 >= `i' & var01 < `i' + .05
display
local i = `i' + .05
}
---

However, there are probably some table commands / options more convenient that I'm not aware of.

Hope this helps,


I'd like to know how many values are between :
                        1.05  and  1.1                  that means >= 1.05
and < 1.1    stepwidth = 0.05
I'd like to know how many values are between :
                         1.1   and  1.15                that means >= 1.1
and  < 1.15    stepwidth = 0.05
I'd like to know how many values are between :
                         1.15   and  1.2                that means >= 1.15
and  < 1.2    stepwidth = 0.05
and so on .........

I can't  get  good results with already discussed method of  - tabulate
myvar,subpop(var2) -
because I know results from an Excel-Macro.
My question is: Is there another method of counting  ?
any help will be appreciated very much

andreas


--
+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net


*
*   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/
Mario F. Rueda Narváez
Departamento de Estadística y Econometría
Facultad de Ciencias Económicas
Universidad de Málaga
El Ejido s/n
29013      Málaga  (España)
<http://www.estyeco.uma.es/>http://www.estyeco.uma.es/
Tlf:  +34 952 13 71 90
Fax: +34 952 13 72 62


*
*   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