search for: mlmfit

Displaying 6 results from an estimated 6 matches for "mlmfit".

Did you mean: lmfit
2008 Sep 09
1
How do I compute interactions with anova.mlm ?
...actions with more than two 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 = ~ fac...
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 replace...
2005 Nov 15
1
Repeates Measures MANOVA for Time*Treatment Interactions
...is, how does one set this 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...
2007 May 13
2
Some questions on repeated measures (M)ANOVA & mixed models with lme4
...ething along the lines of: aov(outcome ~ group * time + baseline + 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, te...
2006 Aug 12
0
anova.mlm for single model (one-way repeated measured anova)
...39;d like to one-way repeated measured anova by using mlm. > I'm using R-2.3.1 and my code is: > > dat<-matrix( c(9,7,8,8,12,11,8,13, 6,5,6,3,6,7,10,9, > 10,13,8,13,12,14,14,16, 9,11,13,14,16,12,15,14), > ncol=4, dimname=list(s=1:8, c=1:4)) > mlmfit<-lm(dat~1) > anova(mlmfit, X=~1) > Error: ceiling(length.out) : Non-numeric argument to mathematical function > > this error occurs in anova.mlm > > if (rk > 0) { > p1 <- 1:rk > comp <- object$effects[p1, ] > asgn...
2009 May 22
1
anova leads to an error
Dear R-list, the following code had been running well over the last months: exam <- matrix(rnorm(100,0,1), 10, 10) gg <- factor(c(rep("A", 5), rep("B", 5))) mlmfit <- lm(exam ~ 1); mlmfitG <- lm(exam ~ gg) result <- anova(mlmfitG, mlmfit, X=~0, M=~1) Until, all of a sudden the following error occured: Fehler in apply(abs(sapply(deltassd, function(X) diag((T %*% X %*% t(T))))), : dim(X) must have a positive length I have not kept track o...