Hi Stata folks, I am working on a dataset where each ID is associated with a numeric value comprised of 0 and 1s. What I need to do now is to extract part of the numeric values based on a rule. For instance, for a value of 1001100, I need to extract the last three digits (100); for a value of 1010110, I need to extract the last two digit (10); for a value of 1011000, I need to extract the last four digits (1000). The rule is to extract the part where the last 1 was seen (together with the 0s behind the last 1s). Is there a way to achieve this using stata? Thanks!
Related Posts with How to split numeric variables based on rule
Deciding equation when analyzing by ppmlHello My data is panel data with strongly balanced . As I want to know the effect of lpi on export a…
Non integer weights - problemHi. I'm using weights from the European social Survey which have three different weights: design, po…
How to make mother education variable for each observation in a large datai have data in the form of Parent key KEY indvidual_number_ in_ roaster completed education mother l…
Logit model for estimate Demand (Berry 1944)Hello everybody I have the following excercise to estimate Demand allowing for heterogeneal prefere…
Mark Highest Recurring ObservationDear All, Hope you are well. I am wanting to generate a variable that marks the highest recurring …
Subscribe to:
Post Comments (Atom)
0 Response to How to split numeric variables based on rule
Post a Comment