Foreach loop in Stata: A detailed explanation | Stata Tutorial

Поділитися
Вставка
  • Опубліковано 1 лис 2024

КОМЕНТАРІ • 28

  • @BilalHassan-zv8wh
    @BilalHassan-zv8wh 6 місяців тому

    Hi. Thanks for the video. I want to run bivariate logistic reg with factor variable such educational or income levels for each year. May you please tell me how this type of loops would work work? Thanks

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

    Superb channel. Wish I had it in college

  • @tuhinurrahmanchowdhury9705
    @tuhinurrahmanchowdhury9705 3 роки тому

    Excellent explanation! Waiting for many more

  • @subharthipradhan5987
    @subharthipradhan5987 2 роки тому

    Can you show me Multidimensional Poverty Index using statA from DHS data....or any commmany

  • @moirarising3363
    @moirarising3363 2 роки тому

    Many thanks, can you please post the link to the video on how to read syntax in STATA?

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

      Please check this video. It explains how to read stata syntax ua-cam.com/video/NxvHM_ht39Y/v-deo.html

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

      Many thanks. I have added the link in description. Pleaes let me know if you find any misisng link in any other video.

    • @moirarising3363
      @moirarising3363 2 роки тому

      @@thedatahall Thank you!

  • @varunmiglani110
    @varunmiglani110 3 роки тому

    very nice. i have query in levelsof. if i have to perform regression of 1999 and 2000 year seperately and not of all the time periods. then what will be the commanf

    • @thedatahall
      @thedatahall  3 роки тому

      You can use if statement along with regression e.g regress y x1 x2 if year==2000

    • @varunmiglani110
      @varunmiglani110 3 роки тому

      @@thedatahall suppose here we want regression for 1999 as well how to do in loop

    • @thedatahall
      @thedatahall  3 роки тому

      @@varunmiglani110 can you email me the data info@thedatahall.com i will check and send you the code.

    • @varunmiglani110
      @varunmiglani110 3 роки тому

      @@thedatahall sent

  • @NasriddinovSalohiddin-p8q
    @NasriddinovSalohiddin-p8q 3 роки тому +1

    Good job

  • @varunmiglani110
    @varunmiglani110 3 роки тому

    levelsof cropcode, local(code)
    foreach x in local `code' {
    tabstat acd ack if cropcode==`x' & & state_s==1, stat(su)
    }
    i get error local not found

    • @thedatahall
      @thedatahall  3 роки тому

      U have to run all these commands simultaneously if u have saved then in do file the select them all and run

    • @varunmiglani110
      @varunmiglani110 3 роки тому

      @@thedatahall yes i am running all of them simultaneously

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

    How to use local and global macros in loops?

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

      ua-cam.com/video/10X7JWDSQmw/v-deo.html
      Please check this video on local global macro. Once u define a macro you can directly use them in loop.

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

    What is ado file how it's work in do file

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

      Ado files are command files.. e.g if u download a user written command it will come in ado extension

    • @subharthipradhan5987
      @subharthipradhan5987 2 роки тому

      @@thedatahall please give me a example with a video please

  • @BilalHassan-zv8wh
    @BilalHassan-zv8wh 6 місяців тому

    Hi. Thanks for the video. I want to run bivariate logistic reg with factor variable such educational or income levels for each year. May you please tell me how this type of loop would work work? Thanks

    • @thedatahall
      @thedatahall  6 місяців тому

      U can use bys year: logistics etc etc . U may not need loop

    • @BilalHassan-zv8wh
      @BilalHassan-zv8wh 6 місяців тому

      Thanks for quick reply l. have twenty years/countries. It looks more handy to use loops than bys years to draw coefficient plots of bivariate and multivariate models