Statalist


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

Re: st: Graphs and number of observations


From   "Friedrich Huebler" <fhuebler@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Graphs and number of observations
Date   Thu, 10 Apr 2008 13:37:11 -0400

Herve,

You can list the number of observations in a footnote.

. count if post_ifrs == 0
. local pi0 = r(N)
. count if post_ifrs == 1
. local pi1 = r(N)
. histogram ib_scaled_w if ib_scaled_w >-.1 & ib_scaled_w<.1 &
country=="AUS"  & sample_sum==1, bin(20) by(post_ifrs, note("post_ifrs
= 0: `pi0' observations, post_ifrs = 1: `pi1' observations"))
title("AUS") saving (hist_AUS, replace)

Friedrich

On Thu, Apr 10, 2008 at 1:17 PM, Herve STOLOWY <stolowy@hec.fr> wrote:
> Dear Statalisters:
>
>  I am starting to use graphs. So, I hope that you will forgive my probably basic question.
>
>  I run the following command:
>
>  histogram ib_scaled_w if ib_scaled_w >-.1 & ib_scaled_w<.1 & country=="AUS"  & sample_sum==1, bin(20) by(post_ifrs) title("AUS") saving (hist_AUS, replace)
>
>  post_ifrs is a binary variable (coded 0 or 1).
>
>  Is there a way to display the total number of observations corresponding to each of the histograms obtained with the command? (one graph with post_ifrs = 0 and one graph with post_ifrs=1)
>
>  I searched in the Graphics Stata manual but did not find the solution.
>
>  Best regards
>
>  Herve Stolowy
>
>  ***********************************************************
>  Professeur/Professor
>  President of the French Accounting Association (AFC)
>  HEC Paris
>  Departement Comptabilite Controle de gestion / Dept of Accounting and Management Control
>  1, rue de la Liberation
>  78351 - Jouy-en-Josas
>  France
>  Tel: +33 1 39 67 94 42 - Fax: +33 1 39 67 70 86
>  mail: stolowy at hec dot fr
>  web: http://www.hec.fr/stolowy
*
*   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