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
ACTEST Error: "struct ms_vcvorthog undefined"Hi folks, I am re-running some ITSA script from a couple of months ago with some updated data and ha…
import all excel sheets from a specified folder, and save as STATA filesHello - I am attempting to import all excel sheets from a specified folder, and save as STATA files.…
Graph dates X-axis formatHello, I have what I think is a simple problem but I cannot seem to solve: I want to graph just the…
How can I use Stata to generate 50 consecutive strings like star1 star2 star3 star4 star5........star50?As the title suggested, I know how to use R to generate them. However, I don't know how to do that i…
choosing the correct model estimationgood evening everyone i have a big problem with my database already i was focused on the gmm estimat…
Subscribe to:
Post Comments (Atom)
0 Response to Keep only matching values
Post a Comment