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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:39:54+00:00 2026-06-13T12:39:54+00:00

While investigating some fundamentals of multiple regression, I decided to try and compare my

  • 0

While investigating some fundamentals of multiple regression, I decided to try and compare my manual efforts to those of the “effects” package, by John Fox. I’ve generated variables with some relationships, and want to get adjusted means for a factor when controlling for the influence of a continuous variable.

I have become stalled, however, as the effect function in the effects package returns an error “invalid type (builtin) for variable ‘c'”

When I check the type of variable ‘c’ using typeof(c), I’m told it is of type double, as I constructed it to be.

  • What could be the cause of this error?
  • Is the variable ‘c’ being coerced for some reason to type ‘builtin’?

Here is my code:

set.seed(1986)
y <- rnorm(100)
f <- sapply(y, function(x) if(x < 0) 1 else 2)
f.f <- as.factor(f)
set.seed(1987)
c <- rnorm(100, 0, .1) + y + f

an3 <- lm(y ~ f.f + c); summary(an3)

ef <- effect("f.f", an3)
  • 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-13T12:39:55+00:00Added an answer on June 13, 2026 at 12:39 pm

    c is not a good choice for a a variable name. It’s an extremely commonly-used built-in function in R.

    Changing c to d works for me:

    set.seed(1986)
    y <- rnorm(100)
    f <- sapply(y, function(x) if(x < 0) 1 else 2)
    f.f <- as.factor(f)
    set.seed(1987)
    d <- rnorm(100, 0, .1) + y + f
    
    an3 <- lm(y ~ f.f + d); summary(an3)
    
    library(effects)
    ef <- effect("f.f", an3)
     ef
    
     f.f effect
    f.f
             1          2 
     0.5504214 -0.3231941 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Often, while investigating some code I'm developing, I'll throw in a Console.WriteLine here or
While investigating some localization options, I stumbled across this as a save option in
While investigating some performance issues I stumbled upon the following performance comparison: http://jsperf.com/fastest-canvas-drawing/2 which
While investigating an issue with application I'm working on, I've came across one behavior
I have been looking at monotorrent and while investigating the whole bittorrent thing I
We are trying to do Major upgrade. While i was investigating i found 2
Been investigating for a while now and keep hitting a brick wall. I am
while looking at some code I stumbled onto: throw /*-->*/new std::exception (//... and I
My friend's server has some problem with spoolsv service. While he is searching for
I'm investigating a stack trace (seen while debugging) that looks something like the following:

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.