Description Usage Arguments Value Author(s) See Also Examples
View source: R/expr.dev.test.R
Deviance permuation test.
1 2 3 4 5 6 7 | expr.dev.test(xx, formula.full, formula.red = NULL, D.red = NULL, model.dat,
test.vars, glm.family, perm = 100, method = c("chisqstat", "permutation"),
cf="fisher", adjust=FALSE, snowfall.args=list(parallel=FALSE),
snowfall.seed, save.stat.data = FALSE,
file.save = "GlobalDeviance_statistic_Tperm_and_Tobs.Rdata",
use.save.stat.data = FALSE,
file.use = "GlobalDeviance_statistic_Tperm_and_Tobs.Rdata")
|
xx |
Dataset (variables x observations/patients). |
formula.full |
Formula from the full model. |
formula.red |
Formula from the reduced model. |
D.red |
Designmatrix of the reduced model. |
model.dat |
Dataset with covariables (observations/patients x covariables). |
test.vars |
Variables or groups of variables to test. |
glm.family |
Family for the regression. |
perm |
Number of permutations. |
method |
Method for the calculation of the p-value. |
cf |
Combining function for the partial tests. |
adjust |
Method for p-value adjustment. Not implemented. |
snowfall.args |
A list with parameters for the initialisation of parallelizing with package |
snowfall.seed |
Start seed. |
save.stat.data |
Logical value, default is |
file.save |
File name for saving. |
use.save.stat.data |
Logical value, default is |
file.use |
File name for data loading. |
A list
|
Method for the calculation of the p-value. |
|
Number of variables. |
|
Number of permutations. |
|
Formula from the full model. |
|
Formula from the reduced model. |
|
Test results. |
|
Permutation test statistic. |
|
Original test statistic. |
|
Variables or groups of variables to test. |
Frederike Fuhlbrueck f.fuhlbrueck@googlemail.com
See PermTest
, varwiselogLik
and Rossi
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | ## Not run:
### Example 1: poisson random data
set.seed(6666)
n<-100
Y1<-c(rpois(n, 1))
Y2<-c(rpois(n/2, 1), rpois(n/2, 10))
A<-rnorm(n)
B<-c(rep(1, n/2), rep(0, n/2)) # group variable
C<-rpois(n, 1)
test.variables<-list("Y1", "Y2", c("Y1", "Y2"))
names(test.variables)<-c("Y1", "Y2", "Y1, Y2")
t.random<-expr.dev.test(xx=t(data.frame(Y1, Y2)), formula.full=~ A + B + C,
formula.red=~ A + C, model.dat=data.frame(A, B, C), test.vars=test.variables,
glm.family=poisson(link="log"), perm=1000, method="permutation", cf="fisher",
snowfall.args=list(parallel=TRUE), snowfall.seed=54321)
summary(t.random, digits=3)
### Example 2: data set Rossi
data(Rossi)
# Covariables (patients x covariables)
model.dat<-Rossi[, c("arrest", "fin", "wexp")]
str(model.dat)
# data (variables/genes x patients)
xx<-rbind(t(t(t(Rossi[, c("prio", "n.work.weeks")]))), rpois(432, 1))
rownames(xx)<-c("prio", "n.work.weeks", "random")
formula.full<- ~ arrest + fin + wexp
formula.red<- ~ arrest + fin
test.vars<-list("prio", "n.work.weeks", "random", c("prio", "n.work.weeks"),
c("prio", "n.work.weeks", "random"))
names(test.vars)<-c("prio", "n.work.weeks", "random", "prio+n.work.weeks",
"prio+n.work.weeks+random")
set.seed(54321)
t.rossi1<-expr.dev.test(xx=xx, formula.full=formula.full, formula.red=formula.red,
D.red=NULL, model.dat, test.vars=test.vars, glm.family=poisson(link="log"),
perm=100, method="permutation", cf="fisher")
t.rossi2<-expr.dev.test(xx=xx, formula.full=formula.full, formula.red=formula.red,
D.red=NULL, model.dat, test.vars=test.vars, glm.family=poisson(link="log"),
perm=100, method="chisqstat", cf="fisher")
summary(t.rossi1, digits=2)
summary(t.rossi2, digits=3)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.