Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasGraz committed Nov 17, 2024
1 parent 8989fb0 commit b2db4fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
12 changes: 5 additions & 7 deletions _posts/2024-07-26-lmer_vs_ttests-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ t.test(COEFS$Fatigued)$p.value

## Type I Error & Power

<details class="code-fold">
<summary>Simulation Code</summary>

``` r
# Setup auxiliary functions =========================
##| code-fold: true
##| code-summary: "Simulation Code"

# Setup auxiliary functions
get_type1_CI <- function(P.vals){
C.int <- apply(P.vals < 0.05, 1, function(x)
prop.test(sum(x), length(x), p = 0.05)$conf.int |> round(4))
Expand Down Expand Up @@ -289,8 +289,6 @@ ggplot(H_all, aes(x = test, y = `Power`, ymin = lwr, ymax = upr)) +
xlab("")
```

</details>

![](../quarto/lmer-slopes-new/lmer_vs_ttests-new_files/figure-commonmark/Ex-sim-1.png)

# Power-Simulations
Expand Down Expand Up @@ -354,7 +352,7 @@ simr::makeLmer(
#> Formula: Y ~ Fatigued + Caffein + Physical_Activity + Time + (Fatigued +
#> Caffein + Physical_Activity + Time | PersonID)
#> Data: D
#> REML criterion at convergence: 1982
#> REML criterion at convergence: 2018
#> Random effects:
#> Groups Name Std.Dev. Corr
#> PersonID (Intercept) 1
Expand Down
7 changes: 4 additions & 3 deletions quarto/lmer-slopes-new/lmer_vs_ttests-new.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ t.test(COEFS$Fatigued)$p.value

## Type I Error & Power {.smaller}
```{r Ex-sim}
#| code-fold: true
#| code-summary: "Simulation Code"
# Setup auxiliary functions =========================
##| code-fold: true
##| code-summary: "Simulation Code"
# Setup auxiliary functions
get_type1_CI <- function(P.vals){
C.int <- apply(P.vals < 0.05, 1, function(x)
prop.test(sum(x), length(x), p = 0.05)$conf.int |> round(4))
Expand Down

0 comments on commit b2db4fe

Please sign in to comment.