Skip to content

Commit

Permalink
Commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
FerreiraAS committed Jul 19, 2024
1 parent dc36bd9 commit 43995e4
Show file tree
Hide file tree
Showing 89 changed files with 16,059 additions and 13,772 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified Ciencia-com-R.docx
Binary file not shown.
2,886 changes: 1,849 additions & 1,037 deletions Ciencia-com-R.log

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Ciencia-com-R_files/figure-html/evento-dado-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added R/.DS_Store
Binary file not shown.
Empty file modified R/Desempenho diagnostico/dtROC.R
100644 → 100755
Empty file.
Empty file modified R/Desempenho diagnostico/stROC.R
100644 → 100755
Empty file.
Binary file modified R/Ensaio experimental aleatorizado/.DS_Store
Binary file not shown.
Empty file modified R/Ensaio experimental aleatorizado/RCT-Table1.R
100644 → 100755
Empty file.
Empty file modified R/Propriedades psicometricas/reliability-kappa-icc.R
100644 → 100755
Empty file.
File renamed without changes.
1 change: 1 addition & 0 deletions _bookdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ rmd_files:
- "rmd/correlacao.Rmd"
- "rmd/redes.Rmd"
- "rmd/associacao.Rmd"
- "rmd/modelos.Rmd"
- "rmd/regressao.Rmd"
- "rmd/arvore-decisao.Rmd"
- "rmd/aprendizagem-maquina.Rmd"
Expand Down
Binary file modified covers/Cover_1.pdf
Binary file not shown.
Binary file modified covers/Cover_2.pdf
Binary file not shown.
Binary file modified covers/Cover_4.pdf
Binary file not shown.
467 changes: 235 additions & 232 deletions docs/404.html

Large diffs are not rendered by default.

Binary file modified docs/Ciencia-com-R.docx
Binary file not shown.
Binary file modified docs/Ciencia-com-R.epub
Binary file not shown.
Binary file modified docs/Ciencia-com-R.pdf
Binary file not shown.
Binary file modified docs/Ciencia-com-R.pptx
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/Ciencia-com-R_files/figure-html/evento-dado-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/R/Desempenho diagnostico/dtROC.R
100644 → 100755
Empty file.
Empty file modified docs/R/Desempenho diagnostico/stROC.R
100644 → 100755
Empty file.
Empty file modified docs/R/Ensaio experimental aleatorizado/RCT-Table1.R
100644 → 100755
Empty file.
Empty file modified docs/R/Propriedades psicometricas/reliability-kappa-icc.R
100644 → 100755
Empty file.
467 changes: 235 additions & 232 deletions docs/agradecimentos.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/analise-inicial-dados-cap.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/análise-descritiva.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/análise-exploratória-de-dados.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/análise-inferencial.html

Large diffs are not rendered by default.

505 changes: 254 additions & 251 deletions docs/aprendizagem-de-máquina.html

Large diffs are not rendered by default.

503 changes: 253 additions & 250 deletions docs/associação.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/bibliografia.html

Large diffs are not rendered by default.

473 changes: 238 additions & 235 deletions docs/comparação.html

Large diffs are not rendered by default.

469 changes: 236 additions & 233 deletions docs/computação-estatística.html

Large diffs are not rendered by default.

561 changes: 282 additions & 279 deletions docs/correlação.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/dados-metadados-e-big-data.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/dedicatória.html

Large diffs are not rendered by default.

525 changes: 264 additions & 261 deletions docs/delineamento-de-estudos.html

Large diffs are not rendered by default.

471 changes: 237 additions & 234 deletions docs/descrição.html

Large diffs are not rendered by default.

567 changes: 285 additions & 282 deletions docs/desempenho-diagnóstico.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/distribuições-e-parâmetros.html

Large diffs are not rendered by default.

621 changes: 312 additions & 309 deletions docs/ensaios-experimentais.html

Large diffs are not rendered by default.

493 changes: 248 additions & 245 deletions docs/ensaios-quase-experimentais-cap.html

Large diffs are not rendered by default.

493 changes: 248 additions & 245 deletions docs/estudos-observacionais.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/fontes-externas.html

Large diffs are not rendered by default.

Binary file modified docs/images/Cover_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
471 changes: 237 additions & 234 deletions docs/index.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/medidas-e-instrumentos.html

Large diffs are not rendered by default.

505 changes: 254 additions & 251 deletions docs/meta-análise.html

Large diffs are not rendered by default.

