Announcement

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

  • Optimization to estimate a parameter


    I have cohort data where status (0,10 is my outcome and treatment (trt) is my predictor that declines over time:
    trt celltype time status karno age
    1 squamous 72 1 60 69
    1 squamous 411 1 70 64
    1 squamous 228 1 60 38
    1 squamous 126 1 60 63
    1 squamous 118 1 70 65
    1 squamous 10 1 20 49
    1 squamous 82 1 40 69
    1 squamous 110 1 80 68
    1 squamous 314 1 50 43
    1 squamous 100 0 70 70
    1 squamous 42 1 60 81
    1 squamous 8 1 40 63
    1 squamous 144 1 30 63
    1 squamous 25 0 80 52
    1 squamous 11 1 70 48
    1 smallcell 30 1 60 61
    1 smallcell 384 1 60 42
    1 smallcell 4 1 40 35
    1 smallcell 54 1 80 63
    1 smallcell 13 1 60 56
    1 smallcell 123 0 40 55
    1 smallcell 97 0 60 67
    1 smallcell 153 1 60 63
    1 smallcell 59 1 30 65
    1 smallcell 117 1 80 46
    1 smallcell 16 1 30 53

    I am trying to estimate a constant value for this decline.

    I am using the following code

    gen mu=0.01
    stset time, failure(status)

    forvalues i=1/10 {

    replace mu =0.01*`i'

    stcox karno, tvc(trt) texp(exp(-mu*_t))

    }

    But then to use optimization to find the value of "mu" where maximum likelihood is the least and I am stuck at this point. Mata does not seem to be able to factor existing stata commands like stcox.
    Any guidance will be of great help
Working...
X