Last data update: 2014.03.03
|
R: critical regions
critVal.power | R Documentation |
critical regions
Description
critical region cutpoints
Usage
critVal.power(k, p0, target, pwr = 0.8, odds = 7)
Arguments
k |
- window width(s)
|
p0 |
- length 2 probabilities
|
target |
- false discoveries wanted
|
pwr |
- desired power
|
odds |
- alternative odds ratio
|
Details
This version uses power and TFD and will limit windows
screened
Value
list of cutoffs and attributes
Author(s)
Charles Berry
See Also
gRxCluster for how and why this function is
used
Examples
# symmetric odds:
crit <-
critVal.power(5:25,c(1,1),5,pwr=0.8,odds=7)
crit[[1]]
sapply(crit,c)
# 5:1 odds
asymmetric.crit <-
critVal.power(5:25,c(1,5),5,pwr=0.8,odds=7)
# show the critical regions
par(mfrow=c(1,2))
gRxPlot(crit,method="critical")
gRxPlot(asymmetric.crit,method="critical")
rm(crit,asymmetric.crit)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(geneRxCluster)
Loading required package: GenomicRanges
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from 'package:stats':
IQR, mad, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
rbind, rownames, sapply, setdiff, sort, table, tapply, union,
unique, unsplit
Loading required package: S4Vectors
Loading required package: stats4
Attaching package: 'S4Vectors'
The following objects are masked from 'package:base':
colMeans, colSums, expand.grid, rowMeans, rowSums
Loading required package: IRanges
Loading required package: GenomeInfoDb
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/geneRxCluster/critVal.power.Rd_%03d_medium.png", width=480, height=480)
> ### Name: critVal.power
> ### Title: critical regions
> ### Aliases: critVal.power
>
> ### ** Examples
>
> # symmetric odds:
> crit <-
+ critVal.power(5:25,c(1,1),5,pwr=0.8,odds=7)
> crit[[1]]
[1] 2 4
attr(,"fdr")
target.low target.hi low hi
[1,] 0.8125 26.0000 0.03125 1.00000
[2,] 4.8750 25.1875 0.18750 0.96875
[3,] 13.0000 21.1250 0.50000 0.81250
[4,] 21.1250 13.0000 0.81250 0.50000
[5,] 25.1875 4.8750 0.96875 0.18750
[6,] 26.0000 0.8125 1.00000 0.03125
attr(,"n")
[1] 13.33333
attr(,"target")
[1] 5
> sapply(crit,c)
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
[1,] 2 2 3 3 3 3 3 3 4 4 4 4 4 4 5 5 5 5 5 5 5
[2,] 4 5 5 6 7 8 9 10 10 11 12 13 14 15 15 16 17 18 19 20 21
> # 5:1 odds
> asymmetric.crit <-
+ critVal.power(5:25,c(1,5),5,pwr=0.8,odds=7)
> # show the critical regions
> par(mfrow=c(1,2))
> gRxPlot(crit,method="critical")
> gRxPlot(asymmetric.crit,method="critical")
> rm(crit,asymmetric.crit)
>
>
>
>
>
> dev.off()
null device
1
>
|
|