[R] fitted values are different from manually calculating

john seers (IFR) john.seers at bbsrc.ac.uk
Tue Feb 19 15:51:37 CET 2008


 

Hi

A simple example of a linear model:

x<-1:10
y<-3*x+1
m1<-lm(y~x)
 
y
# [1]  4  7 10 13 16 19 22 25 28 31

fitted(m1)
# 1  2  3  4  5  6  7  8  9 10 
# 4  7 10 13 16 19 22 25 28 31 

The fitted and calculated values look identical to me.

Can you give an example of how your calculated values do not match? Or
have I misunderstood your question?

Regards

JS 

 
---

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of gatemaze at gmail.com
Sent: 19 February 2008 14:41
To: r-help at stat.math.ethz.ch
Subject: [R] fitted values are different from manually calculating

Hello,

on a simple linear model the values produced from the fitted(model)
function are difference from manually calculating on calc. Will anyone
have a clue...
or any insights on how fitted function calculates the values? Thank you.

--
-- Yianni

	[[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list