diff --git a/404.html b/404.html index 9fb6d06..7230217 100644 --- a/404.html +++ b/404.html @@ -7,8 +7,8 @@
You can make a publication-ready table easily using myft(). It makes a flextable object which can use in HTML, PDF, microsoft word or powerpoint file.
autoReg(fit) %>% myft()
Dependent: mpg
unit
value
Coefficient (multivariable)
wt
[1.5,5.4]
Mean ± SD
3.2 ± 1.0
-4.80 (-13.06 to 3.46, p=.242)
hp
[52,335]
146.7 ± 68.6
-0.09 (-0.22 to 0.04, p=.183)
am
[0,1]
0.4 ± 0.5
12.84 (-16.52 to 42.19, p=.376)
wt:hp
0.01 (-0.03 to 0.05, p=.458)
wt:am
-5.36 (-14.85 to 4.13, p=.255)
hp:am
-0.03 (-0.22 to 0.15, p=.717)
wt:hp:am
:
0.02 (-0.04 to 0.07, p=.503)
You can make a publication-ready table with the following R command.
Dependent: cens.factor
Alive (N=387)
Died (N=299)
OR (multivariable)
horTh
no
235 (60.7%)
205 (68.6%)
yes
152 (39.3%)
94 (31.4%)
0.62 (0.44-0.88, p=.007)
pnodes
3.8 ± 4.6
6.5 ± 6.1
1.11 (1.08-1.16, p<.001)
menostat
Pre
171 (44.2%)
119 (39.8%)
Post
216 (55.8%)
180 (60.2%)
1.34 (0.96-1.87, p=.082)
name
levels
Female (N=287)
Male (N=570)
p
age
68.7 ± 10.7
60.6 ± 11.2
<.001
cardiogenicShock
No
275 (95.8%)
530 (93%)
.136
Yes
12 (4.2%)
40 (7%)
entry
Femoral
119 (41.5%)
193 (33.9%)
.035
Radial
168 (58.5%)
377 (66.1%)
Dx
NSTEMI
50 (17.4%)
103 (18.1%)
.012
STEMI
84 (29.3%)
220 (38.6%)
Unstable Angina
153 (53.3%)
247 (43.3%)
EF
56.3 ± 10.1
55.6 ± 9.4
.387
height
153.8 ± 6.2
167.9 ± 6.1
weight
57.2 ± 9.3
68.7 ± 10.3
BMI
24.2 ± 3.6
24.3 ± 3.2
.611
obesity
194 (67.6%)
373 (65.4%)
.580
93 (32.4%)
197 (34.6%)
TC
188.9 ± 51.1
183.3 ± 45.9
.124
LDLC
117.8 ± 41.2
116.0 ± 41.1
.561
HDLC
39.0 ± 11.5
37.8 ± 10.9
.145
TG
119.9 ± 76.2
127.9 ± 97.3
.195
DM
173 (60.3%)
380 (66.7%)
.077
114 (39.7%)
190 (33.3%)
HBP
83 (28.9%)
273 (47.9%)
204 (71.1%)
297 (52.1%)
smoking
Ex-smoker
49 (17.1%)
155 (27.2%)
Never
209 (72.8%)
123 (21.6%)
Smoker
29 (10.1%)
292 (51.2%)
You can also use three or more grouping variables.The resultant table will be too long to review, but you can try.
gaze(sex+DM+HBP~age,data=acs) %>% myft()
sexDM(N)
FemaleNo(N=173)
FemaleYes(N=114)
MaleNo(N=380)
MaleYes(N=190)
No (N=54)
Yes (N=119)
No (N=29)
Yes (N=85)
No (N=205)
Yes (N=175)
No (N=68)
Yes (N=122)
68.5 ± 14.2
69.6 ± 9.9
.589
67.1 ± 7.8
68.0 ± 10.3
.660
57.7 ± 11.5
64.5 ± 10.4
56.9 ± 10.4
61.9 ± 10.3
.002
If you do not want to show the reference values in table, you can shorten the table.
shorten(result) %>% myft()
Dependent: Mortality
Alive (N=925)
Died (N=897)
Treatment
Lev
285 (30.8%)
323 (36%)
0.93 (0.74-1.18, p=.571)
Lev+5FU
358 (38.7%)
232 (25.9%)
0.53 (0.42-0.68, p<.001)
Sex
Male
489 (52.9%)
463 (51.6%)
0.95 (0.78-1.15, p=.589)
Age(Years)
60.1 ± 11.5
59.5 ± 12.3
1.00 (0.99-1.01, p=.586)
Obstruction
161 (17.4%)
191 (21.3%)
1.33 (1.04-1.70, p=.023)
Perforation
22 (2.4%)
32 (3.6%)
1.38 (0.78-2.44, p=.274)
Positive nodes
2.7 ± 2.4
4.6 ± 4.2
1.21 (1.17-1.25, p<.001)
If you want to include all explanatory variables in the multivariate model, just set the threshold 1.
autoReg(fit, uni=TRUE,threshold=1) %>% myft()
OR (univariable)
Obs
282 (30.5%)
342 (38.1%)
0.93 (0.75-1.17, p=.554)
0.53 (0.43-0.67, p<.001)
Female
436 (47.1%)
434 (48.4%)
0.95 (0.79-1.14, p=.594)
1.00 (0.99-1.00, p=.305)
764 (82.6%)
706 (78.7%)
1.28 (1.02-1.62, p=.036)
903 (97.6%)
865 (96.4%)
1.52 (0.88-2.63, p=.137)
You can perform stepwise backward elimination to select variables and make a final model. Just set final=TRUE.
autoReg(fit, uni=TRUE,threshold=1, final=TRUE) %>% myft()
OR (final)
0.94 (0.74-1.18, p=.575)
0.54 (0.42-0.68, p<.001)
1.34 (1.05-1.71, p=.019)
You can make a publication-ready table with myft() function which can be used in HTML, pdf, microsoft word and powerpoint file.
gaze(sex~.,data=acs) %>% myft()
You can select whether or not show total column.
gaze(sex+Dx~.,data=acs,show.total=TRUE) %>% myft()
sex (N)
NSTEMI (N=50)
STEMI (N=84)
Unstable Angina (N=153)
total (N=287)
NSTEMI (N=103)
STEMI (N=220)
Unstable Angina (N=247)
total (N=570)
70.9 ± 11.4
69.1 ± 10.4
67.7 ± 10.7
.177
61.1 ± 11.6
59.4 ± 11.7
61.4 ± 10.6
.133
49 (98%)
73 (86.9%)
153 (100%)
100 (97.1%)
183 (83.2%)
247 (100%)
1 (2%)
11 (13.1%)
0 (0%)
3 (2.9%)
37 (16.8%)
22 (44%)
45 (53.6%)
52 (34%)
.013
36 (35%)
88 (40%)
69 (27.9%)
.022
28 (56%)
39 (46.4%)
101 (66%)
67 (65%)
132 (60%)
178 (72.1%)
54.8 ± 9.1
52.3 ± 10.9
59.4 ± 8.8
55.1 ± 9.4
52.4 ± 8.9
59.1 ± 8.7
154.2 ± 5.1
155.7 ± 5.4
152.6 ± 6.7
167.5 ± 5.7
168.7 ± 6.0
167.3 ± 6.4
.055
57.2 ± 10.3
57.4 ± 9.0
57.1 ± 9.1
.978
67.5 ± 8.4
68.8 ± 10.9
69.0 ± 10.6
.479
24.1 ± 4.3
23.6 ± 3.2
24.5 ± 3.5
.215
24.1 ± 2.6
24.1 ± 3.4
24.6 ± 3.4
.205
35 (70%)
60 (71.4%)
99 (64.7%)
.528
71 (68.9%)
149 (67.7%)
153 (61.9%)
.301
15 (30%)
24 (28.6%)
54 (35.3%)
32 (31.1%)
71 (32.3%)
94 (38.1%)
196.3 ± 52.7
180.7 ± 45.7
191.1 ± 53.1
.192
192.6 ± 54.3
184.1 ± 42.6
178.7 ± 44.6
.036
127.7 ± 39.5
111.0 ± 40.0
118.3 ± 41.8
.088
125.4 ± 47.1
118.9 ± 39.1
109.5 ± 39.2
40.1 ± 13.8
39.5 ± 11.2
38.5 ± 10.8
.627
38.4 ± 10.9
38.1 ± 10.9
37.4 ± 10.9
.655
112.5 ± 51.1
112.3 ± 87.2
126.3 ± 76.0
.316
138.0 ± 100.2
104.3 ± 65.5
144.3 ± 114.2
25 (50%)
54 (64.3%)
94 (61.4%)
.240
154 (70%)
155 (62.8%)
.219
30 (35.7%)
59 (38.6%)
66 (30%)
92 (37.2%)
19 (38%)
28 (33.3%)
36 (23.5%)
.084
43 (41.7%)
122 (55.5%)
108 (43.7%)
.016
31 (62%)
56 (66.7%)
117 (76.5%)
60 (58.3%)
98 (44.5%)
139 (56.3%)
8 (16%)
13 (15.5%)
28 (18.3%)
.184
34 (33%)
53 (24.1%)
68 (27.5%)
37 (74%)
57 (67.9%)
115 (75.2%)
13 (12.6%)
40 (18.2%)
70 (28.3%)
5 (10%)
14 (16.7%)
10 (6.5%)
56 (54.4%)
127 (57.7%)
109 (44.1%)
If there is no missing data, show the table summarizing missing numbers.
gaze(sex~.,data=acs,missing=TRUE) %>% myft() There is no missing data in column 'sex'
N
stats
n
857
63.3 ± 11.7
805 (93.9%)
805
52 (6.1%)
52
312 (36.4%)
312
545 (63.6%)
545
153 (17.9%)
153
304 (35.5%)
304
400 (46.7%)
400
723
55.8 ± 9.6
764
163.2 ± 9.1
766
64.8 ± 11.4
24.3 ± 3.3
567 (66.2%)
567
290 (33.8%)
290
834
185.2 ± 47.8
833
116.6 ± 41.1
38.2 ± 11.1
842
125.2 ± 90.9
553 (64.5%)
553
356 (41.5%)
356
501 (58.5%)
501
204 (23.8%)
204
332 (38.7%)
332
321 (37.5%)
321
x=autoReg(fit,uni=TRUE,threshold=1) x %>% myft()
Dependent: Surv(time, status != 2)
all
HR (univariable)
HR (multivariable)
52.5 ± 16.7
1.03 (1.01-1.05, p<.001)
1.02 (1.01-1.04, p=.005)
sex
126 (61.5%)
79 (38.5%)
1.93 (1.21-3.07, p=.006)
1.51 (0.94-2.42, p=.085)
thickness
2.9 ± 3.0
1.16 (1.10-1.23, p<.001)
1.10 (1.03-1.18, p=.004)
ulcer
Absent
115 (56.1%)
Present
90 (43.9%)
3.52 (2.14-5.80, p<.001)
2.59 (1.53-4.38, p<.001)
n=205, events=71, Likelihood ratio test=47.89 on 4 df(p<.001)
Site built with pkgdown 2.0.5.
Site built with pkgdown 2.0.6.