Statalist


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

=?UTF-8?Q?R=C3=A9p.=20:=20Re:=20st:=20How=20to=20print=20in=20bl?==?UTF-8?Q?ack=20an=20interval=20in=20an=20histogram?=


From   "Herve STOLOWY" <stolowy@hec.fr>
To   <statalist@hsphsun2.harvard.edu>
Subject   =?UTF-8?Q?R=C3=A9p.=20:=20Re:=20st:=20How=20to=20print=20in=20bl?==?UTF-8?Q?ack=20an=20interval=20in=20an=20histogram?=
Date   Wed, 23 Apr 2008 23:26:08 +0200

Dear Sergiy:

Thank you for your reply. 

In the mean time, I discovered the graph editor of Stata 10. There is the solution to my problem (click on the histogram, right click on the selected observation, click on observation properties, choice of a color).

Thanks again.

Best regards

Herve

***********************************************************
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
>>> "Sergiy Radyakin" <serjradyakin@gmail.com> 23/04/08 17:57 >>>
Dear Herve,

here is an example which might help you:


sysuse auto
gen price1=price if rep78==1
gen price2=price if rep78==2
gen price345=price if inlist(rep78,3,4,5)
graph bar price1 price2 price345, over(rep78) bar(1,color(blue))
bar(2,color(red)) nofill

Note 3 things:
1) price is separated into three vars, so that styles can be
controlled individually
2) using graph bar instead of histogram, since option -bar- does not
apply to histogram for some reason.
3) using -nofill-option to align the bars properly

I think you can first compute the frequencies, put them in a small
dataset, then plot it similarly to this example.

Hope this helps.

Best regards, Sergiy

On 4/23/08, Herve STOLOWY <stolowy@hec.fr> wrote:
> Dear Statalisters:
>
> I get histograms which represent the distributions of earnings (for levels of earnings between -10% and +10% of assets). I get 20 intervals. Each has a width of 1%.
>
> I would like to know if there is a possibility to print in black (or a different color or design) the two intervals directly adjacent to zero (which represent the heart of my study).
>
> I provide below the command lines. (Thanks again to all the replies I received recently and which helped me to be able to get these graphs).
>
> foreach val in "AUS" "FRA" "GBR" {
>
> label define post_ifrs2 0 "Pre IFRS" 1 "Post IFRS"
> label values post_ifrs post_ifrs2
> distinct name if abs(ib_scaled_w)<.1 & country=="`val'" & sample_sum==1 & post_ifrs==0
> local n0 = r(N)
> local n0bis = r(ndistinct)
> distinct name if  abs(ib_scaled_w)<.1  & country=="`val'" & sample_sum==1 & post_ifrs==1
> local n1 = r(N)
> local n1bis = r(ndistinct)
> la def `:val label post_ifrs' 0 `"`:label (post_ifrs) 0': `n0' obs."', modify
> la def `:val label post_ifrs' 1 `"`:label (post_ifrs) 1': `n1' obs."', modify
>
> histogram ib_scaled_w if abs(ib_scaled_w)<.1 & country=="`val'"  & sample_sum==1, bin(20) by(post_ifrs, note("Number of firms - Pre IFRS: `n0bis' firms, Number of firms - Post IFRS: `n1bis' firms")) title("`val'") saving (hist_`val', replace)
>
> label drop post_ifrs2
>
> }
>
> graph combine hist_AUS.gph hist_FRA.gph hist_GBR.gph, saving(hist_combine.gph, replace) altshrink
>
> 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/
>
*
*   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/


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