Working With String Variables in Stata

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ต.ค. 2024
  • 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/1...
    Download Data and Do file:
    thedatahall.co...
    Website: thedatahall.com
    As an Amazon Associate, I earn from qualifying purchases.

ความคิดเห็น • 14

  • @varunmiglani110
    @varunmiglani110 ปีที่แล้ว +1

    very useful commands for data management

  • @naimatkadha817
    @naimatkadha817 10 หลายเดือนก่อน

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

    • @thedatahall
      @thedatahall  10 หลายเดือนก่อน

      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 10 หลายเดือนก่อน

      Many thaks@@thedatahall

  • @peepepepe3616
    @peepepepe3616 14 วันที่ผ่านมา

    Hello I have a question. I have one string variable which have 4 characters the first two are the houres a the two second are the minutes How can I Split that variable into to variable one for the houres and other for the minutes?

  • @milimomashini9432
    @milimomashini9432 ปีที่แล้ว +1

    very useful sir thanks for video

  • @rassoronmore8931
    @rassoronmore8931 8 หลายเดือนก่อน

    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  8 หลายเดือนก่อน +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.

  • @tingting1818
    @tingting1818 ปีที่แล้ว

    thank you so much

  • @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

  • @jesuscardenas2551
    @jesuscardenas2551 ปีที่แล้ว

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

    • @thedatahall
      @thedatahall  ปีที่แล้ว

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