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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:14:15+00:00 2026-06-01T08:14:15+00:00

I am using a standard lm model and would like to set the coefficients

  • 0

I am using a standard lm model and would like to set the coefficients of one or more of my variables to a specific integer.

For example, I would like the coefficient of my weather and price variables to be 647 and 15 respectively.

I am using the lm function with a standard formula.

The closest things I’ve found so far are the offset function within glm, or restrict.rhs within systemfit.

I’ve also looked at subtracting the total contribution from these variables with their coefficients set, but this is not very scalable.

I’m aware of all the issues setting a coefficient has, but would like to do so just from an exploratory point of view.

  • 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-01T08:14:16+00:00Added an answer on June 1, 2026 at 8:14 am

    You can use the offset term in the formula and include the desired coefficient and variable therein:

    df<-data.frame(aa=1:6,bb=2:7,cc=c(4,2,7,5,8,3))
    
    lm(cc ~ aa + offset(647*bb), data = df)
    

    So this is regressing cc on aa plus the fixed term bb * 647. For more than one given coefficient, add the appropriate additional offset() terms.

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

Sidebar

Related Questions

We can initialize a container deque by using standard input like this: deque<int> c((istream_iterator<int>(cin)),(istream_iterator<int>()));
I have an existing data model. I would like to express this data model
I am using jqgrid (standard) with EF 4 + MVC3 . I'd like to
I am using the standard User model (django.contrib.auth) which comes with Django. I have
I am using pyhton's multiprocessing package in a standard client-server model. I have a
I was able to accomplish a standard search in one of my models using
I'm using MVC3 and I would like to make my views be fully integrated
I am using standard String.Format method. It is using numeric objects. Console.WriteLine(obj1 = {0}
Let me clarify: I'm using standard jQuery autocomplete plugin (bassistanse.de) and bind it to
I'm writing a simple data UI using standard .Net databinding to a typed DataSet

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.