Produce table for descriptive statistics by groups for several variables easily. Depending on the nature of these variables, different descriptive statistical methods were used(t-test, ANOVA, Kruskal-Wallis, chi-squared, Fisher's,...)
Usage
gaze(x, ...)
# S3 method for formula
gaze(x, ...)
# S3 method for data.frame
gaze(x, ...)
# S3 method for coxph
gaze(x, ...)
# S3 method for survreg
gaze(x, ...)
# S3 method for glm
gaze(x, ...)
# S3 method for lm
gaze(x, ...)
# S3 method for tidycrr
gaze(x, ...)
Arguments
- x
An R object, formula or data.frame
- ...
arguments to be passed to gaze.data.frame or gaze.formula
Value
An object of class "gaze" which inherits from the class "data.frame" with at least the following attributes:
- attr(*,"yvars)
character. name of dependent variable
Methods (by class)
gaze(formula)
: S3 method for formulagaze(data.frame)
: default S3 methodgaze(coxph)
: default S3 methodgaze(survreg)
: default S3 methodgaze(glm)
: default S3 methodgaze(lm)
: default S3 methodgaze(tidycrr)
: default S3 method
Examples
library(moonBook)
library(dplyr)
gaze(acs)
#> —————————————————————————————————————————————————
#> name levels stats
#> —————————————————————————————————————————————————
#> age Mean ± SD 63.3 ± 11.7
#> sex Female 287 (33.5%)
#> Male 570 (66.5%)
#> cardiogenicShock No 805 (93.9%)
#> Yes 52 (6.1%)
#> entry Femoral 312 (36.4%)
#> Radial 545 (63.6%)
#> Dx NSTEMI 153 (17.9%)
#> STEMI 304 (35.5%)
#> Unstable Angina 400 (46.7%)
#> EF Mean ± SD 55.8 ± 9.6
#> height Mean ± SD 163.2 ± 9.1
#> weight Mean ± SD 64.8 ± 11.4
#> BMI Mean ± SD 24.3 ± 3.3
#> obesity No 567 (66.2%)
#> Yes 290 (33.8%)
#> TC Mean ± SD 185.2 ± 47.8
#> LDLC Mean ± SD 116.6 ± 41.1
#> HDLC Mean ± SD 38.2 ± 11.1
#> TG Mean ± SD 125.2 ± 90.9
#> DM No 553 (64.5%)
#> Yes 304 (35.5%)
#> HBP No 356 (41.5%)
#> Yes 501 (58.5%)
#> smoking Ex-smoker 204 (23.8%)
#> Never 332 (38.7%)
#> Smoker 321 (37.5%)
#> —————————————————————————————————————————————————
gaze(~age+sex,data=acs)
#> ——————————————————————————————
#> name levels stats
#> ——————————————————————————————
#> age Mean ± SD 63.3 ± 11.7
#> sex Female 287 (33.5%)
#> Male 570 (66.5%)
#> ——————————————————————————————
gaze(sex~.,data=acs,digits=1,method=1,show.p=TRUE) %>% myft()
name
levels
Female (N=287)
Male (N=570)
p
age
Mean ± SD
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
Mean ± SD
56.3 ± 10.1
55.6 ± 9.4
.387
height
Mean ± SD
153.8 ± 6.2
167.9 ± 6.1
<.001
weight
Mean ± SD
57.2 ± 9.3
68.7 ± 10.3
<.001
BMI
Mean ± SD
24.2 ± 3.6
24.3 ± 3.2
.611
obesity
No
194 (67.6%)
373 (65.4%)
.580
Yes
93 (32.4%)
197 (34.6%)
TC
Mean ± SD
188.9 ± 51.1
183.3 ± 45.9
.124
LDLC
Mean ± SD
117.8 ± 41.2
116.0 ± 41.1
.561
HDLC
Mean ± SD
39.0 ± 11.5
37.8 ± 10.9
.145
TG
Mean ± SD
119.9 ± 76.2
127.9 ± 97.3
.195
DM
No
173 (60.3%)
380 (66.7%)
.077
Yes
114 (39.7%)
190 (33.3%)
HBP
No
83 (28.9%)
273 (47.9%)
<.001
Yes
204 (71.1%)
297 (52.1%)
smoking
Ex-smoker
49 (17.1%)
155 (27.2%)
<.001
Never
209 (72.8%)
123 (21.6%)
Smoker
29 (10.1%)
292 (51.2%)
# \donttest{
gaze(sex~age+Dx,data=acs)
#> —————————————————————————————————————————————————————————————————————
#> Dependent:sex levels Female Male p
#> (N) (N=287) (N=570)
#> —————————————————————————————————————————————————————————————————————
#> age Mean ± SD 68.7 ± 10.7 60.6 ± 11.2 <.001
#> Dx NSTEMI 50 (17.4%) 103 (18.1%) .012
#> STEMI 84 (29.3%) 220 (38.6%)
#> Unstable Angina 153 (53.3%) 247 (43.3%)
#> —————————————————————————————————————————————————————————————————————
gaze(EF~.,data=acs) %>% myft()
name
levels
unit
value
age
[28,91]
Mean ± SD
63.3 ± 11.7
sex
Female (N=287)
Mean ± SD
56.3 ± 10.1
Male (N=570)
Mean ± SD
55.6 ± 9.4
cardiogenicShock
No (N=805)
Mean ± SD
56.1 ± 9.4
Yes (N=52)
Mean ± SD
50.2 ± 11.6
entry
Femoral (N=312)
Mean ± SD
54.5 ± 10.6
Radial (N=545)
Mean ± SD
56.6 ± 8.9
Dx
NSTEMI (N=153)
Mean ± SD
55.0 ± 9.3
STEMI (N=304)
Mean ± SD
52.4 ± 9.5
Unstable Angina (N=400)
Mean ± SD
59.2 ± 8.7
height
[130,185]
Mean ± SD
163.2 ± 9.1
weight
[30,112]
Mean ± SD
64.8 ± 11.4
BMI
[15.6,41.4]
Mean ± SD
24.3 ± 3.3
obesity
No (N=567)
Mean ± SD
55.2 ± 9.8
Yes (N=290)
Mean ± SD
57.0 ± 9.2
TC
[25,493]
Mean ± SD
185.2 ± 47.8
LDLC
[15,366]
Mean ± SD
116.6 ± 41.1
HDLC
[4,89]
Mean ± SD
38.2 ± 11.1
TG
[11,877]
Mean ± SD
125.2 ± 90.9
DM
No (N=553)
Mean ± SD
56.4 ± 8.9
Yes (N=304)
Mean ± SD
54.9 ± 10.7
HBP
No (N=356)
Mean ± SD
56.0 ± 9.6
Yes (N=501)
Mean ± SD
55.7 ± 9.7
smoking
Ex-smoker (N=204)
Mean ± SD
55.7 ± 9.1
Never (N=332)
Mean ± SD
56.0 ± 10.2
Smoker (N=321)
Mean ± SD
55.7 ± 9.4
gaze(sex+Dx~.,data=acs,show.p=TRUE) %>% myft()
sex (N)
Female (N=287)
Male (N=570)
name
levels
NSTEMI (N=50)
STEMI (N=84)
Unstable Angina (N=153)
p
NSTEMI (N=103)
STEMI (N=220)
Unstable Angina (N=247)
p
age
Mean ± SD
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
cardiogenicShock
No
49 (98%)
73 (86.9%)
153 (100%)
<.001
100 (97.1%)
183 (83.2%)
247 (100%)
<.001
Yes
1 (2%)
11 (13.1%)
0 (0%)
3 (2.9%)
37 (16.8%)
0 (0%)
entry
Femoral
22 (44%)
45 (53.6%)
52 (34%)
.013
36 (35%)
88 (40%)
69 (27.9%)
.022
Radial
28 (56%)
39 (46.4%)
101 (66%)
67 (65%)
132 (60%)
178 (72.1%)
EF
Mean ± SD
54.8 ± 9.1
52.3 ± 10.9
59.4 ± 8.8
<.001
55.1 ± 9.4
52.4 ± 8.9
59.1 ± 8.7
<.001
height
Mean ± SD
154.2 ± 5.1
155.7 ± 5.4
152.6 ± 6.7
.002
167.5 ± 5.7
168.7 ± 6.0
167.3 ± 6.4
.055
weight
Mean ± SD
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
BMI
Mean ± SD
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
obesity
No
35 (70%)
60 (71.4%)
99 (64.7%)
.528
71 (68.9%)
149 (67.7%)
153 (61.9%)
.301
Yes
15 (30%)
24 (28.6%)
54 (35.3%)
32 (31.1%)
71 (32.3%)
94 (38.1%)
TC
Mean ± SD
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
LDLC
Mean ± SD
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
.002
HDLC
Mean ± SD
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
TG
Mean ± SD
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
<.001
DM
No
25 (50%)
54 (64.3%)
94 (61.4%)
.240
71 (68.9%)
154 (70%)
155 (62.8%)
.219
Yes
25 (50%)
30 (35.7%)
59 (38.6%)
32 (31.1%)
66 (30%)
92 (37.2%)
HBP
No
19 (38%)
28 (33.3%)
36 (23.5%)
.084
43 (41.7%)
122 (55.5%)
108 (43.7%)
.016
Yes
31 (62%)
56 (66.7%)
117 (76.5%)
60 (58.3%)
98 (44.5%)
139 (56.3%)
smoking
Ex-smoker
8 (16%)
13 (15.5%)
28 (18.3%)
.184
34 (33%)
53 (24.1%)
68 (27.5%)
.002
Never
37 (74%)
57 (67.9%)
115 (75.2%)
13 (12.6%)
40 (18.2%)
70 (28.3%)
Smoker
5 (10%)
14 (16.7%)
10 (6.5%)
56 (54.4%)
127 (57.7%)
109 (44.1%)
gaze(sex+Dx~.,data=acs)
#> —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
#> sex (N) Female (N=287) Male (N=570)
#> —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
#> Dependent:Dx levels NSTEMI STEMI Unstable Angina p NSTEMI STEMI Unstable Angina p
#> (N) (N=50) (N=84) (N=153) (N=103) (N=220) (N=247)
#> —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
#> age Mean ± SD 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
#> cardiogenicShock No 49 (98%) 73 (86.9%) 153 (100%) <.001 100 (97.1%) 183 (83.2%) 247 (100%) <.001
#> Yes 1 (2%) 11 (13.1%) 0 (0%) 3 (2.9%) 37 (16.8%) 0 (0%)
#> entry Femoral 22 (44%) 45 (53.6%) 52 (34%) .013 36 (35%) 88 (40%) 69 (27.9%) .022
#> Radial 28 (56%) 39 (46.4%) 101 (66%) 67 (65%) 132 (60%) 178 (72.1%)
#> EF Mean ± SD 54.8 ± 9.1 52.3 ± 10.9 59.4 ± 8.8 <.001 55.1 ± 9.4 52.4 ± 8.9 59.1 ± 8.7 <.001
#> height Mean ± SD 154.2 ± 5.1 155.7 ± 5.4 152.6 ± 6.7 .002 167.5 ± 5.7 168.7 ± 6.0 167.3 ± 6.4 .055
#> weight Mean ± SD 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
#> BMI Mean ± SD 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
#> obesity No 35 (70%) 60 (71.4%) 99 (64.7%) .528 71 (68.9%) 149 (67.7%) 153 (61.9%) .301
#> Yes 15 (30%) 24 (28.6%) 54 (35.3%) 32 (31.1%) 71 (32.3%) 94 (38.1%)
#> TC Mean ± SD 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
#> LDLC Mean ± SD 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 .002
#> HDLC Mean ± SD 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
#> TG Mean ± SD 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 <.001
#> DM No 25 (50%) 54 (64.3%) 94 (61.4%) .240 71 (68.9%) 154 (70%) 155 (62.8%) .219
#> Yes 25 (50%) 30 (35.7%) 59 (38.6%) 32 (31.1%) 66 (30%) 92 (37.2%)
#> HBP No 19 (38%) 28 (33.3%) 36 (23.5%) .084 43 (41.7%) 122 (55.5%) 108 (43.7%) .016
#> Yes 31 (62%) 56 (66.7%) 117 (76.5%) 60 (58.3%) 98 (44.5%) 139 (56.3%)
#> smoking Ex-smoker 8 (16%) 13 (15.5%) 28 (18.3%) .184 34 (33%) 53 (24.1%) 68 (27.5%) .002
#> Never 37 (74%) 57 (67.9%) 115 (75.2%) 13 (12.6%) 40 (18.2%) 70 (28.3%)
#> Smoker 5 (10%) 14 (16.7%) 10 (6.5%) 56 (54.4%) 127 (57.7%) 109 (44.1%)
#> —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
gaze(Dx+sex~cardiogenicShock,data=acs,show.p=TRUE) %>% myft()
Dx (N)
NSTEMI (N=153)
STEMI (N=304)
Unstable Angina (N=400)
name
levels
Female (N=50)
Male (N=103)
p
Female (N=84)
Male (N=220)
p
Female (N=153)
Male (N=247)
p
cardiogenicShock
No
49 (98%)
100 (97.1%)
1.000
73 (86.9%)
183 (83.2%)
.535
153 (100%)
247 (100%)
1.000
Yes
1 (2%)
3 (2.9%)
11 (13.1%)
37 (16.8%)
0 (0%)
0 (0%)
gaze(Dx+sex+HBP~cardiogenicShock,data=acs,show.p=TRUE)
#> ———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
#> Dx NSTEMI NSTEMI STEMI STEMI Unstable Angina Unstable Angina
#> sex Female Male Female Male Female Male
#> (N) (N=50) (N=103) (N=84) (N=220) (N=153) (N=247)
#> ———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
#> Dependent:HBP levels No Yes p No Yes p No Yes p No Yes p No Yes p No Yes p
#> (N) (N=19) (N=31) (N=43) (N=60) (N=28) (N=56) (N=122) (N=98) (N=36) (N=117) (N=108) (N=139)
#> ———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
#> cardiogenicShock No 19 (100%) 30 (96.8%) 1.000 42 (97.7%) 58 (96.7%) 1.000 23 (82.1%) 50 (89.3%) .567 106 (86.9%) 77 (78.6%) .145 36 (100%) 117 (100%) 1.000 108 (100%) 139 (100%) 1.000
#> Yes 0 (0%) 1 (3.2%) 1 (2.3%) 2 (3.3%) 5 (17.9%) 6 (10.7%) 16 (13.1%) 21 (21.4%) 0 (0%) 0 (0%) 0 (0%) 0 (0%)
#> ———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
gaze(~mpg+cyl,data=mtcars)
#> —————————————————————————————
#> name levels stats
#> —————————————————————————————
#> mpg Mean ± SD 20.1 ± 6.0
#> cyl Mean ± SD 6.2 ± 1.8
#> —————————————————————————————
gaze(~.,data=mtcars)
#> ————————————————————————————————
#> name levels stats
#> ————————————————————————————————
#> mpg Mean ± SD 20.1 ± 6.0
#> cyl Mean ± SD 6.2 ± 1.8
#> disp Mean ± SD 230.7 ± 123.9
#> hp Mean ± SD 146.7 ± 68.6
#> drat Mean ± SD 3.6 ± 0.5
#> wt Mean ± SD 3.2 ± 1.0
#> qsec Mean ± SD 17.8 ± 1.8
#> vs Mean ± SD 0.4 ± 0.5
#> am Mean ± SD 0.4 ± 0.5
#> gear Mean ± SD 3.7 ± 0.7
#> carb Mean ± SD 2.8 ± 1.6
#> ————————————————————————————————
gaze(cyl~.,data=mtcars,show.p=TRUE)
#> ———————————————————————————————————————————————————————————————————————————
#> Dependent:cyl levels 4 6 8 p
#> (N) (N=11) (N=7) (N=14)
#> ———————————————————————————————————————————————————————————————————————————
#> mpg Mean ± SD 26.7 ± 4.5 19.7 ± 1.5 15.1 ± 2.6 <.001
#> disp Mean ± SD 105.1 ± 26.9 183.3 ± 41.6 353.1 ± 67.8 <.001
#> hp Mean ± SD 82.6 ± 20.9 122.3 ± 24.3 209.2 ± 51.0 <.001
#> drat Mean ± SD 4.1 ± 0.4 3.6 ± 0.5 3.2 ± 0.4 <.001
#> wt Mean ± SD 2.3 ± 0.6 3.1 ± 0.4 4.0 ± 0.8 <.001
#> qsec Mean ± SD 19.1 ± 1.7 18.0 ± 1.7 16.8 ± 1.2 .002
#> vs Mean ± SD 0.9 ± 0.3 0.6 ± 0.5 0.0 ± 0.0 <.001
#> am Mean ± SD 0.7 ± 0.5 0.4 ± 0.5 0.1 ± 0.4 .010
#> gear Mean ± SD 4.1 ± 0.5 3.9 ± 0.7 3.3 ± 0.7 .015
#> carb Mean ± SD 1.5 ± 0.5 3.4 ± 1.8 3.5 ± 1.6 .003
#> ———————————————————————————————————————————————————————————————————————————
gaze(hp~.,data=mtcars)
#> —————————————————————————————————————————————————————
#> Dependent:hp levels unit value
#> —————————————————————————————————————————————————————
#> mpg [10.4,33.9] Mean ± SD 20.1 ± 6.0
#> cyl [4,8] Mean ± SD 6.2 ± 1.8
#> disp [71.1,472] Mean ± SD 230.7 ± 123.9
#> drat [2.8,4.9] Mean ± SD 3.6 ± 0.5
#> wt [1.5,5.4] Mean ± SD 3.2 ± 1.0
#> qsec [14.5,22.9] Mean ± SD 17.8 ± 1.8
#> vs [0,1] Mean ± SD 0.4 ± 0.5
#> am [0,1] Mean ± SD 0.4 ± 0.5
#> gear [3,5] Mean ± SD 3.7 ± 0.7
#> carb [1,8] Mean ± SD 2.8 ± 1.6
#> —————————————————————————————————————————————————————
gaze(cyl+am~.,data=mtcars)
#> ———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
#> cyl (N) 4 (N=11) 6 (N=7) 8 (N=14)
#> ———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
#> Dependent:am levels 0 1 p 0 1 p 0 1 p
#> (N) (N=3) (N=8) (N=4) (N=3) (N=12) (N=2)
#> ———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
#> mpg Mean ± SD 22.9 ± 1.5 28.1 ± 4.5 .089 19.1 ± 1.6 20.6 ± 0.8 .221 15.1 ± 2.8 15.4 ± 0.6 .866
#> disp Mean ± SD 135.9 ± 14.0 93.6 ± 20.5 .010 204.6 ± 44.7 155.0 ± 8.7 .124 357.6 ± 71.8 326.0 ± 35.4 .563
#> hp Mean ± SD 84.7 ± 19.7 81.9 ± 22.7 .856 115.2 ± 9.2 131.7 ± 37.5 .530 194.2 ± 33.4 299.5 ± 50.2 .002
#> drat Mean ± SD 3.8 ± 0.1 4.2 ± 0.4 .094 3.4 ± 0.6 3.8 ± 0.2 .330 3.1 ± 0.2 3.9 ± 0.5 .002
#> wt Mean ± SD 2.9 ± 0.4 2.0 ± 0.4 .010 3.4 ± 0.1 2.8 ± 0.1 .001 4.1 ± 0.8 3.4 ± 0.3 .218
#> qsec Mean ± SD 21.0 ± 1.7 18.4 ± 1.1 .017 19.2 ± 0.8 16.3 ± 0.8 .005 17.1 ± 0.8 14.6 ± 0.1 <.001
#> vs Mean ± SD 1.0 ± 0.0 0.9 ± 0.4 .351 1.0 ± 0.0 0.0 ± 0.0 0.0 ± 0.0 0.0 ± 0.0
#> gear Mean ± SD 3.7 ± 0.6 4.2 ± 0.5 .113 3.5 ± 0.6 4.3 ± 0.6 .117 3.0 ± 0.0 5.0 ± 0.0
#> carb Mean ± SD 1.7 ± 0.6 1.5 ± 0.5 .662 2.5 ± 1.7 4.7 ± 1.2 .122 3.1 ± 0.9 6.0 ± 2.8 .379
#> ———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
# }
library(survival)
x=coxph(Surv(time,status) ~rx,data=anderson1)
gaze(x)
#> ———————————————————————————————————————————————————————————————————
#> coef se(coef) z Pr(>|z|) HR lower upper
#> ———————————————————————————————————————————————————————————————————
#> rxControl 1.572 0.412 3.812 <.001 4.817 2.147 10.809
#> ———————————————————————————————————————————————————————————————————
#> n=42, events=30, Likelihood ratio test=16.35 on 1 df (p<.001)
x=coxph(Surv(time,status) ~rx*logWBC,data=anderson1)
gaze(x)
#> ——————————————————————————————————————————————————————————————————————————————
#> coef se(coef) z Pr(>|z|) HR lower upper
#> ——————————————————————————————————————————————————————————————————————————————
#> rxControl 2.375 1.705 1.393 .164 10.750 0.380 304.162
#> logWBC 1.872 0.451 4.148 <.001 6.504 2.685 15.755
#> rxControl:logWBC -0.318 0.526 -0.604 .546 0.728 0.260 2.040
#> ——————————————————————————————————————————————————————————————————————————————
#> n=42, events=30, Likelihood ratio test=47.07 on 3 df (p<.001)
library(survival)
x=survreg(Surv(time, status) ~ rx, data=anderson,dist="exponential")
gaze(x)
#> ——————————————————————————————————————————————————————————————————————————————————————————————
#> Value Std. Error z p ETR LB UB HR lower upper
#> ——————————————————————————————————————————————————————————————————————————————————————————————
#> (Intercept) 3.686 0.333 11.058 <.001 39.889 20.755 76.663 0.025 0.013 0.048
#> rx -1.527 0.398 -3.832 <.001 0.217 0.100 0.474 4.603 2.108 10.049
#> ——————————————————————————————————————————————————————————————————————————————————————————————
#> Exponential distribution
#> Loglik(model)= -108.5 Loglik(intercept only)= -116.8
#> Chisq= 16.49 on 1 degrees of freedom, p= 4.9e-05
#> n= 42
#>
x=survreg(Surv(time, status) ~ ph.ecog + age + sex, lung)
gaze(x)
#> —————————————————————————————————————————————————————————————————————————————————————————————————
#> Value Std. Error z p ETR LB UB HR lower upper
#> —————————————————————————————————————————————————————————————————————————————————————————————————
#> (Intercept) 6.273 0.454 13.831 <.001 530.296 217.988 1290.044 0.000 0.000 0.001
#> ph.ecog -0.340 0.083 -4.069 <.001 0.712 0.605 0.839 1.591 1.272 1.990
#> age -0.007 0.007 -1.105 .269 0.993 0.979 1.006 1.010 0.992 1.029
#> sex 0.401 0.124 3.242 .001 1.493 1.172 1.903 0.578 0.415 0.805
#> Log(scale) -0.313 0.061 -5.105 <.001 0.731 1.535
#> —————————————————————————————————————————————————————————————————————————————————————————————————
#> Weibull distribution
#> Loglik(model)= -1132.4 Loglik(intercept only)= -1147.4
#> Chisq= 29.98 on 3 degrees of freedom, p= 1.39e-06
#> n=227 (1 observation deleted due to missingness)
#>
data(cancer,package="survival")
fit=glm(status~rx+sex+age+obstruct+nodes,data=colon,family="binomial")
gaze(fit)
#> ———————————————————————————————————————————————————————————————————————————
#> Estimate Std. Error z value Pr(>|z|) OR lower upper
#> ———————————————————————————————————————————————————————————————————————————
#> (Intercept) -0.641 0.285 -2.247 .025 0.527 0.301 0.921
#> rxLev -0.067 0.119 -0.560 .576 0.936 0.741 1.181
#> rxLev+5FU -0.627 0.122 -5.153 <.001 0.534 0.421 0.678
#> sex -0.054 0.099 -0.541 .588 0.948 0.781 1.151
#> age 0.002 0.004 0.550 .583 1.002 0.994 1.011
#> obstruct 0.296 0.125 2.370 .018 1.344 1.052 1.716
#> nodes 0.191 0.018 10.457 <.001 1.210 1.168 1.255
#> ———————————————————————————————————————————————————————————————————————————
#> Null deviance: 2525.4(df: 1821), Residual deviance: 2343.6(df: 1815) AIC:2357.6
#> (36 observations deleted due to missingness)
#> Number of Fisher Scoring iterations: 4
fit=lm(mpg~wt*hp+am+I(wt^2),data=mtcars)
gaze(fit)
#> ———————————————————————————————————————————————————————————————————————
#> Estimate Std. Error t value Pr(>|t|) lower upper
#> ———————————————————————————————————————————————————————————————————————
#> (Intercept) 49.262 5.523 8.920 <.001 37.910 60.614
#> wt -7.674 3.341 -2.297 .030 -14.542 -0.807
#> hp -0.127 0.059 -2.164 .040 -0.248 -0.006
#> am 0.167 1.385 0.120 .905 -2.681 3.015
#> I(wt^2) -0.108 0.712 -0.152 .880 -1.572 1.356
#> wt:hp 0.030 0.017 1.705 .100 -0.006 0.066
#> ———————————————————————————————————————————————————————————————————————
#> Residual SE: 2.233 on 26 DF, Multiple R^2: 0.8849, Adjusted R^2: 0.8628
#> F-statistic: 39.98 on 5 and 26 DF, p-value: 2.124e-11
data(melanoma,package="boot")
melanoma$status_crr=ifelse(melanoma$status==1,1,ifelse(melanoma$status==2,0,2))
fit=crrFormula(time+status_crr~age+sex+thickness+ulcer,data=melanoma)
gaze(fit)
#> ———————————————————————————————————————————————————————————————
#> coef se(coef) z p HR lower upper
#> ———————————————————————————————————————————————————————————————
#> age 0.006 0.009 0.638 .520 1.006 0.988 1.024
#> sex 0.405 0.276 1.470 .140 1.499 0.874 2.573
#> thickness 0.090 0.038 2.346 .019 1.094 1.015 1.180
#> ulcer 1.129 0.303 3.719 <.001 3.091 1.706 5.603
#> ———————————————————————————————————————————————————————————————