Re: [R] lm function - na.action

2012-11-09 Thread R. Michael Weylandt
On Fri, Nov 9, 2012 at 5:21 PM, tesssa wrote: > How do you lm throw away excess data points. I am following the > documentation with no success Why would you want to throw away this data? I think that's generally considered sub-optimal model-fitting technique, thought it might explain your diffi

Re: [R] lm function - strange error

2012-11-09 Thread John Kane
ox.com Subject: Re: [R] lm function - strange error Hi Tessa, I agree with John. I think you've made a typo, but looking at your data I think the zero concentration should not be there. Try plotting it. conc = c(10, 20, 30, 40, 50) signal = c (4, 22, 44, 60, 82) plot(

Re: [R] lm function - strange error

2012-11-09 Thread John Kane
> -Original Message- > From: sarah.gos...@gmail.com > Sent: Fri, 9 Nov 2012 14:34:57 -0500 > To: jrkrid...@inbox.com > Subject: Re: [R] lm function - strange error > > On Fri, Nov 9, 2012 at 2:20 PM, John Kane wrote: >> >>> -Original Message--

Re: [R] lm function - strange error

2012-11-09 Thread Tom Shatwell
60, 82, NA) > lm.r <- lm( signal ~ conc) > summary(lm.r) > > I hope this helps. > John Kane > Kingston ON Canada > > > > -Original Message- > > From: tesara...@gmail.com > > Sent: Fri, 9 Nov 2012 09:36:23 -0800 (PST) > > To: r-he

Re: [R] lm function - strange error

2012-11-09 Thread Sarah Goslee
On Fri, Nov 9, 2012 at 2:20 PM, John Kane wrote: > >> -Original Message- >> From: dwinsem...@comcast.net >> Sent: Fri, 9 Nov 2012 10:56:48 -0800 >> To: tesara...@gmail.com >> Subject: Re: [R] lm function - strange error >> >> >> On Nov 9,

Re: [R] lm function - strange error

2012-11-09 Thread John Kane
> -Original Message- > From: dwinsem...@comcast.net > Sent: Fri, 9 Nov 2012 10:56:48 -0800 > To: tesara...@gmail.com > Subject: Re: [R] lm function - strange error > > > On Nov 9, 2012, at 9:16 AM, tesssa wrote: > >> Sorry it is not a comma but a t

Re: [R] lm function - strange error

2012-11-09 Thread John Kane
lm.r) I hope this helps. John Kane Kingston ON Canada > -Original Message- > From: tesara...@gmail.com > Sent: Fri, 9 Nov 2012 09:36:23 -0800 (PST) > To: r-help@r-project.org > Subject: Re: [R] lm function - strange error > > Here is the document > > http://

Re: [R] lm function - strange error

2012-11-09 Thread David Winsemius
On Nov 9, 2012, at 9:16 AM, tesssa wrote: > Sorry it is not a comma but a tilda. The R.help message editor Please > replace the dash with a tilda as lm function requires It might be interesting to have such a supernatural entity zooming around the Rhelp Universe answering prayers from newbi

Re: [R] lm function - strange error

2012-11-09 Thread tesssa
Here is the document http://www.montefiore.ulg.ac.be/~kvansteen/GBIO0009-1/ac20092010/Class8/Using%20R%20for%20linear%20regression.pdf -- View this message in context: http://r.789695.n4.nabble.com/lm-function-strange-error-tp4649065p4649080.html Sent from the R help mailing list archive at Na

[R] lm function - na.action

2012-11-09 Thread tesssa
How do you lm throw away excess data points. I am following the documentation with no success -- View this message in context: http://r.789695.n4.nabble.com/lm-function-na-action-tp4649075.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] lm function - strange error

2012-11-09 Thread tesssa
Sorry it is not a comma but a tilda. The R.help message editor Please replace the dash with a tilda as lm function requires -- View this message in context: http://r.789695.n4.nabble.com/lm-function-strange-error-tp4649065p4649074.html Sent from the R help mailing list archive at Nabbl

Re: [R] lm function - strange error

2012-11-09 Thread John Kane
anada > -Original Message- > From: tesara...@gmail.com > Sent: Fri, 9 Nov 2012 08:37:13 -0800 (PST) > To: r-help@r-project.org > Subject: [R] lm function - strange error > > I am following a document teaching how to use regression and right at the > onset I get a

Re: [R] lm function - strange error

2012-11-09 Thread R. Michael Weylandt
On Fri, Nov 9, 2012 at 4:37 PM, tesssa wrote: > I am following a document teaching how to use regression and right at the > onset I get an R error. I understand that variables "conc" and "signal" > should have the same length but I am using the what R manual suggests to > drop the error and it i

[R] lm function - strange error

2012-11-09 Thread tesssa
I am following a document teaching how to use regression and right at the onset I get an R error. I understand that variables "conc" and "signal" should have the same length but I am using the what R manual suggests to drop the error and it is not cooperating. What gives? The manual says that

Re: [R] Lm function: Error in model.frame.default

