A simple way to creating beautiful regression tables in STATA: the "esttab" command from "estout"
A lot of times we work with. Stata the automatic regression results that it gives us is not very beautiful and we have to somehow manually or automatically generate like a table like this there looks publishable and very nice right nicely formatted and today. I'm gonna introduce a user-generated Stata package called essed out. It was developed by band. Jen that will help you automatically generate a table like this and it's also usable for latex and for Excel formats. Okay and first of all if you haven't done so you need to install this Esther out package because it's a user generated package it doesn't come automatically together with state up so what you need to do is to type as the C install asked alt replace in your command and it's checking whether it's already installed so I'm gonna the line here and then you use this because the way that mas out runs is that every time you run a regression like this it will generate a new table even though so for example if you restart from line one and it will still stall it will still have in its memory. All the previous regressions through estimation store that you've generated and you probably you will probably have a really long table and you don't want that so I suggest that before. You run estimation store this command. You can use a store clear to clear whatever is already in your memory. So why don't we go to this general package and see there are four main commands here and the ones we will be talking about or using are esta and asked store so first of all you just type whatever regression you can have a regression here. Load it here o load it whatever it is and then plus this part which tells the esta out package. What estimates will be stored from this regression table. Okay and let's run another regression and then all you need is to run something like this. Actually this is a lot of complexities that about to it. If you only run as tab for instance you will see a very nice table here look. I didn't run this as a store clear before I retyped these things so you see.
I've done like these table. Both of them twice right by default it will give you something like one two three four and no title right and just a number of observations to notes here but you might want more information which is why here. I've got something more. For instance by default these things in these parent theses is the t-statistic and these are asterisks. Tell you about a p-value level so you might want to instead at least in sociology and economics one standard error to be there this is s e and you might also want something like an adjusted r-square or other statistics estimating model fit like be IC or AIC or you might not like this star here in that case you can do nice tall and very nicely you can add titles to this whole table maybe three this is a regression table and you can also adjust the name of these models here so maybe I'll call the model a model B and you can add notes here okay so let's run this again and see I'm gonna comment out this first okay so now notice that there is a strange thing that there's still 1 & 2 here so I might not want that and I in which case I can add no numbers okay let me run this again okay so this is a pretty nice table here right I also added this note. Oh but there's an issue well we actually usually do is that we want something that will be output into maybe a word document or like an. Excel document right or latex. I don't necessarily take that much but the está out does offer that option. Just go and check their documentation so what in that case you want to do. For example in this case the word is you have to make sure that you set your working directory and you generate actually a new file and it will automatically write this file for you so make sure that m1 dot. RTF does not exist yet in your desktop at a time that you're running this command so for now. I'm going to delete this and he could be named anything so now if I run this immediately you see there is an m1 dot RTF rich text format right for what the generated and if you open it it's nicely there it's nicely there and it's seen as a table that you can maybe further work with in reality there are other options that you might want for instance adding changing variable names to the actual names or adding reference categories and stuff like that so you can do it through the s-type command although sometimes.
I actually find it easier just to adjust them yourself after you do that. You might want to change this name. Just change it there. But the formatting thing is a big it's a big headache for me and I find this really useful in that sense and just in case you prefer if you prefer an Excel table here just type CSV and there you go okay. So we've got the table like that. I think it's nice in Word the bars and the kind of borders and stuff right so um this is up to your own preference though and I hope you benefit from this video and you will find the text version of this new file in the comment section accompanying this video.
I've done like these table. Both of them twice right by default it will give you something like one two three four and no title right and just a number of observations to notes here but you might want more information which is why here. I've got something more. For instance by default these things in these parent theses is the t-statistic and these are asterisks. Tell you about a p-value level so you might want to instead at least in sociology and economics one standard error to be there this is s e and you might also want something like an adjusted r-square or other statistics estimating model fit like be IC or AIC or you might not like this star here in that case you can do nice tall and very nicely you can add titles to this whole table maybe three this is a regression table and you can also adjust the name of these models here so maybe I'll call the model a model B and you can add notes here okay so let's run this again and see I'm gonna comment out this first okay so now notice that there is a strange thing that there's still 1 & 2 here so I might not want that and I in which case I can add no numbers okay let me run this again okay so this is a pretty nice table here right I also added this note. Oh but there's an issue well we actually usually do is that we want something that will be output into maybe a word document or like an. Excel document right or latex. I don't necessarily take that much but the está out does offer that option. Just go and check their documentation so what in that case you want to do. For example in this case the word is you have to make sure that you set your working directory and you generate actually a new file and it will automatically write this file for you so make sure that m1 dot. RTF does not exist yet in your desktop at a time that you're running this command so for now. I'm going to delete this and he could be named anything so now if I run this immediately you see there is an m1 dot RTF rich text format right for what the generated and if you open it it's nicely there it's nicely there and it's seen as a table that you can maybe further work with in reality there are other options that you might want for instance adding changing variable names to the actual names or adding reference categories and stuff like that so you can do it through the s-type command although sometimes.
I actually find it easier just to adjust them yourself after you do that. You might want to change this name. Just change it there. But the formatting thing is a big it's a big headache for me and I find this really useful in that sense and just in case you prefer if you prefer an Excel table here just type CSV and there you go okay. So we've got the table like that. I think it's nice in Word the bars and the kind of borders and stuff right so um this is up to your own preference though and I hope you benefit from this video and you will find the text version of this new file in the comment section accompanying this video.