Hello!
Now I am working with many files from 2006 to 2017 (each file for each year). In every of them there are date and month of interview, cost for food in this period, year of birth of a person and so on. I need to make a column with the number of week (1, 2, 3, 4) for each month and a column with money that he/she spent on food. I have already made a column for weeks. So, for every row I defined a number from 1 to 4. I do not know how to calculate the sum of costs for a particular week and month. Eventually, I need to make a linear graph, where on X axis I will have the number of week and month, Y axis - costs.
For example,
week month costs
4 12 200
1 11 500
2 10 300
3 10 550
4 12 350
1 11 400
2 12 250
And I think that I need to get something like
week month costs
1 11 900
2 10 300
2 12 250
3 10 550
4 12 550
Later I suppose I will need to sort it in order to make a graph, but, actually, now I do not know, how to draw it, when I have two conditions on a week and a month.
Could you help me with these problems, please?
Thank you in advance
Related Posts with Summarizing essential information by some conditions
Interpreting Interaction Term CoefficientsDear Stata Users, I intend to study the relationship between ethnicity and COVID-19 on income. I c…
HELP! xtline producing different graphs each runPlease help! I have a simple, balanced longitudinal data set. I xtset the data and then run xtline.…
Creating lagged variables with pooled cross sectional dataI am working with a dataset that contains student grade observations in a variety of subjects, in di…
Spilt variable and fill in numeric terms in the stringDear Statalist, I have a variable called Name which looks like below. I would like to spilt Name in…
Eliminating leading blanks from a stringHi all, It seems there are leading blanks for a string variable state in 2 out of 5 rounds of data …
Subscribe to:
Post Comments (Atom)
0 Response to Summarizing essential information by some conditions
Post a Comment