Re: [R] Increasing number of observations worsen the regression model

2019-05-27 Thread Raffa
iversity Hamilton, Ontario, Canada Web: https://socialsciences.mcmaster.ca/jfox/ -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Raffa Sent: Saturday, May 25, 2019 8:38 AM To: r-help@r-project.org Subject: [R] Increasing number of observations worsen the regression model

Re: [R] Increasing number of observations worsen the regression model

2019-05-27 Thread Ivan Krylov
On Sat, 25 May 2019 14:38:07 +0200 Raffa wrote: > I have tried to ask for example in CrossValidated > > > but the code works for them. Any help? In the comments you note that the p

Re: [R] Increasing number of observations worsen the regression model

2019-05-26 Thread R. Mark Sharp via R-help
Raffa, I ran this on a MacOS machine and got what you expected. I added a call to sessionInfo() for your information. > rm(list=ls()) > N = 3 > xvar <- runif(N, -10, 10) > e <- rnorm(N, mean=0, sd=1) > yvar <- 1 + 2*xvar + e > plot(xvar,yvar) > lmMod <- lm(yvar~xvar) > print(summary(lmMod))

Re: [R] Increasing number of observations worsen the regression model

2019-05-26 Thread Fox, John
Professor Emeritus McMaster University Hamilton, Ontario, Canada Web: https://socialsciences.mcmaster.ca/jfox/ > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Raffa > Sent: Saturday, May 25, 2019 8:38 AM > To: r-help@r-project.org >

[R] Increasing number of observations worsen the regression model

2019-05-26 Thread Raffa
I have the following code: ``` rm(list=ls()) N = 3 xvar <- runif(N, -10, 10) e <- rnorm(N, mean=0, sd=1) yvar <- 1 + 2*xvar + e plot(xvar,yvar) lmMod <- lm(yvar~xvar) print(summary(lmMod)) domain <- seq(min(xvar), max(xvar))    # define a vector of x values to feed into model lines(domain, p