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

  • Home
  • SEARCH
  • 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 9125581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:50:15+00:00 2026-06-17T06:50:15+00:00

For the example given below, how could I paint the area between the dashed

  • 0

For the example given below, how could I paint the area between the dashed lines?

Here is the code:

X <- rnorm(100)
Y<- X + rnorm(100)
reg<-lm(Y~X)

 CI <- predict(reg,interval="confidence")
 F <- CI[,1]
  L <- CI[,2]
 U <- CI[,3]

 plot(X,F)
 abline(reg, col="red")
 reg2<-lm(L~X)
 abline(reg2, col="red", lty="dashed")
 reg3<-lm(U~X)
 abline(reg3, col="red", lty="dashed")

here is the output

enter image description here

  • 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-17T06:50:16+00:00Added an answer on June 17, 2026 at 6:50 am

    Seems like it should be a duplicate but I couldn’t find it in an SO search. I know it’s appeared many times on rhelp. But there’s a fortune for that:

    require(fortunes)
     fortune("every question")
    
    Lastly, by what we could call the 'Liaw-Baron principle', every question that can be 
    asked has in fact  already been asked.
       -- Dirk Eddelbuettel (citing Andy Liaw's and Jonathan Baron's opinion on unique 
                questions on R-help)
          R-help (January 2006)
    
    polygon(x= c(X[order(X)],    rev(X[order(X)]) ), # both x and y  go "out" in order; 
              y=c(L[order(X)], rev(U[order(X)])),  # and then come "back in reverse order
                 col=rgb(1,0,0,0.3) )    # transparent pink.
    
    > plot(X,Y, pch="+")
    > abline(reg, col="red")
    > polygon(x= c(X\[order(X)\], rev(X\[order(X)\]) ), y=c(L\[order(X)\],rev(U\[order(X)\])), col=rgb(1,0,0,0.3) )
    

    enter image description here

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

Sidebar

Related Questions

Given the example below, can someone please show me how this could be called?
Given the example source code below, is it possible for someone to see the
When I try to compile the example code given below, I get the following
I have a string.An example is given below. [playlist]\r\npath1=url1\r\npath2=url2\r\npath=url3\r\npath4=url4\r\ncount=1 How can I extract path
I have an array of as given below. For example: array = [20%,*,30%, 10%]
Given the XML/RDF example below taken from the W3C website, how can I access
I know how to do this... I'll give example code below. But I can't
Going from the example given here... http://ericswann.org/blog/archive/2009/04/06/linq-to-sql-datacontext-provider-revisited.aspx I'm trying to use the datacontext between
Note that I'm mirroring the example given here very closely. In fact, my situation
My question has to do with facetting. In my example code below, I look

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.