Hello Stataliest,
I have the following variables:
ID
Region
Productname
Date
Price
I want another variable that tells me how many IDs sell Product1 or Product2 in each region.
I have tried egen tag_product=tag(product Region) if productname=="Product1" | "Product2"
(I only obtain nulls, which must be wrong)
and
egen tag_product=count(Productname) if Productname=="Product1"| "Product2"
Here I got a type missmatch
Can you help me?
Thanks.
I have the following variables:
ID
Region
Productname
Date
Price
I want another variable that tells me how many IDs sell Product1 or Product2 in each region.
I have tried egen tag_product=tag(product Region) if productname=="Product1" | "Product2"
(I only obtain nulls, which must be wrong)
and
egen tag_product=count(Productname) if Productname=="Product1"| "Product2"
Here I got a type missmatch
Can you help me?
Thanks.
Comment