Dear Statlist community,
Despite being a very simple question, I did not figure how to perform this command through my textbook or by reading previous topics by searching through this forum. If this has been discussed earlier, I would be very grateful if someone could redirect me.
I have huge datasets where I want to check for groups of specific string-values in a specific variable. This can be done by "list in if variable == "value"", but this seems to be very ineffective, time-consuming, and computationally expensive. Also, in many instances, I want only to check if the value contains a set of letters at the beginning of the string value. An example can be that I want to check for whether the variable icd_10 in a certain dataset contains the value of C31 (but this can typically contain values of C310, C311, C312, etc - but I want to check C30 as a group).
Kind regards,
Haakon
Related Posts with Checking for specific string values
A meta-comment about posts following up on old threadsI rarely find that a posting following up on an old thread is useful, and I wonder if that practice …
Generating new observation for all id's in panel dataDear Stata community, can you help me with this issue of adding a generated observation to the data …
Multilevel model: REML or robust SE's?My apologies for the silly question: I've been running a mixed effects model and since I have a smal…
How to calculate institutional investor churn rate and investor turnoverHello My study looks at investor horizon and return predictability. I tried checking the posts on ho…
putexcel in foreach loopI am having some issue writing my data to excel in a for loop. I am very new to macros and loops. Ba…
Subscribe to:
Post Comments (Atom)
0 Response to Checking for specific string values
Post a Comment