How to convert string to numeric data in Stata| Destring in Stata

Поділитися
Вставка
  • Опубліковано 23 січ 2025

КОМЕНТАРІ • 19

  • @ProffyChaos
    @ProffyChaos Рік тому +1

    thank you for your helpful video. Much easier to understand the official Stata stuff.

  • @ppp3729
    @ppp3729 Рік тому +2

    Absolute Genius you are! Incredible!!!!! You should definately getting more reviews. I am so glad your videos are naturally found on Google - thank you 🙏🙏♥

  • @taylarh
    @taylarh 2 роки тому +1

    Thank you very much for this video! I'm very new to econometrics and this has saved my dissertation! :)

  • @varunmiglani110
    @varunmiglani110 Рік тому

    need help i have string variable . 5 acres 5 acre when i use command destring Whatisthetotallandinacres, gen(ttlown1) i("acre" "acres" " acre*") i get contains characters not specified in ignore(); no generate

    • @thedatahall
      @thedatahall  Рік тому +1

      U can only use one string in ignore option. In this case u might want to use subinstr function. Check my video on string variable

    • @varunmiglani110
      @varunmiglani110 Рік тому

      @@thedatahall thanks, query resolved

    • @thedatahall
      @thedatahall  Рік тому +1

      That is great. How did you resolved it...i e. What command/function did u uses

    • @varunmiglani110
      @varunmiglani110 Рік тому +1

      @@thedatahall Seek your feedback, i ran following commands as i had acre acres in my data.
      gen ttlown3= subinstr(ttlown2,"acre"," " ,.)
      gen ttlown4= subinstr(ttlown3,"s"," " ,.)
      replace ttlown4=trim(ttlown4)

  • @varunmiglani110
    @varunmiglani110 Рік тому

    Useful video. request for advice: If we have data like 100,000. How do we get rid of comma . we dont want to replace it with decimal

    • @thedatahall
      @thedatahall  Рік тому +1

      You can try ignore option in destring
      Destring variable,ignore(",")

    • @varunmiglani110
      @varunmiglani110 Рік тому

      @@thedatahall thanks. also what if my data column has
      Rs.18,000
      rs.5750
      I need only numbers in cell. i want to ignore Rs. rs. and ,

    • @thedatahall
      @thedatahall  Рік тому +1

      You can use subinstr function check my latest video "working with strings"

    • @thedatahall
      @thedatahall  Рік тому +1

      You are our regular viewer and i enjoy your queries. Do promote our channel in your academic circle. Thanks

    • @varunmiglani110
      @varunmiglani110 Рік тому

      @@thedatahall yes , I teach Stata to my undergraduate students, i have shared your videos as reference

  • @guidoverosimile2734
    @guidoverosimile2734 Рік тому

    Grazie amo