Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RE: How can I append tabout output in Excel using logout?


From   sara khan <[email protected]>
To   [email protected]
Subject   Re: st: RE: How can I append tabout output in Excel using logout?
Date   Wed, 28 Apr 2010 11:34:19 +0100

Dear Nick

I will look into the commands you suggested.

I prefer to work with output in Excel as i find it easier to format.

Thank you so much for your advice.


On Wed, Apr 28, 2010 at 11:22 AM, Nick Cox <[email protected]> wrote:
> Thanks for this. My answer is the same. I think you are better off with -collapse- or -statsby-. The reason is this: you seem to want a dataset of results. You can get that directly with either of those two commands. What you are proposing is running a command repeatedly and then working on all the results to put them together. But those two commands do that for you in a single step.
>
> But in any case, I have never used -logout- and can't advise on its use. -logout- is a user-written program from SSC, as you are asked to make clear in postings. Its author is not a member of Statalist, so a direct personal mail to him may be the best strategy if you do not get what you ask for from somebody else on the list.
>
> As before: What do you want to do in MS Excel that (you think) can't be done in Stata?
>
> Nick
> [email protected]
>
> sara khan
>
> Many thanks for your suggestion yesterday. Apologies that I didn't
> read this yesterday.
>
> I am now trying to export the tabstat output into Excel using
> -logout-. I added this to command to my code from yesterday (which I
> will update using your helpful suggestions). Logout doesn't seem to
> append each additional table.
>
> On Wed, Apr 28, 2010 at 10:59 AM, Nick Cox <[email protected]> wrote:
>
>> I'd first pay attention to the suggestions you have received in
>>
>> <http://www.stata.com/statalist/archive/2010-04/msg01552.html>
>>
>> -- if only because it's possible that the extra condition & `y' hides a
>> bug in your code.
>>
>> But you're probably better off with -collapse- or -statsby-. What do you
>> want to do in MS Excel that can't be done in Stata?
>
> sara khan
>
>> I am running a lot of tabstats and need to compare the output in one
>> Excel sheet. Is there a way of appending the output as there isn't an
>> append option for logout?
>
>> Here is my code:
>>
>> forv i=0/5 {
>> foreach y in male singlet{
>> forv s=0/1{
>> di "myga==`i' & `y'==`s'"
>> qui su bwtg if myga==`i' & intab1==1 & admit_ic==1 & bwtg<. & `y'
>>        if r(N)!=0{
>>  logout, save("C:\data\do_files\mytab.txt")  excel replace: tabstat
>> bwtg if myga==`i' & intab1==1 & admit_ic==1 & bwtg<., stat(n mean
>> median p25 p75 min max ) by(`y') col(stat) f(%9.0g) notot nosep
>>
>> }
>> }
>> }
>> }
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index