[R] problems with lm for nested fixed-factor Anova

2009-02-09 Thread Sergii Ivakhno
Dear R users, I want to run nested fixed-factor Anova in R on different experiments. In this toy example I have 3 levels of the main factor x1 and 7 levels of the nested factor z1 x1 and continuous response variable y1. x1 [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2

Re: [R] Problems with lm()

2008-07-17 Thread Christoph Scherber
Dear Hsin-Ya, The problem here is that subject is a factor with 14 levels, and sequence again is a factor with 2 levels; so the subject:sequence interaction already uses up another (13*1)=13 d.f.; given that there are only 28 replicates, it is not surprising that there are no residual degrees

Re: [R] Problems with lm()

2008-07-08 Thread Chibisi Chima-Okereke
-help@r-project.org Betreff: [R] Problems with lm() Dear all, I am trying to fit a multiple linear regression model to a table of data. My data.frame is like this ... fit.data - data.frame(y, x1, x2, x3, x4, x5, x6), then I use the linea regression command ... lm(formula = y ~ x1 + x2

[R] Problems with lm()

2008-07-07 Thread Chibisi Chima-Okereke
Dear all, I am trying to fit a multiple linear regression model to a table of data. My data.frame is like this ... fit.data - data.frame(y, x1, x2, x3, x4, x5, x6), then I use the linea regression command ... lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6, data = fit.data) however, for some

Re: [R] Problems with lm()

2008-07-07 Thread Daniel Malter
PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Chibisi Chima-Okereke Gesendet: Monday, July 07, 2008 8:09 PM An: r-help@r-project.org Betreff: [R] Problems with lm() Dear all, I am trying to fit a multiple linear regression model to a table of data. My data.frame is like this ... fit.data

Re: [R] Problems with lm()

2008-07-01 Thread Hsin-Ya Lee
Dear Dr. Dalgaard Sorry for delay reply.. That's exactly what I was looking for - thanks a lot. Hsin-Ya Peter Dalgaard wrote: oops, this got sent as reply to Andrew only Andrew Robinson wrote: In your data, subject is nested within sequence. Was that your intention? Presumably

Re: [R] Problems with lm()

2008-06-21 Thread Hsin-Ya Lee
Dear Dr. Andrew Robinson: Thanks for your reply. In my data, subject is nested within sequence. According to Dr. Christoph's reply, I have change the sequence data. It seems not work in R. However, I am sure that I run the same data with GLM in SPSS that I posted in first time. I really do

Re: [R] Problems with lm()

2008-06-21 Thread Dr. Christoph Scherber
Dear Hsin-Ya, Then it might be that you have checked Type 3 sums of squares in SPSS, while R uses type 1 by default. Dear Dr. Andrew Robinson: Thanks for your reply. In my data, subject is nested within sequence. According to Dr. Christoph's reply, I have change the sequence data. It

Re: [R] Problems with lm()

2008-06-21 Thread Peter Dalgaard
oops, this got sent as reply to Andrew only Andrew Robinson wrote: In your data, subject is nested within sequence. Was that your intention? Presumably yes. This looks like a standard cross-over design. I fail to see what the interaction between subject and sequence might mean, so I also

[R] Problems with lm()

2008-06-19 Thread leeznar
Dear R-users: I am a new R-user and I have a question about lm function. Here is my data. a-c(1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14) b-c(1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2) c-c(2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2)

Re: [R] Problems with lm()

2008-06-19 Thread Christoph Scherber
Dear Hsin-Ya Lee, The problem seems to be that every subject always only received one sequence: sequence subject 1 2 1 0 2 2 2 0 3 0 2 4 2 0 5 0 2 6 2 0 7 0 2 8 2 0 9 0 2 10 2 0 11 0 2 12 2 0 13 0 2 14 2 0 You

Re: [R] Problems with lm()

2008-06-19 Thread Andrew Robinson
In your data, subject is nested within sequence. Was that your intention? a-c(1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14) b-c(1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2) c-c(2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2)