2011-10-31 Thread R. Michael Weylandt
I don't know if you've gotten any follow up, but here are some quick reactions: 1) You make reference to the columns of y but your dput(y) does not provide columns, 2) It's still not clear to me what all this data actually means? Do you have multiple observations of the dependent variable corresp

Re: [R] Lm function: Error in model.frame.default

2011-10-25 Thread Julie
When I tried dput function, the result was this: > dput(x) c(20, 200, 2000, 2) > dput(y) c(0.45, 0.05, 0.5, 0.4, 0, 0.5, 0.4, 0.05, 0.4, 0.25, 0.35, 0.5, 0.05, 0.4, 0.5, 0.5, 0.5, 0.25, 0.85, 0.5, 0.5, 0.5, 0.25, 0.4, 0.25, 0.25, 0.4, 0.25, 0.5, 0.15, 0.25, 0.1, 0.25, 0.25, 0.015, 0.4, 0.5

Re: [R] Lm function: Error in model.frame.default

2011-10-24 Thread R. Michael Weylandt
Could you dput() the structure of x and y: I'm having trouble visualizing how your data is set up. Michael On Mon, Oct 24, 2011 at 12:07 PM, Julie wrote: > The variable y is made of four columns, each paired to 20, 200, 2000 or 20 > 000. >> y <- c(rdiktator20, rDiktator200, rDikt2000, rDikt2

Re: [R] Lm function: Error in model.frame.default

2011-10-24 Thread Julie
The variable y is made of four columns, each paired to 20, 200, 2000 or 20 000. > y <- c(rdiktator20, rDiktator200, rDikt2000, rDikt2) So I guess the problem is in the fact that I did not specify it correctly, is it so? How can I tell R properly that one part of y matches to one part of x? Th

Re: [R] Lm function: Error in model.frame.default

2011-10-24 Thread Jeff Newmiller
X and y must have the same number of elements, and NA values must be removed (?na.omit) --- Jeff Newmiller The . . Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar

Re: [R] Lm function: Error in model.frame.default

2011-10-24 Thread R. Michael Weylandt
You are trying to regress ~372 observations of the dependent against ~4 observations of the independent variable. Ask yourself again if this makes sense. A further hint might be given by this y = rnorm(5); x = y[1:4] lm(y~x) Michael On Mon, Oct 24, 2011 at 11:13 AM, Julie wrote: > Hello, > I a

[R] Lm function: Error in model.frame.default

2011-10-24 Thread Julie
Hello, I am trying to get a linear model of y ~ log(x). *> lm (y~log(x))* However, I always get an error report: /Error in model.frame.default(formula = y ~ log(x), drop.unused.levels = TRUE) : variable lengths differ (found for 'log(x)')/ *Here was my y:* > y [1]0.4500.050

Re: [R] lm function in R

2010-02-14 Thread kMan
PM To: kMan Subject: Re: [R] lm function in R Thank you so much, kMan. That makes sense. Only one question, how can I see the value of 'error'? Here's what I see: Call: lm(formula = Y ~ X1 * X2 * X3, na.action = na.exclude) Coefficients: (Intercept)

Re: [R] lm function in R

2010-02-14 Thread Douglas Bates
turday, February 13, 2010 5:04 PM > To: Bert Gunter > Cc: r-help@r-project.org > Subject: Re: [R] lm function in R > > I tried.. > > mod = lm(Y ~ X1*X2*X3, na.action = na.exclude) > formula(mod) > > This produced > Y ~ X1 * X2 * X3 > > > When I typ

Re: [R] lm function in R

2010-02-13 Thread Ista Zahn
;>> Is it correct to assume then that... >>>> >>>> When I put + R evaluates the following equation: >>>> Y-Hat = b0 + b1X1 + b2X2 + . . . bkXk + 7 7 7 + bkXk >>>> >>>> >>>> But when I put * R evaluates the following equa

Re: [R] lm function in R

2010-02-13 Thread Daniel Malter
iscussurus - -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Something Something Sent: Saturday, February 13, 2010 5:04 PM To: Bert Gunter Cc: r-help@r-project.org Subject: Re: [R] lm function in R I tried.. mod = lm

Re: [R] lm function in R

2010-02-13 Thread Something Something
ia, which is surprisingly good for that sort > of question these days. > > -- > David. > >> >> >> >> >> >> On Sat, Feb 13, 2010 at 1:30 PM, Bert Gunter >> wrote: >> >> ?formula >>> >>> >>> Bert Gunter

Re: [R] lm function in R

2010-02-13 Thread Gabor Grothendieck
Feb 13, 2010 at 1:30 PM, Bert Gunter wrote: > >> ?formula >> >> >> Bert Gunter >> Genentech Nonclinical Statistics >> >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] >> On >> Behalf

Re: [R] lm function in R

2010-02-13 Thread David Winsemius
ordlund Cc: r-help@r-project.org Subject: Re: [R] lm function in R Thanks Dan. Yes that was very helpful. I didn't see the change from '*' to '+'. Seems like when I put * it means - interaction & when I put + it's not an interaction. Is it correct to assum

Re: [R] lm function in R

