Working With String Variables in Stata

Поделиться
HTML-код
  • Опубликовано: 26 май 2023
  • In this video, we discuss how to extract specific text from a string variable using substr and the word function. Further, how to count the number of characters in the string variable or count the number of words in the string variables. How to remove white spaces from the string variable or convert the case to text to upper, lower, or proper case. Check the position of specific characters in the text, or split a string variable into multiple variables.
    Download the exercise file:
    payhip.com/b/1XGra
    Download Data and Do file:
    thedatahall.com/cleaning-extr...
    Website: thedatahall.com
    As an Amazon Associate, I earn from qualifying purchases.

Комментарии • 13

  • @milimomashini9432
    @milimomashini9432 11 месяцев назад +1

    very useful sir thanks for video

  • @tingting1818
    @tingting1818 9 месяцев назад

    thank you so much

  • @varunmiglani110
    @varunmiglani110 Год назад +1

    very useful commands for data management

  • @naimatkadha817
    @naimatkadha817 7 месяцев назад

    Informative as usual. I have a suggestion to please upload the do file in description of the video.

    • @thedatahall
      @thedatahall  7 месяцев назад

      Thnaks for the suggestion. I have added a link to the files in the description of this video. We will do it for other videos as well.

    • @naimatkadha817
      @naimatkadha817 7 месяцев назад

      Many thaks@@thedatahall

  • @varunmiglani110
    @varunmiglani110 Год назад

    i have data in some cell it is: "Received" in another cell: Continuing without support now i want for both these observations to get a code of 1 in newly generated variable. how to put two criteria in strmatch

  • @rassoronmore8931
    @rassoronmore8931 5 месяцев назад

    This is a very useful video. I want to ask how do we match multiple words? Like if I want to look for any of the multiple words in the variable data?

    • @thedatahall
      @thedatahall  5 месяцев назад +1

      Please look into the inlist function, i do have a video on that, if it doesn't work the n send me an email at info@thedatahall.com along with example data.

  • @jesuscardenas2551
    @jesuscardenas2551 10 месяцев назад

    Is there any way to identify blank spaces in string variables? I do not need to remove it, just to identify it

    • @thedatahall
      @thedatahall  10 месяцев назад

      You can use following command
      gen var=1 if regexm(variable_name," ")==1