Está en la página 1de 5

a) Directamente relacionados

b) Directamente relacionados

c) Inmediatamente relacionados
Independiente - metadona dosis

Dependiente - QTc
> # Ejemplo de datos
> y<- c(600, 625, 560, 585, 590, 500, 700, 570, 540, 785, 765, 611, 600,
625,650, 635, 522)
> x<- c(1000, 550, 97, 90, 85, 126, 300, 110, 65, 650, 600, 660, 270, 680
, 540, 600, 330)
> # Ajustar un modelo de regresión lineal
> modelo <- lm(y ~ x)
> # Imprimir los coeficientes del modelo
> print(coef(modelo))
(Intercept) x
559.9028013 0.1398863
> # Graficar los datos
> plot(x, y)
> # Añadir la línea de regresión
> abline(modelo, col = "red")
> summary(modelo)

Call:
lm(formula = y ~ x)

Residuals:
Min 1Q Median 3Q Max
-99.789 -30.026 -8.835 14.559 134.171

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 559.90280 29.12926 19.221 5.61e-12 ***
x 0.13989 0.06033 2.319 0.0349 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 68.28 on 15 degrees of freedom
Multiple R-squared: 0.2639, Adjusted R-squared: 0.2148
F-statistic: 5.377 on 1 and 15 DF, p-value: 0.03493

Independiente Cmax with water

Dependiente- change in Cmax with GFJ


> # Ejemplo de datos
> x<- c(2.34, 2.46, 1.87, 3.09, 5.59, 4.05, 6.21, 2.34)
> y<- c(29.5, 40.7, 5.3, 23.3, -45.1, -35.3, -44.6, 29.5)
> # Ajustar un modelo de regresión lineal
> modelo <- lm(y ~ x)
> # Imprimir los coeficientes del modelo
> print(coef(modelo))
(Intercept) x
68.64231 -19.52911
> # Graficar los datos
> plot(x, y)
> # Añadir la línea de regresión
> abline(modelo, col = "red")
> summary(modelo)

Call:
lm(formula = y ~ x)

Residuals:
Min 1Q Median 3Q Max
-26.823 -9.643 6.556 9.776 20.099

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 68.642 16.678 4.116 0.00625 **
x -19.529 4.375 -4.464 0.00427 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 18.87 on 6 degrees of freedom


Multiple R-squared: 0.7686, Adjusted R-squared: 0.73
F-statistic: 19.93 on 1 and 6 DF, p-value: 0.004265
> # Ejemplo de datos
> x<- c(18, 21, 21, 23, 27, 27, 30, 32, 32, 32, 36, 37, 41, 42, 42, 43, 4
3, 48, 48, 51, 55, 58, 60,62, 67, 68, 88)
> y<- c(0.231, 0.265, 0.446, 0.203, 0.369, 0.568, 0.382, 0.383, 0.274, 0.
424, 0.308, 0.498, 0.398, 0.485, 0.427, 0.562, 0.463, 0.549, 0.538, 0.571
, 0.546, 0.402, 0.592, 0.541, 0.568, 0.8, 0.667)
>
> # Ajustar un modelo de regresión lineal
> modelo <- lm(y ~ x)
>
> # Imprimir los coeficientes del modelo
> print(coef(modelo))
(Intercept) x
0.19609565 0.00621998
> # Graficar los datos
> plot(x, y)
> # Añadir la línea de regresión
> abline(modelo, col = "red")
> summary(modelo)

Call:
lm(formula = y ~ x)

Residuals:
Min 1Q Median 3Q Max
-0.154855 -0.057415 -0.000555 0.048845 0.203965

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.196096 0.048135 4.074 0.00041 ***
x 0.006220 0.001051 5.918 3.55e-06 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.09092 on 25 degrees of freedom


Multiple R-squared: 0.5835, Adjusted R-squared: 0.5669
F-statistic: 35.03 on 1 and 25 DF, p-value: 3.546e-06

También podría gustarte