-
Notifications
You must be signed in to change notification settings - Fork 1
/
openapi.yaml
170 lines (163 loc) · 6 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
openapi: 3.0.1
info:
title: RestRserve OpenAPI
version: '1.0'
servers:
- url: /
tags:
- name: version
description: Information about R packages
- name: data
description: Retrieve example datasets or upload own dataset
- name: imputation
description: Impute missing data
- name: fit
description: Some predifined fits (optional)
- name: pool
description: Pool results of a fit given its summary table. Depending on mice 3.16.4 or higher.
paths:
/version:
get:
tags:
- version
description: Software version
responses:
200:
description: API response
content:
text/json:
schema:
type: string
example: {"success":[true],"error":[""],"result":["3.16.4"]}
/exampledata:
get:
tags:
- data
description: Retrieve exmple datasets (nhanes, nhanes2)
parameters:
- name: "name"
description: "Example Dataset name (nhanes or nhanes2), or full path of the csv file"
in: query
schema:
type: string
example: "nhanes"
required: true
responses:
200:
description: API response
content:
text/json:
schema:
type: string
example: {"success":[true],"result":[{"age":1},{"age":2,"bmi":22.7,"hyp":1,"chl":187},
{"age":1,"hyp":1,"chl":187},{"age":3},
{"age":2,"bmi":27.4,"hyp":1,"chl":186}],"error":[""]}
/data:
post:
tags:
- data
summary: Uploads a csv - file
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
csvfile:
type: string
format: binary
responses:
200:
description: API response
content:
text/plain:
schema:
type: string
/long:
get:
tags:
- imputation
description: Run mice imputation on a datasets (nhanes, nhanes2) or an own csv file.
parameters:
- name: "payload"
description: "Json with keys \"data\", \"maxit\", \"m\", \"seed\",
\"predictorMatrix\" (optional), \"blocks\" (optional), \"ignore\" (optional),
\"where\" (optional), \"visitSeq\" (optional), \"method\" (optional),
\"formula\" (optional), \"dots\" (optional)"
in: query
schema:
type: string
example: "{\"data\":\"nhanes\",\"maxit\":2,\"m\":2,\"seed\":1}"
required: true
responses:
200:
description: API response
content:
text/json:
schema:
type: string
example: {"result":[{"age":1,"bmi":30.1,"hyp":1,"chl":187,".imp":1,".id":"1"},
{"age":2,"bmi":22.7,"hyp":1,"chl":187,".imp":1,".id":"2"},
{"age":1,"bmi":27.5,"hyp":1,"chl":131,".imp":2,".id":"23"},
{"age":3," bmi":24.9,"hyp":1,"chl":218,".imp":2,".id":"24"},
{"age":2,"bmi":27.4,"hyp":1,"chl":186,".imp":2,".id":"25"}],
"error":[""],"success":[true]}
/fit:
get:
tags:
- fit
description: Fit a model.
parameters:
- name: "payload"
description: "data: JSON of mice::complete output, model: lm, formula chl ~ age + bmi"
in: query
schema:
type: string
example: "{\"data\": [{\".imp\":1,\".id\":1,\"age\":1,\"bmi\":30.1,\"hyp\":1,\"chl\":187}],
\"model\":[\"lm\"], \"formula\":[\"chl ~ age + bmi\"]}"
required: true
responses:
200:
description: API response
content:
text/json:
schema:
type: string
example: {"result":{"call":{},"terms":{},"residuals":[0],
"coefficients":[[187,"NaN","NaN","NaN"]],"aliased":[false,true,true],
"sigma":["NaN"],"df":[1,0,3],"adj.r.squared":[0],"r.squared":[0],
"cov.unscaled":[[1]]},"error":[""],"success":[true]}
/pool:
get:
tags:
- pool
description: Pool the results of fitting a model to the imputed data.
Requires the summary(fit) table as json.
parameters:
- name: "payload"
description: "data: JSON of the summary(mice::fit) output"
in: query
schema:
type: string
example: "{\"data\": [{\"term\":\"(Intercept)\",\"estimate\":23.9357,\"std.error\":3.8732,
\"statistic\":6.1798,\"p.value\":3.2106e-06,\"nobs\":25,\"df.residual\":22},
{\"term\":\"hyp\",\"estimate\":1.1677,\"std.error\":1.6218,\"statistic\":0.72,
\"p.value\":0.4791,\"nobs\":25,\"df.residual\":22},{\"term\":\"chl\",\"estimate\":0.0063,
\"std.error\":0.0185,\"statistic\":0.3385,\"p.value\":0.7382,\"nobs\":25,\"df.residual\":22},
{\"term\":\"(Intercept)\",\"estimate\":24.5434,\"std.error\":4.7611,\"statistic\":5.155,
\"p.value\":0,\"nobs\":25,\"df.residual\":22},{\"term\":\"hyp\",\"estimate\":1.5843,
\"std.error\":2.236,\"statistic\":0.7086,\"p.value\":0.486,\"nobs\":25,\"df.residual\":22},
{\"term\":\"chl\",\"estimate\":-0.0032,\"std.error\":0.0205,\"statistic\":-0.1569,
\"p.value\":0.8768,\"nobs\":25,\"df.residual\":25}]}"
required: true
responses:
200:
description: API response
content:
text/json:
schema:
type: string
example: {"term":"(Intercept)","m":2,"estimate":24.2396,"std.error":4.3717,
"statistic":5.5446,"df":19.8636,"p.value":0,"conf.low":15.1163,
"conf.high":33.3628,"riv":0.0147,"lambda":0.0145,"fmi":0.1007,
"ubar":18.8351,"b":0.1846,"t":19.112,"dfcom":22}