limma, is there a limited number of levels for a factor?
1
0
Entering edit mode
steve shen ▴ 50
@steve-shen-3974
Last seen 10.3 years ago
Hello, Does anyone know if there is a limited number of levels for a factor or how to reset the defaults? I have a two factor experiment which one factor has 2 levels while another has 7 levels. I got errors while I run following analysis. Please help. Thanks, Steve > design <- model.matrix(~phe+tr) > design (Intercept) pheVehicle tr1-Ant tr2-TCDD tr3-DIM tr4-Ago tr5-CH tr6- DMSO 1 1 0 0 0 0 0 0 0 2 1 0 0 0 0 0 0 0 3 1 0 0 0 0 0 0 0 4 1 1 0 0 0 0 0 1 5 1 1 0 0 0 0 0 1 6 1 1 0 0 0 0 0 1 7 1 1 0 1 0 0 0 0 8 1 1 0 1 0 0 0 0 9 1 1 0 1 0 0 0 0 10 1 1 0 0 1 0 0 0 11 1 1 0 0 1 0 0 0 12 1 1 0 0 1 0 0 0 13 1 1 0 0 0 1 0 0 14 1 1 0 0 0 1 0 0 15 1 1 0 0 0 1 0 0 16 1 1 0 0 0 0 1 0 17 1 1 0 0 0 0 1 0 18 1 1 0 0 0 0 1 0 19 1 1 1 0 0 0 0 0 20 1 1 1 0 0 0 0 0 21 1 1 1 0 0 0 0 0 attr(,"assign") [1] 0 1 2 2 2 2 2 2 attr(,"contrasts") attr(,"contrasts")$phe [1] "contr.treatment" attr(,"contrasts")$tr [1] "contr.treatment" > fit <- lmFit(x.data, design) Coefficients not estimable: tr6-DMSO Warning message: Partial NA coefficients for 29198 probe(s) > fit2 <- eBayes(fit) Warning message: In ebayes(fit = fit, proportion = proportion, stdev.coef.lim = stdev.coef.lim) : Estimation of var.prior failed - set to default value > sessionInfo() R version 2.10.1 (2009-12-14) x86_64-apple-darwin9.8.0 locale: [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] limma_3.2.2 loaded via a namespace (and not attached): [1] tools_2.10.1
• 979 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 1 day ago
United States
Hi Steve, On 8/7/2010 2:32 PM, steve shen wrote: > Hello, > > Does anyone know if there is a limited number of levels for a factor or > how to reset the defaults? I have a two factor experiment which one > factor has 2 levels while another has 7 levels. I got errors while I run > following analysis. Please help. Thanks, The limit to the number of factors is dependent on the number of samples you have. In your case, you are fooling R into creating a design matrix that is not of full rank. Anyway, I am not sure you want to use the 'phe' factor. I am guessing that you have some sort of control sample that is not treated, and then six other sample types that are treated with the same thing, but in a different vehicle. In which case I think you just want design <- model.matrix(~tr) which is full rank. The baseline in this case would be the untreated sample, and the coefficients for everything else would be the comparison of the treatment/vehicle combination to the untreated sample. Best, Jim > > Steve > > > design <- model.matrix(~phe+tr) > > design > (Intercept) pheVehicle tr1-Ant tr2-TCDD tr3-DIM tr4-Ago tr5-CH tr6-DMSO > 1 1 0 0 0 0 0 0 0 > 2 1 0 0 0 0 0 0 0 > 3 1 0 0 0 0 0 0 0 > 4 1 1 0 0 0 0 0 1 > 5 1 1 0 0 0 0 0 1 > 6 1 1 0 0 0 0 0 1 > 7 1 1 0 1 0 0 0 0 > 8 1 1 0 1 0 0 0 0 > 9 1 1 0 1 0 0 0 0 > 10 1 1 0 0 1 0 0 0 > 11 1 1 0 0 1 0 0 0 > 12 1 1 0 0 1 0 0 0 > 13 1 1 0 0 0 1 0 0 > 14 1 1 0 0 0 1 0 0 > 15 1 1 0 0 0 1 0 0 > 16 1 1 0 0 0 0 1 0 > 17 1 1 0 0 0 0 1 0 > 18 1 1 0 0 0 0 1 0 > 19 1 1 1 0 0 0 0 0 > 20 1 1 1 0 0 0 0 0 > 21 1 1 1 0 0 0 0 0 > attr(,"assign") > [1] 0 1 2 2 2 2 2 2 > attr(,"contrasts") > attr(,"contrasts")$phe > [1] "contr.treatment" > > attr(,"contrasts")$tr > [1] "contr.treatment" > > > fit <- lmFit(x.data, design) > Coefficients not estimable: tr6-DMSO > Warning message: > Partial NA coefficients for 29198 probe(s) > > fit2 <- eBayes(fit) > Warning message: > In ebayes(fit = fit, proportion = proportion, stdev.coef.lim = > stdev.coef.lim) : > Estimation of var.prior failed - set to default value > > sessionInfo() > R version 2.10.1 (2009-12-14) > x86_64-apple-darwin9.8.0 > > locale: > [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] limma_3.2.2 > > loaded via a namespace (and not attached): > [1] tools_2.10.1 > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald, M.S. Biostatistician Douglas Lab University of Michigan Department of Human Genetics 5912 Buhl 1241 E. Catherine St. Ann Arbor MI 48109-5618 734-615-7826 ********************************************************** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues
ADD COMMENT

Login before adding your answer.

Traffic: 304 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6