Dear all,
I am currently working with a dataset where I would like to get the sum of values with certain characteristics.
This is my code:
list country obstime sector obsvalue
foreach var of varlist country obstime sector obsvalue {
keep if country == "DEU"
keep if sector == "AGR"
drop if qdate < 240
}
if I execute the code, I get the following table:
country obstime sector obsvalue
1. DEU 2020-Q1 AGR 4329.4
2. DEU 2020-Q2 AGR 4290.1
Now I would like to calculate the total of obsvalues. I tried different options but I am still stuck at this point. Does anyone know how to do this?
I would appreciate any kind of help. Thank you in advance!
Related Posts with Calculate sum of values in a table
Separating by group in a scatterI would like to plot the mean wage with confidence standard deviations by grade and race (black v wh…
How to extract matrix elements to Word table using putdocx table?I have a matrix called matrix1 whose values are present and verified (e.g., using matrix list matrix…
Fill a dummy for all individuals based on the answer of only oneHello everyone, Just a quick question on dummy creation. I'm working on a household survey and I w…
How to calculate weighted mean incomeI want to calculate a weighted mean income for each state. Here is a part of the sample. (I randoml…
How should I test significance between 2 groups?I have two groups. I want to measure whether group difference is significant or not. For example, in…
Subscribe to:
Post Comments (Atom)
0 Response to Calculate sum of values in a table
Post a Comment