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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:10:41+00:00 2026-06-11T06:10:41+00:00

Is there a difference between the functions fitted() and predict() ? I’ve noticed that

  • 0

Is there a difference between the functions fitted() and predict()? I’ve noticed that mixed models from lme4 work with fitted() but not predict().

  • 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-11T06:10:43+00:00Added an answer on June 11, 2026 at 6:10 am

    Yes, there is. If there is a link function relating the linear predictor to the expected value of the response (such as log for Poisson regression or logit for logistic regression), predict returns the fitted values before the inverse of the link function is applied (to return the data to the same scale as the response variable), and fitted shows it after it is applied.

    For example:

    x = rnorm(10)
    y = rpois(10, exp(x))
    m = glm(y ~ x, family="poisson")
    
    print(fitted(m))
    #         1         2         3         4         5         6         7         8 
    # 0.3668989 0.6083009 0.4677463 0.8685777 0.8047078 0.6116263 0.5688551 0.4909217 
    #         9        10 
    # 0.5583372 0.6540281 
    print(predict(m))
    #          1          2          3          4          5          6          7 
    # -1.0026690 -0.4970857 -0.7598292 -0.1408982 -0.2172761 -0.4916338 -0.5641295 
    #          8          9         10 
    # -0.7114706 -0.5827923 -0.4246050 
    print(all.equal(log(fitted(m)), predict(m)))
    # [1] TRUE
    

    This does mean that for models created by linear regression (lm), there is no difference between fitted and predict.

    In practical terms, this means that if you want to compare the fit to the original data, you should use fitted.

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

Sidebar

Related Questions

Is there any difference between pointer to const and usual pointer for functions? When
In a tutorial, I read that that there is a difference between input and
Is there any dramatic difference between functions and methods in Objective -C?
Is there a difference between these two functions? ghct says: Prelude> :t (+1) (+1)
What's the difference between table-valued functions and views? Is there something you can do
Is there a simple way to plot the difference between two probability density functions?
I am wondering whether there is any difference between inlining functions on a linker
Is there any difference in functionality between these two types of complete-functions in Vimscript?
Is there any difference between using vcl components in Delphi and WinApi functions to
Is there any difference between these two functions? I mean in-terms of the result

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.