Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down at the end of May, and its replacement, **statalist.org** is already up and running.

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

From |
Nick Cox <njcoxstata@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: Re: st: Tabulate summary statistics by percentiles and save output |

Date |
Sat, 29 Dec 2012 00:06:36 +0000 |

You miss my point, which is that you are expected to explain the provenance of user-written commands, as a courtesy to other members of the list, and to the authors who deserve their credit. This is explained in the FAQ. http://www.stata.com/support/faqs/resources/statalist-faq/#stata In the cases of -esttab-, -estpost-, -estout-, -tabout-: all are widely used and respected programs but I use none routinely and have no advice on their use. Nick On Fri, Dec 28, 2012 at 11:03 PM, annoporci <annoporci@gmail.com> wrote: > Nick wrote: >> >> One problem here is where you think Stata is looking for saved results >> such as r(p1). Either non-missing values are accessible because they were >> left behind by some _previous_ command; or Stata will use missing values, >> which in your case will result in lack of restriction on the observations >> used. It's not an error to refer to saved results that don't exist. > > > > I get it! > > So either I need to add summarize,detail before every new computation > dependent upon r(pi) (i=1,2,...) or I need to save these values. I'm > guessing the latter is more efficient, so I'll probably do that eventually. > In the meantime, I confirm that the following seems to produce the correct > results: > > > foreach var of varlist `variables' { > quietly summarize `var', detail > > quietly estpost summarize `var' if inrange(`var',`=r(p1)',`=r(p10)'), > detail > esttab using moments`var'.tex, replace cells("count mean sd skewness > kurtosis") noobs nodis nonumbers nonotes > quietly summarize `var', detail > > quietly estpost summarize `var' if inrange(`var',`=r(p90)',`=r(p100)'), > detail > esttab using moments`var'.tex, append cells("count mean sd skewness > kurtosis") noobs nodis nonumbers nonotes > } > > Thanks Nick. > > > > Nick wrote: >> >> You refer here to several user-written commands but in no case do you >> explain where they come from. > > > > Well, I googled "stata export table latex" and quickly gathered a few of > them. I'm not sure which one is the most appropriate for my problem, can you > recommend one? > > Thanks, > > -- > Patrick Toche. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: Re: Re: st: Tabulate summary statistics by percentiles and save output***From:*annoporci <annoporci@gmail.com>

**References**:**st: Tabulate summary statistics by percentiles and save output***From:*annoporci <annoporci@gmail.com>

**Re: st: Tabulate summary statistics by percentiles and save output***From:*Nick Cox <njcoxstata@gmail.com>

**Re: Re: st: Tabulate summary statistics by percentiles and save output***From:*annoporci <annoporci@gmail.com>

- Prev by Date:
**st: CEM speed up.** - Next by Date:
**st: Creating object names in Mata through looping** - Previous by thread:
**Re: Re: st: Tabulate summary statistics by percentiles and save output** - Next by thread:
**Re: Re: Re: st: Tabulate summary statistics by percentiles and save output** - Index(es):