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

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,

[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: 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

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:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing

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? The

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 julie.novak...@gmail.com wrote: The variable y is made of four columns, each paired to 20, 200, 2000 or 20 000. y - c(rdiktator20, rDiktator200,