Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: graphing margins in Stata 11


From   "Valle, Giuseppina" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: graphing margins in Stata 11
Date   Mon, 9 Sep 2013 16:59:20 +0000

Hello. I am trying to graph the results of a categorical by continuous interaction from a logistic regression model in Stata 11 (I do not access to Stata 12 to use the marginsplot command). My categorical predictor has 3 categories and my continuous predictor has a max value of 50. I have used the code below without error:

margins vaginal, at(numpart=(1(1)50)) vsquish 
matrix b=r(b)'
matrix list b
matrix at=r(at)
matrix list at

However, for the next step, I use the code:

matrix at=at[1...,"numpart"]#(1\2\3)
matrix list at

I get the following: 

at[150,1]
           numpart:
                c1
   r1:r1         1
   r1:r2         2
   r1:r3         3
   r2:r4         2
   r2:r5         4
   r2:r6         6
   r3:r7         3
   r3:r8         6
   r3:r9         9
  r4:r10         4
  r4:r11         8
  r4:r12        12
  r5:r13         5
  r5:r14        10
  r5:r15        15
  r6:r16         6
  r6:r17        12
  r6:r18        18
  r7:r19         7
  r7:r20        14
  r7:r21        21
  r8:r22         8
  r8:r23        16
  r8:r24        24
  r9:r25         9
  r9:r26        18
  r9:r27        27
 r10:r28        10
 r10:r29        20
 r10:r30        30
 r11:r31        11
 r11:r32        22
 r11:r33        33
 r12:r34        12
 r12:r35        24
 r12:r36        36
 r13:r37        13
 r13:r38        26
 r13:r39        39
 r14:r40        14
 r14:r41        28
 r14:r42        42
 r15:r43        15
 r15:r44        30
 r15:r45        45
 r16:r46        16
 r16:r47        32
 r16:r48        48
 r17:r49        17
 r17:r50        34
 r17:r51        51
 r18:r52        18
 r18:r53        36
 r18:r54        54
 r19:r55        19
 r19:r56        38
 r19:r57        57
 r20:r58        20
 r20:r59        40
 r20:r60        60
 r21:r61        21
 r21:r62        42
 r21:r63        63
 r22:r64        22
 r22:r65        44
 r22:r66        66
 r23:r67        23
 r23:r68        46
 r23:r69        69
 r24:r70        24
 r24:r71        48
 r24:r72        72
 r25:r73        25
 r25:r74        50
 r25:r75        75
 r26:r76        26
 r26:r77        52
 r26:r78        78
 r27:r79        27
 r27:r80        54
 r27:r81        81
 r28:r82        28
 r28:r83        56
 r28:r84        84
 r29:r85        29
 r29:r86        58
 r29:r87        87
 r30:r88        30
 r30:r89        60
 r30:r90        90
 r31:r91        31
 r31:r92        62
 r31:r93        93
 r32:r94        32
 r32:r95        64
 r32:r96        96
 r33:r97        33
 r33:r98        66
 r33:r99        99
r34:r100        34
r34:r101        68
r34:r102       102
r35:r103        35
r35:r104        70
r35:r105       105
r36:r106        36
r36:r107        72
r36:r108       108
r37:r109        37
r37:r110        74
r37:r111       111
r38:r112        38
r38:r113        76
r38:r114       114
r39:r115        39
r39:r116        78
r39:r117       117
r40:r118        40
r40:r119        80
r40:r120       120
r41:r121        41
r41:r122        82
r41:r123       123
r42:r124        42
r42:r125        84
r42:r126       126
r43:r127        43
r43:r128        86
r43:r129       129
r44:r130        44
r44:r131        88
r44:r132       132
r45:r133        45
r45:r134        90
r45:r135       135
r46:r136        46
r46:r137        92
r46:r138       138
r47:r139        47
r47:r140        94
r47:r141       141
r48:r142        48
r48:r143        96
r48:r144       144
r49:r145        49
r49:r146        98
r49:r147       147
r50:r148        50
r50:r149       100
r50:r150       150


It seems as if something is incorrect. As previously mentioned, "numpart" has a max value of 50, but here I am getting a values of 150. In the example online(http://www.ats.ucla.edu/stat/stata/faq/mar_graph/margins_graph.htm), I should get values of 1 through 50 in the "c1" column. 

Any advice on this matter would be greatly appreciated!

Thank you in advance,
Pina Valle



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index