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

From |
"Dr. Stephen Rothenberg" <srothenberg@mda.cinvestav.mx> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: Re: log only results of r-class commands |

Date |
Fri, 23 May 2008 11:59:55 -0500 |

Thank you Sergiy for the code, which I will try adapting. I appreciate the advice Maarten. The hundreds of lines of commands appearing in my logs are from the do file limited to descriptive statistic production, the equivalent of your "analysis.do" (see example below).

Roy, I include below a piece of my analysis do-file to give you the flavor of the task.

The descriptive analysis extensively uses -fsum- (fsum.ado Full SUMmary program v 2.4.0 fw 2may05), contributed by Fred Wolfe, as it prints variable labels instead of variable names.

I would like to preserve the comments in the log, since they identify analyses, but could live without that feature. Far easier to add a few table headers to table groups than to edit out hundreds of lines of command code.

The variable [gradoesc06] identifies the school room, of which there can be up to 12. There are 4 schools in all, but I am keeping the "school" files separate until the second and further data waves are recorded. Please note that the line breaks in this snippet are sometimes different than in the do-file, in which line breaks within a command are always terminated with /*. All secondary variable creation and labeling is done in other do-files.

do file fragment:

version 10

clear all

log using C:\............\Leone_v.smcl, replace

use C:\............\cuestionario_esc_leones_v_R.dta

quietly set more off

* ESCUELA LEONES_V

* Conducta con sus compañeros

bysort gradoesc06: fsum _2008pree1_1intcomp _2008pree1_4ayucomp _2008pree1_9disfrpart /*

*/_2008pree1_12sabesc, stats(n mean sd min max) uselabel

* TOTAL Conducta con sus compañeros

fsum _2008pree1_1intcomp _2008pree1_4ayucomp _2008pree1_9disfrpart /*

*/_2008pree1_12sabesc, stats(n mean sd min max) uselabel

* Conducta en la aula

bysort gradoesc06: fsum _2008pree1_2paract _2008pree1_3genact _2008pree1_5muesprob /*

*/_2008pree1_6creaprob, stats(n mean sd min max) uselabel

* TOTAL Conducta en la aula

fsum _2008pree1_2paract _2008pree1_3genact _2008pree1_5muesprob /*

*/_2008pree1_6creaprob, stats(n mean sd min max) uselabel

* Desempeño en la aula

bysort gradoesc06: fsum _2008pree1_7asumresp _2008pree1_8partproy /*

*/_2008pree1_10exprclarhabl _2008pree1_11exprclarescr _2008pree1_13intrescr /*

*/_2008pree1_14instroral _2008pree1_15ordlogpen _2008pree1_16explid /*

*/_2008pree1_17utbiblau _2008pree1_18leemas _2008pree1_19traematcomp, /*

*/stats(n mean sd min max) uselabel

* TOTAL Desempeño en la aula

fsum _2008pree1_7asumresp _2008pree1_8partproy /*

*/_2008pree1_10exprclarhabl _2008pree1_11exprclarescr _2008pree1_13intrescr /*

*/_2008pree1_14instroral _2008pree1_15ordlogpen _2008pree1_16explid /*

*/_2008pree1_17utbiblau _2008pree1_18leemas _2008pree1_19traematcomp, /*

*/stats(n mean sd min max) uselabel

* RESUMEN de las tres escalas

bysort gradoesc06: fsum cond_comp cond_aula desemp_aula, stat(n mean sd min max) uselabel

--------snip-------

* DIFERENCIAS significativas entre aulas

kwallis cond_comp, by(gradoesc06)

kwallis cond_aula, by(gradoesc06)

kwallis desemp_aula, by(gradoesc06)

------snip------

Thanks for your help,

Steve Rothenberg

CINVESTAV-Merida

Yucatan, Mexico

----- Original Message ----- From: "Dr. Stephen Rothenberg" <srothenberg@mda.cinvestav.mx>

To: <statalist@hsphsun2.harvard.edu>

Sent: Thursday, May 22, 2008 3:07 PM

Subject: log only results of r-class commands

I am setting up do-files in anticipation of running repetitive descriptive statistics for a long-term project. I will need to produce appendices that contain these descriptive statistics, each of which will be scores of pages long.

My problem is logging the output of commands like -sum- or -fsum- so I can print the appendix stats. I'd like to produce output that contains only the results of the commands in legible tables and my preceding comments that identify them, without the tedious chore of editing out the commands themselves. The commands run to nearly 400 lines in scattered places throughout the log, despite using -bysort- to combine analyses.

Stata includes such commands as -quietly- and the various -set output- variations, all of which suppress results output. The user-supplied commands in the -estout- family and others do a great job in producing tables of estimation output. They do not work with descriptive commands, which are r-class commands. Stata allows me to open two logs simultaneously, one showing commands, comments, results, and error messages, the other showing only the commands, but not only results and comments.

I've searched the FAQs, the ssc contributions, and Statalist, without success.

Does anyone know:

1. A way to log only results of r-class commands in presentable tables?

2. If not, can someone provide a method that will do this?

3. If nothing now exists, will StataCorp consider making output only logging possible in future releases?

Steve Rothenberg

CINVESTAV-Merida

Yucatan, Mexico

- Prev by Date:
**Re: st: RE: Dealing with Missing Values** - Next by Date:
**[no subject]** - Previous by thread:
**st: tackling endogeneity using stata** - Next by thread:
**st: Re: log only results of r-class commands** - Index(es):

© Copyright 1996–2015 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |