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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:26:57+00:00 2026-06-14T14:26:57+00:00

I am in a bind. I am trying to create an interaction plot between

  • 0

I am in a bind.
I am trying to create an interaction plot between some variables to determine their impact on the response.

The data is at http://faculty.chicagobooth.edu/nicholas.polson/teaching/41000/election2012.txt

I could not figure out how to do interaction plots in R, but I found a site that demonstrated a user defined function executing interaction plots:
– http://alumni.media.mit.edu/~tpminka/courses/36-350.2001/lectures/day30/
The user defined functions are located here

Using this user defined function, I am trying to create an interaction plot with
Response: VP
Predictors: G and P (I would also like to include Z, but I am having enough trouble with 2 variables so I have put that on the back burner)
(VP,G,& P are columns in the initial data set above.)

Every time I try to plug in my values, R throws me errors, claiming objects G and P are not found etc. I also tried to use the interaction.plot function, but it would draw me a blank chart, and when I changed parameters, I would get an error claiming that a variable was an atomic vector, but when I plugged the same variable into the predict.plot function (the user defined one from the MIT site) R threw an error because the same variable supposedly wasn’t atomic.

How can I make a 2 variable interaction plot like the one on the MIT site with my data (and if anyone is so inclined, how can I make it with 3 variables)?

  • 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-14T14:26:58+00:00Added an answer on June 14, 2026 at 2:26 pm

    Solved:
    The problem was that I was attempting to pass column names from a data frame into the predict.plot and interaction.plot functions.

    I had to convert the columns to matrices and then pass those matrices into the functions. Now everything works.

    To convert data frames to matrices, use

    MatrixVari = as.matrix(listColumni)
    where each listColumni is a column from your data frame that you then read into its own matrixVari.

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

Sidebar

Related Questions

I'm trying to bind a list of data to a data grid, but can't
I'm trying to create a GridView with custom paging. I have very large data
I am trying to create a simple TreeView which will represent my applications data
I'm trying to create some local groups in my AD but sadly if I
I'm trying to create a select input from javascript and bind a function to
I'm trying to create predicate for std::find_if by using boost::bind together with boost::contains (from
I'm trying to create a functor that returns a shared_ptr by calling std::bind on
I'm trying to create a user control with dependency properties to bind to. Internally
I'm trying to create a PHP script that will return some details of each
I am trying to create objects using binding data from xml file to classes

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.