Announcement

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

  • Difficulty with collection of regression results

    Apologies for a too verbose post.

    I am having trouble following what appears to be a simple example of using collect and regress to layout regression results. I am using a recently updated Stata 17.0 with Windows 11. I start with this code:

    Code:
    collect clear
    sysuse auto, clear
    
    regress price mpg
    
    collect get r() e()
    
    collect layout (result)(colname)
    The regression succeeds and produces unremarkable results but with the following notes:


    Code:
    Note: collect is ignoring label "z" for level _r_z of dimension result.
    Note: collect is ignoring label "|z|" for level _r_z_abs of dimension result.

    The examples I have seen imply that this should return the coefficient, CI, lower bound, upper bound, df, p, se, and t. In the table this produces on my machine I only see the coefficient for mpg. I chekck the dimensions of the default collection and see:
    collect dims
    Collection dimensions
    Collection: default
    Dimension No. levels
    Layout, style, header, label
    cmdset 1
    coleq 1
    colname 2
    program_class 2
    result 33
    result_type 3
    rowname 10
    Style only
    border_block 4
    cell_type 4
    So, having checked the levels of result, I tried (what I thought would be relatively simple):

    Code:
    collect layout (result[F r2a])

    Which will show the F statistic but nothing else.

    I have also tried:

    Code:
     collect layout (colname)(result[F r2a])
    But this tells me that level r2a of result is not found and then a message:

    Code:
    Your layout specification does not identify any items.
    I am convinced that the new tables and collection commands are very useful, but I'm still mired in the complexity.

    Any help in understanding what I'm doing wrong would be very welcome.

  • #2
    Please ignore this. The mistake is trivial.

    Comment


    • #3
      Most mistakes are trivial once you've figured them out. It would be a service to the entire Forum if you explained what the mistake is, so that others who encounter similar problems in the future will benefit from what you learned solving the problem yourself. The -collect- and -table- commands are, indeed, very complex. It isn't apparent to me what was wrong in #1, and I suspect it won't be to others either. Please share your knowledge with us. Knowledge sharing is the point of the Forum. It's not a help line; it's a community.

      Comment


      • #4
        Just want to second #3. I am trying to understand the new -collect- system and learning from your initial mistake would really help!

        Comment


        • #5
          In case of the annoying "collect is ignoring label", usually it´s because there´s a previous label. In that case, you should add ", modify" at the end.

          Comment

          Working...
          X