Announcement

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

  • Problems with ordered logit regression. How to get "overall" pairwise comparisons?

    Dear all,
    thanks in advance for your precious time.

    I have to solve an ordered regression problem.

    I have 5 groups of patients, treated with 5 different drug doses.
    Subjects were measured with an ordinal efficacy outcome (variable "v") ranging from 0 to 5.
    The outcome was measured at 4 different timepoints ("time" variable): 30, 60, 120 and 180 minutes.

    My model looks like this:

    meologit v i.dose##i.time|| id:, or

    The problem lies in the fact that I would like to compare the 5 doses with each other in terms of effectiveness over time.

    If I do:

    margins i.dose#i.time, pwcompare(pveffects) mcompare(bonferroni) atmeans

    I would get pairwise comparisons for any dose-drug combination but.....for any possible level of outcome! And that's too many comparisons and difficult to report.

    How can I make an "overall" comparison of doses over time, without having comparisons for each level of outcome?


    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input byte dose int time byte v float id
    0  30 4  1
    0  30 5  2
    0  30 5  3
    0  30 4  4
    0  30 4  5
    0  30 3  6
    0  30 4  7
    0  30 5  8
    1  30 4  9
    1  30 3 10
    1  30 5 11
    1  30 4 12
    1  30 4 13
    1  30 4 14
    1  30 4 15
    1  30 5 16
    2  30 2 17
    2  30 2 18
    2  30 2 19
    2  30 3 20
    2  30 2 21
    2  30 2 22
    2  30 1 23
    2  30 2 24
    3  30 0 25
    3  30 0 26
    3  30 1 27
    3  30 1 28
    3  30 1 29
    3  30 0 30
    3  30 0 31
    3  30 1 32
    4  30 1 33
    4  30 0 34
    4  30 1 35
    4  30 2 36
    4  30 0 37
    4  30 0 38
    4  30 0 39
    4  30 0 40
    0  60 5  1
    0  60 5  2
    0  60 5  3
    0  60 4  4
    0  60 5  5
    0  60 4  6
    0  60 5  7
    0  60 5  8
    1  60 5  9
    1  60 5 10
    1  60 4 11
    1  60 5 12
    1  60 4 13
    1  60 5 14
    1  60 5 15
    1  60 5 16
    2  60 2 17
    2  60 3 18
    2  60 3 19
    2  60 4 20
    2  60 3 21
    2  60 3 22
    2  60 3 23
    2  60 3 24
    3  60 2 25
    3  60 1 26
    3  60 1 27
    3  60 1 28
    3  60 0 29
    3  60 1 30
    3  60 1 31
    3  60 2 32
    4  60 1 33
    4  60 1 34
    4  60 1 35
    4  60 1 36
    4  60 1 37
    4  60 1 38
    4  60 1 39
    4  60 2 40
    0 120 5  1
    0 120 5  2
    0 120 5  3
    0 120 4  4
    0 120 5  5
    0 120 5  6
    0 120 5  7
    0 120 5  8
    1 120 5  9
    1 120 5 10
    1 120 5 11
    1 120 5 12
    1 120 4 13
    1 120 5 14
    1 120 5 15
    1 120 4 16
    2 120 5 17
    2 120 5 18
    2 120 5 19
    2 120 4 20
    end

  • #2
    Originally posted by Gianfranco Di Gennaro View Post
    How can I make an "overall" comparison of doses over time, without having comparisons for each level of outcome?
    Assuming balanced data:
    Code:
    bysort id (time): integ v time, trapezoid double generate(integral)
    
    version 16.1: table dose if time == 180, ///
        contents(mean integral sd integral min integral max integral n integral) format(%3.0f)
    
    // And then either
    regress integral i.dose if time == 180
    testparm i.dose
    
    // or
    anova integral dose if time == 180
    If you had equidistant intervals, you could just sum the outcome variable across time.

    Comment


    • #3
      Thank you very much Joseph Coveney
      It works perfectly.
      I wonder wether
      pwcompare i.dose##i.time, pveffects or mcompare(bonferroni) cim eff
      is also correct.
      The problem here is that bonferroni over-adjust p values for a loto of comparisons (I have dose#time interaction term!)

      What do you think about that?
      Thanks again and again for your time.
      Gianfranco

      Comment


      • #4
        Originally posted by Gianfranco Di Gennaro View Post
        I wonder wether
        pwcompare i.dose##i.time, pveffects or mcompare(bonferroni) cim eff
        is also correct.
        Regardless of its correctness, I think that it doesn't further your objective if it's as you state in your first post above.

        If it were me, I would be inclined to forgo the pairwise-testing muddle and first take a look at the time-integrated outcome score in order to get a handle on the dose-response relationship, if any. See the first graph below for an example.

        Then I would look at the contrast of the four levels of dose from the control-treatment condition, again using the time-integrated outcome score. (Here I assume that the lowest category of dose is the zero-dose / placebo / control-treatment condition.) See the second graph below for an example. This is the only graph where I would include the standard errors (68% CI) in the plot as an index of precision in the estimates.

        Finally, for differences between dose levels in the timecourse, I would fit an ordered-probit mixed-effect regression model with dose × time interaction as predictors and create four profile plots of the linear predictions, each a level of dose (and each would include the control-treatment group's timecourse for comparison). See the last graph below for an example. Keep in mind that it will be almost certainly futile to discern five levels of dose (let alone their interaction with time over a short interval) with so coarse an outcome measure as you have.

        The output below was used to create the attached example graphs.

        .ÿ
        .ÿversionÿ18.0

        .ÿ
        .ÿclearÿ*

        .ÿ
        .ÿ//ÿseedem
        .ÿsetÿseedÿ684080522

        .ÿ
        .ÿquietlyÿsetÿobsÿ250

        .ÿgenerateÿintÿpidÿ=ÿ_n

        .ÿgenerateÿdoubleÿpid_uÿ=ÿrnormal()

        .ÿ
        .ÿgenerateÿbyteÿdosÿ=ÿmod(_n,ÿ5)

        .ÿlabelÿvariableÿdosÿDose

        .ÿtempvarÿdos

        .ÿgenerateÿdoubleÿ`dos'ÿ=ÿ(dosÿ-ÿ2)ÿ/ÿ4

        .ÿ
        .ÿquietlyÿexpandÿ4

        .ÿbysortÿpidÿdos:ÿgenerateÿbyteÿtimÿ=ÿ_n

        .ÿtempvarÿtim

        .ÿgenerateÿdoubleÿ`tim'ÿ=ÿ(timÿ-ÿ2.5)ÿ/ÿ3

        .ÿquietlyÿreplaceÿ`tim'ÿ=ÿ`tim'ÿ*ÿ`tim'

        .ÿquietlyÿrecodeÿtimÿ(1=30)ÿ(2=60)ÿ(3=120)ÿ(4=180)

        .ÿlabelÿvariableÿtimÿ"Timeÿ(Minutes)"

        .ÿ
        .ÿgenerateÿdoubleÿxbÿ=ÿ(`dos'ÿ+ÿ`tim'ÿ-ÿ`dos'ÿ*ÿ`tim')ÿ/ÿ1.25

        .ÿgenerateÿdoubleÿxbuÿ=ÿxbÿ+ÿpid_u

        .ÿtempvarÿlat

        .ÿgenerateÿdoubleÿ`lat'ÿ=ÿxbuÿ+ÿrnormal()

        .ÿ
        .ÿgenerateÿbyteÿoutÿ=ÿ0

        .ÿforvaluesÿcutÿ=ÿ1/5ÿ{
        ÿÿ2.ÿÿÿÿÿÿÿÿÿquietlyÿreplaceÿoutÿ=ÿoutÿ+ÿ1ÿifÿ`lat'ÿ>ÿinvnormal(`cut'ÿ/ÿ6)
        ÿÿ3.ÿ}

        .ÿ
        .ÿ*
        .ÿ*ÿBeginÿhere
        .ÿ*
        .ÿ//ÿDose-reponseÿrelationship
        .ÿbysortÿpidÿ(tim):ÿintegÿoutÿtim,ÿtrapezoidÿdoubleÿgenerate(oot)

        .ÿhetregressÿootÿi.dosÿifÿtimÿ==ÿ180,ÿhet(i.dos)ÿnolog

        HeteroskedasticÿlinearÿregressionÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿÿÿ250
        MLÿestimation
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿWaldÿchi2(4)ÿÿÿÿÿÿ=ÿÿÿÿÿÿ11.62
        Logÿlikelihoodÿ=ÿ-1710.231ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿÿÿÿÿÿÿ=ÿÿÿÿÿ0.0204

        ------------------------------------------------------------------------------
        ÿÿÿÿÿÿÿÿÿootÿ|ÿCoefficientÿÿStd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
        -------------+----------------------------------------------------------------
        ootÿÿÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿÿÿÿÿdosÿ|
        ÿÿÿÿÿÿÿÿÿÿ1ÿÿ|ÿÿÿÿÿÿÿ28.8ÿÿÿ42.99501ÿÿÿÿÿ0.67ÿÿÿ0.503ÿÿÿÿ-55.46868ÿÿÿÿ113.0687
        ÿÿÿÿÿÿÿÿÿÿ2ÿÿ|ÿÿÿÿÿÿÿ99.9ÿÿÿ45.27844ÿÿÿÿÿ2.21ÿÿÿ0.027ÿÿÿÿÿ11.15589ÿÿÿÿ188.6441
        ÿÿÿÿÿÿÿÿÿÿ3ÿÿ|ÿÿÿÿÿÿ113.4ÿÿÿ43.40493ÿÿÿÿÿ2.61ÿÿÿ0.009ÿÿÿÿÿÿ28.3279ÿÿÿÿ198.4721
        ÿÿÿÿÿÿÿÿÿÿ4ÿÿ|ÿÿÿÿÿÿ108.6ÿÿÿ42.11402ÿÿÿÿÿ2.58ÿÿÿ0.010ÿÿÿÿÿ26.05804ÿÿÿÿÿ191.142
        ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿÿÿ_consÿ|ÿÿÿÿÿÿ316.2ÿÿÿ28.14198ÿÿÿÿ11.24ÿÿÿ0.000ÿÿÿÿÿ261.0427ÿÿÿÿ371.3573
        -------------+----------------------------------------------------------------
        lnsigma2ÿÿÿÿÿ|
        ÿÿÿÿÿÿÿÿÿdosÿ|
        ÿÿÿÿÿÿÿÿÿÿ1ÿÿ|ÿÿÿ.2882865ÿÿÿ.2828427ÿÿÿÿÿ1.02ÿÿÿ0.308ÿÿÿÿ-.2660751ÿÿÿÿÿ.842648
        ÿÿÿÿÿÿÿÿÿÿ2ÿÿ|ÿÿÿ.4628852ÿÿÿ.2828427ÿÿÿÿÿ1.64ÿÿÿ0.102ÿÿÿÿ-.0914763ÿÿÿÿ1.017247
        ÿÿÿÿÿÿÿÿÿÿ3ÿÿ|ÿÿÿ.3212565ÿÿÿ.2828427ÿÿÿÿÿ1.14ÿÿÿ0.256ÿÿÿÿÿ-.233105ÿÿÿÿÿ.875618
        ÿÿÿÿÿÿÿÿÿÿ4ÿÿ|ÿÿÿ.2146784ÿÿÿ.2828427ÿÿÿÿÿ0.76ÿÿÿ0.448ÿÿÿÿ-.3396831ÿÿÿÿÿÿ.76904
        ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ10.58655ÿÿÿÿÿÿÿÿÿ.2ÿÿÿÿ52.93ÿÿÿ0.000ÿÿÿÿÿ10.19456ÿÿÿÿ10.97854
        ------------------------------------------------------------------------------
        LRÿtestÿofÿlnsigma2=0:ÿchi2(4)ÿ=ÿ2.81ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿ0.5898

        .ÿ
        .ÿquietlyÿmarginsÿdos

        .ÿquietlyÿmarginsplotÿ,ÿ///
        >ÿÿÿÿÿÿÿÿÿxdimension(dos)ÿ///
        >ÿÿÿÿÿÿÿÿÿtitle("")ÿytitle("OutcomeÿScore")ÿ///
        >ÿÿÿÿÿÿÿÿÿplotopts(msymbol(O)ÿmcolor(black)ÿmfcolor(white)ÿlcolor(black))ÿ///
        >ÿÿÿÿÿÿÿÿÿnociÿ///
        >ÿÿÿÿÿÿÿÿÿscheme(s2color)ÿylabel(ÿ,ÿangle(horizontal)ÿnogrid)

        .ÿquietlyÿgraphÿexportÿDoseReponse1.png,ÿreplace

        .ÿ
        .ÿquietlyÿmarginsÿr.dos,ÿcontrast

        .ÿquietlyÿmarginsplotÿ,ÿ///
        >ÿÿÿÿÿÿÿÿÿxdimension(dos)ÿ///
        >ÿÿÿÿÿÿÿÿÿtitle("")ÿytitle("Response")ÿ///
        >ÿÿÿÿÿÿÿÿÿplotopts(msymbol(O)ÿmcolor(black)ÿmfcolor(white)ÿlcolor(black))ÿ///
        >ÿÿÿÿÿÿÿÿÿlevel(68)ÿciopts(lcolor(black))ÿ///
        >ÿÿÿÿÿÿÿÿÿscheme(s2color)ÿylabel(ÿ,ÿangle(horizontal)ÿnogrid)

        .ÿquietlyÿgraphÿexportÿDoseReponse2.png,ÿreplace

        .ÿ
        .ÿ//ÿDoseÿ×ÿtimeÿinteractionÿ&ÿtimecourseÿofÿresponseÿ(profileÿplots)
        .ÿmeoprobitÿoutÿi.dos##i.timÿ||ÿpid:ÿ,ÿnolog

        Mixed-effectsÿoprobitÿregressionÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿ1,000
        Groupÿvariable:ÿpidÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿgroupsÿÿ=ÿÿÿÿÿÿÿÿ250

        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿObsÿperÿgroup:
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿminÿ=ÿÿÿÿÿÿÿÿÿÿ4
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿavgÿ=ÿÿÿÿÿÿÿÿ4.0
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmaxÿ=ÿÿÿÿÿÿÿÿÿÿ4

        Integrationÿmethod:ÿmvaghermiteÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿIntegrationÿpts.ÿÿ=ÿÿÿÿÿÿÿÿÿÿ7

        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿWaldÿchi2(19)ÿÿÿÿÿ=ÿÿÿÿÿÿ22.30
        Logÿlikelihoodÿ=ÿ-1587.9125ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿÿÿÿÿÿÿ=ÿÿÿÿÿ0.2694
        ------------------------------------------------------------------------------
        ÿÿÿÿÿÿÿÿÿoutÿ|ÿCoefficientÿÿStd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
        -------------+----------------------------------------------------------------
        ÿÿÿÿÿÿÿÿÿdosÿ|
        ÿÿÿÿÿÿÿÿÿÿ1ÿÿ|ÿÿÿÿ.354215ÿÿÿ.3098642ÿÿÿÿÿ1.14ÿÿÿ0.253ÿÿÿÿ-.2531077ÿÿÿÿ.9615378
        ÿÿÿÿÿÿÿÿÿÿ2ÿÿ|ÿÿÿ.3329259ÿÿÿ.3127225ÿÿÿÿÿ1.06ÿÿÿ0.287ÿÿÿÿ-.2799989ÿÿÿÿ.9458506
        ÿÿÿÿÿÿÿÿÿÿ3ÿÿ|ÿÿÿ.4689935ÿÿÿ.3151112ÿÿÿÿÿ1.49ÿÿÿ0.137ÿÿÿÿ-.1486131ÿÿÿÿÿÿ1.0866
        ÿÿÿÿÿÿÿÿÿÿ4ÿÿ|ÿÿÿÿ.450958ÿÿÿ.3105915ÿÿÿÿÿ1.45ÿÿÿ0.147ÿÿÿÿ-.1577901ÿÿÿÿ1.059706
        ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿÿÿÿÿtimÿ|
        ÿÿÿÿÿÿÿÿÿ60ÿÿ|ÿÿÿ.0093019ÿÿÿ.2235831ÿÿÿÿÿ0.04ÿÿÿ0.967ÿÿÿÿ-.4289129ÿÿÿÿ.4475166
        ÿÿÿÿÿÿÿÿ120ÿÿ|ÿÿ-.2762499ÿÿÿ.2202303ÿÿÿÿ-1.25ÿÿÿ0.210ÿÿÿÿ-.7078934ÿÿÿÿ.1553936
        ÿÿÿÿÿÿÿÿ180ÿÿ|ÿÿÿ.1429116ÿÿÿ.2218406ÿÿÿÿÿ0.64ÿÿÿ0.519ÿÿÿÿÿ-.291888ÿÿÿÿ.5777112
        ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿdos#timÿ|
        ÿÿÿÿÿÿ1ÿÿ60ÿÿ|ÿÿ-.5015543ÿÿÿ.3158545ÿÿÿÿ-1.59ÿÿÿ0.112ÿÿÿÿ-1.120618ÿÿÿÿ.1175093
        ÿÿÿÿÿÿ1ÿ120ÿÿ|ÿÿ-.1878046ÿÿÿ.3136091ÿÿÿÿ-0.60ÿÿÿ0.549ÿÿÿÿ-.8024671ÿÿÿÿ.4268578
        ÿÿÿÿÿÿ1ÿ180ÿÿ|ÿÿ-.2643964ÿÿÿ.3140895ÿÿÿÿ-0.84ÿÿÿ0.400ÿÿÿÿ-.8800006ÿÿÿÿ.3512077
        ÿÿÿÿÿÿ2ÿÿ60ÿÿ|ÿÿÿ.2400885ÿÿÿ.3198824ÿÿÿÿÿ0.75ÿÿÿ0.453ÿÿÿÿ-.3868694ÿÿÿÿ.8670465
        ÿÿÿÿÿÿ2ÿ120ÿÿ|ÿÿÿ.2050275ÿÿÿ.3167494ÿÿÿÿÿ0.65ÿÿÿ0.517ÿÿÿÿ-.4157899ÿÿÿÿ.8258449
        ÿÿÿÿÿÿ2ÿ180ÿÿ|ÿÿÿ.0289992ÿÿÿ.3192459ÿÿÿÿÿ0.09ÿÿÿ0.928ÿÿÿÿ-.5967113ÿÿÿÿ.6547097
        ÿÿÿÿÿÿ3ÿÿ60ÿÿ|ÿÿ-.0670375ÿÿÿ.3206935ÿÿÿÿ-0.21ÿÿÿ0.834ÿÿÿÿ-.6955853ÿÿÿÿ.5615103
        ÿÿÿÿÿÿ3ÿ120ÿÿ|ÿÿÿÿ.403246ÿÿÿ.3198534ÿÿÿÿÿ1.26ÿÿÿ0.207ÿÿÿÿ-.2236552ÿÿÿÿ1.030147
        ÿÿÿÿÿÿ3ÿ180ÿÿ|ÿÿ-.2783783ÿÿÿ.3215911ÿÿÿÿ-0.87ÿÿÿ0.387ÿÿÿÿ-.9086853ÿÿÿÿ.3519286
        ÿÿÿÿÿÿ4ÿÿ60ÿÿ|ÿÿÿ.0184683ÿÿÿ.3166184ÿÿÿÿÿ0.06ÿÿÿ0.953ÿÿÿÿ-.6020923ÿÿÿÿ.6390289
        ÿÿÿÿÿÿ4ÿ120ÿÿ|ÿÿÿ.1956433ÿÿÿ.3133416ÿÿÿÿÿ0.62ÿÿÿ0.532ÿÿÿÿÿ-.418495ÿÿÿÿ.8097815
        ÿÿÿÿÿÿ4ÿ180ÿÿ|ÿÿÿ-.130418ÿÿÿ.3163268ÿÿÿÿ-0.41ÿÿÿ0.680ÿÿÿÿ-.7504071ÿÿÿÿ.4895711
        -------------+----------------------------------------------------------------
        ÿÿÿÿÿÿÿ/cut1ÿ|ÿÿ-.8731126ÿÿÿ.2232214ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-1.310619ÿÿÿ-.4356067
        ÿÿÿÿÿÿÿ/cut2ÿ|ÿÿ-.2558094ÿÿÿ.2218711ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-.6906687ÿÿÿÿ.1790499
        ÿÿÿÿÿÿÿ/cut3ÿ|ÿÿÿ.1683255ÿÿÿ.2219335ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-.2666562ÿÿÿÿ.6033072
        ÿÿÿÿÿÿÿ/cut4ÿ|ÿÿÿ.6480261ÿÿÿ.2228791ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.2111912ÿÿÿÿ1.084861
        ÿÿÿÿÿÿÿ/cut5ÿ|ÿÿÿ1.188822ÿÿÿ.2245933ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.7486272ÿÿÿÿ1.629017
        -------------+----------------------------------------------------------------
        pidÿÿÿÿÿÿÿÿÿÿ|
        ÿÿÿvar(_cons)|ÿÿÿ1.148859ÿÿÿ.1625004ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.8706999ÿÿÿÿÿ1.51588
        ------------------------------------------------------------------------------
        LRÿtestÿvs.ÿoprobitÿmodel:ÿchibar2(01)ÿ=ÿ258.91ÿÿÿÿÿÿÿProbÿ>=ÿchibar2ÿ=ÿ0.0000

        .ÿcontrastÿdos#tim

        Contrastsÿofÿmarginalÿlinearÿpredictions

        Margins:ÿasbalanced

        ------------------------------------------------
        ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿdfÿÿÿÿÿÿÿÿchi2ÿÿÿÿÿP>chi2
        -------------+----------------------------------
        outÿÿÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿdos#timÿ|ÿÿÿÿÿÿÿÿÿ12ÿÿÿÿÿÿÿ11.64ÿÿÿÿÿ0.4747
        ------------------------------------------------

        .ÿquietlyÿmarginsÿdos#tim,ÿpredict(xb)

        .ÿ
        .ÿquietlyÿmarginsplotÿ,ÿ///
        >ÿÿÿÿÿÿÿÿÿxdimension(tim)ÿ///
        >ÿÿÿÿÿÿÿÿÿplotdimension(dos)ÿ///
        >ÿÿÿÿÿÿÿÿÿnociÿtitle("")ÿytitle(LinearÿPrediction)ÿxtitle("")ÿ///
        >ÿÿÿÿÿÿÿÿÿplot1opts(msymbol(none)ÿlcolor(black)ÿlpattern(solid))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot2opts(msymbol(none)ÿlcolor(black)ÿlpattern(longdash))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot3opts(msymbol(none)ÿlcolor(black)ÿlpattern(blank))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot4opts(msymbol(none)ÿlcolor(black)ÿlpattern(blank))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot5opts(msymbol(none)ÿlcolor(black)ÿlpattern(blank))ÿ///
        >ÿÿÿÿÿÿÿÿÿscheme(s2color)ÿ///
        >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿylabel(ÿ,ÿformat(%04.2f)ÿangle(horizontal)ÿnogrid)ÿ///
        >ÿÿÿÿÿÿÿÿÿlegend(off)ÿname(D12,ÿreplace)

        .ÿ
        .ÿquietlyÿmarginsplotÿ,ÿ///
        >ÿÿÿÿÿÿÿÿÿxdimension(tim)ÿ///
        >ÿÿÿÿÿÿÿÿÿplotdimension(dos)ÿ///
        >ÿÿÿÿÿÿÿÿÿnociÿtitle("")ÿytitle("")ÿxtitle("")ÿ///
        >ÿÿÿÿÿÿÿÿÿplot1opts(msymbol(none)ÿlcolor(black)ÿlpattern(solid))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot2opts(msymbol(none)ÿlcolor(black)ÿlpattern(blank))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot3opts(msymbol(none)ÿlcolor(black)ÿlpattern(longdash))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot4opts(msymbol(none)ÿlcolor(black)ÿlpattern(blank))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot5opts(msymbol(none)ÿlcolor(black)ÿlpattern(blank))ÿ///
        >ÿÿÿÿÿÿÿÿÿscheme(s2color)ÿ///
        >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿylabel(ÿ,ÿformat(%04.2f)ÿangle(horizontal)ÿnogrid)ÿ///
        >ÿÿÿÿÿÿÿÿÿlegend(off)ÿname(D13,ÿreplace)

        .ÿ
        .ÿquietlyÿmarginsplotÿ,ÿ///
        >ÿÿÿÿÿÿÿÿÿxdimension(tim)ÿ///
        >ÿÿÿÿÿÿÿÿÿplotdimension(dos)ÿ///
        >ÿÿÿÿÿÿÿÿÿnociÿtitle("")ÿytitle(LinearÿPrediction)ÿxtitle(Timeÿ(Minutes))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot1opts(msymbol(none)ÿlcolor(black)ÿlpattern(solid))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot2opts(msymbol(none)ÿlcolor(black)ÿlpattern(blank))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot3opts(msymbol(none)ÿlcolor(black)ÿlpattern(blank))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot4opts(msymbol(none)ÿlcolor(black)ÿlpattern(longdash))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot5opts(msymbol(none)ÿlcolor(black)ÿlpattern(blank))ÿ///
        >ÿÿÿÿÿÿÿÿÿscheme(s2color)ÿ///
        >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿylabel(ÿ,ÿformat(%04.2f)ÿangle(horizontal)ÿnogrid)ÿ///
        >ÿÿÿÿÿÿÿÿÿlegend(off)ÿname(D14,ÿreplace)

        .ÿ
        .ÿquietlyÿmarginsplotÿ,ÿ///
        >ÿÿÿÿÿÿÿÿÿxdimension(tim)ÿ///
        >ÿÿÿÿÿÿÿÿÿplotdimension(dos)ÿ///
        >ÿÿÿÿÿÿÿÿÿnociÿtitle("")ÿytitle("")ÿxtitle(Timeÿ(Minutes))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot1opts(msymbol(none)ÿlcolor(black)ÿlpattern(solid))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot2opts(msymbol(none)ÿlcolor(black)ÿlpattern(blank))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot3opts(msymbol(none)ÿlcolor(black)ÿlpattern(blank))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot4opts(msymbol(none)ÿlcolor(black)ÿlpattern(blank))ÿ///
        >ÿÿÿÿÿÿÿÿÿplot5opts(msymbol(none)ÿlcolor(black)ÿlpattern(longdash))ÿ///
        >ÿÿÿÿÿÿÿÿÿscheme(s2color)ÿ///
        >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿylabel(ÿ,ÿformat(%04.2f)ÿangle(horizontal)ÿnogrid)ÿ///
        >ÿÿÿÿÿÿÿÿÿlegend(off)ÿname(D15,ÿreplace)

        .ÿ
        .ÿgraphÿcombineÿD12ÿD13ÿD14ÿD15,ÿrows(2)ÿysize(5.5)ÿxsize(4)

        .ÿquietlyÿgraphÿexportÿProfiles.png,ÿreplace

        .ÿ
        .ÿexit

        endÿofÿdo-file


        .


        Click image for larger version

Name:	DoseReponse1.png
Views:	1
Size:	22.3 KB
ID:	1719746

        Click image for larger version

Name:	DoseReponse2.png
Views:	1
Size:	22.6 KB
ID:	1719747

        Click image for larger version

Name:	Profiles.png
Views:	1
Size:	26.9 KB
ID:	1719748

        Comment


        • #5
          Thank you dear Joseph Coveney
          I agree with what you tell me.
          I don't have much data management practice at STATA, so I'm going to study, as well as replicate, your script.
          Kind regards and thank you again for solving my problem.

          Comment

          Working...
          X