Announcement

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

  • Need help in using the Fieller and Delta methods to calculate the 95% confidence interval for the extreme point

    Good day to you,

    I am testing an inversed U-shaped between stock returns and environmental performance (Enviscore1 with the squared term is Envisqr1). I used OLS and followed by UTEST. The extreme point is reported in the result of UTEST. Finally, I need to determine the 95% confidence interval for the extreme point using both Fieller and Delta methods.

    So far, I have finished the UTEST and found the extreme point. However, I do not understand how to calculate the 95% CI for the extreme point.

    The results of UTEST are as follows:
    Click image for larger version

Name:	Picture1.jpg
Views:	1
Size:	49.7 KB
ID:	1669251



    Then I run the Delta method as follows:
    Click image for larger version

Name:	Picture2.jpg
Views:	1
Size:	28.5 KB
ID:	1669252



    The current confidence interval does not include the extreme point, which is very strange, leading me to believe that I wrote the wrong code to calculate it.

    Could you please help me?

    I am appreciated your precious help!

    Trang Dang
    Last edited by Trang Dang; 14 Jun 2022, 21:30.

  • #2
    Originally posted by Trang Dang View Post
    So far, I have finished the UTEST and found the extreme point. However, I do not understand how to calculate the 95% CI for the extreme point.
    According to the user-written command's help file, you need to specify the option fieller in order for it to calculate the confidence interval.

    The current confidence interval does not include the extreme point, which is very strange, leading me to believe that I wrote the wrong code to calculate it.

    Could you please help me?
    First, you don't show all of the code that you used to calculate it, and so there's no way for anyone on the list to comment on your belief that you wrote the wrong code.

    Second, for some reason, utest issued a warning or notification that "105 missing values generated". Was that expected, based upon your dataset and regression model? If not, then perhaps you should look into what's causing that and whether it could give rise to unexpected results with the command.

    For reference, I've downloaded utest from SSC and probed it with a toy example (below). utest's estimate of the vertex's location and its Fieller-method confidence interval matches those by nlcom quite well: the point estimates match exactly (as expected) and the confidence bounds differ only slightly, [0.08, 0.30] versus [0.08, 0.29]; both sets of CIs contain the true parameter value in the toy example below.

    .ÿ
    .ÿversionÿ17.0

    .ÿ
    .ÿclearÿ*

    .ÿ
    .ÿ//ÿseedem
    .ÿsetÿseedÿ1775056707

    .ÿ
    .ÿquietlyÿsetÿobsÿ30

    .ÿ
    .ÿgenerateÿdoubleÿxÿ=ÿruniform(-2,ÿ2)

    .ÿgenerateÿdoubleÿyÿ=ÿ0.5ÿ*ÿxÿ-ÿxÿ*ÿxÿ+ÿ1ÿ+ÿrnormal(0,ÿsqrt(0.25))

    .ÿ
    .ÿ*
    .ÿ*ÿBeginÿhere
    .ÿ*
    .ÿ//ÿ-utest-ÿisÿfromÿVersionÿ9,ÿandÿsoÿnoÿfactorÿvariableÿnotation
    .ÿgenerateÿdoubleÿx2ÿ=ÿxÿ*ÿx

    .ÿ
    .ÿregressÿyÿc.(xÿx2)

    ÿÿÿÿÿÿSourceÿ|ÿÿÿÿÿÿÿSSÿÿÿÿÿÿÿÿÿÿÿdfÿÿÿÿÿÿÿMSÿÿÿÿÿÿNumberÿofÿobsÿÿÿ=ÿÿÿÿÿÿÿÿ30
    -------------+----------------------------------ÿÿÿF(2,ÿ27)ÿÿÿÿÿÿÿÿ=ÿÿÿÿÿ50.72
    ÿÿÿÿÿÿÿModelÿ|ÿÿ24.5705532ÿÿÿÿÿÿÿÿÿ2ÿÿ12.2852766ÿÿÿProbÿ>ÿFÿÿÿÿÿÿÿÿ=ÿÿÿÿ0.0000
    ÿÿÿÿResidualÿ|ÿÿ6.53937942ÿÿÿÿÿÿÿÿ27ÿÿ.242199238ÿÿÿR-squaredÿÿÿÿÿÿÿ=ÿÿÿÿ0.7898
    -------------+----------------------------------ÿÿÿAdjÿR-squaredÿÿÿ=ÿÿÿÿ0.7742
    ÿÿÿÿÿÿÿTotalÿ|ÿÿ31.1099326ÿÿÿÿÿÿÿÿ29ÿÿÿ1.0727563ÿÿÿRootÿMSEÿÿÿÿÿÿÿÿ=ÿÿÿÿ.49214

    ------------------------------------------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿyÿ|ÿCoefficientÿÿStd.ÿerr.ÿÿÿÿÿÿtÿÿÿÿP>|t|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
    -------------+----------------------------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿxÿ|ÿÿÿ.3384388ÿÿÿ.0937972ÿÿÿÿÿ3.61ÿÿÿ0.001ÿÿÿÿÿ.1459829ÿÿÿÿ.5308947
    ÿÿÿÿÿÿÿÿÿÿx2ÿ|ÿÿ-.9043633ÿÿÿ.0920202ÿÿÿÿ-9.83ÿÿÿ0.000ÿÿÿÿ-1.093173ÿÿÿ-.7155535
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.8642573ÿÿÿ.1308411ÿÿÿÿÿ6.61ÿÿÿ0.000ÿÿÿÿÿ.5957935ÿÿÿÿ1.132721
    ------------------------------------------------------------------------------

    .ÿpredictÿdoubleÿyhat,ÿxb

    .ÿ
    .ÿ//ÿ"extremeÿpoint"ÿandÿdelta-methodÿCI
    .ÿnlcomÿapex:ÿ-_b[x]ÿ/ÿ2ÿ/ÿ_b[x2]

    ÿÿÿÿÿÿÿÿapex:ÿ-_b[x]ÿ/ÿ2ÿ/ÿ_b[x2]

    ------------------------------------------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿyÿ|ÿCoefficientÿÿStd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
    -------------+----------------------------------------------------------------
    ÿÿÿÿÿÿÿÿapexÿ|ÿÿÿ.1871144ÿÿÿ.0525838ÿÿÿÿÿ3.56ÿÿÿ0.000ÿÿÿÿÿ.0840521ÿÿÿÿ.2901767
    ------------------------------------------------------------------------------

    .ÿtempnameÿnlcom

    .ÿscalarÿdefineÿ`nlcom'ÿ=ÿr(b)[1,1]

    .ÿ
    .ÿ//ÿdittoÿbyÿ-utest-,ÿandÿFieller-methodÿCI
    .ÿutestÿxÿx2,ÿfieller

    Specification:ÿf(x)=x^2
    Extremeÿpoint:ÿÿ.1871144

    Test:
    ÿÿÿÿÿH1:ÿInverseÿUÿshape
    ÿvs.ÿH0:ÿMonotoneÿorÿUÿshapeÿ

    -------------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿLowerÿboundÿÿÿÿÿÿUpperÿbound
    -----------------+-------------------------------
    Intervalÿÿÿÿÿÿÿÿÿ|ÿÿÿÿ-1.68208ÿÿÿÿÿÿÿÿÿ1.801741
    Slopeÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿ3.380861ÿÿÿÿÿÿÿÿ-2.920418
    t-valueÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿ10.05463ÿÿÿÿÿÿÿÿ-8.816604
    P>|t|ÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿ6.32e-11ÿÿÿÿÿÿÿÿÿ9.84e-10
    -------------------------------------------------

    OverallÿtestÿofÿpresenceÿofÿaÿInverseÿUÿshape:
    ÿÿÿÿÿt-valueÿ=ÿÿÿÿÿÿ8.82
    ÿÿÿÿÿP>|t|ÿÿÿ=ÿÿ9.84e-10

    95%ÿFiellerÿintervalÿforÿextremeÿpoint:ÿ[.08182511;ÿ.3027142]

    .ÿtempnameÿutest

    .ÿscalarÿdefineÿ`utest'ÿ=ÿr(extr)

    .ÿ
    .ÿdisplayÿinÿsmclÿasÿtextÿ"Differenceÿbetweenÿestimates:ÿ"ÿasÿresultÿ`nlcom'ÿ-ÿ`utest'
    Differenceÿbetweenÿestimates:ÿ0

    .ÿ
    .ÿgraphÿtwowayÿ///
    >ÿÿÿÿÿÿÿÿÿfunctionÿyÿ=ÿ0.5ÿ*ÿxÿ-ÿx^2ÿ+ÿ1,ÿrange(-2ÿ2)ÿlcolor(black)ÿ///
    >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿxline(`=0.5ÿ/ÿ2',ÿlcolor(red))ÿ||ÿ///
    >ÿÿÿÿÿÿÿÿÿlineÿyhatÿx,ÿsortÿlcolor(black)ÿlpattern(dash)ÿ///
    >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿxline(`r(extr)',ÿlcolor(red)ÿlpattern(dash))ÿ||ÿ///
    >ÿÿÿÿÿÿÿÿÿscatterÿyÿx,ÿmcolor(black)ÿmfcolor(white)ÿmsize(small)ÿ///
    >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿylabel(ÿ,ÿangle(horizontal)ÿnogrid)ÿlegend(off)

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

    .ÿ
    .ÿexit

    endÿofÿdo-file


    .


    Click image for larger version

Name:	U.png
Views:	1
Size:	28.7 KB
ID:	1669262

    Solid lines actual; dashed lines estimated.

    Comment

    Working...
    X