Re: [R] Inconsistent linear model calculations

From: Kenn Konstabel <lebatsnok_at_gmail.com>
Date: Thu, 15 May 2008 23:16:28 +0300

On Thu, May 15, 2008 at 3:05 PM, e-letter <inpost_at_gmail.com> wrote:

> Using version 251 I tried the following command:
>
> lm(y~a+b,data=datafile)
>
> Resulting in, inter alia:
> ...
> coefficients
> (intercept) a
> 1.2 3.4
>
[...]

> When using version 171 I entered the same command:
>
> lm(y~a+b,data=datafile)
>
> Resulting in, inter alia:
> ...
> coefficients
> (intercept) a b
> 5.6 7.8 9.01
>

> Why do I get different results when entering the same equation
> command? The correct answer was obtained using the older version of
> the software, so I want to replicate using the new version, which is
> installed onto a new pc that I am using. Any advice.
>

First check if your data frame is the same on both occasions. (It definitely wasn't the data set you provided in a later message - so it sounds possible you've made another error.)

Secondly, try to make sure you're copying real output here. You should have three coefficients if you ask for three.

Third, check your lm function:

"lm"%in%ls()

Maybe an evil twin of yours has modified it, for instance, this way:

lm<- function(...) cat("coefficients\
(intercept) \ta\
1.2 \t\t3.4\n")

        [[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 Fri 16 May 2008 - 16:16:42 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 Fri 16 May 2008 - 17:30:37 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