Announcement

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

  • Plotting 95%CI with "fpfitci" after Multivariable fractional polynomial (MFP)

    Graph.jpg




    Dear Forum,

    New-ish STATA user here kindly asking for guidance with plotting 95%CI area for a twoway plot after multivariable fractional polynomials (MFP). I would like to have the (%%CI as an area or band instead of current pasted figure. My code is as follows:

    Code:
    mfp, alpha(0.05) select(0.05): glm vat bmi age asset_index alcohol smoke enmo tb if group==0, family(gaussian) link(identity)
    
    predictnl vat_mbn = predict(), ci (mbn_lb mbn_ub)
    
    twoway (fpfitci vat_mbn bmi if group==0 & bmi >= 15 & bmi <= 50, c(l) lc(navy) lwidth(medthick)) (rarea mbn_lb mbn_ub bmi if group==0 & bmi >= 15 & bmi <= 50, lcolor(navy*.2))

    I had understood that fpfitci automatically plots the 95%CI but it was not, so I tried to estimate the 95%CI using predictnl, ...ci ( ).

    Thanks in advance.

    Mya
Working...
X