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
Is there any way we could permanently set the graphregion(fcolor(white))?I like white plotting background. So, to make it white, I have to set the graph region color option …
Create multiple observations from a current one considering a specific variableI have a set of companies with the date they were founded and the date they were acquired by other c…
GamHello I am not able to get GAM to work anyone has advice on how to download GAM? Thank you …
Why trend is important in AMG and CCEMG estimators?Dear Statalist I read many papers estimate the CCEMG and AMG using the command of xtmg they add tre…
Picking initial log of value added per worker per country in their initial yearHi, I am trying to figure it out how to set up Stata to pick the first log of real value added per …
Subscribe to:
Post Comments (Atom)
0 Response to Line graph for categorical data
Post a Comment