-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to set the graph region size and use value labels for yaxis labels #3
Comments
Thanks, Eric. Hongyu, could you take a look?
…On Tue, Jul 18, 2023 at 5:48 AM Eric Melse ***@***.***> wrote:
Dear Hongyu and Yiqing,
I have manually edited some of the labels to give you an impression of
what I am looking for, using this code:
panelview median , i(c_sector) t(age) type(treat) xlabdist(1) ylabdist(1) bytiming ///
graphreg(m(l-17 r-15 t-0 b-4)) tit("", s(*.8) m(t-0 b+0)) /// xsize(4) ysize(4)
xtit(, m(t-1)) ytit("market sector", m(l-2 r+3)) ///
text(37.4 5 "Median salary stanine:" , s(3pt)) ///
ylab(1 "Catering industry" 2 "Industry" 3 "Other services" 4 "Transport" 5 "Health care" 6 "Bankers, insurers" 7 "ICT" 8 "Unknown" 9 "Other industry" ) ///
legend(pos(6) tit("", s(2pt)) symy(*.68) symx(*.54) bmargin(t-1.5))
which results in:
[image:
PANELVIEW_Example_salary_by_market_sector_and_age_using_value_labels_manually_20230718]
<https://user-images.githubusercontent.com/3686136/254265592-1101109d-ad00-4987-8dd4-9e5bc38b5955.png>
As such, because of the problematic graphregion (x) size, your panelview
plot is pushed to the right side of the plot.
I think there are some options to automate the use of the value labels
but, for my suggestions, I would need to know how the sorted order of the
panelview is stored in the background. When a matrix is used I do know
how value labels can be saved and retrieved to store in the result matrix
for proper use. Maybe even as a variable.
—
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2PKGEXN23M7T5ZB6OMM33XQ2AYJANCNFSM6AAAAAA2IY5BRE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Yiqing Xu
Assistant Professor
Department of Political Science
Stanford University
https://yiqingxu.org/
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dear Hongyu and Yiqing,
Working on a rather simple example to visualize the pattern of salary earned in various sectors by age groups, reported by the salary stanines, I do get an interesting result but also I would like to ask you for some options.
I upload a zipped dta and do file so you can replicate my example:
Example_salary_by_market_sector_and_age.zip
The code used is:
which results in:
As such this is already very good, The plot seems to indicate that within market sectors, generally, there is a tendency that the median salary increases by age group. Something that should not be a surprise. However we can observe exceptions like for market sector 10 and 8. Also of interest is where information is not available in sectors or age groups.
Having described this first impresstion of the
panelview
plot, you maybe can understand that I would like to use the value labels of the variablec_sector
for yaxis labels. Instead of the values being reported as yaxis labels, I would like to be able to use the labels, names, of the sectors, like:But, to be able to make this work graphically, we need also the ability to set the size of the graphregion, like:
That is now not possible and an error message is reported in the result window of Stata:
Time permitting, maybe you can implement both options.
Best regards,
Eric Melse
The text was updated successfully, but these errors were encountered: