Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: outsheet or outfile display


From   Michael McCulloch <mm@pinest.org>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: outsheet or outfile display
Date   Tue, 24 Oct 2006 10:20:41 -0700

Thank you very much Nick. I didn't mean to disparage Stata or integrators with my question.
I'm sorry, but at this point in my own progress on the Stata learning curve, I haven't yet learned programming and am working with do files using basic commands and their options.

The results I would like to achieve is a table separated not by every N lines, but rather by specific values of a variable, such as in this case, month/year:

.list ini dxage sex race datetx, noobs sepby(datetx)
------------------------------------------------
AD 63 male white November, 1993
CV 69 male white November, 1993
JC 39 male white November, 1993
LF 46 male white November, 1993
MF 55 male white November, 1993
NL 63 male white November, 1993
VJ 68 male asian November, 1993
------------------------------------------------
HM 59 male white December, 1993
IT 47 male white December, 1993
MO 76 male white December, 1993
WC 74 male white December, 1993
------------------------------------------------
AW 61 male white January, 1994
+------------------------------------------------+




At 10:09 AM 10/24/2006, you wrote:

This would be most un-Stataish and it would be in my view
be bad style for StataCorp to allow this with -outsheet-
or -outfile-, regardless of whether this is a format that
is acceptable or congenial downstream. But you could program
it yourself fairly easily. The best way that occurs to
me is to use -outsheet- or -outfile- to produce a file,
and then just read in that file once more and spit it
out again with extra intercalated lines.

... if !mod(count, s)

picks up every s th line. That is, the task doesn't
or shouldn't require a hit on -outsheet- or -outfile-
code but could just be treated as a twist on copying a file.

However, if you want tabs or commas in corresponding places,
that would need to be part of the twist.

Nick
n.j.cox@durham.ac.uk

Michael McCulloch

> -list- has a nifty option, -sepby()-, that allows me to list
> data separated
> with lines between a variable, in this case a date:
>
> .list  ini dxage sex race datetx, noobs sepby(datetx)
> VJ 68 male asian November, 1993
> ------------------------------------------------
> HM 59 male white December, 1993
> IT 47 male white December, 1993
> MO 76 male white December, 1993
> WC 74 male white December, 1993
> ------------------------------------------------
> AW 61 male white January, 1994
> +------------------------------------------------+
>
>  From reading the help files, I don't see that there is a way
> to do this
> using outsheet or outfile. Is it possible to output such a
> table to a file
> that can be read by Microsoft Excel or Word?

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

Best wishes,
Michael


____________________________________

Michael McCulloch
Pine Street Clinic
124 Pine Street, San Anselmo, CA 94960-2674
tel     415.407.1357
fax     415.485.1065
email:  mm@pinest.org
web:    www.pinest.org
        www.pinestreetfoundation.org





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