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

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ธ.ค. 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.

  • @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

  • @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)

  • @basti0159
    @basti0159 3 ปีที่แล้ว

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

  • @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

  • @Garrettthethief
    @Garrettthethief 7 ปีที่แล้ว +2

    Thank you Nick. You are a valuable person.

  • @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.

  • @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

  • @HuzMusFinanceData
    @HuzMusFinanceData 3 ปีที่แล้ว

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

  • @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

  • @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.

  • @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

  • @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)

  • @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

  • @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

  • @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

  • @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

  • @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.

  • @lphoca8861
    @lphoca8861 6 ปีที่แล้ว +1

    life saving video. A big thank you!

  • @danielgardner4267
    @danielgardner4267 7 ปีที่แล้ว

    Thank you Nick, you are the best.

  • @elishayu8002
    @elishayu8002 4 ปีที่แล้ว

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

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  4 ปีที่แล้ว

      This isn't possible as far as I know. Maybe estout can do 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

  • @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

  • @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

  • @criticalcog6363
    @criticalcog6363 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

  • @huynhngoctrong9510
    @huynhngoctrong9510 6 ปีที่แล้ว

    That was awesome Nick!

  • @harutohonda7564
    @harutohonda7564 4 ปีที่แล้ว

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

  • @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

  • @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

  • @luisortizgervasi3820
    @luisortizgervasi3820 5 ปีที่แล้ว

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

  • @yusnipuspasari5306
    @yusnipuspasari5306 3 ปีที่แล้ว

    thank you so much, it help me a lot

  • @jiangally4919
    @jiangally4919 4 ปีที่แล้ว

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

  • @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

  • @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 th-cam.com/video/9dNZJziERHw/w-d-xo.html

  • @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

  • @katiesullivan8055
    @katiesullivan8055 4 ปีที่แล้ว

    This is so useful! Thank you!

  • @regularviewer1682
    @regularviewer1682 5 ปีที่แล้ว

    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  5 ปีที่แล้ว +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 5 ปีที่แล้ว

      @@NickHuntingtonKlein Thanks!

  • @AnaPerez-bd1sq
    @AnaPerez-bd1sq 4 ปีที่แล้ว

    you're amazing and I love 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

  • @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?

  • @praveenkumar-kn7qf
    @praveenkumar-kn7qf 3 ปีที่แล้ว

    This is GREATTTTT

  • @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.

  • @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

  • @alessandragutierrezgamboa5069
    @alessandragutierrezgamboa5069 4 ปีที่แล้ว

    CAN YOU DO A VIDEO ON ODDS RATIO?

  • @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!

  • @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.

  • @SebiScoot
    @SebiScoot 2 ปีที่แล้ว

    thanks a lot works well with esttab aswell

  • @Mineirovsky
    @Mineirovsky 5 ปีที่แล้ว

    Very helpful. Thanks.

  • @lucialara3875
    @lucialara3875 2 ปีที่แล้ว

    Thank youuuuuu!

  • @jeetv
    @jeetv 5 ปีที่แล้ว

    Excellent!!

  • @dougrhess
    @dougrhess 6 ปีที่แล้ว

    Well done.

  • @tesfahun_taddege
    @tesfahun_taddege 7 ปีที่แล้ว

    Very Helpful

  • @noorrizvi1657
    @noorrizvi1657 6 ปีที่แล้ว

    Thank you very much!

  • @camilafloressanhueza7966
    @camilafloressanhueza7966 5 ปีที่แล้ว

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

  • @beingfijian1855
    @beingfijian1855 3 ปีที่แล้ว

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

    • @NickHuntingtonKlein
      @NickHuntingtonKlein  3 ปีที่แล้ว

      It needs to be installed first with ssc install outreg2

  • @dhanishtha_anand
    @dhanishtha_anand 6 ปีที่แล้ว

    Thank you so muchhhhh

  • @zerohero109
    @zerohero109 5 ปีที่แล้ว

    Bookmarked.

  • @rajchatrg
    @rajchatrg 3 ปีที่แล้ว

    7:29