Stata Introduction, How to use Stata for a beginner 1/2

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everybody so I'm decided to make a video for the Johns Hopkins Bloomberg School of Public Health students but also for anyone else on YouTube about how to use data and what I thought I'd do is do the problem sets and show how to use stative because when I did this I didn't exactly when I was doing the problem sets I'm just I didn't really understand what I was doing with data I was just following commands and just praying that I'd figure it out as the day as a year went by and I basically did but I thought this might be helpful so you begin by click open in Stata and you get something like this and it'll be just a white box there might be some data but some of that has my personal information that I want to give that out but what the best thing you could do is let's you can start by opening various windows to make it so that you see the full amount of data so begin by here on the command line say browse browse and what will happen is this will pop up the editor window so this will basically this window shows you all of the data that the like the numbers and the variables this part right here will just show you the results and this is the command this is where you put on all the information all the you've already type whatever commands you want you can also use all these various pulldown menus but I've never done them and you can but I think it's easier just to with the command line anyway and that's how we're taught in at Hopkins so the first thing is let me open a dataset and I will provide this data set to everybody online as well through my Google Drive ok so what you can see is when I put I open the data file you see all of sudden the data window the data editor when a window now shows data and the data was basically telling me what are the groups one of the variables groups and debts and I can get more information here on the properties and what have you and and so that's basically showing what that doesn't really tell me too much about the data that just as show me as it shows me the raw data but you know we won't do statistics with this data so what do we do so the first thing after browse after opening that window and seeing now the data what you can do is you can do something like describe and that'll show sort of give you more another way of looking at the data and it's just telling you how many observations it's 40 observations there's two variables when it was created to 2006 this data set and it's sorted by group okay but let's say we want a little more information we could do codebook so these are the two couple commands you could do at the very beginning they figured out you know what what am I looking at when I'm looking this data set so here's again the what the group data set is and then for the debts you'll see that there are actually now giving me a standard deviation a mean percentiles all that kind of stuff missing data if there is any and all that kind and the range so some good information so you could do describe codebook but one of the first commands you can do is sort so let's see sort you can do sort by group and you can see nothing really changes on the data editor but let's say because it's already been sorted let's say we say sort by deaths and you'll see all of a sudden now the debts are all sorted by numerical from lowest to highest so that's a handy function have so let's go back by group I want to sort by groups because that's what the problem set was stating group there's reason why you'll see that why we're doing advice screw so I sorted by group and now again we got a one to one all the one and then twos so now if I want to make a stem-and-leaf plot all right we do by so by group so by the group meaning one by group means by the group one and two I'm I want to see by those variables I want to see us so for one for Group one I wanna see the stem-and-leaf plot and for group two I want to see a stem-and-leaf plot so I say by group stem and then I so want to say debts so I want to buy but but so the first one will be the first stem and the plot will be by the first group and I want to see the stem of the debts and I say enter and there you go you can see a nice representation or a graphical representation of the data more and from you can get more you can glean more information from this then say this raw data you can sort of figure out where the means are or the ranges are where the skewness is all that kind of fun stuff but we can also do another command so we're going to again bye-bye the groups so by Group one or two I want to stem and I want debts I can put lines and I put one and what that does is that sort of truncates didn't work on what seven oh I forgot a comma sorry yeah so you have to be very speed very specific with data it doesn't like little errors group stem debts comma lines one there you go so you see now it shrunk them so it's another way of viewing them and if I want you can do it again by croup stem deaths and then say lines - oops and the same chart that we saw before so that's stem and leaf plot how you do it on Stata instead of doing by hand trust me when you do this in lab you want to pull your outer one point this is much easier so the next command that the problems that gives is it wants to show how do you make a box plot so you're going to be making tons and tons of these box and whisker plots and doing the interquartile ranges and all that fun stuff anyway if you want to make a graph what you can do is let me copy and paste this and copy there we go and let me just go over what this means so we're going to do a graph graph and I'm going to we're going to make a graph this so you can telling first data you're going to tell Stata I want to make a graph right and then the next one is the box plot itself and then you want a box plot of debts and then you want buy see I'm sorry one second there we go you want graph box plots and then by group so you'll see what happens okay it's a couple seconds and there's a box in plot box plot that's by by Group one and group two so the graph of course explains this up the box as this kind of box plot and then we want we want a box plot of debts if I do watch if I did graph and I said box and I said that's now look what happens now these are all the debts so you'll see that all these debts if I just make a regardless of the group I can just make a box plot of all the debts I don't care about the group's here but if I want to see it by groups that's when I do graph box that's I want to buy but I went by the group so imagine instead of group that was I don't know was something else sex or something then you kind of seen it by male and female so there we go unlikely group one and two is male or female but anyway so this is a quick overview of the first part of the problem set on the next video will be about the second part of the problem set I don't think these videos too long can ask many questions you want in the comments and thank you very much
Info
Channel: AverageInvestor/Dr. Abdullah
Views: 190,461
Rating: 4.7916665 out of 5
Keywords: Stata (Software), Statistics (Field Of Study), How-to (Website Category), Website (Industry), Johns Hopkins Bloomberg School Of Public Health (Educational Institution), Johns Hopkins University (College/University), Biostatisitics, Epidemiology, University (Building Function), College (TV Genre), stem and leaf, Statistics Canada (Government Agency), Industry (Organization Sector), StataCorp
Id: mQNwhlKHN8s
Channel Id: undefined
Length: 8min 21sec (501 seconds)
Published: Sat Aug 30 2014
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.