Hi there,
I am using Stata 15 and I am having trouble using the command graph. This is the code I am using:
mylabels 0(10)40, local(pctlabel) suffix("%")
graph hbar rt, ylab(`pctlabel') over(var1, sort(1)) over(var2) ///
blabel(total, format(%4.0f) color(black)) ylabel() ytitle("") ///
title ("Some Title", position(12) color("0 43 92"))
var1 and var2 are categorical variables.
I realized that, when using this code, I get the same values of var1 for each category of var2, despite the fact that not all var1 categories have a correspondence with var2.
Is there a way I can use graph bar to graph and display the labels of only those categories of var1 that are "not empty".
I am attaching an image that may explain better my question.
Thanks in advance for your help.
Array
Related Posts with Problem with labels using graph
Difference of a variable based on corresponding variables in other columnsHi, Based on a subset of data pasted below: Code: * Example generated by -dataex-. To install: ssc…
'End Duplicates' error in mata programing Hello, everyone. I'm Zhang. I would like to ask you a question about an 'End Duplicates' error in …
PPML multicolinealityHi, I have estimated a model with OLS and PPML. With OLS I obtain R2 = 0.78 estat vif = 1.2 With…
Mediation analysis with STATA and control variables?I've seen a lot of forms to do a mediation analysis, being Baron and Kenny (1986) steps the most pop…
georoute command and HERE API not working?hello all, I'm having some trouble with the HERE API and the georoute package. I registered for a H…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with labels using graph
Post a Comment