0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

R/統計分析/使ってみる

Posted at

入力データサンプル

$ head KenshinData.dat
# date     FY     age     place     age2     height     weight     Sibo_ratio     ALL_DL     LDL     HDL     Sibo     g_GTP     Cmt
1991/12/12     1991     25     一般検診     25.75     171     69          151               85     22
1992/09/04     1992     26     一般検診     26.50     170     68
1993/12/08     1993     27     一般検診     27.75     170     71

Rでデータ読込

data=read.table("...../****.dat",header=T,sep="\t",comment.char="")

Rでグラフ化

> str(data)
'data.frame':     26 obs. of  14 variables:
 $ X..date   : Factor w/ 26 levels "1991/12/12","1992/09/04",..: 1 2 3 4 5 6 7 8 9 10 ...
 $ FY        : int  1991 1992 1993 1994 1995 1996 1997 1999 2000 2001 ...
 $ age       : int  25 26 27 28 29 30 32 33 34 35 ...
 $ place     : Factor w/ 7 levels "NTT伊豆","NTT五反田",..: 3 3 3 3 3 3 3 3 3 6 ...
 $ age2      : num  25.8 26.5 27.8 28.6 29.3 ...
 $ height    : num  171 170 170 171 170 ...
 $ weight    : num  69 68 71 68 69 73 71.5 78.6 72.2 71.7 ...
 $ Sibo_ratio: num  NA NA NA NA NA NA NA NA NA 25 ...
 $ ALL_DL    : int  151 NA NA NA NA 206 144 205 175 197 ...
 $ LDL       : int  NA NA NA NA NA NA NA NA NA NA ...
 $ HDL       : int  NA NA NA NA NA NA NA 52 56 55 ...
 $ Sibo      : int  85 NA NA NA NA 172 141 141 82 121 ...
 $ g_GTP     : int  22 NA NA NA NA 36 23 62 42 39 ...
 $ Cmt       : Factor w/ 2 levels "","納会翌日": 1 1 1 1 1 1 1 1 1 1 ...

plot(data[c(5,7,8,9,10,11,12)])
plot(data[c(5,7,8,11,12)])
pairs(data[c(5,7,8,11,12)])

pdf(filename.pdf,family="Japan1GothicBBB") #このフォントは数字等も結構デフォルトな感じになる

dev.off()
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?