1,305 changes: 1,305 additions & 0 deletions docs/modelos.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/paradoxos-e-falácias.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/parte-1---fundamentos.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/parte-2---estatística-básica.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/parte-3---estatística-aplicada.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/parte-4---metodologia-da-pesquisa-aplicada.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/pensamento-estatístico.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/pensamento-metodológico.html

Large diffs are not rendered by default.

469 changes: 236 additions & 233 deletions docs/pensamento-probabilístico.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/plano-de-análise.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/prefácio.html

Large diffs are not rendered by default.

659 changes: 331 additions & 328 deletions docs/propriedades-psicométricas.html

Large diffs are not rendered by default.

505 changes: 254 additions & 251 deletions docs/redação-de-resultados.html

Large diffs are not rendered by default.

471 changes: 237 additions & 234 deletions docs/redes.html

Large diffs are not rendered by default.

557 changes: 280 additions & 277 deletions docs/referências.html

Large diffs are not rendered by default.

823 changes: 303 additions & 520 deletions docs/regressão.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/search_index.json

Large diffs are not rendered by default.

505 changes: 254 additions & 251 deletions docs/seleção-de-testes.html

Large diffs are not rendered by default.

501 changes: 252 additions & 249 deletions docs/simulação-computacional.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/sobre-o-autor.html

Large diffs are not rendered by default.

507 changes: 255 additions & 252 deletions docs/tabulação-de-dados.html

Large diffs are not rendered by default.

553 changes: 278 additions & 275 deletions docs/tamanho-da-amostra.html

Large diffs are not rendered by default.

711 changes: 445 additions & 266 deletions docs/tamanho-do-efeito-e-p-valor.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/testes-estatísticos.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/variáveis-e-fatores.html

Large diffs are not rendered by default.

467 changes: 235 additions & 232 deletions docs/vieses-metodológicos.html

Large diffs are not rendered by default.

485 changes: 244 additions & 241 deletions docs/árvore-de-decisão.html

Large diffs are not rendered by default.

