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
dividing variable with lagged variableI am getting back to STATA after a very long time and is having some difficulties. I want to create …
String to Numeric-Need UNIQUE values---Encode/Destring/Real is not workingHi all, I am working with the following dataset: Code: * Example generated by -dataex-. To inst…
how to realize the LMtest and wald test of spatial panel data in stata?hey everyone, do you know how to realize the LMtest and wald test of spatial panel data in stata? an…
Estout: How to get rid of "Main" on top of the variable list when using esttab?Hi all, I want to get rid of the "main" writing on top of my list of variables in the regression tab…
Having problem correctly estimating a 3sls system of equation with Instrumental variables.Hello I'm currently doing my dissertation in Economics and chose from a topics list at my universit…
Subscribe to:
Post Comments (Atom)
0 Response to How to split numeric variables based on rule
Post a Comment