primera versión de un scatter de IMC vs algunos químicos

parent 2e9e4352
......@@ -51,6 +51,29 @@ def popdist(datos):
)
return fig
def popcorr(datos):
medidas = [ "glucose", "hba1c", "ct", "hdl", "insuline"]
# removemos outliers
fig = make_subplots(rows=2, cols=3, shared_yaxes=False, subplot_titles=medidas)
lcol = 1
lrow = 1
for medida in medidas:
datosfil = datos[np.abs(stats.zscore(datos[medida], nan_policy='omit')) < 3]
fig.add_trace(
go.Scatter(x=datosfil["imc"], y=datosfil[medida], name=medida, mode="markers"),
row=lrow, col=lcol
)
lrow = lrow + (lcol // 3)
lcol = lcol + 1 if lcol < 3 else 1
fig.update_layout(
bargap=0.05, # gap between bars of adjacent location coordinates
bargroupgap=0.05, # gap between bars of the same location coordinates
showlegend = False
)
return fig
def correlaciones(datos, controlado):
......@@ -445,6 +468,12 @@ app.layout = html.Div(children=[
html.Div(children= [ html.H1("Distribuciones de la población", className= "header-title2"),], ),
dcc.Graph(figure=popdist(visitas_incluidos))
]),
# correlaciones entre indices de la poblacion
html.Div(children=[
html.Div(children= [ html.H1("Correlaciones entre medidas", className= "header-title2"),], ),
dcc.Graph(figure=popcorr(visitas_incluidos))
]),
# ppgr a controlados
html.Div(children= [
html.Div(children= [html.H1("iAUC/Controlados ", className = "header-title2")]),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment