Outputting Stata Summary and Regression Tables for Excel, Word, or LaTeX

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

КОМЕНТАРІ • 126

  • @niilolaiho9991
    @niilolaiho9991 6 років тому +21

    From somebody making their Bachelor's thesis: this is brilliant, much appreciated!

  • @boyzrulethawld1
    @boyzrulethawld1 4 роки тому +2

    The copy table function at the end made me LOL at how easy it was.
    Hey, cheers for a great tutorial. Take it easy Mr. Nick.

  • @jordiburger1462
    @jordiburger1462 3 роки тому +7

    for anyone who wants to use it with latex: you just need to write tex instead of excel. In my packege version it doesn function if you type in "latex" (as shown in video)

  • @awhileawonder
    @awhileawonder 6 років тому +7

    " Don't you dare spend hours copying over every cell of your table by hand! " Hah thank you Nick, that was me a couple of hours ago until persistence wore thin and sensibility caught up to me, yelling, "THERE MUST BE A BETTER WAY TO DO THIS."

    • @godoggo9346
      @godoggo9346 4 роки тому +1

      THERE MUS TBE A BETTER WAY TO DO THIS is a summary of my entire research process

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

    thanks its so helpful and you cannot find this information anywhere but here!

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

    Thank you for such a useful Video... Stay healthy..

  • @hannahrichards4200
    @hannahrichards4200 7 років тому +5

    This video was extremely useful - thank you so much! I'm turning in my first-year summer paper in a few days, so I was looking for a quick way to export my summary statistics, correlations, & regression results, & this video tackled all those questions!
    I especially enjoyed learning about the mkcorr function since it exports summary statistics and correlations at the same time. However, do you know if there is a way to get the significance levels marked on the correlations? The following command is what I was using to export correlations & that Excel output does show the significance levels:
    estpost corr (variables), matrix listwise
    est store c1
    esttab * using correlations.csv, unstack not noobs compress

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

    Thanks Nick for the video, I tried using outreach with a multiple regression in different country regions. It displays only the last region result in the excel file. How can I rectify this to reflect all regions in the regression result?

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

      If you're running multiple regressions you need to run outreg2 after each regression, using the append option to keep adding to the same file

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

    Can someone help? I am getting this reply "matrix e(b) not found; run/post a regression, or specify varlist for non-regression outputs"

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

      That message is suggesting that you didn't run a regression first. If you haven't run anything there's nothing for outreg2 to output

  • @bwemlie
    @bwemlie 5 років тому +1

    Thanks man! Really appreciate it:) WE WANT MORE!!

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

      For the record, I am now working on my third thesis and I just watched your video again to see that I apparently commented on it hahah

  • @Garrettthethief
    @Garrettthethief 7 років тому +2

    Thank you Nick. You are a valuable person.

  • @frankmaina7070
    @frankmaina7070 5 років тому +1

    Hey... Thanks for the informative video
    However, my stata is telling me that it doesn't recognize the command outreg2...what do I do?

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  5 років тому +3

      outreg2 needs to be installed. You can do this with
      ssc install outreg2

    • @frankmaina7070
      @frankmaina7070 5 років тому +2

      @@NickHuntingtonKlein that was fast 🙌👊...thank you very much...the command has worked now

  • @ahmedelrabbat6892
    @ahmedelrabbat6892 6 років тому +1

    dear
    thanks so much, i actually used the command and worked but when i try to open it , tell me the Xml file regression results .xml cannot be opened because there is no available data view(xslt)

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  6 років тому

      Excel should be able to read the file. You might have xml files associated with a different program. Try opening excel first and using File -> Open to open the Xml file, see if that works.

    • @georgi8254
      @georgi8254 5 років тому

      Hi, @@NickHuntingtonKlein, this is super useful! Thank you. However, I am having the same issue as ahmed, and the same message pops up for some reason.

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  5 років тому

      Try designating the file as an .xls in the outreg2 command and see if that works @@georgi8254

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

    Hi, I am struggling with exporting the STATA output to LYX/ Overleaf (Latex). It is mentioned in the title " Outputting STATA regression for Latex" but I could not find it in the video. Do you have a video about this? If so, I would be great.

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

      As it mentions about 1:48, if you put latex instead of excel in the options, it will output a file with LaTeX table code in it.

  • @aaronstark1969
    @aaronstark1969 3 роки тому +1

    Why would my results say “command outreg2 is unrecognized”

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  3 роки тому +3

      Because outreg2 is a user written command that must be installed. Do ssc install outreg2

    • @aaronstark1969
      @aaronstark1969 3 роки тому +1

      @@NickHuntingtonKlein Thank you so much, just downloaded Stata and I couldn’t get that to work, you’re a huge help

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

    by region_code, sort : regress Log_GDP_Per_Capita lpc lhc
    How do I export the result for each region at once to excel using outreg2. I did this but only one region result was exported. note that all regions' output will be shown at once in Stata

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

      Oh I see. You'll need to use a loop instead of a bysort. See www.statalist.org/forums/forum/general-stata-discussion/general/1567800-how-to-use-outreg2-when-running-regression-bysort

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

    It's a life-saving one! However, I couldn't use the mkcorr command. Please kindly suggest how to use it.

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

      Install it first with ssc install mkcorr

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

      @@NickHuntingtonKlein thank you so much for your prompt reply.

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

    When I use this command it all works in stata but when I go to the folder I only find an XML and textdocument but no actual excel file. How do I get the actual excel file? Thanks in advance!

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

      The xml file should be able to open in Excel

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

      @@NickHuntingtonKlein it's really weird but it opens internet explorer automatically (which I don't use) when I click on the XML file and it's not the data output from stata but more like some random text... Also when I try to open the XML file through an empty excel file nothing happens

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

      @@maxvanheerde5582 It sounds like XML files are not associated with Excel in your system. But it should work if you right click the file and do "Open With" and select Excel.
      If that still doesn't work you might want to try another table-export package like regsave.

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

    Hi i'm trying to do this with a dummy in my regression and it's saving all my variables as Firm.1, all the way up to Firm.850, it would be impossible for me to manually edit this, I was trying to use the label command but no success, do you know how I make it show the firm names rather than the stata names?

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

      It would work if your firm variable is properly labeled. Take your string variable with the firm names and use encode on it. That should hopefully work

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

    thank you so much, it help me a lot

  • @inaevalerio5464
    @inaevalerio5464 4 роки тому +1

    Nick, thank you so much for this excellent video. It helps me a lot! I was wondering if there is a way to export my confidence interval too... Thanks again in advance!

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  4 роки тому

      Use the stats(ci) option of outreg2. And thanks!

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

      @@NickHuntingtonKlein can you please write the command? thanks

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

      @@yannisima3043 To add an option to a command in Stata, just do a comma and then the option. So here it's:
      outreg2 using "filename", stats(ci)

  • @Hendrichards
    @Hendrichards 6 років тому +1

    Hi Nick, the command outreg2 doesn't work for me. I am on Stata15 and it says command outreg2 is urecognised.

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  6 років тому +2

      Whenever Stata tells you a command is unrecognized that means you haven't installed the package for it. You can usually do this with the ssc install command. So put "ssc install outreg2" in Stata and run that, and from that point on, your copy of Stata will always be able to use outreg2.

    • @parfaitberi3974
      @parfaitberi3974 5 років тому

      @@hossamabdellatif3039 I had a similar problem even after installing "ssc install outreg2". But then, I found somewhere that I could install "ssc install mkcorr", and it worked pretty well for me!
      Thanks

  • @danielgardner4267
    @danielgardner4267 7 років тому

    Thank you Nick, you are the best.

  • @halomaster657
    @halomaster657 4 роки тому

    Hi im trying to donwload outreg2 into STATA but get the following error message if anyone can help please. "could not rename c:\ado\plus\stata.trk to c:\ado\plus\backup.trk"
    may be important to note that I am using a remote desktop.

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  4 роки тому

      That's strange! Sounds like a permission issue on your computer or something? I'm not really sure how to fix it

  • @harutohonda7564
    @harutohonda7564 4 роки тому

    such a nice video
    helped me a lot
    thanks!!!!

  • @lphoca8861
    @lphoca8861 6 років тому +1

    life saving video. A big thank you!

  • @HarryWalshe
    @HarryWalshe 5 років тому

    Hello, after running my regression analysis, my output doesn't come out as clear as in the video here. How do I rectify my problem?

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  5 років тому

      Depends on the issue. Some regression commands don't play well with outreg2, so if you're doing something unusual that could be it.

    • @HarryWalshe
      @HarryWalshe 5 років тому

      Is there a way I could send you a screenshot of my problem so you could have a closer look?

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  5 років тому

      @@HarryWalshe sure. My email is on my website nickchk.com

  • @elishayu8002
    @elishayu8002 4 роки тому

    Hello, is it possible to export to different sheets in ONE Excel file using outreg2? Thank you!

  • @lorenzopignataro591
    @lorenzopignataro591 5 років тому

    what if I get r(603) file xxx.txt could not be opened?

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  5 років тому

      It's having trouble opening the file. The file might not be formatted correctly for what you're doing

  • @luisortizgervasi3820
    @luisortizgervasi3820 5 років тому

    Great....¡ Clear and straightforward. Many thanks

  • @MrLodesmond
    @MrLodesmond 4 роки тому

    How can I deal with interaction effect between two variables? Thanks.

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  4 роки тому

      See my video on interaction terms in stata ua-cam.com/video/9dNZJziERHw/v-deo.html

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

    Thanks Nick! Can you please make a similar video for R? I was wondering what options are available in R. thanks again :)

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  3 роки тому +1

      There are quite a few options, but I recommend modelsummary for regression tables, and the sumtable function in my own vtable package for summary statistics

  • @jiangally4919
    @jiangally4919 4 роки тому

    Thank you so much! This is so helpful!!!

  • @biggieboomboom
    @biggieboomboom 5 років тому

    This was very helpful, thank you. Is there a way to use adjusted R^2 in the output regression tables with outreg2, or do you just have to do it manually?

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  5 років тому +1

      If you look in the help file for outreg2 you can see that it allows you to include a whole bunch of extra statistics. If one isn't supported you can extract it yourself and include it in outreg with the addtext() option

  • @maenesophie31
    @maenesophie31 4 роки тому

    I have a problem when I do the "outreg2 using regression_results2, replace excel dec(3)" command I get an error saying that the XML-file can not be opened as there is no available data displayer: details: specified error
    location: row:1 column 361. Do you have a solution for this?

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  4 роки тому +1

      Strange, I've never seen that error before. Maybe try specifying the .xls extension? Like "outreg2 using regression_results2.xls, replace excel dec(3)"

    • @krystalpalmer2595
      @krystalpalmer2595 4 роки тому

      @@NickHuntingtonKlein I was having the same problem. This solution worked for me. Thanks!

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

      @@NickHuntingtonKlein Solution worked well done

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

      @@NickHuntingtonKlein Solution worked well done

  • @alessandragutierrezgamboa5069
    @alessandragutierrezgamboa5069 4 роки тому

    CAN YOU DO A VIDEO ON ODDS RATIO?

  • @huynhngoctrong9510
    @huynhngoctrong9510 6 років тому

    That was awesome Nick!

  • @katiesullivan8055
    @katiesullivan8055 4 роки тому

    This is so useful! Thank you!

  • @DevianParraP
    @DevianParraP 7 років тому

    Thank you Nick. Despite the progress I got with this video, I still have an issue with my model. I am running a logistic regression model reporting ODDS ratios, but the output table only shows raw coefficients despite I use the logistic command in Stata. Can you help me?

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  7 років тому

      Devian Parra Padilla Hi Devian. Good question! I'd recommend taking a look at this Statalist post: www.statalist.org/forums/forum/general-stata-discussion/general/844502-outputting-logistic-regression-results-using-outreg2-command

    • @DevianParraP
      @DevianParraP 7 років тому

      Nick Huntington-Klein Thank you Nick for your willingness to help. The post looks very useful

  • @AnaPerez-bd1sq
    @AnaPerez-bd1sq 4 роки тому

    you're amazing and I love you :,)

  • @regularviewer1682
    @regularviewer1682 6 років тому

    After the regression... How did you get the number of observations in your excel table when they weren't there in the notes?

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  6 років тому +1

      Outreg2 will include the number of observations automatically. You can also see the number of observations in the Stata table in the top right (Number of obs.)

    • @regularviewer1682
      @regularviewer1682 6 років тому

      @@NickHuntingtonKlein Thanks!

  • @praveenkumar-kn7qf
    @praveenkumar-kn7qf 3 роки тому

    This is GREATTTTT

  • @suriyaparvinnishi3710
    @suriyaparvinnishi3710 7 років тому +1

    The same process is applicable for exporting in Latex?

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  7 років тому +2

      Yes, correct. Just put latex instead of excel in the command options, and it will output LaTeX code you can copy wherever you need it.

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

      @@NickHuntingtonKlein it didn't work for me. They say option latex not allowed

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  3 роки тому +1

      @@nouhailasafi6685 sorry I should have said tex instead of latex. See help outreg2 for the full syntax

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

      @@NickHuntingtonKlein I used it right now. It still didn't work for me. They say that file could not be opened

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  3 роки тому +1

      @@nouhailasafi6685 either the file you're trying to save to is open in another program, or the syntax is wrong. What is the line of core you're using?

  • @DIMPLEKHATTAR
    @DIMPLEKHATTAR 5 років тому

    hey, how to do the same in Stata 12

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  5 років тому +1

      All of this works the same in stata 12. Just be sure to install outreg2 first using "ssc install outreg2"

    • @DIMPLEKHATTAR
      @DIMPLEKHATTAR 5 років тому +1

      @@NickHuntingtonKlein, thanks!

  • @AllanKOSTO
    @AllanKOSTO 4 роки тому +1

    Awesome video Nick!!!
    Actually, how can I import a tabulate or a summarize from stata to latex text, can you give me a stata command?
    THX my friend

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  4 роки тому

      Use outreg2 with the sum(log) option as well as the tex option

  • @kirkmotocross9388
    @kirkmotocross9388 7 місяців тому

    may be to old of a video but outreg2 is not working. says it is unreconizable

    • @kirkmotocross9388
      @kirkmotocross9388 7 місяців тому

      well I got it to work from other comments but now it is opening into word

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  7 місяців тому

      @@kirkmotocross9388 Set the output document type in "using" i.e. output.tex or look at the help file for how to set the output type using options.

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

    thanks a lot works well with esttab aswell

  • @bochengjing883
    @bochengjing883 5 років тому

    I don't think this works for the streg. Also, where is the regression_results variable or table? Is it pre-created?

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  5 років тому

      There are some commands that outreg2 doesn't work with. I've never used streg so I'm not sure if it's one of them. You might try estout instead of outreg2 in that case. regression_results is the name I chose to give the file that outreg2 made.

    • @bochengjing883
      @bochengjing883 5 років тому

      @@NickHuntingtonKlein I see. I have been researching on how to output Hazard ratio and p-value to excel sheet for STREG for a while and couldn't find a good solution. Not sure Stata could handle it.

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  5 років тому

      @@bochengjing883 If none of the export commands work, you can always select the table in Stata, right click, choose "Copy Table" (not just Copy but Copy Table) and paste into Excel.

    • @bochengjing883
      @bochengjing883 5 років тому

      @@NickHuntingtonKlein I know but what I want is the detailed p-value. I am using 1 million records to run the streg, which p-value is extremely significant (p=10^(-100)), I want to output all the detailed p-value so I can make a decision. Copy and Paste couldn't do it as the p-value is only 0.000.

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  5 років тому

      @@bochengjing883 Ah, I see. For something unusual like that you'll probably have to code the output by hand. Look at the streg documentation to see where values like the p-value are stored (or the component parts that let you estimate it yourself). Basically, pull out the regression info you want into locals and write a loop to generate a CSV file. See this thread for an example twitter.com/nickchk/status/1146859527456940034

  • @Mineirovsky
    @Mineirovsky 5 років тому

    Very helpful. Thanks.

  • @Spacemrk
    @Spacemrk 6 років тому

    Sorry but this isn't working for me at all as Excel cannot open the file

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  6 років тому

      Spacemrk It should be able to. You might want to try opening Excel first and opening it from there.

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

    Thank youuuuuu!

  • @noorrizvi1657
    @noorrizvi1657 6 років тому

    Thank you very much!

  • @jeetv
    @jeetv 5 років тому

    Excellent!!

  • @camilafloressanhueza7966
    @camilafloressanhueza7966 5 років тому

    Thank u Thank u Thank u!!!!!!!!!

  • @tesfahun_taddege
    @tesfahun_taddege 7 років тому

    Very Helpful

  • @dougrhess
    @dougrhess 6 років тому

    Well done.

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

    7:29

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

    why do you use outreg2. it doesnt work for me. you need to explain each stuff.

  • @dhanishtha_anand
    @dhanishtha_anand 6 років тому

    Thank you so muchhhhh

  • @zerohero109
    @zerohero109 5 років тому

    Bookmarked.