R int num factor character 1 2 (dichotomous variable) (trichotomous variable) 3 (nominal scale) M F 1 2 coding as.numeric() as.integer() 2

Similar documents
win.metafile() emf Microsoft PowerPoint OpenOffice.org Draw 2 R CRAN R (2004) [ ](2004) (2005) The R Tips R The R Tips R 6

Rによる計量分析:データ解析と可視化 - 第3回 Rの基礎とデータ操作・管理

R による統計解析入門

5 5.1 A B mm 0.1mm Nominal Scale 74

k2 ( :35 ) ( k2) (GLM) web web 1 :


講義のーと : データ解析のための統計モデリング. 第3回

秋植え花壇の楽しみ方

<82D282A982C1746F95F18D908F57967B95B E696E6464>



BMIdata.txt DT DT <- read.table("bmidata.txt") DT head(dt) names(dt) str(dt)


1 R Windows R 1.1 R The R project web R web Download [CRAN] CRAN Mirrors Japan Download and Install R [Windows 9

DAA09

卒業論文

講義のーと : データ解析のための統計モデリング. 第2回

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè2²ó

Microsoft PowerPointの利用 V 1,1 暫定版

28 9

untitled


PackageSoft/R-033U.tex (2018/March) R:

DAA04

服用者向け_資料28_0623

データ分析のまとめ方

EPSON PS Tools HTMLヘルプ <Macintosh版>

報告書.PDF

Keynote 3 ユーザーズガイド

統計研修R分散分析(追加).indd

2004/01/ /01/23 2 I /04/ /04/ ,-1-8-1,-2-2-1,-3-4-1,-3-5-1,-4-2-1, ,-5-6-1, _.doc 1

untitled

ECCS. ECCS,. ( 2. Mac Do-file Editor. Mac Do-file Editor Windows Do-file Editor Top Do-file e

BSE Excel

2.1 R, ( ), Download R for Windows base. R ( ) R win.exe, 2.,.,.,. R > 3*5 # [1] 15 > c(19,76)+c(11,13)

一般化線形 (混合) モデル (2) - ロジスティック回帰と GLMM

untitled

Excel97関数編


橡ファミリー企業の分析020806


Taro13-芦北(改).jtd

Taro13-宇城(改).jtd

1

Exif Viewer, DPOF Editor 使用説明書

untitled

OpenOffice.org OOo HTML MicrosoftOffice Windows OOo OOo OpenOffice 2

kubostat2017c p (c) Poisson regression, a generalized linear model (GLM) : :

1

ISBN ISBN 0 0 ISBN


ISBN ISBN 5 128p ISBN ISBN 2

民事責任規定・エンフォースメント

ISBN ISBN ISBN

496


CanoScan Toolbox 1.6 ユーザーズガイド


stat-base_ppt [互換モード]

CanoScan Toolbox

Microsoft Word - ランチョンプレゼンテーション詳細.doc

iR-ADV C2230/C2220 製品カタログ

,

CSV PDF TIFF JPG A A

無印良品のスキンケア

o 2o 3o 3 1. I o 3. 1o 2o 31. I 3o PDF Adobe Reader 4o 2 1o I 2o 3o 4o 5o 6o 7o 2197/ o 1o 1 1o

p000表紙.eps

stat-base [互換モード]

DAA03

125 2 P 1st washout 2 PB P mg/dL nd washout 2 P 5.5mg/dL< mg/dL <2.5mg/dL P P 2 D D 3 Ca 10

kubostat2015e p.2 how to specify Poisson regression model, a GLM GLM how to specify model, a GLM GLM logistic probability distribution Poisson distrib

Adobe Bridge Bridge Bridge Bridge P10 Bridge Finder 2

★20052G1.doc

u u u 1 1

5 LATEX 2ε 2010

Keynote '08 ユーザーズガイド

家庭系パソコンの回収再資源化にかかる論点

untitled

技能継承に関するアンケートの結果概要

DNS


- - i



untitled


29





喀痰吸引

平成18年度「商品先物取引に関する実態調査」報告書


t-a-PPT

かんたん操作ガイド[arrows M02]

かんたん操作ガイド[arrows RM02]



かんたん操作ガイド[arrows M03]

Transcription:

2006 10 16 http://phi.med.gunma-u.ac.jp/medstat/p01.xls p01.txt R p01 <- read.delim("p01.txt") str(p01) 100 pid int sex F M 2 Factor ht wt num data.frame : 100 obs. of 4 variables: $ pid: int 1 2 3 4 5 6 7 8 9 10... $ sex: Factor w/ 2 levels "F","M": 1 2 1 1 2 1 2 2 1 1... $ ht : num 165 169 160 163 172... $ wt : num 61.3 65.7 57.6 62.9 58.3 55.2 70.2 60.6 60.3 58.9... summary(p01) NA pid sex 100 ht 99 1 wt 98 2 pid sex ht wt Min. : 1.00 F:50 Min. :150.6 Min. :45.60 1st Qu.: 25.75 M:50 1st Qu.:160.2 1st Qu.:58.08 Median : 50.50 Median :165.0 Median :61.95 Mean : 50.50 Mean :165.1 Mean :61.93 3rd Qu.: 75.25 3rd Qu.:169.7 3rd Qu.:66.40 Max. :100.00 Max. :181.3 Max. :76.60 NA s : 1.0 NA s : 2.00 p01s <- subset(p01,complete.cases(p01)) p01s str(p01s) summary(p01s) 97 1

R int num factor character 1 2 (dichotomous variable) (trichotomous variable) 3 (nominal scale) M F 1 2 coding 1 2 3 4 4 1 as.numeric() as.integer() 2 as.ordered() 3 4 2

(ordinal scale) (Ord.factor) R as.ordered() +++ ++ + ± + 3, 2, 1, 0.5, 0 3 2 2 1 3 2 2 1 3, 2, 1, 0.5, 0 as.ordered(o.blood) 3, 2, 1 15, 3.14159265358979, 1 1 5, 4, 3, 2, 1 (interval scale) 5 39 36 39/36 1.083 6 5 6 cm m 3

(ratio scale) 7 cm kg 8 TFR 9 10 100cm cm 170cm 2cm 7 8 9 PowerPoint OpenOffice.org Impress PowerPoint 10 OpenOffice.org Draw Adobe Illustrator 4

(2005) (ISBN4-06-149773-1) R pdf jpg png tiff Windows Macintosh Linux postscript 11 R source() 12 X R barplot(table(x)) M + + + 4 ++ 1 + 2 ± 12 97 table(x) c() names() barplot() OpenOffice.org Draw 11 table() 12 source("http://phi.med.gunma-u.ac.jp/medstat/it02-3.r") R Console URL R Editor 5

it02-3.r ob <- c(4,1,2,12,97) names(ob) <- c("+++","++","+"," ","-") barplot(ob,ylim=c(0,100),main=" \n ") 2 barplot() it02-4.r ob <- c(4,1,2,12,97) names(ob) <- c("+++","++","+"," ","-") ii <- barplot(matrix(ob,nrow(ob)),beside=f,ylim=c(0,120),main=" ") oc <- ob for (i in 1:length(ob)) { oc[i] <- sum(ob[1:i])-ob[i]/2 } text(ii,oc,paste(names(ob))) + + + ++ 0 + 1 ± 5 47 + + + 4 ++ 1 + 1 ± 7 50 R 6

it02-5.r obm <- c(0,0,1,5,47) obf <- c(4,1,1,7,50) obx <- cbind(obm,obf) rownames(obx) <- c("+++","++","+"," ","-") colnames(obx) <- c(" "," ") ii <- barplot(obx,beside=f,ylim=c(0,70),main=" ") oc <- obx for (i in 1:length(obx[,1])) { oc[i,1] <- sum(obx[1:i,1])-obx[i,1]/2 } for (i in 1:length(obx[,2])) { oc[i,2] <- sum(obx[1:i,2])-obx[i,2]/2 } text(ii[1],oc[,1],paste(rownames(obx))) text(ii[2],oc[,2],paste(rownames(obx))) 100% R 2 (%) 4 horiz=t it02-6.r ob <- c(4,1,2,12,97) obp <- ob/sum(ob)*100 names(obp) <- c("+++","++","+"," ","-") ii <- barplot(matrix(obp,nrow(obp)),horiz=t,beside=f,xlim=c(0,100), xlab="(%)",main=" ") oc <- obp for (i in 1:length(obp)) { oc[i] <- sum(obp[1:i])-obp[i]/2 } text(oc,ii,paste(names(obp))) 7

barplot() dotchart() it02-7.r obm <- c(0,0,1,5,47) obf <- c(4,1,1,7,50) obx <- cbind(obm,obf) rownames(obx) <- c("+++","++","+"," ","-") colnames(obx) <- c(" "," ") dotchart(obx) dotchart(t(obx)) 100% 8

13 R pie() 14 R it02-8.r ob <- c(4,1,2,12,97) names(ob) <- c("+++","++","+"," ","-") pie(ob) Excel R hist() 15 90 10 1 16 it02-9.r dat <- read.delim("http://phi.med.gunma-u.ac.jp/medstat/p01.txt") hist(dat$ht,main=" ") 13 Cleveland Cleveland WS (1985) The elements of graphing data. Wadsworth, Monterey, CA, USA. p.264 R help 14 R-1.5 piechart() 15 http://phi.med.gunma-u.ac.jp/demography/makepyramid.html 16 http://phi.med.gunma-u.ac.jp/medstat/p01.txt 9

qqnorm() qqline() it02-10.r dat <- read.delim("http://phi.med.gunma-u.ac.jp/medstat/p01.txt") qqnorm(dat$ht,main=" ",ylab=" (cm)") qqline(dat$ht,lty=2) (stem and leaf plot) 5 10 R stem() 90 17 dat <- read.delim("http://phi.med.gunma-u.ac.jp/medstat/p01.txt") stem(dat$ht) (box and whisker plot) (median) 1/4 (first quartile) 1/4 (third quartile) 1.5 17 source("http://phi.med.gunma-u.ac.jp/swtips/gstem.r") stem() gstem() 10

R boxplot() dat <- read.delim("http://phi.med.gunma-u.ac.jp/medstat/p01.txt") boxplot(dat$ht) (stripchart) R stripchart() vert=t it02-11.r dat <- read.delim("http://phi.med.gunma-u.ac.jp/medstat/p01.txt") attach(dat) mht <- tapply(ht,sex,mean) sht <- tapply(ht,sex,sd) IS <- c(1,2)+0.15 stripchart(ht~sex,method="jitter",vert=t,ylab=" (cm)") points(is,mht,pch=18) arrows(is,mht-sht,is,mht+sht,code=3,angle=90,length=.1) detach(dat) (scatter plot) R plot() plot() pch points() symbols() 18 18 http://phi.med.gunma-u.ac.jp/medstat/semen.r 11

matplot() matpoints() pairs() text() identify() dat <- read.delim("http://phi.med.gunma-u.ac.jp/medstat/p01.txt") plot(dat$ht,dat$wt,pch=paste(dat$sex),xlab=" (cm)",ylab=" (kg)") R stars() maptools ESRI GIS 19 http://phi.med.gunma-u.ac.jp/medstat/p02.txt 1 Excel (wt) R A4 1 19 http://phi.med.gunma-u.ac.jp/swtips/epimap.html 12