Hi, I have a problem of translating my categorical data into a line graph showing change over time. I have used the survey data, the answer is rather 0 for disagree and 1 for agree. I have one question but it is coded under different variables because they come from different years of survey, hence different datasets and I just merged the datasets together. Also the data goes by country. I attached the image, there are two other countries apart from Egypt. Q601_3 and Q601_31 are essentially the same question but recoded from different datasets hence different years, so I kept them under different variables. I do not understand how I can do a line graph over years using these two variables as basically one. I will attach below the graph that I made in excel. I tabulated the data and made a new table in excel exclusively with percentages to get this type of graph. At this point I wouldn't mind a bar graph as well, but I can't seem to combine both variables together.
graph hbar, by(COUNTRY) over(Q601_3)
graph hbar, by(COUNTRY) over(Q601_31)
This code worked, but it is not what I am looking for, unfortunately.
Also I do not understand how to potentially remove one of the responses for the graph (have just disagree or just agree).
I hope what I tried to explain was clear. Thank you! Also attached my merged dataset, I tried to combine the variables but the result turned out even more weird...
Related Posts with Line graph for categorical data
putpdf failed to add table, failed to set borderHello Statalist, I am trying to use putpdf to convert a surveyCTO-formatted survey into pdf, but I …
correlation across error terms in nlsurHi all, I am unsure on how to impose the correlation across the error terms in nlsur. Thanks in adv…
Export cross tabulation table to excel using stataHello folks, this may be a dumb question, but how can i get a cross tabulation output export to exce…
estout by Ben Jann (available from ssc): Add horizontal lines to table, csv formatHello, after three hours of trying and searching, here is my question: Is there an elegant way to a…
Repeated measures ANOVA: Standard errors of estimated marginal means produced by Stata's margins were different from that of SPSS's EMMEANSHi, Why the SE's of estimated marginal means differ in this case? And which one should be used if w…
Subscribe to:
Post Comments (Atom)
0 Response to Line graph for categorical data
Post a Comment