2010-02-13 Thread Something Something
> Genentech Nonclinical Statistics > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On > Behalf Of Something Something > Sent: Saturday, February 13, 2010 1:24 PM > To: Daniel Nordlund > Cc: r-help@r-project.org > Subjec

Re: [R] lm function in R

2010-02-13 Thread Bert Gunter
oject.org [mailto:r-help-boun...@r-project.org] > > On Behalf Of Something Something > > Sent: Friday, February 12, 2010 5:28 PM > > To: Phil Spector; r-help@r-project.org > > Subject: Re: [R] lm function in R > > > > Thanks for the replies everyone. Greatly app

Re: [R] lm function in R

2010-02-13 Thread Something Something
g [mailto:r-help-boun...@r-project.org] > > On Behalf Of Something Something > > Sent: Friday, February 12, 2010 5:28 PM > > To: Phil Spector; r-help@r-project.org > > Subject: Re: [R] lm function in R > > > > Thanks for the replies everyone. Greatly appreciate it.

Re: [R] lm function in R

2010-02-12 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Something Something > Sent: Friday, February 12, 2010 5:28 PM > To: Phil Spector; r-help@r-project.org > Subject: Re: [R] lm function in R > > Thanks

Re: [R] lm function in R

2010-02-12 Thread Something Something
Thanks for the replies everyone. Greatly appreciate it. Some progress, but now I am getting the following values when I don't use "as.factor" 13.14167 25.11667 28.34167 49.14167 40.39167 66.86667 Is that what you guys get? On Fri, Feb 12, 2010 at 5:00 PM, Phil Spector wrote: > By converting

[R] lm function in R

2010-02-12 Thread Something Something
Hello, I am trying to learn how to perform Multiple Regression Analysis in R. I decided to take a simple example given in this PDF: http://www.utdallas.edu/~herve/abdi-prc-pretty.pdf I created a small CSV called, students.csv that contains the following data: s1 14 4 1 s2 23 4 2 s3 30 7 2 s4 50

[R] lm function

2009-02-03 Thread RORAM
Hi, I do not use R lenguage for programming, hence Im trying to understand how are specified the models below. I been reading some webpages with information about the notation in the "lm" function, but havent understand exactly what does the ":" do. Can some one give me an explenation of the mode

Re: [R] lm() function

2008-05-29 Thread Peter Dalgaard
Cleber Nogueira Borges wrote: my linear model is y=c+a*x1+b*x2 i tried to found a, c, b by the use of: mymodel<-lm(y~1+x1+x2) where y, x1, x2 are 3 vectors with the same length the result is a=NA.so i want to know where is the problem. It's the sum of x1 and x2 equal to one? run the command:

Re: [R] lm() function

2008-05-29 Thread Cleber Nogueira Borges
my linear model is y=c+a*x1+b*x2 i tried to found a, c, b by the use of: mymodel<-lm(y~1+x1+x2) where y, x1, x2 are 3 vectors with the same length the result is a=NA.so i want to know where is the problem. It's the sum of x1 and x2 equal to one? run the command: round( sum( c(x1,x2) ),12)==1

Re: [R] lm() function

2008-05-29 Thread Roland Rau
Hi, Cleber Nogueira Borges wrote: hanen wrote: hi, my linear model is y=c+a*x1+b*x2 i tried to found a, c, b by the use of: mymodel<-lm(y~1+x1+x2) where y, x1, x2 are 3 vectors with the same length the result is a=NA.so i want to know where is the problem. It's the sum of x1 and x2 equal t

Re: [R] lm() function

2008-05-29 Thread Rolf Turner
On 30/05/2008, at 9:57 AM, Jorge Ivan Velez wrote: Dear Hanen, You don't need "1" in your R code. Try this: # Model mymodel<-lm(y~x1+x2) # Coefficients summary(mymodel) See also ?lm. That's not the problem. The ``1'' is redundant but does no harm. There is presumably something ``wrong''

Re: [R] lm() function

2008-05-29 Thread Cleber Nogueira Borges
hanen wrote: hi, my linear model is y=c+a*x1+b*x2 i tried to found a, c, b by the use of: mymodel<-lm(y~1+x1+x2) where y, x1, x2 are 3 vectors with the same length the result is a=NA.so i want to know where is the problem. It's the sum of x1 and x2 equal to one? run the command: round( sum(

Re: [R] lm() function

2008-05-29 Thread Jorge Ivan Velez
Dear Hanen, You don't need "1" in your R code. Try this: # Model mymodel<-lm(y~x1+x2) # Coefficients summary(mymodel) See also ?lm. Thanks, Jorge On Thu, May 29, 2008 at 5:15 PM, hanen <[EMAIL PROTECTED]> wrote: > > hi, > > > my linear model is y=c+a*x1+b*x2 i tried to found a, c, b by t

[R] lm() function

2008-05-29 Thread hanen
hi, my linear model is y=c+a*x1+b*x2 i tried to found a, c, b by the use of: mymodel<-lm(y~1+x1+x2) where y, x1, x2 are 3 vectors with the same length the result is a=NA.so i want to know where is the problem. -- View this message in context: http://www.nabble.com/lm%28%29-function-tp1754607