Binary file modified images/Cover_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
258 changes: 258 additions & 0 deletions rmd/efeito-pvalor.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,264 @@ O pacote *pwr*[@pwr] fornece a função [*cohen.ES*](https://www.rdocumentation.

<br>

## Efeito fixo

<br>

### O que é efeito fixo?

- .[REF]

<br>

## Efeito aleatório

<br>

### O que é efeito aleatório?

- .[REF]

<br>

## Efeito principal

<br>

### O que é efeito principal?

- .[@Bours2023]

<br>

## Efeito de modificação

<br>

### O que é um modificador de efeito?

- .[@Bours2023]

<br>

### O que é efeito de modificação?

- .[@Bours2023]

<br>

## Efeito de interação

<br>

### O que é efeito de interação?

- A interação - representada pelo símbolo \* - é o termo estatístico empregado para representar a heterogeneidade de um determinado efeito.[@Altman1996]

- .[@Bours2023]

```{r efeito-interacao-direta, echo = FALSE, warning = FALSE, message = FALSE, fig.align = 'center', results = "asis", fig.fullwidth = TRUE, fig.cap = "Análise de efeito de interação (direta) entre grupos e tempo. Retas paralelas sugerem ausência de efeito de interação."}
# Simulate data
set.seed(123) # For reproducibility
n <- 5 # Number of observations
# Create a data frame with two time points and different offsets
data <- data.frame(
group = rep(c("A", "B", "B'"), each = n*2),
time = rep(c(1, 2), each = n),
response = c(
5 + rnorm(n, mean = 0, sd = 1), # Group A at time 1
15 + rnorm(n, mean = 0, sd = 1), # Group A at time 2
10 + rnorm(n, mean = 0, sd = 1), # Group B' at time 1
20 + rnorm(n, mean = 0, sd = 1), # Group B' at time 2
rnorm(n, mean = 0, sd = 1), # Group B at time 1
rnorm(n, mean = 0, sd = 1) # Group B at time 2
)
)
# add offset to group B at 2
data$response[data$group == "B'" & data$time == 1] <- data$response[data$group == "B" & data$time == 1]
data$response[data$group == "B'" & data$time == 2] <- data$response[data$group == "B" & data$time == 2] + 5
# Calculate means for plotting
means <- aggregate(response ~ group + time, data, mean)
# Create the plot
ggplot2::ggplot(means, ggplot2::aes(x = time, y = response, color = group, group = group)) +
ggplot2::geom_line(size = 1) + # Draw lines for means
ggplot2::geom_point(size = 3) + # Add points for means
ggplot2::labs(title = "",
x = "Tempo",
y = "Resposta") +
ggplot2::theme_minimal() +
ggplot2::scale_color_manual(values = c("black", "gray", "black")) + # Custom colors
ggplot2::theme(legend.title = ggplot2::element_blank()) +
# minumum theme
ggplot2::theme(
panel.grid.major = ggplot2::element_blank(),
panel.grid.minor = ggplot2::element_blank(),
panel.background = ggplot2::element_blank(),
axis.line = ggplot2::element_line(colour = "black")
) +
# move legent to the top left corner
ggplot2::theme(legend.position = c(0, 1), legend.justification = c(0, 1)) +
# annotate plot with "Efeito esperado sem interação"
ggplot2::annotate("text", x = 2, y = mean(data$response[data$group == "B" & data$time == 2]), label = "Sem efeito de \n interação", size = 3, color = "gray", hjust = -0.1, vjust = 0.5) +
# annotate plot with "Efeito esperado com interação"
ggplot2::annotate("text", x = 2, y = mean(data$response[data$group == "B'" & data$time == 2]), label = "Com efeito de \n interação", size = 3, color = "black", hjust = -0.1, vjust = 0.5) +
# draw dashed arrow of effect from B' to B at time 2
ggplot2::geom_segment(ggplot2::aes(x = 2, xend = 2, y = mean(data$response[data$group == "B'" & data$time == 2]), yend = mean(data$response[data$group == "B" & data$time == 2])), arrow = ggplot2::arrow(type = "open", length = ggplot2::unit(0.1, "inches"), ends = "both", angle = 20), color = "black", linetype = "dashed") +
# annotate plot with "Efeito de interação"
ggplot2::annotate("text", x = 2, y = mean(data$response[data$group != "A" & data$time == 2]), label = "Tamanho de efeito \n estimado", size = 3, color = "black", hjust = -0.1, vjust = 0.5) +
# augment x axis margins to make room for annotations
ggplot2::scale_x_continuous(breaks = c(1, 2), labels = c("Antes", "Depois"), expand = c(0.3, 0.3))
```

<br>

```{r efeito-interacao-inversa, echo = FALSE, warning = FALSE, message = FALSE, fig.align = 'center', results = "asis", fig.fullwidth = TRUE, fig.cap = "Análise de efeito de interação (inversa) entre grupos e tempo. Retas paralelas sugerem ausência de efeito de interação."}
# Simulate data
set.seed(123) # For reproducibility
n <- 5 # Number of observations
# Create a data frame with two time points and different offsets
data <- data.frame(
group = rep(c("A", "B", "B'"), each = n*2),
time = rep(c(1, 2), each = n),
response = c(
5 + rnorm(n, mean = 0, sd = 1), # Group A at time 1
15 + rnorm(n, mean = 0, sd = 1), # Group A at time 2
10 + rnorm(n, mean = 0, sd = 1), # Group B' at time 1
20 + rnorm(n, mean = 0, sd = 1), # Group B' at time 2
rnorm(n, mean = 0, sd = 1), # Group B at time 1
rnorm(n, mean = 0, sd = 1) # Group B at time 2
)
)
# add offset to group B at 2
data$response[data$group == "B'" & data$time == 1] <- data$response[data$group == "B" & data$time == 1]
data$response[data$group == "B'" & data$time == 2] <- data$response[data$group == "B" & data$time == 2] - 5
# Calculate means for plotting
means <- aggregate(response ~ group + time, data, mean)
# Create the plot
ggplot2::ggplot(means, ggplot2::aes(x = time, y = response, color = group, group = group)) +
ggplot2::geom_line(size = 1) + # Draw lines for means
ggplot2::geom_point(size = 3) + # Add points for means
ggplot2::labs(title = "",
x = "Tempo",
y = "Resposta") +
ggplot2::theme_minimal() +
ggplot2::scale_color_manual(values = c("black", "gray", "black")) + # Custom colors
ggplot2::theme(legend.title = ggplot2::element_blank()) +
# minumum theme
ggplot2::theme(
panel.grid.major = ggplot2::element_blank(),
panel.grid.minor = ggplot2::element_blank(),
panel.background = ggplot2::element_blank(),
axis.line = ggplot2::element_line(colour = "black")
) +
# move legent to the top left corner
ggplot2::theme(legend.position = c(0, 1), legend.justification = c(0, 1)) +
# annotate plot with "Efeito esperado sem interação"
ggplot2::annotate("text", x = 2, y = mean(data$response[data$group == "B" & data$time == 2]), label = "Sem efeito de \n interação", size = 3, color = "gray", hjust = -0.1, vjust = 0.5) +
# annotate plot with "Efeito esperado com interação"
ggplot2::annotate("text", x = 2, y = mean(data$response[data$group == "B'" & data$time == 2]), label = "Com efeito de \n interação", size = 3, color = "black", hjust = -0.1, vjust = 0.5) +
# draw dashed arrow of effect from B' to B at time 2
ggplot2::geom_segment(ggplot2::aes(x = 2, xend = 2, y = mean(data$response[data$group == "B'" & data$time == 2]), yend = mean(data$response[data$group == "B" & data$time == 2])), arrow = ggplot2::arrow(type = "open", length = ggplot2::unit(0.1, "inches"), ends = "both", angle = 20), color = "black", linetype = "dashed") +
# annotate plot with "Efeito de interação"
ggplot2::annotate("text", x = 2, y = mean(data$response[data$group != "A" & data$time == 2]), label = "Tamanho de efeito \n estimado", size = 3, color = "black", hjust = -0.1, vjust = 0.5) +
# augment x axis margins to make room for annotations
ggplot2::scale_x_continuous(breaks = c(1, 2), labels = c("Antes", "Depois"), expand = c(0.3, 0.3))
```

<br>

::: {.infobox .Rlogo data-latex="{images/Rlogo}"}
O pacote *nlme*[@nlme] fornece a função [*nlme*](https://www.rdocumentation.org/packages/nlme/versions/3.1-163/topics/nlme) para ajustar um modelo de regressão misto não linear.
:::

<br>

::: {.infobox .Rlogo data-latex="{images/Rlogo}"}
O pacote *mmrm*[@mmrm] fornece a função [*mmrm*](https://rdrr.io/cran/mmrm/man/mmrm.html) para ajuste de um modelo de regressão misto linear.
:::

<br>

::: {.infobox .Rlogo data-latex="{images/Rlogo}"}
O pacote *emmeans*[@emmeans] fornece a função [*emmeans*](https://www.rdocumentation.org/packages/emmeans/versions/1.8.7/topics/emmeans) para calcular as médias marginais dos fatores e suas combinações de um modelo de regressão misto linear.
:::

<br>

## Efeito de mediação

<br>

### O que é um mediador de efeito?

- .[@Baron1986]

- .[@Bours2023]

<br>

### O que é efeito de mediação?

- .[@Baron1986]

- .[@Bours2023]

<br>

### O que é efeito direto?

- .[@Baron1986]

- .[@Bours2023]

<br>

### O que é efeito indireto?

- .[@Baron1986]

- .[@Bours2023]

<br>

### O que é efeito total?

- .[@Baron1986]

- .[@Bours2023]

<br>

## Efeitos brutos e padronizados

<br>

### O que é efeito bruto?

- .[@greenland1986]

- .[@greenland1991]

<br>

### O que é efeito padronizado?

- .[@greenland1986]

- .[@greenland1991]

<br>

## P-valor

<br>
Expand Down
53 changes: 53 additions & 0 deletions rmd/modelos.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# **Modelos**

<br>

## Suposições dos modelos

<br>

### Quais suposições são feitas para modelagem de regressão?

- .[REF]

<br>

### Como avaliar as suposições do modelo?

- .[REF]

<br>

::: {.infobox .Rlogo data-latex="{images/Rlogo}"}
O pacote *performance*[@performance] fornece a função [*check_model*](https://www.rdocumentation.org/packages/performance/versions/0.10.4/topics/check_model) para analisar a colinearidade entre variáveis, a normalidade da distribuição das variáveis e a heteroscedasticidade.
:::

<br>

## Avaliação de modelos

<br>

### O que é qualidade de ajuste de um modelo?

- .[REF]

<br>

### Como avaliar a qualidade de ajuste de um modelo?

- .[REF]

<br>

::: {.infobox .Rlogo data-latex="{images/Rlogo}"}
O pacote *performance*[@performance] fornece a função [*model_performance*](https://www.rdocumentation.org/packages/performance/versions/0.10.4/topics/model_performance) para calcular as métricas de ajuste da regressão adequadas ao modelo pré-especificado.
:::

<br>

::: {.infobox .Rlogo data-latex="{images/Rlogo}"}
O pacote *performance*[@performance] fornece a função [*compare_performance*](https://www.rdocumentation.org/packages/performance/versions/0.10.4/topics/compare_performance) para comparar o desempenho e a qualidade do ajuste de diversos modelos de regressão pré-especificados.
:::

<br>
Loading

0 comments on commit 43995e4

Please sign in to comment.