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
Technical indicatorsHi, I am trying to replicate three technical indicators as done in the paper Neely et al. (2014) to…
Currency conversion for several time periodsHello everyone, I would like to translate one of my variables (ValueUSD) into values in EUR, depend…
Problems lagging a variable with PPML estimatorDear all. I am trying to lag a variable with the PPML estimator through the command = L. The varia…
Can I use Likliehood Ratio Test to choose Double Hurdle Model over Tobit?I am trying to analyze the determinants of the intention to grow an a certain variety of maize in Za…
Interactive Year Fixed EffectsHello, I have a regression of the form: xtreg yvariable c.xvariable#i.year c.xvariable i.year `cont…
Subscribe to:
Post Comments (Atom)
0 Response to How to split numeric variables based on rule
Post a Comment