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

Re: st: improvement


From   Edwin Leuven <[email protected]>
To   [email protected]
Subject   Re: st: improvement
Date   Tue, 10 Feb 2004 11:30:31 +0100 (CET)

you could do something like the following to output your stuff to a 
file which can be read by excel:

g catpos = autocode(pos,(20-3)/0.05,3,20)
g count = 1
collapse (sum) count, by(catpos)
outsheet using count




On Tue, 10 Feb 2004, Andreas Aschbacher wrote:

> Dear fellows :
> In austrian centre of physics we use Stata to do
> LevenbergMarquardt(nl-command)since about
> four months,about 400 measurements were evaluated.
> we consider small (not infinitesimal) dosis-intervals and the number of
> persons who are exposed
> to these intervals - the following little program shows how to count the
> number of persons in certain
> intervals :
> 
> /pos is ln(dosis-value) because then it seems to be Gau�-distribution
> without logarithmusnaturalis it is lognormal distribution -
> it is easier to reach convergence with Gau�-formula in
> most cases /
> 
> local i = 3
> while `i' <= 20 {
>         count if pos >= `i' & pos  < `i' + .05  
>         display
>         local i = `i' + .05
> }
> *  3           -            3.05                ->  3.025
> *  3.05      -            3.1                  ->  3.075
> *  3.1        -            3.15                ->  3.125
> *  3.15      -            3.2                  ->  3.175
> *  3.2        -            3.25                ->  3.225
> *  3.3        -            3.35                ->  3.325
> 
> this program counts and you get  also zero if there is no value in interval
> -
> with these values I can obtain the following ascii-text-file :
> 
> Ascii-Text-file :  
> x              y      x...dosis-value in radioactive measurement 
>                        y...number of counts 
> 3.025    1                       ->for example  :
> 3.075    2 ...............   two counts in interval 3.05  to 3.1
> 3.125    4
> 3.175    7
> 3.225    6
> 3.275    5
> 3.325    10
> 3.375    13
> 3.425    22
> 3.475    13
> 3.525    24
> 3.575    41
> 3.625    41
> 3.675    60
> 3.725    67
> 3.775    81
> 3.825    98
> 3.875    143
> 3.925    162
> 3.975    181
> 4.025    241
> 4.075    268
> 4.125    301
> ... and so on
> 
> my question : is there a way to get x-column and y-column
> simultaneously in a sheet(ascii) during counting ? -
> because I start my little counting-program and get the counted values
> on results-screen with one blank line after each count value,then I import
> in
> excel with copy/paste and add x-column after deleting all blank lines
> with a macro. complicated way isn't it ? then I have ascii-sheet with x-and
> y-
> column by copy and paste from excel-
> each help will be appreciated very much            andreas
> 
> 

-- 
Edwin Leuven
Department of Economics
University of Amsterdam
Roetersstraat 11
1018 WB Amsterdam
the Netherlands
tel: +31 20 525 5241
fax: +31 20 525 4310
http://www.fee.uva.nl/scholar/mdw/leuven
*
*   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