Good Afternoon,
I have a large data set which has about 11,000 observations like the code presented below.
I am trying to find a way to combine the values under "var" into a single one for each year. For instance, I want to add all 7 values of var for country id 2 and year 1952 into a single observation for the year 1952, and then repeat this 1,645 times to cover the entire data set.
I appreciate any insight or suggestions! - John
I have a large data set which has about 11,000 observations like the code presented below.
I am trying to find a way to combine the values under "var" into a single one for each year. For instance, I want to add all 7 values of var for country id 2 and year 1952 into a single observation for the year 1952, and then repeat this 1,645 times to cover the entire data set.
I appreciate any insight or suggestions! - John
Code:
country_id year sharedrule var 2 1952 constitutional_reform .9723096 2 1952 executive_control 1.944619 2 1952 fiscal_control .9723096 2 1952 law_making_a .4861548 2 1952 law_making_b 0 2 1952 law_making_c .4861548 2 1952 law_making_d .4861548 2 1953 constitutional_reform .9723096 2 1953 executive_control 1.944619 2 1953 fiscal_control .9723096 2 1953 law_making_a .4861548 2 1953 law_making_b 0 2 1953 law_making_c .4861548 2 1953 law_making_d .4861548 2 1954 constitutional_reform .9723096 2 1954 executive_control 1.944619 2 1954 fiscal_control .9723096 2 1954 law_making_a .4861548 2 1954 law_making_b 0 2 1954 law_making_c .4861548 2 1954 law_making_d .4861548