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 8097149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:40:04+00:00 2026-06-05T21:40:04+00:00

I am trying to replicate the example, given in Statistical Models in S .

  • 0

I am trying to replicate the example, given in Statistical Models in S. Here is the code given in the book.

data(ethanol)
attach(ethanol)
E.intervals <- co.intervals(E, number = 9, overlap = 1/4)
coplot(NOx ~ C | E, given.values = E.intervals,
                    panel = function(x,y) panel.smooth(x,y,degree = 1, span = 1))

This code works only in S, because panel.smooth function doesn’t have degree argument.
So I used

coplot(NOx ~ C | E, given.values = E.intervals,
                    panel = function(x,y,...) panel.smooth(x,y, iter = 1, span = 1))

I would like to use lattice graphics package because it has panel.loess function that is similar to panel.smooth from S, but I haven’t found the function similar to coplot. I think it is xyplot. If it is, can you suggest me the parameter equivalent to given.values?

  • 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-05T21:40:06+00:00Added an answer on June 5, 2026 at 9:40 pm

    Here is how it might be done, it is not quite the same but very close.

    require(gridExtra)
    require(lattice)
    data(ethanol)
    E.intervals <- equal.count(E, number = 9, overlap = 1/4)
    plot1 <- plot(E.intervals)
    plot2 <- xyplot(NOx ~ C | E.intervals, data = ethanol, span = 1, layout = c(3,3),
                    panel = function(x,y,span){
                    panel.xyplot(x, y);
                    panel.loess(x, y, span);
                   })
    grid.arrange(plot1,plot2, nrow=2)
    

    The difference is the hight of the upper plot, it should be smaller.

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

Sidebar

Related Questions

trying to replicate the example here; http://onertipaday.blogspot.com/2011/07/word-cloud-in-r.html Need help figuring out how to increase
I'm trying to replicate the Convert.ToBase64String() behavior in Ruby. Here is my C# code:
I am trying to replicate the example given by Alex Kuhl on his excellent
I'm trying to replicate the example of https://www.primefaces.org/showcase/ui/multimedia/photoCam.xhtml with a simple variation. In the
I am trying to replicate what my C# / XPath code does on Linux
I'd like to use jQuery with Google maps. I'm trying to replicate this example
I'm trying to replicate the inlines in the Django admin for adding related models
I'm currently hacking away, trying to replicate Coda's tooltip: http://jqueryfordesigners.com/coda-popup-bubbles/ Check out my example
I am trying to replicate an example found on MSDN. I am using ASP.NET
I am trying to replicate Hadley Wickham's example on page 86 of the ggplot2

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.