トップ 履歴 一覧 Farm ソース 検索 ヘルプ PDF RSS ログイン

gtsummary

*disclaimer
655696

gtsummary


分析結果をきれいな表にまとめてくれる。

http://www.danieldsjoberg.com/gtsummary/
http://www.danieldsjoberg.com/gtsummary/articles/tbl_regression.html

 

tbl_summary()

str(SbyS.dat)

'data.frame':	1952 obs. of  9 variables:
 $ Lang    : Factor w/ 2 levels "CN","JP": 1 1 1 1 1 1 1 1 1 1 ...
 $ Year    : Factor w/ 3 levels "2","3","NS": 1 1 1 1 1 1 1 1 1 1 ...
 $ PID     : Factor w/ 105 levels "2001","2002",..: 1 1 1 1 1 1 1 1 1 1 ...
 $ SID     : Factor w/ 35 levels "1","2","3","4",..: 1 2 3 4 5 6 7 8 9 10 ...
 $ sentence: chr  "大学に入ってもう一年が経ちました" "今学期私たちは二年生になりました"...
 $ SL      : num  5 4 3 3 7 5 4 4 3 2 ...
 $ MDD     : num  1.5 2 1 1 1.5 ...
 $ Omega   : num  0.5 -1 1 1 0.875 ...
 $ MHD     : num  1.5 1 1.5 1.5 2 ...

SbyS.dat %>% select(Lang, Year, SL, MDD, MHD, Omega) %>% tbl_summary(by = Year)

tbl_regression()

library(gtsummary)
tbl_regression(L.model.best)


Characteristic	Beta	95% CI  	p-value
S3_1S_Neg	1.1	0.49, 1.6	<0.001
S3_2SMOD	1.4	0.95, 1.9	<0.001
S3_3Adv         1.2	0.66, 1.8	<0.001
S3_6Wh	        0.90	0.25, 1.5	0.007
S4_2cop	        0.50	0.05, 0.94	0.030
S4_3Copula	0.48	-0.03, 0.99	0.066
S6_1Cancel	1.5	0.32, 2.6	0.013

 CI = Confidence Interval