Announcement

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

  • Problem with lincom

    I am facing some problems with the lincom command. Here is an example of my data.
    Code:
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float id byte(test d y) float dy
     1 1 1 1 1
     1 2 1 1 1
     2 1 1 0 0
     2 2 1 1 1
     3 1 1 1 1
     3 2 1 0 0
     4 1 1 0 0
     4 2 1 0 0
     5 1 0 1 0
     5 2 0 1 0
     6 1 0 0 1
     6 2 0 1 0
     7 1 0 1 0
     7 2 0 0 1
     8 1 0 0 1
     8 2 0 0 1
     9 1 1 1 1
     9 2 1 1 1
    10 1 1 1 1
    10 2 1 1 1
    11 1 1 1 1
    11 2 1 1 1
    12 1 1 1 1
    12 2 1 1 1
    13 1 1 1 1
    13 2 1 1 1
    14 1 1 1 1
    14 2 1 1 1
    15 1 1 1 1
    15 2 1 1 1
    16 1 1 1 1
    16 2 1 1 1
    17 1 1 1 1
    17 2 1 1 1
    18 1 1 1 1
    18 2 1 1 1
    19 1 1 1 1
    19 2 1 1 1
    20 1 1 1 1
    20 2 1 1 1
    21 1 1 1 1
    21 2 1 1 1
    22 1 1 1 1
    22 2 1 1 1
    23 1 1 1 1
    23 2 1 1 1
    24 1 1 1 1
    24 2 1 1 1
    25 1 1 1 1
    25 2 1 1 1
    26 1 1 1 1
    26 2 1 1 1
    27 1 1 1 1
    27 2 1 1 1
    28 1 1 1 1
    28 2 1 1 1
    29 1 1 1 1
    29 2 1 1 1
    30 1 1 1 1
    30 2 1 1 1
    31 1 1 1 1
    31 2 1 1 1
    32 1 1 1 1
    32 2 1 1 1
    33 1 1 1 1
    33 2 1 1 1
    34 1 1 1 1
    34 2 1 1 1
    35 1 1 1 1
    35 2 1 1 1
    36 1 1 1 1
    36 2 1 1 1
    37 1 1 1 1
    37 2 1 1 1
    38 1 1 1 1
    38 2 1 1 1
    39 1 1 1 1
    39 2 1 1 1
    40 1 1 1 1
    40 2 1 1 1
    41 1 1 1 1
    41 2 1 1 1
    42 1 1 1 1
    42 2 1 1 1
    43 1 1 1 1
    43 2 1 1 1
    44 1 1 1 1
    44 2 1 1 1
    45 1 1 1 1
    45 2 1 1 1
    46 1 1 1 1
    46 2 1 1 1
    47 1 1 1 1
    47 2 1 1 1
    48 1 1 1 1
    48 2 1 1 1
    49 1 1 1 1
    49 2 1 1 1
    50 1 1 1 1
    50 2 1 1 1
    end
    label values d ynlbl
    label values y negposlb
    label var id "Patient ID" 
    label var test "Test type" 
    label var d "Disease" 
    label var y "Test result" 
    label var dy "dy = cond(d == y, 1, 0)"
    I run the command
    Code:
    xtgee dy i.test i.d i.test#i.d, fam(bin) link(log) i(id) corr(ind) robust eform nolog
    followed by the lincom command
    Code:
    lincom 2.test#1.d + 1.d, eform
    I receive the error message
    matrix operators that return matrices not allowed in this context
    r(509);
    I expect the lincom to work. What could be wrong with my code or the use of lincom

  • #2
    Inaamul:
    what about:
    Code:
    . lincom (2.test#1.d) + 1.d, eform
    
     ( 1)  1.d + 2.test#1.d = 0
    
    ------------------------------------------------------------------------------
              dy |     exp(b)   Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             (1) |   1.913043   .9681405     1.28   0.200     .7095032    5.158166
    ------------------------------------------------------------------------------
    
    .
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Thank you very much. That worked perfectly.

      Comment

      Working...
      X