Thank you very much, Mike! You make it seem so simple... I am much more confident now thanks to your guidance. Please post more videos like this when you can.
Hi Mike, Thank you for the posting. If I have data about unemployment rate (UNRATE) and corruption (CRP) across 20 countries (country id from 1 to 20) and if I want to run a regression "reg UNRATE CRP" for each country, how can I do this using the loops codes?
I added a link in the description for "An Introduction to Stata Programming" by Baum, which covers loops, as well as many, many other useful topics. The "Microeconometrics Using Stata" book (also linked in description) has some examples of loops as well.
@ mike Jonas econometrics; I have a quarterly dataset (1999q1-2015q4) with several IDs. But I want to keep the data if the value of a variable (Total loans) >= 30000 irrespective of the year and quarter. How do I set the function for such exercise? I defined available =0, and replace available =1 if Total loans>= 30000. But along the lines, in Q1 for some ID they are =0 and in q4=1 but I want to keep All years and quarters as long as it is =1 in a single quarter. Does anyone have an idea?
Hi Mike, Could you give me an advice for my case? I have panel data of 100 companies with time frame from 2009 - 2017. Now, I need to run regression for each company and save coefficient of each regression. Thank you very much!
@Mike Jonas___ Can you pelase share Federal reserve data with this video? If possible, Please upload a new video showing how to down load Federal reserve data into STATA through API Key.... Just a request.. Thanks for the video.
Hello, could you please help me with a Stata assignment? Could I schedule a zoom meeting with you? The assignment is due tomorrow and I’m truly lost with STATA.
Hello guys whoever you are reading this i would very appreciate it if you would let me know how i can solve this problem. So right now this is the command that i would like to repeat: _pctile expcap [fweight = wert] if province == "Aceh", p(20) replace p20prov = r(r1) if province == "Aceh" the command above works perfectly with the value "Aceh" is the variable in the list which has many values I was trying this line of command, however it just won't work: foreach prov of province { _pctile expcap [fweight = wert] if province == "'prov'", p(20) replace p20prov = r(r1) if province == "'prov'" } if you know how to solve it please reply in the comment section thank you
Thanks a ton . please make more stata videos. They are really great ...
Thank you very much, Mike! You make it seem so simple... I am much more confident now thanks to your guidance. Please post more videos like this when you can.
Thanks, will do!
Hi, is there a way to use a loop to display multiple regression results as you did in the last section of the video but without using a time variable?
Hi Mike,
Thank you for the posting. If I have data about unemployment rate (UNRATE) and corruption (CRP) across 20 countries (country id from 1 to 20) and if I want to run a regression "reg UNRATE CRP" for each country, how can I do this using the loops codes?
Incredible stuff. This really really helped me out in my thesis. I really appreciate it man. Thanks a lot and keep up the good work :D
Nice video!!! Thanks so much!
Thank you, Haim - I’m very glad you found the video to be helpful. Please let me know if there are other topics you’d like me to cover.
Thnk u so much. I rlly appreciated for this video. Do u have any book recommendation for this entire loop thing?
I added a link in the description for "An Introduction to Stata Programming" by Baum, which covers loops, as well as many, many other useful topics. The "Microeconometrics Using Stata" book (also linked in description) has some examples of loops as well.
@ mike Jonas econometrics; I have a quarterly dataset (1999q1-2015q4) with several IDs. But I want to keep the data if the value of a variable (Total loans) >= 30000 irrespective of the year and quarter. How do I set the function for such exercise? I defined available =0, and replace available =1 if Total loans>= 30000. But along the lines, in Q1 for some ID they are =0 and in q4=1 but I want to keep All years and quarters as long as it is =1 in a single quarter. Does anyone have an idea?
Try this:
By ID: egen maxloans=max(loans) // keep if maxloans >=30000
Hi Mike,
Could you give me an advice for my case?
I have panel data of 100 companies with time frame from 2009 - 2017. Now, I need to run regression for each company and save coefficient of each regression.
Thank you very much!
this really was very helpful! thank you so much
@Mike Jonas___ Can you pelase share Federal reserve data with this video? If possible, Please upload a new video showing how to down load Federal reserve data into STATA through API Key.... Just a request.. Thanks for the video.
there is problem with the sound
Thought it was just me!
thanks a lot
where is the audio? can hear just whispers.
Will delete the video, my apologies.
Hello, could you please help me with a Stata assignment? Could I schedule a zoom meeting with you? The assignment is due tomorrow and I’m truly lost with STATA.
I'm not available over zoom, but can try to respond to specific questions over email: mrjonas23@gmail.com
Hello guys whoever you are reading this i would very appreciate it if you would let me know how i can solve this problem. So right now this is the command that i would like to repeat:
_pctile expcap [fweight = wert] if province == "Aceh", p(20)
replace p20prov = r(r1) if province == "Aceh"
the command above works perfectly with the value "Aceh" is the variable in the list which has many values
I was trying this line of command, however it just won't work:
foreach prov of province {
_pctile expcap [fweight = wert] if province == "'prov'", p(20)
replace p20prov = r(r1) if province == "'prov'"
}
if you know how to solve it please reply in the comment section thank you
The thing I hate the most in stata. 😵
I cannot hear you bro, and I am not deaf.