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
how can concat observation data by IDI have the dataset like this: ID Course 1 MS Word 1 MS Excel 2 Windows 2 DOS I want to change it a…
Referring to a certain value when generating a new variableHello, I want to refer to a certain value when generating a new variable. My panel dataset looks a…
Transform data from wide to long but then lots of values/observations went missing.Hi everyone, I have a dataset with dimension of individuals, observations (e.g income, total broadc…
IV regressions with interaction termsDear Stata community, I'd like to run an IV regression with interaction terms between the endogenou…
Dropping Observations and Creating Fertility VariableQuestion 1: I am using two fertlity variables- age at first intercourse (var name: age1stsex) and a…
Subscribe to:
Post Comments (Atom)
0 Response to Line graph for categorical data
Post a Comment