[BioC] Two-way ANOVA with multtest's MTP/EBMTP

James W. MacDonald jmacdon at med.umich.edu
Fri Jan 21 21:28:15 CET 2011


Hi Neil,

Well, I've played around with this a bit, googled around for an example, 
and looked at the code to see if I could divine exactly what the 
expectation for the Y argument is, and I must say that I am stumped.

I was thinking that you actually wanted

 > y
  [1] 11 11 11 12 12 12 21 21 21 22 22 22
Levels: 11 12 21 22

as the code is grepping for "12", but it doesn't work out the way it 
should. Anyway, I think you would be better served by contacting the 
maintainer directly. She is the expert, after all. See

packageDescription("multtest")$Main

for her email address.

Best,

Jim



On 1/20/2011 4:42 PM, Neil Gray wrote:
> Hi Jim,
> Thanks for your help, but I'm still having some trouble. The format
> seems to be correct, but I keep getting an error:
>
>  > y = paste(rep(c("pF","pS"), each=6),rep(c("aF","aS"), each=3,
> times=2),sep="")
>  > yf = factor(y)
>  > yf
> [1] pFaF pFaF pFaF pFaS pFaS pFaS pSaF pSaF pSaF pSaS pSaS pSaS
> Levels: pFaF pFaS pSaF pSaS
>  > m =
> MTP(exset,Y=yf,test='f.twoway',B=100,typeone='fdr',nulldist='boot.ctr',method='sd.minP',alpha=0.05)
>
> Error in rep(x, BlockNum[x]) : invalid 'times' argument
>
>  > traceback()
> 9: FUN(1L[[1L]], ...)
> 8: lapply(X, FUN, ...)
> 7: sapply(1:l, function(x) rep(x, BlockNum[x]))
> 6: unlist(sapply(1:l, function(x) rep(x, BlockNum[x])))
> 5: FUN(newX[, i], ...)
> 4: apply(X, MARGIN, FUN, ...)
> 3: wapply(X, 1, stat.closure, W)
> 2: get.Tn(X, stat.closure, W)
> 1: MTP(exset, Y = yf, test = "f.twoway", B = 100, typeone = "fdr",
> nulldist = "boot.ctr", method = "sd.minP", alpha = 0.05)
>
> I feel like I must be missing something obvious here, but I've tried
> organizing the group data in a number of ways...
>
> Neil
>
> On 1/19/11 5:37 PM, James W. MacDonald wrote:
>> Hi Neil,
>>
>> On 1/19/2011 4:12 PM, Neil Gray wrote:
>>> Hello - hopefully a quick question here. I've been using the MTP and
>>> EBMTP functions for multiple testing correction of microarray expression
>>> data. I've had no problems using the t-test option, but my overall
>>> design is a two-factor ANOVA (2x2 groups using two different
>>> treatments). My eSet therefore has two phenoData slots, and while it's
>>> easy enough to specify one or the other, e.g., test='t.twosamp.equalvar'
>>> and Y='treatment1', but I don't understand how to specify the 2x2 design
>>> for test='f.twoway'. It seems Y can't be a matrix, and it can only be of
>>> length equal to the number of samples.
>>
>> Yes. From ?MTP:
>>
>> Y: A vector, factor, or 'Surv' object containing the outcome of
>> interest. This may be class labels (F-tests and two sample
>> t-tests) or a continuous or polycotomous dependent variable
>> (linear regression based t-tests), or survival data (Cox
>> proportional hazards based t-tests). For 'block.f' and
>> 'f.twoway' tests, class labels must be ordered by block and
>> within each block ordered by group. If 'X' is an
>> ExpressionSet, 'Y' can be a character string referring to the
>> column of 'pData(X)' to use as outcome. Default is 'NULL'.
>>
>> So for f.twoway, you need a factor, with the class labels ordered
>> correctly.
>>
>> Let's say you have something like this:
>>
>> > trt <- rep(c("trt","untrt"), each=6)
>> > typ <- rep(c("wt","ko"), each=3, times=2)
>> > cbind(trt,typ)
>> trt typ
>> [1,] "trt" "wt"
>> [2,] "trt" "wt"
>> [3,] "trt" "wt"
>> [4,] "trt" "ko"
>> [5,] "trt" "ko"
>> [6,] "trt" "ko"
>> [7,] "untrt" "wt"
>> [8,] "untrt" "wt"
>> [9,] "untrt" "wt"
>> [10,] "untrt" "ko"
>> [11,] "untrt" "ko"
>> [12,] "untrt" "ko"
>>
>> To get the factor, I believe you need something like this:
>>
>> > my.y <- factor(paste(trt,typ, sep = ""))
>> > my.y
>> [1] trtwt trtwt trtwt trtko trtko trtko untrtwt untrtwt untrtwt
>> [10] untrtko untrtko untrtko
>> Levels: trtko trtwt untrtko untrtwt
>>
>> Does that make sense?
>>
>> Best,
>>
>> Jim
>>
>>
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> 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 



More information about the Bioconductor mailing list