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

st: AW: Inputting data from inside .do-file


From   "Christian Holz" <[email protected]>
To   <[email protected]>
Subject   st: AW: Inputting data from inside .do-file
Date   Fri, 8 Jul 2005 14:45:46 +0100

You could also outsheet (.outsheet year male age pop using whatever.txt,
nonames nolabel replace) the data, and then add the first three
   clear
   set obs 3468
   input year male age pop
lines to the top of the ASCII file you got with that command.

Christian

-----Urspr´┐Żngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von
[email protected]
Gesendet: 08 July 2005 12:53
An: [email protected]
Betreff: st: Inputting data from inside .do-file

Dear Statalisters,

I am making an .ado-file to produce a large number of standardized incidence
rates. The program uses data from the standard population stored in
'standardpop.dta' which has 3468 records. Now, I have to keep this standard
population with the .ado-file as an ancillary file, and I thought it would
be easier if the data from 'standardpop.dta' could be entered automatically
from inside my .ado-file. 

I could do it like this:

clear
set obs 3468
input year male age pop
1901 0 0 151800
1901 0 5 133900

...etc., but it's hard work!

Could anybody suggest a more efficient way?

Thank you in advance.

Peter.



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


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