I am trying to recreate a model that would mimic results a peer obtained using SAS, but in R. The goal of this model would be to determine if there is any variation among parental sets and lines (essentially is there a significant p-value for the variables ?set? and ?line?). The problems I am having are: 1) The usage of nested data ?Line%in%Set? 2) Having to have both fixed and random variables Fixed=Set Random=Line and Block 3) Results I have obtained usually contain significant Blocking effects. Code I have used thus far without being able to replicate the data includes: Fm<-lmer(Score~(1|Line%in%Set)+Set+(1|Block)) (I figured out how to get a p-value, but it didn't yield the same results as those obtained in SAS) Model<-lm(Score~Line%in%Set+Set+Block) Overall, I realize that I might be completely off in the way I am attempting to create this model and any suggestions will be extremely helpful! Also, if it would be more helpful I can add a dput() of my data. -- View this message in context: http://r.789695.n4.nabble.com/Creating-a-model-with-fixed-and-random-variables-tp4672905.html Sent from the R help mailing list archive at Nabble.com.
> Code I have used thus far without being able to replicate the > data includes: > > Fm<-lmer(Score~(1|Line%in%Set)+Set+(1|Block)) > (I figured out how to get a p-value, but it didn't yield the > same results as those obtained in SAS)%in% doesn't generally mean 'nested in' in R. It is a set membership test and will return TRUE for those labels in Line that are also in Set and FALSE otherwise. Did you mean Score~(1|Set/Line)...? If you did, bear in mind that , combined with the fixed Set term, (1|Set/Line) implies a random Set grouping effect as well as a fixed effect - not sure that makes sense in your circumstance unless Set is a continuous predictor. May be safer to define SetLine<-interaction(Set, Line) and do Score~Set + (1|SetLine) + (1|Block) S Ellison ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}