Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8849395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:38:25+00:00 2026-06-14T12:38:25+00:00

I am having problems trying to add the 95% CI (lower/upper) to an existing

  • 0

I am having problems trying to add the 95% CI (lower/upper) to an existing plot using the values from two columns in a matrix. What would be the best way to use this information to add the error bars?

Here is a sample of my data:

option<-read.table(text="
distance p.move id option   mean lower95%CI upper95%CI
1      close   0.05  1    10% 13.682     11.306     15.768
2      close   0.10  2    10% 10.886      9.336     12.270
3      close   0.15  3    10%  8.402      7.262      9.580
4      close   0.20  4    10%  7.240      6.132      8.350
5      close   0.25  5    10%  6.322      5.288      7.370
6      close   0.30  6    10%  5.850      4.920      6.714
7      close   0.35  7    10%  3.838      3.084      4.648
8      close   0.40  8    10%  3.600      2.936      4.200
9      close   0.45  9    10%  3.380      2.702      4.016
10     close   0.50 10    10%  3.152      2.462      3.720
11     close   0.55 11    10%  2.772      2.214      3.286
12     close   0.60 12    10%  3.072      2.458      3.596
13     close   0.65 13    10%  2.670      2.134      3.212
14     close   0.70 14    10%  2.194      1.724      2.634
15     close   0.75 15    10%  1.980      1.612      2.336
16     close   0.80 16    10%  2.028      1.594      2.466
17     close   0.85 17    10%  1.650      1.294      1.974
18     close   0.90 18    10%  1.916      1.564      2.254",header=T)

option

This is my plot:

plot(option$mean~option$p.move,xlim=c(0,1),type="o",ylim=c(0,20),
xlab="Probability",ylab="% time",col=1,lwd=1.85)

Thanks a lot in advance,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:38:27+00:00Added an answer on June 14, 2026 at 12:38 pm

    You can just add the extra columns in with lines which is like plot but draws on the existing plot. (see ?lines, ?points).

    Also, when you plot with a data frame you can skip all the option$ by feeding option into the dat argument (see ?plot):

    # draw original plot
    plot(mean ~ p.move, dat=option, xlim=c(0,1), type="o", ylim=c(0,20),
         xlab="Probability",ylab="% time",col=1,lwd=1.85)
    
    # draw extra lines (the '%' in the column names gets converted to '.' by R)
    # note you can put your usual `plot` arguments into `lines` like lwd, type etc
    # if you want
    lines(upper95.CI ~ p.move, option)
    lines(lower95.CI ~ p.move, option)
    

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im having problems trying to add (sum) up all the values in a NSMutable
I'm having a couple problems trying to add/remove a class from links and their
I am having some problems trying to add a ValueConverter in my xaml usercontrol:
I'm having problems with trying to catch an error. I'm using Pyramid/SQLAlchemy and made
I am having problems when trying to use a TypedFactoryFacility in Castle. I'm using
I'm having problems trying to connect my website to Facebook. What I would like
I'm having problems trying to add buttons into a UITableViewCell's content view. The button
I've been having problems trying to retrieve a related entity using an HQL subquery.
I'm having problems trying to reach for the target of the Touch Event from
I'm having problems trying to upload files using the latest XHR 2 along with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.