Announcement

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

  • #16
    As noted, there is a tremendous amount of free online help, e.g. -help margins-. If it would be easier for you to read a book about Stata, one of the many good ones is

    https://www.stata.com/bookstore/gent...tion-to-stata/

    For an intro to Margins, see

    https://www3.nd.edu/~rwilliam/stats/Margins01.pdf
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #17
      Originally posted by Marcos Almeida View Post

      Both sentences are hardly believable.


      For the first, you may get the Stata Manuals:

      A) Directly from the command window.

      B) In the Web, starting by taking a look at Stata's main page.


      For the second, margins and marginsplot represent a great resource to explore the results from the regression analysis. That said:

      A) The issue on the factor notation is clearly displayed in the Manual as well as when we type "help margins".

      B) If by " the logic behind the regression procedure" you mean the core-knowledge concerning linear regression analysis, it is not that difficult to grasp the main aspects. Any decent textbook will present it, and this will surely be the best starting point.
      Thanks. I started to learn statistics and Stata three months ago.

      Well, I would try to type 'help xxx' in Stata. Previous posts fixed the issue of 95% PI, now what's the command for 95% CI of conditional means after linear regression? Thanks

      Tom

      Comment


      • #18
        I have no advice on your confidence interval question, but since you're new to Stata and, as of today, new to Stata's documentation, I have some advice on making good use of the documentation.

        I'm sympathetic to you as a new user of Stata - it's a lot to absorb. And even worse if perhaps you are under pressure to produce some output quickly. Nevertheless, I'd like to encourage you to take a step back from your immediate tasks.

        When I began using Stata in a serious way, I started, as have others here, by reading my way through the Getting Started with Stata manual relevant to my setup. Chapter 18 then gives suggested further reading, much of which is in the Stata User's Guide, and I worked my way through much of that reading as well. There are a lot of examples to copy and paste into Stata's do-file editor to run yourself, and better yet, to experiment with changing the options to see how the results change.

        All of these manuals are included as PDFs in the Stata installation (since version 11) and are accessible from within Stata - for example, through the PDF Documentation section of Stata's Help menu. The objective in doing the reading was not so much to master Stata as to be sure I'd become familiar with a wide variety of important basic techniques, so that when the time came that I needed them, I might recall their existence, if not the full syntax, and know how to find out more about them in the help files and PDF manuals.

        Stata supplies exceptionally good documentation that amply repays the time spent studying it - there's just a lot of it. The path I followed surfaces the things you need to know to get up to speed in a hurry and to work effectively.

        I'll add that in most cases, if you are reviewing the output of help xxx in Stata's results window, clicking on the first line will open in Acrobat Reader the PDF containing the corresponding full documentation.

        And in regard to the margins command, Richard William's paper that he referenced in post #16 is an excellent starting point, giving a fuller perspective on the documentation for margins in Stata's PDFs.

        Comment


        • #19
          I took a look at the manual, that, margins could do marginal means (95% CI of conditional means?), predictive margins (the 95% PI of y?). I guess the margins command without any options does the 95% CI of conditional means. But when I tried to find the 95% PI of the dependent variable, I got this error (at the end of below codes).

          Code:
          regress averagedailydoseduringtheinitial i.ttestforweightstatus i.gendercode i.ageforttest i.a
          > f i.hypertension i.nonaaornonanona i.non11ornon1non1 i.chf i.potentialstatinddi i.ttestindicat
          > ion i.ttesttargetinr i.afandwarfarinhistory
          
                Source |       SS           df       MS      Number of obs   =       173
          -------------+----------------------------------   F(12, 160)      =      6.57
                 Model |  37.3497262        12  3.11247719   Prob > F        =    0.0000
              Residual |  75.7845906       160  .473653691   R-squared       =    0.3301
          -------------+----------------------------------   Adj R-squared   =    0.2799
                 Total |  113.134317       172  .657757656   Root MSE        =    .68823
          
          ----------------------------------------------------------------------------------------
          averagedailydoseduri~l |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -----------------------+----------------------------------------------------------------
          1.ttestforweightstatus |  -.1565956   .1806711    -0.87   0.387    -.5134032    .2002119
                    1.gendercode |  -.1469949   .1177466    -1.25   0.214    -.3795328     .085543
                   1.ageforttest |  -.4027729   .1385781    -2.91   0.004     -.676451   -.1290948
                            1.af |   .0171156   .1441167     0.12   0.906    -.2675008    .3017319
                  1.hypertension |   .3533904   .1313281     2.69   0.008     .0940303    .6127504
               1.nonaaornonanona |   .8950594   .1565783     5.72   0.000     .5858326    1.204286
               1.non11ornon1non1 |  -.3943921    .174079    -2.27   0.025    -.7381809   -.0506033
                           1.chf |  -.2865583    .150622    -1.90   0.059    -.5840219    .0109053
            1.potentialstatinddi |  -.1987298   .2251816    -0.88   0.379    -.6434413    .2459816
               1.ttestindication |  -.3378382   .1835563    -1.84   0.068    -.7003438    .0246674
                1.ttesttargetinr |  -.2363605   .1964999    -1.20   0.231    -.6244284    .1517074
          1.afandwarfarinhistory |   .3488952   .2047595     1.70   0.090    -.0554848    .7532751
                           _cons |   3.082789   .1557819    19.79   0.000     2.775135    3.390443
          ----------------------------------------------------------------------------------------
          
          . margins chf
          
          Predictive margins                              Number of obs     =        173
          Model VCE    : OLS
          
          Expression   : Linear prediction, predict()
          
          ------------------------------------------------------------------------------
                       |            Delta-method
                       |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                   chf |
                    0  |   2.721582    .057725    47.15   0.000     2.607581    2.835583
                    1  |   2.435023    .136658    17.82   0.000     2.165137    2.704909
          ------------------------------------------------------------------------------
          
          . margins chf, predict
          option predict not allowed
          r(198);

          Comment


          • #20
            For linear regression, 95% CI of condition means of the dependent variable and the 95% prediction interval of dependent variable is absolutely different. The Stata manual appears like a shit and did not say anything related thing to how to estimate these two important parameters.

            Tom

            Comment


            • #21
              And the 95% PI is always wider than the 95% CI of conditional means. I have to find the 95% CI of conditional means instead of the 95% PI of the individual dependent variable. My intention is not to predict the response variable but to compare the conditional means between two levels of a qualitative independent variable. The t-test could list the conditional means between, but it is unadjusted via t-test. Only with regression other independent variables are fixed while I have investigate a specific independent variable.

              Comment

              Working...
              X