+ Reply to Thread
Results 1 to 3 of 3

Thread: proc gplot (graphing confidence intervals)

  1. #1
    Points: 3,999, Level: 40
    Level completed: 25%, Points required for next Level: 151

    Posts
    305
    Thanks
    16
    Thanked 15 Times in 15 Posts

    proc gplot (graphing confidence intervals)



    Hello:

    Some background info on the problem:

    mu'(c) = beta1 + 2*beta2*c
    I am supposed to make 20 95% confidence intervals based on when c=.05, .10, .15......,.90, .95 and 1.

    So basically mu'(c) = beta1 + beta2*.10 (when c=.05)
    = beta1 + beta2*.20 (when c=.10)
    = beta1 + beta2*.30 (when c=.15)
    and so on.

    I have been able to make a graph using proc gplot in which I have the upper bounds and lower bounds plotted. HOWEVER, I am supposed to connect each upper and lower bound (thus, my graph would have 20 vertical lines which represent the 95% confidence interval). I do not know how to connect the upper and lower bounds.

    For example, I need to connect the lower and upper bound of c=.05. I need to connect the lower and upper bound of c=.10.......

    Here is my code:

    proc gplot data=c;
    plot muprimec*c lower*c upper*c / overlay;
    run;
    quit;

    Any help on how to do this?

  2. #2
    Ninja say what!?!
    Points: 8,297, Level: 61
    Level completed: 49%, Points required for next Level: 153
    Link's Avatar
    Posts
    1,165
    Thanks
    37
    Thanked 82 Times in 75 Posts

    Re: proc gplot (graphing confidence intervals)

    what's the graph showing? I'm confused by what you mean when you say "connect"

  3. #3
    Points: 3,999, Level: 40
    Level completed: 25%, Points required for next Level: 151

    Posts
    305
    Thanks
    16
    Thanked 15 Times in 15 Posts

    Re: proc gplot (graphing confidence intervals)


    Thanks, but I figured it out. I needed to use the interpol=hilo option. Basically I had 20 different values of some variable (c) and made 95% CI's based on what this value was (thus there were 20 different confidence intervals). I wanted to plot both the upper and lower bounds and connect the region between each lower/upper bound (hence, I would have 20 vertical lines representing the confidence interval). If you are curious as to what I am still talking about, my code is below.

    data c;

    input c lower upper muprimec;

    label muprimex = "mu'(c)";

    cards;

    .05 0.54541147 1.03896747 0.79218947

    .10 0.53864926 1.02997368 0.78431147

    .15 0.53151950 1.02134745 0.77643347

    .20 0.52401881 1.01309214 0.76855548

    .25 0.51614548 1.00520948 0.76067748

    .30 0.50789949 0.99769948 0.75279949

    .35 0.49928252 0.99056046 0.74492149

    .40 0.49029788 0.98378910 0.73704349

    .45 0.48095051 0.97738048 0.72916550

    .50 0.47124680 0.97132820 0.72128750

    .55 0.46119448 0.96562453 0.71340951

    .60 0.45080249 0.96026053 0.70553151

    .65 0.44008076 0.95522627 0.69765351

    .70 0.42904009 0.95051095 0.68977552

    .75 0.41769193 0.94610311 0.68189752

    .80 0.40604822 0.94199083 0.67401952

    .85 0.39412125 0.93816181 0.66614153

    .90 0.38192345 0.93460361 0.65826353

    .95 0.36946733 0.93130374 0.65038554

    1.0 0.35676530 0.92824978 0.64250754

    ;

    run;



    data c1;

    set c;

    drop lower upper muprimec;

    bound = lower; output;

    bound = upper; output;

    bound = muprimec; output;

    run;



    symbol1 interpol=hiloctj cv=red ci=blue width=2 value=dot;



    proc gplot data=c1;

    plot bound*c;

    run;

    quit;

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts








Advertise on Talk Stats