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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:20:51+00:00 2026-05-23T03:20:51+00:00

Does R have a function for weighted least squares? Specifically, I am looking for

  • 0

Does R have a function for weighted least squares? Specifically, I am looking for something that computes intercept and slope.

Data sets

  1. 1 3 5 7 9 11 14 17 19 25 29
  2. 17 31 19 27 31 62 58 35 29 21 18
  3. 102153 104123 96564 125565 132255 115454 114555 132255 129564 126455 124578

The dependent variable is dataset 3 and dataset 1 and 2 are the independent 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-05-23T03:20:52+00:00Added an answer on May 23, 2026 at 3:20 am

    Yes, of course, there is a weights= option to lm(), the basic linear model fitting function. Quick example:

    R> df <- data.frame(x=1:10)
    R> lm(x ~ 1, data=df)            ## i.e. the same as mean(df$x)
    
    Call:
    lm(formula = x ~ 1, data = df)
    
    Coefficients:
    (Intercept)  
            5.5  
    
    R> lm(x ~ 1, data=df, weights=seq(0.1, 1.0, by=0.1))
    
    Call:
    lm(formula = x ~ 1, data = df, weights = seq(0.1, 1, by = 0.1))
    
    Coefficients:
    (Intercept)  
              7  
    
    R> 
    

    so by weighing later observations more heavily the mean of the sequence 1 to 10 moves from 5.5 to 7.

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

Sidebar

Related Questions

I have tried to create a template function that does some weighted sampling within
does php have a function that will convert a string (data type will be
Does Actionscript have a built-in function that accepts a number and can return a
Does .NET have some type of built in function that allows filtering on Gridviews?
Does anyone have a working class or function to create the hashed email that
Note that this function does not have a { and } body. Just a
When you have a function with a string parameter, does that create another instance
How do I create a Ruby function that does not have an explicit number
Does Actionscript have a function that would tell me what number the input is
Does MATLAB have a function/operator that indicates the type of a variable (similar to

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.