This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ##metaforパッケージをインストールする | |
| #install.packages("metafor") | |
| #library("metafor") | |
| calcTaronesTest <- function(mylist,referencerow=2) | |
| { | |
| numstrata <- length(mylist) | |
| # 各層における曝露グループの人数のアレイ"ntrt"を作る | |
| # 各層における非曝露グループの人数のアレイ"nctrl"を作る | |
| # 各層における疾病を持つ曝露グループの人数のアレイ"ptrt"を作る |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| calcMHRatio <- function(mymatrix, alpha=0.05) | |
| { | |
| caseExposedControlUnexposed <- mymatrix[1, 2] | |
| caseUnexposedControlExposed <- mymatrix[2, 1] | |
| MHRatio <- caseExposedControlUnexposed / caseUnexposedControlExposed | |
| print(paste("Mantel-Haenszelのオッズ比 =", MHRatio)) | |
| # 信頼区間の計算 | |
| confidenceLevel <- (1 - alpha) * 100 | |
| sigma <- sqrt((1 / caseExposedControlUnexposed) + (1 / caseUnexposedControlExposed)) | |
| # sigmaは,オッズ比の対数の推定値の標準誤差 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| calcRelativeRisk <- function(mymatrix,alpha=0.05,referencerow=2) | |
| { | |
| numrow <- nrow(mymatrix) | |
| myrownames <- rownames(mymatrix) | |
| for (i in 1:numrow) | |
| { | |
| rowname <- myrownames[i] | |
| DiseaseUnexposed <- mymatrix[referencerow,1] | |
| ControlUnexposed <- mymatrix[referencerow,2] | |
| if (i != referencerow) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| calcOddsRatio <- function(mymatrix,alpha=0.05,referencerow=2,quiet=FALSE) | |
| { | |
| numrow <- nrow(mymatrix) | |
| myrownames <- rownames(mymatrix) | |
| for (i in 1:numrow) | |
| { | |
| rowname <- myrownames[i] | |
| DiseaseUnexposed <- mymatrix[referencerow,1] | |
| ControlUnexposed <- mymatrix[referencerow,2] | |
| if (i != referencerow) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % xmodmap -pke> "~/.xmodmap" |
NewerOlder