Re: [R] fitted values are different from manually calculating

From: <gatemaze_at_gmail.com>
Date: Tue, 19 Feb 2008 15:46:51 +0000

Thank you all for your help. Apologies for not giving an example. model.matrix was useful as comparing that table with the one from the spreadsheet showed the "mispell".

On 19/02/2008, Douglas Bates <bates_at_stat.wisc.edu> wrote:
>
> On Feb 19, 2008 8:41 AM, <gatemaze@gmail.com> wrote
>
> > 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.
>
> ______________________________________________
> > 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.
>
> As the posting guide (you did read the posting guide, didn't you?)
> says, it helps if you can provide a reproducible example. Otherwise,
> we can only guess at what you mean.
>
> Try taking a fitted model and examining
>
> model.matrix(model)
>
> and
>
> coef(model)
>
> It should be the case that
>
> model.matrix(model) %*% coef(model)
>
> is reasonably close to fitted(model).
>
> I just saw that Dimitris wrote almost the same thing but, since I have
> written it, I'll mail it anyway.
>

-- 
-- 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.
Received on Tue 19 Feb 2008 - 15:49:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 19 Feb 2008 - 16:30:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive