This file contains 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" |
This file contains 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 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 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 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 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
#/usr/bin/env bash | |
set -e | |
set -x | |
apt-get update | |
apt-get upgrade | |
apt-get -y install build-essential curl git-core openssl libreadline6 libreadline6-dev \ | |
zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev \ |
This file contains 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
#確率密度(対数正規分布 平均log=5,sdlog=1.5 )で | |
#当選番号は1から600の間から60こ抽出 | |
sample(600,60,prob=dlnorm(1:600, meanlog=5, sdlog=1.5)) |
This file contains 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
[ $(date +%d) = 01 ] && ruby ./batch.rb #毎初日に実行 |
This file contains 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
app[web.1]: Parameters: {"utf8"=>"✓", "q"=>{"order_date_cont"=>"2015-03-02"}} | |
app[web.1]: Purchase Load (4.9ms) SELECT DISTINCT "purchases".* FROM "purchases" WHERE ("purchases"."order_date" ILIKE '%2015-03-02%') ORDER BY "purchases"."order_date" DESC | |
app[web.1]: PG::UndefinedFunction: ERROR: operator does not exist: date ~~* unknown | |
app[web.1]: LINE 1: ... FROM "purchases" WHERE ("purchases"."order_date" ILIKE '%20... | |
app[web.1]: ^ | |
app[web.1]: HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. | |
app[web.1]: SELECT DISTINCT "purchases".* FROM "purchases" WHERE ("purchases"."order_date" ILIKE '%2015-03-02%') ORDER BY "purchases"."order_date" DESC | |
app[web.1]: Rendered shared/_search_result_box.html.erb(6.9ms) | |
app[web.1]: Completed 500 Internal Server Error in 69ms |
This file contains 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
var gulp = require('gulp'); | |
var connect = require('gulp-connect'); | |
var modRewrite = require('connect-modrewrite'); | |
var runSequence = require('run-sequence'); | |
var shell = require('gulp-shell'); | |
//proxy all requests to /api to localhost:3000 for rails api | |
gulp.task('connect', function(){ | |
connect.server({ | |
root: './app', |
OlderNewer