[R] dropterm in MANOVA for MLM objects

Vickie S isvik at live.com
Wed Feb 8 23:53:29 CET 2012


Dear Prof Fox,
I tried anova but got the following error message:

mat <- matrix(rnorm(700), ncol=5, dimnames=list( paste("f", c(1:140), sep="_"), c("A", "B", "C", "D", "E")))
summary(Anova(lm(cbind(A, B, C, D, E) ~ factor(rownames(mat)), data=as.data.frame(mat))))

Error in summary(Anova(lm(cbind(A, B, C, D, E) ~ factor(rownames(mat)),  : 
  error in evaluating the argument 'object' in selecting a method for function 'summary': Error in linearHypothesis.mlm(mod, hyp.matrix.2, SSPE = SSPE, V = V, ...) : 
  The error SSP matrix is apparently of deficient rank = 0 < 5

I looked in previous forum and it seems like i have only option of performing the univariate test here. 

Therefore I used the following, but it still results in an error message:
Anova(lm(cbind(A, B, C, D, E) ~ factor(rownames(mat)), data=as.data.frame(mat)), univariate=TRUE, multivariate=F)
Error in linearHypothesis.mlm(mod, hyp.matrix.2, SSPE = SSPE, V = V, ...) : 
  The error SSP matrix is apparently of deficient rank = 0 < 5

Any suggestions ?

Thanks
Vickie



I think I am still missing some important clues here. Is it because the feww

> From: jfox at mcmaster.ca
> To: isvik at live.com
> CC: r-help at r-project.org
> Subject: RE: [R] dropterm in MANOVA for MLM objects
> Date: Wed, 8 Feb 2012 17:01:34 -0500
> 
> Dear Vicki,
> 
> I think that the Anova() function in the car package will do what you want
> (and will also properly handle models with more structure, such as
> interactions).
> 
> Best,
>  John
> 
> --------------------------------
> John Fox
> Senator William McMaster
>   Professor of Social Statistics
> Department of Sociology
> McMaster University
> Hamilton, Ontario, Canada
> http://socserv.mcmaster.ca/jfox
> 
> 
> 
> 
> > -----Original Message-----
> > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> > project.org] On Behalf Of Vickie S
> > Sent: February-08-12 3:57 PM
> > To: r-help at r-project.org
> > Subject: [R] dropterm in MANOVA for MLM objects
> > 
> > 
> > Dear R fans,
> > I have got a difficult sounding problem.
> > 
> > For fitting a linear model using continuous response and then for re-
> > fitting the model after excluding every single variable, the following
> > functions can be used.
> > library(MASS)
> > model = lm(perf ~ syct + mmin + mmax + cach + chmin + chmax, data =
> > cpus) dropterm(model, test = "F")
> > 
> > But I am not sure whether any similar functions is available in R for
> > multivariate data with categorical response.
> > My data looks like the following:
> > mat <- matrix(rnorm(700), ncol=5, dimnames=list( paste("f", c(1:140),
> > sep="_"), c("A", "B", "C", "D", "E")))
> > 
> > There are 140 features describing 5 different plant species. I want to
> > retain only those features that show good performance in model (by
> > using a function similar to dropterm, which can not be used for mlm
> > objects).
> > 
> > I wud appreciate some hints n suggestions.
> > 
> > Thx
> > - Vickie
> > 
> > 
> > 
> > 
> > 
> > 	[[alternative HTML version deleted]]
> > 
> > ______________________________________________
> > R-help at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-
> > guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> 
 		 	   		  


More information about the R-help mailing list