Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [HELP] Regression Table Output

    Hi,

    Question: How can I get pseudo R squared and Pvalue for each model when I do a probit regression?

    I'm testing some models using the commands:
    Code:
    probit PIP RD IRDS IPP CSM CSL NECD PG SVC
    margins, dydx(*)
    outreg2 using "C:\Stata\vmonteiro\models\modelos.doc"

    Which returns the following table:
    Click image for larger version

Name:	Screenshot 2021-05-27 at 15.41.51.png
Views:	1
Size:	157.1 KB
ID:	1611914



    The problem is that I need it to provide me with a table that has the Pseudo R squared and the P value for each model.

    I want a table like this:
    Click image for larger version

Name:	Screenshot 2021-05-27 at 15.42.20.png
Views:	1
Size:	146.5 KB
ID:	1611915


    Can anyone please help me, I'm kind of desperate..

    Thank you,
    Manel

  • #2
    Manel,I will use the new collection system to do it in Stata 17.
    Code:
    sysuse auto,clear
    collect clear
    collect _r_b _r_p,tag(model[Model 1]):probit foreign weight mpg
    collect _r_b _r_p,tag(model[Model 2]):probit foreign weight mpg,r
    collect layout (colname#result result[N p chi2 r2_p]) (model)
    collect style header colname,level(value)
    collect style header result[_r_b _r_p], level(hide)
    collect style cell result[_r_p],sformat("(%s)")
    collect style cell result[_r_b _r_se p chi2 r2_p],nformat(%8.3f)
    collect style cell, border(right, pattern(nil))
    collect style column, extraspace(1)
    collect style cell cell_type[item column-header], halign(center)
    collect style row stack, spacer
    collect label levels result N "Observations" p "p value" chi2 "chi-square test",modify
    collect stars _r_p 0.01 "***" 0.05 "** " 0.1 "*   " 1 "***",attach(_r_b)
    collect preview
    
    . collect preview
    
    ----------------------------------------
                       Model 1      Model 2 
    ----------------------------------------
    weight            -0.002***    -0.002***
                       (0.000)      (0.000) 
                                            
    mpg               -0.104**    -0.104*   
                       (0.044)      (0.080) 
                                            
    _cons              8.275***    8.275*** 
                       (0.001)      (0.001) 
                                            
    Observations          74          74    
                                            
    p value             0.000        0.000  
                                            
    chi-square test     36.378      30.257  
                                            
    Pseudo R-squared    0.404        0.404  
    ----------------------------------------
    Last edited by Raymond Zhang; 28 May 2021, 20:45.
    Best regards.

    Raymond Zhang
    Stata 17.0,MP

    Comment


    • #3
      Also ,you can use outreg2.
      Code:
      sysuse auto,clear
      probit foreign weight mpg
      outreg2 using 1.doc,e(N p chi2 r2_p)
      Best regards.

      Raymond Zhang
      Stata 17.0,MP

      Comment

      Working...
      X