bar graph in STATA -- how to get p values or *** on bars

bar graph in STATA -- how to get p values or *** on bars

by Rima Arnaout -
Number of replies: 4

Hi,

I made a bar graph in STATA, but am not sure how to find a way to post the p-values and/or *** representing p-values between bars, the way one can do it in excel ... is there a way?

Or, if I choose to do my figure in excel so I can get these p-values, then I am concerned my .smcl file for the Figure creation won't show all my work (because some of it will be done in Excel). Is that ok?

Thanks

In reply to Rima Arnaout

Re: bar graph in STATA -- how to get p values or *** on bars

by Rima Arnaout -

One more thing -- how to make the bars themselves thicker in STATA? I've looked around, can't seem to find it.

 

Thanks

In reply to Rima Arnaout

Re: bar graph in STATA -- how to get p values or *** on bars

by Wayne Enanoria -

I have no idea what kind of bar plot you are making but have you tried the  barwidth(#) option? I know twoway bar has this as a valid option.

For example twoway bay y x, barwidth(0.8) 

makes the bars 0.8 times the default width.

In reply to Rima Arnaout

Re: bar graph in STATA -- how to get p values or *** on bars

by Wayne Enanoria -

The p-value can be stated in the figure legend. However, the final project instructions clearly state that you can create the graph using Stata or Excel so it is your choice how you want to create the figure. You should be able to add text to a bar plot using the text option which will require you to specify the x and y coordinates where the text should go as well as the text to be written as well. See help added_text_options for more details.

In reply to Wayne Enanoria

Re: bar graph in STATA -- how to get p values or *** on bars

by Mark Pletcher -

Right.  Just make sure that the actual p-value is generated in Stata.  Then you can use Excel to make the graph and put the p-value on the graph.