I want to count the occourences of a variable based on a regex expression - counted by a group of variables.
E.g.:
ID1 | ID2 | text | result |
12 | 23 | Hello | 1 |
12 | 23 | Bye | 1 |
99 | 23 | Hello | 1 |
My first idea was:
egen result=count(regexm(text, "Hello")), by(ID1 ID2)
or
egen result=count(text == "*Hello*"), by(ID1 ID2)
but both isn't working ...
Can you please help me?
Kind Regards
Simon
0 Response to Question: how to count occurrence with Regex grouped
Post a Comment