Speaker 1: Hello everyone, welcome to ResearchHub. My name is Yawal Haqmanim and I'm the founder of ResearchHub. With this video we are going to start a new playlist on Stata. Mostly we will be showing you how to do statistical analysis with Stata. In this first video we will have an overview of Stata and the topics that we will cover are like basic introduction to Stata, comparison of Stata with other statistical packages, how does the Stata interface look like and also some very common, the most common points when working with Stata. So first, Stata is a complete integrated statistical software package that provides more or less everything you need for data analysis, data management and graphics. And there are similar packages as you know like SPSS, SAS and R. We already have some playlists on R and SPSS and most likely we will also have some videos on SAS in the near future. And Stata puts hundreds of statistical tools that can be easily accessed. And also we have lots of user support available from the Stata Corporation but also there are lots of people, statisticians all over the world, they are working together to make it better and also helping each other in informal platforms in Facebook, in Google community. Here we can see a comparison of the Stata while comparing with SPSS, SAS and R and we are comparing mainly on five things, learning curve, user interface, data manipulation, data analysis and graphics. The learning curve in Stata is quite steep and gradual but where in SPSS it will be gradual or flat and then in SAS and R pretty steep. So what do we really mean by this learning curve? That means that when you start learning Stata, you will be learning quite fast and you will be learning quite a lot of things. But in the beginning, it could be a bit challenging. But when you pass through the challenges, your learning will be very fast. In SPSS, it comes with less challenges compared to Stata or any other software. So it is pretty much easier to use. But then the learning curve is also flat. It's not really, you will not make very high growths in your learning with SPSS. In user interface, in Stata, we have programming and also we have the, you can click and point and click. Okay, you can do. So in Stata, you can do both programming and point and click. In SPSS, it's mostly point and click, but we also have a syntax in SPSS where we can do programming. SAS and R, they are mainly programming. They don't have a very nice user interface where you can just click and get the results. But what I like about Stata is that it has a very nice click and point, point and click user interface. But the programming of Stata is also very intuitive. The commands in Stata is very intuitive. For instance, if you want to see a description of your variables, the format of the variables, you can just write describe and then the variable name. If you want to see some summary statistics, you can just write summarize and the variable name. Whereas in SPSS, the syntax of SPSS is less intuitive compared to Stata and a bit complicated to handle. But for SAS and R, again, the interface, the command, the command, it's the programming of SAS and R. They are also very intuitive, but they don't offer a point and click user interface. But for many of us, we don't really want to go through all this programming. We just want to do our statistical analysis. We have an understanding of the different methods, and we want to run them, and we want to get results, and we want to put them in our journal articles, right? So maybe we don't want to go through all this learning of programming, okay? So for those, the Stata is a very good tool. You can get lots of analysis using the user interface, but also with programming, you can extract them very nicely in your journal article format. But also, Stata offers this log file and do file, which are very useful to regenerate the results later. We will show those things in detail in the later videos. But then manipulation, data manipulation, Stata, SAS, and R, they're very strong. SPSS is also good, but not as powerful as the others. And for data analysis, more or less, SPSS, Stata, both of them are powerful. But SAS and R, they are also very versatile. You can manipulate very small parameters, and you can modify or adjust your figures and tables. You can go really in the very basic unit of modification and customization, if you can code, if you know how to code them. And for graphics, Stata, SAS, and R, they are pretty good, actually, quite very good. SPSS is also not bad. It's decent. But with Stata, SAS, and R, you can do much better. So that's a comparison of these statistical packages. And here, this is how normally it looks like there. When you open Stata, you will have mainly five windows. The first one is command, as you can see here, I marked with 1. So there, if we are using the programming or the commands for getting the results, there we will put our commands, and we will get the output in the part 2, in the window 2 here, as you can see. So here, we will get all our results and outputs, and then we will have a history of our commands or whatever we have ran in this part here. And then the variables, when we upload a data in Stata, the variables will appear here. When you don't have a data, it will be empty. And then, when you click a variable here, you will see the properties of the variable here, okay, in this window here. So this is how normally the Stata window looks like, and here on top here, file, edit there, we can go and click for the different analysis we want to do using the user interfaces. But we can alternatively also write the commands here, and we will get the outputs. In the upcoming videos, I'll be mostly showing you how to get results using the user interfaces, but also I will show you how to make use of the commands in a way that you can get the most out of it. And some preliminary steps in Stata is that you want to check your working directory. For that, you can use this command, pwd, and sometimes you want to change your working directory, then you can use the command cd, and then you just give the path of your new directory. You can create a log file using the command log, using the name of the file.log, and you can close your log file just using the command log close, but you can also do it from the user interface. I will show you both how to do that. And then, if you want to add more information, more output to your existing log file, then you can use this command, log using the name of the file, comma, append. So normally whenever you want to use the append command, then you should use a comma here. And if you want to replace a log file, then you can just, after, if you use the same name, like here, mylabsession.log, here also you are using mylabsession.log, you give a comma, and then replace, then you can replace an existing log file. So what is these log files? In the log files, normally, we will see all the outputs. So when we'll be running Stata, whatever the commands we'll be running, and whatever the outputs we'll be generating, all of them can be saved in a log file. But to do that, first you have to start a log file, and when you are done with your analysis, then you have to close the log file. And sometimes you want to see your Stata memory, then you can just run the command query memory. In addition to log file, we also use the do files. The do files are the files where we can save some of the commands, and we will also be able to save, put some comments next to the commands. So this command is used for this case. So whatever the reason we use the commands, we can add those things, those kind of comments in our do file. The best use of do file that I think is that it helps us to regenerate our results in a later point of time. So let's say if I run some analysis today, and if I save all those analysis, all the commands in a do file, and also with some comments, okay, I use this code for this reason and like that, then after six months, when I suddenly get a revision from my supervisor or my general reviewers, then I can just open the do file, I can easily see, okay, yeah, this is what I did, this is the comments I did, okay, nice. Then we can just load the file and click the do file and all the results will be regenerated. We don't have to go back and click, click, click, yeah, all these things again. We just click on the do file, run, and then it generates all the results. That's the main use of do file, in my opinion. And also you can just manipulate like simple things, you can change simple things in your do for generating additional results. So that I think also very useful for do files. Also when we are working on a paper like three or four co-authors, normally we share the do file and the data file among us. So all of us actually kind of runs the same data and same do file and checks the do file if there are some mistakes in our commands. And in this process, we actually validate the results of our research. So that's a very good use of do file, I also, in my opinion. Normally to get an overview of your data, you will use commands like this list, inspect, look for some, yeah, these kinds of comments, I will show them in the next video. And then also, Stata is normally a color-coded system where we have the black, red, and blue. Okay, so the black is normally for the results, red is for the warnings, and the blue is for the functions or the commands. So these are normally the three colors in Stata that we will see, but we can also change this color. I will show how to do that as well. And if you're working with an existing data set, you can actually just use this command use then file location and name of the file to open that, or if you have saved the data, if you have saved the data in the same working directory, then you can just use use file name. Okay, so if the working directory is set to where you have saved the data, then you can just use the command use and file name to open the data. Here we can see an example. We can also alternatively open the data using the user interface. Thank you for watching this video. If you find it useful, like, comment, and share.
Generate a brief summary highlighting the main points of the transcript.
GenerateGenerate a concise and relevant title for the transcript based on the main themes and content discussed.
GenerateIdentify and highlight the key words or phrases most relevant to the content of the transcript.
GenerateAnalyze the emotional tone of the transcript to determine whether the sentiment is positive, negative, or neutral.
GenerateCreate interactive quizzes based on the content of the transcript to test comprehension or engage users.
GenerateWe’re Ready to Help
Call or Book a Meeting Now