Hi everyone, I admit I am a bit of an R novice, and I was hoping someone could help me with this error message: Warning message: In lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : extra arguments weigths are just disregarded. My equation is: lm( Y ~ X1 + X2 + X3, weigths = seq(0.1, 1, by = 0.1)) -- View this message in context: http://r.789695.n4.nabble.com/Weighted-least-squares-tp4650292.html Sent from the R help mailing list archive at Nabble.com.
Hi, That message usually means that an unknown argument has been supplied to the function. In this case you have spelt weights incorrectly. Best wishes Martyn -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of rbowman16 Sent: 21 November 2012 14:34 To: r-help at r-project.org Subject: [R] Weighted least squares Hi everyone, I admit I am a bit of an R novice, and I was hoping someone could help me with this error message: Warning message: In lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : extra arguments weigths are just disregarded. My equation is: lm( Y ~ X1 + X2 + X3, weigths = seq(0.1, 1, by = 0.1)) -- View this message in context: http://r.789695.n4.nabble.com/Weighted-least-squares-tp4650292.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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. ________________________________________________________________________ This e-mail has been scanned for all viruses by Star.\ _...{{dropped:12}}
I'm guessing that you have more elements in your weights vector than you have observations? It's hard to tell without seeing your data. See below: #Generate fake data y=rnorm(10) X1=rnorm(10) X2=rnorm(10) X3=rnorm(10) #Create a 10 element vector of weights wts=abs(rnorm(10)) #weighted lm works fine lm(y~X1+X2+X3, weights=wts) #Add an additional element to weight vector wts=c(wts, abs(rnorm(1))) #weighted lm throws warning message lm(y~X1+X2+X3, weights=wts) --Mark J. Lamias ________________________________ From: rbowman16 <roosevelt.bowman@gmail.com> To: r-help@r-project.org Sent: Wednesday, November 21, 2012 9:34 AM Subject: [R] Weighted least squares Hi everyone, I admit I am a bit of an R novice, and I was hoping someone could help me with this error message: Warning message: In lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : extra arguments weigths are just disregarded. My equation is: lm( Y ~ X1 + X2 + X3, weigths = seq(0.1, 1, by = 0.1)) -- View this message in context: http://r.789695.n4.nabble.com/Weighted-least-squares-tp4650292.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@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. [[alternative HTML version deleted]]