search for: mlmfit0

Displaying 5 results from an estimated 5 matches for "mlmfit0".

Did you mean: mlmfit
2008 Sep 09
1
How do I compute interactions with anova.mlm ?
...factors. I suspect, I have to create a new "grouping" factor and then test with this factor to get these interactions (as it is hinted in R News 2007/2), but I don't really know how to use this approach. Here is my current code: Two Factors: fac1, fac2 mlmfit <- lm(mydata~1) mlmfit0 <- update(mlmfit, ~0) % test fac1, works, produces same output as SAS anova(mlmfit, mlmfit0, M = ~ fac1 + fac2, X = ~ fac2, idata = idata, test = "Wilks") % test fac1*fac2 interaction, also works, also the same output as SAS anova(mlmfit, mlmfit0, X = ~ fac1 + fac2, idata = idata, te...
2005 May 25
2
Weird function call problem
Hi, I'm encountering a very odd problem with calls to anova.mlm() from within a function. Consider the following code (data.n is a matrix of numeric values): mlmfit <- lm(data.n ~ 1) mlmfit0 <- lm(data.n ~ 0) print(mlmfit) anova(mlmfit,mlmfit0,test="Spherical") If I run it just like this from the console, it works just fine. If, however, I call it from within a function, e.g. using fct <- function(data.k) { # same code with data.n replaced by data.k } fct(data.n) It...
2005 Nov 15
1
Repeates Measures MANOVA for Time*Treatment Interactions
...up using the anova.mlm approach so that in the end I can write up a table that says Treatment Time Time*Treatment I can see from ?anova.mlm how one would get the Treatment effect using something like response<-with(my.data, rbind(Time1, Time2, Time3, Time4, Time5)) mlmfit<-lm(response~1) mlmfit0<-update(mlmfit, ~0) anova(mlmfit, mlmfit0, X = ~ Treatment, idata=my.data, test="Spherical") Although this yields the result that, after correction, it's not significant - perhaps due to the low DF from this simple example -- Analysis of Variance Table Model 1: response ~ 1 Mode...
2005 Jun 15
1
Anohter anova.mlm problem
Hi, yet another anova.mlm problem - it doesn't seem to end. This time, I have a setup with a few within-subject factors and a between-subject factor (SGROUP). Consider the most simple case with only one within-factor (apo): > mlmfit0 <- lm(data.n ~ 0 + SGROUP) > mlmfit1 <- lm(data.n ~ 1 + SGROUP) > anova(mlmfit1,mlmfit0,test="Spherical",M=~hemi,X=~1) Analysis of Variance Table Model 1: data.n ~ 1 + SGROUP Model 2: data.n ~ 0 + SGROUP Contrasts orthogonal to ~1 Contrasts spanned by ~hemi Greenhouse-Gei...
2007 May 13
2
Some questions on repeated measures (M)ANOVA & mixed models with lme4
...+ Error(subj+subj:time)) (from: http://cran.r-project.org/doc/contrib/Baron-rpsych.pdf, p. 41) C. "Repeated measures" MANOVA as follows (using data in wide format): response <- cbind(time1,time2,time3,time4,time5,time6) mlmfit <- lm(response ~ group) mlmfit1 <- lm(response ~ 1) mlmfit0 <- lm(response ~ 0) # Test time*group effect anova.mlm(mlmfit, mlmfit1, X=~1, test="Spherical") # Test overall group effect anova.mlm(mlmfit, mlmfit1, M=~1) # Test overall time effect anova.mlm(mlmfit1, mlmfit0, X=~1, test="Spherical") (taken from http://tolstoy.newcastle.ed...