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
Help Interpreting Continuous Dummy Interaction Term in Fixed Effects Panel dataDear all, I have a question on how to interpret an interaction between a continuous and dummy varia…
Propensity score matching commandHello everyone, i want to use propensity score matching for impact evaluation. I used these ado comm…
how to create a factor variable in this case? and what is a threshold?Create factor variable “pop_fact” out of population, consisting of three categories: low populated, …
Option for mass replace instead of manually replacing many string variablesHello Statalisters, I want to merge two datasets using two string identifiers i.e. name of state an…
Difference in Difference in Matching by incorporating geographical fixed effectsDear All, I would like to ask about matching. If I have a panel data and I want to run Difference i…
Subscribe to:
Post Comments (Atom)
0 Response to Calculate sum of values in a table
Post a Comment