Aparna Sampath
2012-Mar-15 07:59 UTC
[R] substituting own test statistics in a built-in function
Hi All I would like to compute the raw p-value from permutation tests and I found mt.sample.rawp() from the package multtest almost similar to what I want to do. But in the function definition: mt.sample.rawp(V,classlabel,test="t",side="abs",fixed.seed.sampling="y",B=10000,na=.mt.naNUM,nonpara="n") I would like to choose my own t-test which is designed using my model parameters, so it is like a modification of t-test. I would like to use this t-test instead of the ones in the list. I am not sure if this can be done. Can anyone tell me how to do it, if it is possible. the other way I tried is to copy the function and and modify it. But it uses internal functions from the package like mt.checkothers() which I do not know perform what kind of function. I tried to access its function definition, but I was not able to do so. is there some other way I could see what these internal functions do, so that I could possibly try to use the same logic and write the code. Appreciate all help. Thanks a lot :) Regards Ap -- View this message in context: http://r.789695.n4.nabble.com/substituting-own-test-statistics-in-a-built-in-function-tp4474162p4474162.html Sent from the R help mailing list archive at Nabble.com.
Sarah Goslee
2012-Mar-15 10:40 UTC
[R] substituting own test statistics in a built-in function
Hi, On Mar 15, 2012 4:28 AM, "Aparna Sampath" <aparna.sampath26@gmail.com> wrote:> > Hi All > > I would like to compute the raw p-value from permutation tests and I found > mt.sample.rawp() from the package multtest almost similar to what I wantto> do. But in the function definition: > >mt.sample.rawp(V,classlabel,test="t",side="abs",fixed.seed.sampling="y",B=10000,na=.mt.naNUM,nonpara="n")> > I would like to choose my own t-test which is designed using my model > parameters, so it is like a modification of t-test. I would like to usethis> t-test instead of the ones in the list. I am not sure if this can bedone.> Can anyone tell me how to do it, if it is possible. > > the other way I tried is to copy the function and and modify it.Indeed, that's the way to customize functions.> But it uses > internal functions from the package like mt.checkothers() which I do not > know perform what kind of function. I tried to access its function > definition, but I was not able to do so. is there some other way I couldsee> what these internal functions do, so that I could possibly try to use the > same logic and write the code.If you download the package source from CRAN, you'll have all of it, including any comments that have been stripped out.> Appreciate all help. Thanks a lot :) > > Regards > Ap >Sarah [[alternative HTML version deleted]]