Announcement

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

  • lfitci gray region not showing

    I'm trying to make a plot that shows both the scatter and line of best fit; x=regional hospital HHI, y = share of people enrolled in silver or below insurance plans. I used lfitci because I want the confidence interval to show on the graph. However, the graph that's produced doesn't have the gray shaded region repping the confidence interval. What should I do about this?

    My code is

    foreach l of numlist 2014/2019{
    graph twoway (scatter sh_silverbelow_regyr region_hhi [fweight=ccenroll_regyr], graphregion(fcolor(gs16)) msize(small) msymbol(circle_hollow) mcolor(dknavy)) ///
    (lfitci sh_silverbelow_regyr region_hhi [fweight=ccenroll_regyr]) ///
    if year==`l' & silvtag==1, ///
    title(`l' Share Silver or Lower) xtitle("Region HHI") ytitle("% silver or lower") ///
    note("Circles show relative population of each regional market.")
    graph export "${silverfigure}/`l'silver_lower_hhi - new.pdf", replace
    }

    I created the silvtag variable (it's a tag variable flagging the first observation of region-year-regional silver/below share for that year so it would take less time to loop through all the data since it contains over 7 million observations. But I don't believe that should matter in this case because the silver/below shares are calculated at the region-year level and every observation for that region-year will have the same value for that variable.

  • #2
    If you can replicate the issue with about 100 observations, post the data. See FAQ Advice #12 for details on how to do this.

    Comment


    • #3
      Cross-posted at https://stackoverflow.com/questions/...on-not-showing See the comment there about sample size.

      Please note our policy on cross-posting, which is that you should tell us about it.

      Comment


      • #4
        I am having a similar problem. In my data, my bootstrapped confidence intervals will not show, although the ones generated by the default methodology will. This is true even though my bootstrapped results do not seem to have meaningfully different confidence intervals.

        Please see below:

        . regress capacity ht if race==2

        Source | SS df MS Number of obs = 834
        -------------+---------------------------------- F(1, 832) = 157.16
        Model | 217768.173 1 217768.173 Prob > F = 0.0000
        Residual | 1152849.33 832 1385.63621 R-squared = 0.1589
        -------------+---------------------------------- Adj R-squared = 0.1579
        Total | 1370617.5 833 1645.39916 Root MSE = 37.224

        ------------------------------------------------------------------------------
        capacity | Coef. Std. Err. t P>|t| [95% Conf. Interval]
        -------------+----------------------------------------------------------------
        ht | 5.666044 .4519676 12.54 0.000 4.778913 6.553174
        _cons | -211.4331 29.57721 -7.15 0.000 -269.4879 -153.3784
        ------------------------------------------------------------------------------

        . regress capacity ht if race==2, vce(bootstrap, rep(100) seed(0))
        (running regress on estimation sample)

        Bootstrap replications (100)
        ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
        .................................................. 50
        .................................................. 100

        Linear regression Number of obs = 834
        Replications = 100
        Wald chi2(1) = 171.07
        Prob > chi2 = 0.0000
        R-squared = 0.1589
        Adj R-squared = 0.1579
        Root MSE = 37.2241

        ------------------------------------------------------------------------------
        | Observed Bootstrap Normal-based
        capacity | Coef. Std. Err. z P>|z| [95% Conf. Interval]
        -------------+----------------------------------------------------------------
        ht | 5.666044 .4332069 13.08 0.000 4.816974 6.515114
        _cons | -211.4331 28.23315 -7.49 0.000 -266.7691 -156.0972
        ------------------------------------------------------------------------------


        . twoway lfitci capacity ht if race==2



        . twoway lfitci capacity ht if race==2, estopts(vce(bootstrap, reps(100)))




        As can be seen, the bootstrapped 95% CI does not appear, even though it is not meaningfully larger than the one calculated in standard fashion. Any advice on how to fix this?

        Comment

        Working...
        X