This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
You can also embed plots, for example:
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.0 ✔ stringr 1.5.1
## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1
## ✔ lubridate 1.9.3 ✔ tidyr 1.3.1
## ✔ purrr 1.0.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(readxl)
library("ggplot2")
library(psych)
##
## Adjuntando el paquete: 'psych'
##
## The following objects are masked from 'package:ggplot2':
##
## %+%, alpha
library(tableone)
library(table1)
##
## Adjuntando el paquete: 'table1'
##
## The following objects are masked from 'package:base':
##
## units, units<-
library(dplyr)
options(scipen = 999, digits = 3, encoding = 'UTF-8')
library(descr)
library(expss)
## Cargando paquete requerido: maditr
##
## To select columns from data: columns(mtcars, mpg, vs:carb)
##
##
## Adjuntando el paquete: 'maditr'
##
## The following objects are masked from 'package:dplyr':
##
## between, coalesce, first, last
##
## The following object is masked from 'package:purrr':
##
## transpose
##
## The following object is masked from 'package:readr':
##
## cols
##
##
## Adjuntando el paquete: 'expss'
##
## The following objects are masked from 'package:stringr':
##
## fixed, regex
##
## The following objects are masked from 'package:dplyr':
##
## compute, contains, na_if, recode, vars, where
##
## The following objects are masked from 'package:purrr':
##
## keep, modify, modify_if, when
##
## The following objects are masked from 'package:tidyr':
##
## contains, nest
##
## The following object is masked from 'package:ggplot2':
##
## vars
library(DescTools)
##
## Adjuntando el paquete: 'DescTools'
##
## The following object is masked from 'package:maditr':
##
## %like%
##
## The following objects are masked from 'package:psych':
##
## AUC, ICC, SD
library(emmeans)
## Welcome to emmeans.
## Caution: You lose important information if you filter this package's results.
## See '? untidy'
library(summarytools)
##
## Adjuntando el paquete: 'summarytools'
##
## The following objects are masked from 'package:descr':
##
## descr, freq
##
## The following objects are masked from 'package:table1':
##
## label, label<-
##
## The following object is masked from 'package:tibble':
##
## view
library(data.table)
##
## Adjuntando el paquete: 'data.table'
##
## The following object is masked from 'package:DescTools':
##
## %like%
##
## The following objects are masked from 'package:expss':
##
## copy, like
##
## The following objects are masked from 'package:maditr':
##
## copy, dcast, let, melt
##
## The following objects are masked from 'package:lubridate':
##
## hour, isoweek, mday, minute, month, quarter, second, wday, week,
## yday, year
##
## The following objects are masked from 'package:dplyr':
##
## between, first, last
##
## The following object is masked from 'package:purrr':
##
## transpose
library(epiR)
## Cargando paquete requerido: survival
## Package epiR 2.0.77 is loaded
## Type help(epi.about) for summary information
## Type browseVignettes(package = 'epiR') to learn how to use epiR for applied epidemiological analyses
library(sjPlot)
## Learn more about sjPlot with 'browseVignettes("sjPlot")'.
library(survival)
library(survminer)
## Cargando paquete requerido: ggpubr
##
## Adjuntando el paquete: 'ggpubr'
##
## The following object is masked from 'package:expss':
##
## compare_means
##
##
## Adjuntando el paquete: 'survminer'
##
## The following object is masked from 'package:survival':
##
## myeloma
library(pwr)
library(ggpubr)
library(lmtest)
## Warning: package 'lmtest' was built under R version 4.4.3
## Cargando paquete requerido: zoo
##
## Adjuntando el paquete: 'zoo'
##
## The following objects are masked from 'package:data.table':
##
## yearmon, yearqtr
##
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
library("openxlsx")
## Warning: package 'openxlsx' was built under R version 4.4.3
library("car")
## Cargando paquete requerido: carData
##
## Adjuntando el paquete: 'car'
##
## The following object is masked from 'package:DescTools':
##
## Recode
##
## The following object is masked from 'package:expss':
##
## recode
##
## The following object is masked from 'package:psych':
##
## logit
##
## The following object is masked from 'package:dplyr':
##
## recode
##
## The following object is masked from 'package:purrr':
##
## some
library("lmtest")
library("MASS")
##
## Adjuntando el paquete: 'MASS'
##
## The following object is masked from 'package:dplyr':
##
## select
library(fastDummies)
## Warning: package 'fastDummies' was built under R version 4.4.3
data <- read_excel("C:/Users/Administrador/Downloads/data.xlsx")
Note that the echo = FALSE
parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.
#se ponen los nombres en minúscula, se crea la variable imc_cat que está categorizada según la consigna
names(data) <- tolower(names(data))
data <- data %>% mutate(across(c("genero", "estciv", "educ", "dbt", "hta", "hipercol", "tabaq"), as.factor))
data <- data %>% mutate(imc_cat = as.factor(case_when(
imc < 18.5 ~ "bajo_peso",
imc >= 18.5 & imc <25 ~ "peso_normal",
imc >= 25 & imc <30 ~ "sobrepeso",
imc >= 30 ~ "obesidad"
)))
levels(data$imc_cat)
## [1] "bajo_peso" "obesidad" "peso_normal" "sobrepeso"
#modificar el orden de los niveles
data$imc_cat <- relevel(data$imc_cat, ref = "peso_normal")
levels(data$imc_cat)
## [1] "peso_normal" "bajo_peso" "obesidad" "sobrepeso"
#Cración de Variables dummy con imc_cat
data <- na.omit(data)
#Construcción del modelo
#Modelo Vacío
vacio <- lm(pcr ~ 1, data = data)
#Modelo completo
#Usa imc como categoría variable dummy
completo_cat <- lm(pcr ~ genero + edad + estciv + educ + dbt + hta + hipercol + tabaq + imc_cat + hs_af, data = data)
#usa imc como variable continuar
completo_con <- lm(pcr ~ genero + edad + estciv + educ + dbt + hta + hipercol + tabaq + imc+ hs_af, data = data)
summary(completo_cat)
##
## Call:
## lm(formula = pcr ~ genero + edad + estciv + educ + dbt + hta +
## hipercol + tabaq + imc_cat + hs_af, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.2613 -0.4356 0.0241 0.4617 2.1630
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.40261 0.30986 7.75 0.00000000000013 ***
## genero1 0.32190 0.08233 3.91 0.00011 ***
## edad -0.00472 0.00507 -0.93 0.35303
## estciv1 -0.17403 0.08311 -2.09 0.03709 *
## educ2 -0.25438 0.08358 -3.04 0.00254 **
## dbt1 0.07704 0.10221 0.75 0.45158
## hta1 0.20108 0.09558 2.10 0.03622 *
## hipercol1 -0.21875 0.08629 -2.53 0.01175 *
## tabaq1 0.21242 0.10114 2.10 0.03653 *
## imc_catbajo_peso -0.07825 0.25513 -0.31 0.75927
## imc_catobesidad 0.61994 0.12018 5.16 0.00000044949992 ***
## imc_catsobrepeso 0.29420 0.09843 2.99 0.00303 **
## hs_af -0.04145 0.01641 -2.53 0.01207 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.716 on 305 degrees of freedom
## Multiple R-squared: 0.27, Adjusted R-squared: 0.242
## F-statistic: 9.42 on 12 and 305 DF, p-value: 0.00000000000000156
summary(completo_con)
##
## Call:
## lm(formula = pcr ~ genero + edad + estciv + educ + dbt + hta +
## hipercol + tabaq + imc + hs_af, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.2989 -0.4653 0.0181 0.4909 2.2856
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.72038 0.37197 4.63 0.0000055 ***
## genero1 0.33224 0.08305 4.00 0.0000793 ***
## edad -0.00444 0.00508 -0.88 0.3822
## estciv1 -0.16824 0.08380 -2.01 0.0456 *
## educ2 -0.25989 0.08405 -3.09 0.0022 **
## dbt1 0.07630 0.10302 0.74 0.4595
## hta1 0.22093 0.09575 2.31 0.0217 *
## hipercol1 -0.20606 0.08696 -2.37 0.0184 *
## tabaq1 0.20626 0.10187 2.02 0.0438 *
## imc 0.03363 0.00731 4.60 0.0000062 ***
## hs_af -0.04119 0.01650 -2.50 0.0131 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.723 on 307 degrees of freedom
## Multiple R-squared: 0.252, Adjusted R-squared: 0.228
## F-statistic: 10.4 on 10 and 307 DF, p-value: 0.00000000000000455
#coeficientes bivariados
mod_gen <-lm(pcr~genero,data=data)
summary(mod_gen)
##
## Call:
## lm(formula = pcr ~ genero, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.0675 -0.5833 0.0337 0.5552 2.8625
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.0743 0.0591 35.13 < 0.0000000000000002 ***
## genero1 0.3492 0.0917 3.81 0.00017 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.805 on 316 degrees of freedom
## Multiple R-squared: 0.0439, Adjusted R-squared: 0.0409
## F-statistic: 14.5 on 1 and 316 DF, p-value: 0.000167
mod_dbt <-lm(pcr~dbt,data=data)
summary(mod_dbt)
##
## Call:
## lm(formula = pcr ~ dbt, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.053 -0.548 -0.031 0.498 2.877
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.1556 0.0529 40.7 <0.0000000000000002 ***
## dbt1 0.2528 0.1055 2.4 0.017 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.816 on 316 degrees of freedom
## Multiple R-squared: 0.0179, Adjusted R-squared: 0.0147
## F-statistic: 5.74 on 1 and 316 DF, p-value: 0.0171
mod_edad <-lm(pcr~edad,data=data)
summary(mod_edad)
##
## Call:
## lm(formula = pcr ~ edad, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.9882 -0.5947 -0.0349 0.5552 3.0659
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.2233903 0.3216342 6.91 0.000000000026 ***
## edad -0.0000737 0.0056424 -0.01 0.99
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.824 on 316 degrees of freedom
## Multiple R-squared: 5.4e-07, Adjusted R-squared: -0.00316
## F-statistic: 0.000171 on 1 and 316 DF, p-value: 0.99
mod_estciv <-lm(pcr~estciv,data=data)
summary(mod_estciv)
##
## Call:
## lm(formula = pcr ~ estciv, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.927 -0.635 -0.023 0.533 3.127
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.3027 0.0709 32.48 <0.0000000000000002 ***
## estciv1 -0.1442 0.0932 -1.55 0.12
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.821 on 316 degrees of freedom
## Multiple R-squared: 0.00752, Adjusted R-squared: 0.00438
## F-statistic: 2.39 on 1 and 316 DF, p-value: 0.123
mod_tabaq <-lm(pcr~tabaq,data=data)
summary(mod_tabaq)
##
## Call:
## lm(formula = pcr ~ tabaq, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.9067 -0.6047 -0.0087 0.5254 2.7615
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.138 0.051 41.90 < 0.0000000000000002 ***
## tabaq1 0.387 0.111 3.48 0.00057 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.808 on 316 degrees of freedom
## Multiple R-squared: 0.0369, Adjusted R-squared: 0.0339
## F-statistic: 12.1 on 1 and 316 DF, p-value: 0.000572
mod_hipercol <-lm(pcr~hipercol,data=data)
summary(mod_hipercol)
##
## Call:
## lm(formula = pcr ~ hipercol, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.0579 -0.5579 -0.0232 0.5095 2.8721
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.4139 0.0639 37.77 < 0.0000000000000002 ***
## hipercol1 -0.3845 0.0898 -4.28 0.000025 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.801 on 316 degrees of freedom
## Multiple R-squared: 0.0548, Adjusted R-squared: 0.0518
## F-statistic: 18.3 on 1 and 316 DF, p-value: 0.0000247
mod_hta <-lm(pcr~hta,data=data)
summary(mod_hta)
##
## Call:
## lm(formula = pcr ~ hta, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.8556 -0.5536 -0.0351 0.5464 2.8160
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.0866 0.0557 37.47 < 0.0000000000000002 ***
## hta1 0.3834 0.0947 4.05 0.000065 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.803 on 316 degrees of freedom
## Multiple R-squared: 0.0493, Adjusted R-squared: 0.0463
## F-statistic: 16.4 on 1 and 316 DF, p-value: 0.0000647
mod_hs <-lm(pcr~hs_af,data=data)
summary(mod_hs)
##
## Call:
## lm(formula = pcr ~ hs_af, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.0180 -0.5810 -0.0179 0.5300 2.8490
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.4370 0.0755 32.3 < 0.0000000000000002 ***
## hs_af -0.0630 0.0175 -3.6 0.00037 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.807 on 316 degrees of freedom
## Multiple R-squared: 0.0394, Adjusted R-squared: 0.0364
## F-statistic: 13 on 1 and 316 DF, p-value: 0.000367
mod_imc <-lm(pcr~imc,data=data)
summary(mod_imc)
##
## Call:
## lm(formula = pcr ~ imc, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.7801 -0.5362 -0.0588 0.5050 3.0018
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.13987 0.22046 5.17 0.00000042 ***
## imc 0.03906 0.00781 5.00 0.00000096 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.793 on 316 degrees of freedom
## Multiple R-squared: 0.0733, Adjusted R-squared: 0.0703
## F-statistic: 25 on 1 and 316 DF, p-value: 0.000000958
mod_imcat <-lm(pcr~imc_cat,data=data)
summary(mod_imcat)
##
## Call:
## lm(formula = pcr ~ imc_cat, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.7673 -0.5296 -0.0485 0.4873 3.0520
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.8950 0.0874 21.69 < 0.0000000000000002 ***
## imc_catbajo_peso -0.0352 0.2763 -0.13 0.8986
## imc_catobesidad 0.7123 0.1283 5.55 0.00000006 ***
## imc_catsobrepeso 0.3390 0.1074 3.16 0.0018 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.786 on 314 degrees of freedom
## Multiple R-squared: 0.0945, Adjusted R-squared: 0.0858
## F-statistic: 10.9 on 3 and 314 DF, p-value: 0.000000767
mod_educ <-lm(pcr~educ,data=data)
summary(mod_educ)
##
## Call:
## lm(formula = pcr ~ educ, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.0002 -0.5594 -0.0376 0.5387 2.9298
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.3562 0.0603 39.09 < 0.0000000000000002 ***
## educ2 -0.3155 0.0915 -3.45 0.00064 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.809 on 316 degrees of freedom
## Multiple R-squared: 0.0363, Adjusted R-squared: 0.0332
## F-statistic: 11.9 on 1 and 316 DF, p-value: 0.00064
#construcción stepwise imc categórica
regstep1<-step(completo_cat,scope=list (lower=vacio, upper=completo_cat),direction="both"); summary(regstep1)
## Start: AIC=-200
## pcr ~ genero + edad + estciv + educ + dbt + hta + hipercol +
## tabaq + imc_cat + hs_af
##
## Df Sum of Sq RSS AIC
## - dbt 1 0.29 157 -201
## - edad 1 0.44 157 -201
## <none> 156 -200
## - estciv 1 2.25 159 -197
## - tabaq 1 2.26 159 -197
## - hta 1 2.27 159 -197
## - hs_af 1 3.27 160 -195
## - hipercol 1 3.30 160 -195
## - educ 1 4.75 161 -192
## - genero 1 7.84 164 -186
## - imc_cat 3 14.97 171 -177
##
## Step: AIC=-201
## pcr ~ genero + edad + estciv + educ + hta + hipercol + tabaq +
## imc_cat + hs_af
##
## Df Sum of Sq RSS AIC
## - edad 1 0.42 157 -202
## <none> 157 -201
## + dbt 1 0.29 156 -200
## - estciv 1 2.11 159 -199
## - tabaq 1 2.37 159 -198
## - hs_af 1 3.22 160 -197
## - hipercol 1 3.37 160 -196
## - hta 1 3.37 160 -196
## - educ 1 4.70 161 -194
## - genero 1 8.06 165 -187
## - imc_cat 3 14.99 172 -178
##
## Step: AIC=-202
## pcr ~ genero + estciv + educ + hta + hipercol + tabaq + imc_cat +
## hs_af
##
## Df Sum of Sq RSS AIC
## <none> 157 -202
## + edad 1 0.42 157 -201
## + dbt 1 0.26 157 -201
## - estciv 1 2.11 159 -200
## - tabaq 1 2.35 160 -200
## - hta 1 3.08 160 -198
## - hs_af 1 3.16 160 -198
## - hipercol 1 3.60 161 -197
## - educ 1 4.44 162 -195
## - genero 1 7.90 165 -189
## - imc_cat 3 15.21 172 -179
##
## Call:
## lm(formula = pcr ~ genero + estciv + educ + hta + hipercol +
## tabaq + imc_cat + hs_af, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.220 -0.453 0.031 0.461 2.267
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.1440 0.1278 16.78 < 0.0000000000000002 ***
## genero1 0.3220 0.0820 3.93 0.00011 ***
## estciv1 -0.1677 0.0826 -2.03 0.04331 *
## educ2 -0.2443 0.0829 -2.95 0.00347 **
## hta1 0.2149 0.0876 2.45 0.01470 *
## hipercol1 -0.2276 0.0858 -2.65 0.00843 **
## tabaq1 0.2162 0.1008 2.14 0.03281 *
## imc_catbajo_peso -0.0559 0.2539 -0.22 0.82586
## imc_catobesidad 0.6286 0.1198 5.25 0.00000029 ***
## imc_catsobrepeso 0.2897 0.0983 2.95 0.00344 **
## hs_af -0.0407 0.0164 -2.49 0.01347 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.715 on 307 degrees of freedom
## Multiple R-squared: 0.267, Adjusted R-squared: 0.243
## F-statistic: 11.2 on 10 and 307 DF, p-value: 0.000000000000000256
confint(regstep1)
## 2.5 % 97.5 %
## (Intercept) 1.8925 2.39540
## genero1 0.1607 0.48331
## estciv1 -0.3303 -0.00507
## educ2 -0.4074 -0.08109
## hta1 0.0426 0.38719
## hipercol1 -0.3965 -0.05869
## tabaq1 0.0178 0.41465
## imc_catbajo_peso -0.5556 0.44376
## imc_catobesidad 0.3929 0.86428
## imc_catsobrepeso 0.0963 0.48302
## hs_af -0.0730 -0.00848
#construcción stepwise imc continua
regstep3<-step(completo_con,scope=list (lower=vacio, upper=completo_con),direction="both"); summary(regstep3)
## Start: AIC=-196
## pcr ~ genero + edad + estciv + educ + dbt + hta + hipercol +
## tabaq + imc + hs_af
##
## Df Sum of Sq RSS AIC
## - dbt 1 0.29 161 -197
## - edad 1 0.40 161 -197
## <none> 160 -196
## - estciv 1 2.10 162 -194
## - tabaq 1 2.14 162 -194
## - hta 1 2.78 163 -192
## - hipercol 1 2.93 163 -192
## - hs_af 1 3.25 164 -191
## - educ 1 4.99 165 -188
## - genero 1 8.36 169 -182
## - imc 1 11.05 171 -177
##
## Step: AIC=-197
## pcr ~ genero + edad + estciv + educ + hta + hipercol + tabaq +
## imc + hs_af
##
## Df Sum of Sq RSS AIC
## - edad 1 0.38 161 -198
## <none> 161 -197
## + dbt 1 0.29 160 -196
## - estciv 1 1.97 163 -195
## - tabaq 1 2.25 163 -195
## - hipercol 1 3.00 164 -193
## - hs_af 1 3.20 164 -193
## - hta 1 4.07 165 -191
## - educ 1 4.93 166 -190
## - genero 1 8.58 169 -183
## - imc 1 11.08 172 -178
##
## Step: AIC=-198
## pcr ~ genero + estciv + educ + hta + hipercol + tabaq + imc +
## hs_af
##
## Df Sum of Sq RSS AIC
## <none> 161 -198
## + edad 1 0.38 161 -197
## + dbt 1 0.26 161 -197
## - estciv 1 1.96 163 -197
## - tabaq 1 2.25 163 -196
## - hs_af 1 3.14 164 -194
## - hipercol 1 3.21 164 -194
## - hta 1 3.79 165 -193
## - educ 1 4.67 166 -191
## - genero 1 8.42 169 -184
## - imc 1 11.34 172 -179
##
## Call:
## lm(formula = pcr ~ genero + estciv + educ + hta + hipercol +
## tabaq + imc + hs_af, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.2658 -0.4617 0.0165 0.4731 2.3379
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.46508 0.22735 6.44 0.00000000045 ***
## genero1 0.33231 0.08268 4.02 0.00007342054 ***
## estciv1 -0.16160 0.08329 -1.94 0.0533 .
## educ2 -0.24921 0.08325 -2.99 0.0030 **
## hta1 0.23635 0.08760 2.70 0.0074 **
## hipercol1 -0.21466 0.08649 -2.48 0.0136 *
## tabaq1 0.21083 0.10154 2.08 0.0387 *
## imc 0.03402 0.00729 4.67 0.00000457759 ***
## hs_af -0.04043 0.01647 -2.45 0.0147 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.722 on 309 degrees of freedom
## Multiple R-squared: 0.249, Adjusted R-squared: 0.23
## F-statistic: 12.8 on 8 and 309 DF, p-value: 0.000000000000000624
confint(regstep3)
## 2.5 % 97.5 %
## (Intercept) 1.0177 1.91244
## genero1 0.1696 0.49499
## estciv1 -0.3255 0.00229
## educ2 -0.4130 -0.08540
## hta1 0.0640 0.40872
## hipercol1 -0.3848 -0.04448
## tabaq1 0.0110 0.41064
## imc 0.0197 0.04836
## hs_af -0.0728 -0.00802