# knitr::opts_chunk$set(echo = TRUE) # DEBUG # Makes sure all libraries and functions are available to work interactivelly # targets::tar_load_globals() # Loads all libraries # Loads DF_analysis targets::tar_load(DF_analysis) # In this document you will find a template to run analysis, plots, and tables # You will need to adapt to the contents of your DF_analysis # names(DF_analysis$DF_analysis) # Show variable names in DF_analysis
Descripción del proceso de preparación de datos.
DF = DF_analysis$DF_analysis %>% # Update with your variable names select(id, ends_with("_DIRd"), ends_with("_DIRt")) # Continue your data preparation, if needed # filter() %>% # drop_na()
Tabla 1. Descripción de la tabla 1. Tabla 2. ...
# You can add a variable to the `by` argument and uncomment # names(DF) shows the variables you hava available table1 = DF |> dplyr::select(where(is.numeric), -id, -Goodbye_DIRt) |> gtsummary::tbl_summary( # by = AIM_DIRt, type = list(everything() ~ 'continuous') ) table1
Figura 1. Descripción de la Figura 1. Figura 2. ...
# Remember to change the variables in your plot plot1 = DF %>% ggplot(aes(EAR_DIRt, IRI_TomaPerspectiva_DIRd)) + geom_jitter() + geom_smooth(method = "lm") plot1
# Remember to change the variables used in your model and inline_text model1 = lm(EAR_DIRt ~ IRI_DIRt, DF) table_model = gtsummary::tbl_regression(model1, intercept = TRUE) %>% # add_global_p() %>% bold_labels() %>% italicize_levels() %>% add_glance_table(include = c("nobs", "df.residual", "r.squared", "adj.r.squared")) table_model # report::report(model1) paste0("IRI was not a significant predictor of EAR", ", beta = ", gtsummary::inline_text(table_model, variable = IRI_DIRt))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.