Announcement

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

  • How to Save the Predicted Probabilities after Running an Ordinal Logit Model to a Single Data File or Keep in Memory in Stata?

    Hello, I want to save the whole exported table of predicted probabilities after running the command "margins sex#race",
    can someone tell me how to do this?

    use http://www.stata-press.com/data/r8/nhanes2f.dta,clear
    ologit health sex##race zinc copper iron
    margins sex#race

    Thank you!





  • #2

    Code:
    margins sex#race, post
    estimates save margins_results, replace
    This will save all of those results in a file margins_results.ster. To recall it into memory later, -estimates use margins_results-.

    If you wish to save the results in memory rather than in a file, it is -estimates store margins_results-. To bring those results back to active use, -estimates restore margins_results- does it.

    Comment


    • #3
      Professor Clyde, Thank you for your code. What I want is to save the tables as a single .dta file so that I can use it for further visualization.
      It seems that the file .str can not be opened and edited by Stata.




      Comment


      • #4
        I finally got what I want from this webpage at https://www.alexanderkirss.com/uploa...rss_margins.do

        ssc inst parmest, all replace

        use http://www.stata-press.com/data/r8/nhanes2f.dta,clear
        ologit health sex##race zinc copper iron
        margins sex#race, post
        parmest, label list(parm estimate min* max* p) saving(abcdefg, replace)




        Comment


        • #5
          use http://www.stata-press.com/data/r8/nhanes2f.dta,clear
          ologit health sex##race zinc copper iron
          tempfile tmp
          margins sex#race,post saving("`tmp'")
          use "`tmp'" , clear




          Comment

          Working...
          X