Re: [R] Error in lm() with very small (close to zero) regressor

2015-03-31 Thread William Dunlap
If you really want your coefficient estimates to be scale-equivariant you should test those methods for such a thing. E.g., here are functions that let you check how scaling one predictor affects the estimated coefficients - they should give the same results for any scale factor. f <- function (s

Re: [R] Error in lm() with very small (close to zero) regressor

2015-03-31 Thread RiGui
I found a fix to my problem using the fastLm() from package RcppEigen, using the Jacobi singular value decomposition (SVD) (method 4) or a method based on the eigenvalue-eigenvector decomposition of X'X - method 5 of the fastLm function install.packages("RcppEigen") library(RcppEigen) n_obs <-

Re: [R] Error in lm() with very small (close to zero) regressor

2015-03-29 Thread John Maindonald
s Applications, Australian National University, Canberra ACT 0200. On 29/03/2015, at 23:00, mailto:r-help-requ...@r-project.org>> mailto:r-help-requ...@r-project.org>> wrote: From: Ben Bolker mailto:bbol...@gmail.com>> Subject: Re: [R] Error in lm() with very small (close t

Re: [R] Error in lm() with very small (close to zero) regressor

2015-03-29 Thread RiGui
RiGui business.uzh.ch> writes: > [snip] > I am terribly sorry for the code not being reproducible, is the > first time I am posting here, I run the code several times before I > posted, but...I forgot about the library used. Thanks for updating. > To answer to your questions: > >> How d

Re: [R] Error in lm() with very small (close to zero) regressor

2015-03-29 Thread Ben Bolker
RiGui business.uzh.ch> writes: > [snip] > I am terribly sorry for the code not being reproducible, is the > first time I am posting here, I run the code several times before I > posted, but...I forgot about the library used. Thanks for updating. > To answer to your questions: > >> How do

Re: [R] Error in lm() with very small (close to zero) regressor

2015-03-29 Thread peter dalgaard
> On 28 Mar 2015, at 18:52 , RiGui wrote: > > Thank you for your replies! > > I am terribly sorry for the code not being reproducible, is the first time I > am posting here, I run the code several times before I posted, but...I > forgot about the library used. > > To answer to your questions:

Re: [R] Error in lm() with very small (close to zero) regressor

2015-03-29 Thread RiGui
Thank you for your replies! I am terribly sorry for the code not being reproducible, is the first time I am posting here, I run the code several times before I posted, but...I forgot about the library used. To answer to your questions: How do you know this answer is "correct"? What I am doing

Re: [R] Error in lm() with very small (close to zero) regressor

2015-03-29 Thread peter dalgaard
> On 28 Mar 2015, at 18:28 , Ben Bolker wrote: > > peter dalgaard gmail.com> writes: > >> >> >>> On 28 Mar 2015, at 00:32 , RiGui business.uzh.ch> wrote: >>> >>> Hello everybody, >>> >>> I have encountered the following problem with lm(): >>> >>> When running lm() with a regressor close

Re: [R] Error in lm() with very small (close to zero) regressor

2015-03-28 Thread Ben Bolker
peter dalgaard gmail.com> writes: > > > > On 28 Mar 2015, at 00:32 , RiGui business.uzh.ch> wrote: > > > > Hello everybody, > > > > I have encountered the following problem with lm(): > > > > When running lm() with a regressor close to zero - > of the order e-10, the > > value of the estim

Re: [R] Error in lm() with very small (close to zero) regressor

2015-03-28 Thread peter dalgaard
> On 28 Mar 2015, at 00:32 , RiGui wrote: > > Hello everybody, > > I have encountered the following problem with lm(): > > When running lm() with a regressor close to zero - of the order e-10, the > value of the estimate is of huge absolute value , of order millions. > > However, if I write

[R] Error in lm() with very small (close to zero) regressor

2015-03-28 Thread RiGui
Hello everybody, I have encountered the following problem with lm(): When running lm() with a regressor close to zero - of the order e-10, the value of the estimate is of huge absolute value , of order millions. However, if I write the formula of the OLS estimator, in matrix notation: pseudoinv

Re: [R] error in lm

2012-10-30 Thread Greg Snow
For a single response variable tools like LASSO, LARS, ridge regression, elasticnet, model averageing, and other penalized methods (packages lasso2, lars, rms, elasticnet, MASS, BMA, and probably others implement these tools) are preferred to stepwise methods. I don't know if any of these have bee

Re: [R] error in lm

2012-10-30 Thread Greg Snow
First your response in the formula is a matrix which causes the lm function to return an object of type 'mlm' for multivariate linear model. Then when you run the stepAIC function it runs the addterm function which looks for a method(function) to add terms to mlm objects. However nobody has writt

[R] error in lm

2012-10-30 Thread paola
Hi everybody I am trying to run the next code but I have the next problem Y1<-cbind(score.sol, score.com.ext, score.pur) > vol.lm<-lm(Y1~1, data=vol14.df) > library(MASS) > stepAIC(vol.lm,~fsex+fjob+fage+fstudies,data=vol14.df) Start: AIC=504.83 Y1 ~ 1 Error in addterm.mlm(fit, scope$add, scale

Re: [R] Error in lm() function

2009-11-11 Thread David Winsemius
On Nov 11, 2009, at 7:14 AM, Bogaso wrote: Hi all, I wanted to have a seasonality study like whether a particular month has significant effect as compared to others. Here is my data : 0.10499 0 0 1 0 0 0 0 0 0 0 0 0.00259 0

Re: [R] Error in lm() function

2009-11-11 Thread Mohamed Lajnef
Hi Bogaso, Try this vecnames<-names(test[,2:11]) fmla <- as.formula(paste("test[,1] ~ ", paste(vecnames, collapse= "+"))) res<-lm(fmla) Regards M Bogaso a écrit : Hi all, I wanted to have a seasonality study like whether a particular month has significant effect as compared to others. Here i

[R] Error in lm() function

2009-11-11 Thread Bogaso
Hi all, I wanted to have a seasonality study like whether a particular month has significant effect as compared to others. Here is my data : 0.10499 0 0 1 0 0 0 0 0 0 0 0 0.00259 0 0 0 1 0 0 0