I have a dataset that lists all products sold in a one year period in two stores. The quantity sold is aggregated on a monthly basis. A product is normally observed many times. I want to drop all observations of products that are only sold in one of the stores. I only want to keep product_ID's that are sold in both stores. When it was sold is not a matter.
My key variables are month, product_ID, dummy variable Store.
If would be very happy if someone could help me.
Example data:
Month | Product_ID | Store
------------------------------------
1 | 1000 | 0
1 | 1000 | 0
2 | 1001 | 0
7 | 1002 | 0
8 | 1002 | 0
1 | 1000 | 1
1 | 1003 | 1
5 | 1001 | 1
5 | 1003 | 1
If this was my enitre data set I would like to drop all observartions of product_ID 1002 and 1003
Related Posts with Keep only matching values
Multiple cox regression models codeDear all I have the following data set titled "EyeSurgery" The data contains 3000 IDs of patients.…
Significant AR(2) and low Hansen TestHi all, I am currently working on a dissertation to assess the state level of tax impact on marijua…
Bar graph showing percentages in each categoryI have: Y X 1 1 1 0 1 1 2 1 2 0 I want to have a bar graphs that displays two bars for each value o…
Gravity model ppmlhdfe last estimates not foundHi all, I have been dealing with this set of data for a long time, but still can not get to final r…
Bootstrapping proportionsHi - I'm new to Stata and need help with what is probably a simple task, if you know how to do it. …
Subscribe to:
Post Comments (Atom)
0 Response to Keep only matching values
Post a Comment