Skip to content

Commit

Permalink
change report it to reportR
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy authored and Andy committed Sep 16, 2022
1 parent 30c5cf6 commit 762788a
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion inst/tutorials/discovr_08/discovr_08.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ quiz(
The *p*-values in the table all tell us the long-run probability that we would get a a value of *t* at least as large as the ones we have if the the true relationship between each predictor and album sales was 0 (i.e., *b* = 0). In all cases the probabilities are less than 0.001, which researchers would generally take to mean that the observed $\hat{b}$s are significantly different from zero. Given the $\hat{b}$s quantify the relationship between each predictor and album sales, this conclusion implies that each predictor significantly predicts album sales.

<div class="reportbox">
`r pencil()` **Report it!**
`r pencil()` **Report**`r rproj()`

The model that included the band's image and airplay was a significantly better fit than the model that included advertising budget alone, `r report_aov_compare(album_aov)`. The final model explained `r 100*round(album2_fit$r.squared, 3)`% of the variance in album sales. Advertising budget significantly predicted album sales $\hat{b}$ = `r report_pars(album2_par, row = 2, df_r = album2_fit$df.residual)`, as did airplay $\hat{b}$ = `r report_pars(album2_par, row = 3, df_r = album2_fit$df.residual)` and image, $\hat{b}$ = `r report_pars(album2_par, row = 4, df_r = album2_fit$df.residual)`.

Expand Down
6 changes: 3 additions & 3 deletions inst/tutorials/discovr_09/discovr_09.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ question("Which of these statements about Cohen's *d* is **NOT** correct?",
```

<div class="reportbox">
`r pencil()` **Report it!**
`r pencil()` **Report**`r rproj()`

On average, participants given a cloak of invisibility engaged in more acts of mischief (*M* = `r cloak_mod$estimate[2]`, *SE* = 0.48), than those not given a cloak (*M* = `r cloak_mod$estimate[1]`, *SE* = 0.55). Having a cloak of invisibility did not significantly affect the amount of mischief a person got up to: the mean difference, *M* = `r round(cloak_mod$estimate[2]-cloak_mod$estimate[1], 2)`, 95% CI [`r round(cloak_mod$conf.int[1], 2)`, `r round(cloak_mod$conf.int[2], 2)`], was not significantly different from 0, *t*(`r round(as.numeric(cloak_mod$parameter, 2))`) = `r round(cloak_mod$statistic, 2)`, *p* = `r round(cloak_mod$p.value, 2)`. This effect was very large, `r report_es(d_cloak, col = "Cohens_d")`, but the confidence interval for the effect size contained zero. If this confidence interval is one of the 95% that captures the population effect size then this suggests that a zero effect is plausible.
</div>
Expand Down Expand Up @@ -541,7 +541,7 @@ effectsize::cohens_d(mischief ~ cloak, data = cloak_rm_tib) |>


<div class="reportbox">
`r pencil()` **Report it!**
`r pencil()` **Report**`r rproj()`

On average, participants given a cloak of invisibility engaged in more acts of mischief (*M* = 5, *SE* = 0.48), than those not given a cloak (*M* = 3.75, *SE* = 0.55). Having a cloak of invisibility affected the amount of mischief a person got up to: the mean difference, *M* = `r round(as.numeric(cloak_rm_mod$estimate), 2)`, 95% CI [`r round(cloak_rm_mod$conf.int[1], 2)`, `r round(cloak_rm_mod$conf.int[2], 2)`], was significantly different from 0, *t*(`r round(as.numeric(cloak_rm_mod$parameter, 2))`) = `r round(cloak_rm_mod$statistic, 2)`, *p* = `r round(cloak_rm_mod$p.value, 2)`. This effect was very large, `r report_es(d_cloak, col = "Cohens_d")`, but the confidence interval for the effect size contained zero. If this confidence interval is one of the 95% that captures the population effect size then this suggests that a zero effect is plausible.
</div>
Expand Down Expand Up @@ -595,7 +595,7 @@ cloak_rob <- WRS2::yuen(mischief ~ cloak, data = cloak_tib)
<br />

<div class="reportbox">
`r pencil()` **Report it!**
`r pencil()` **Report**`r rproj()`

There was not a significant difference in mischief scores across the two cloak groups, $T_y$ = `r round(cloak_rob$test, 2)`, *p* = `r round(cloak_rob$p.value, 3)`. On average the no cloak group performed one less mischievous act, *M* = `r cloak_rob$diff` with a 95% confidence interval for the trimmed mean difference ranging from `r round(cloak_rob$conf.int[1], 2)` to `r round(cloak_rob$conf.int[2], 2)`.
</div>
Expand Down
6 changes: 3 additions & 3 deletions inst/tutorials/discovr_10/discovr_10.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ agg_rob <- parameters::model_parameters(agg_lm, vcov = TRUE, vcov.type = "HC4")


<div class="reportbox">
`r pencil()` **Report it!**
`r pencil()` **Report**`r rproj()`

Consistent with the non-robust model, the robust model shows a significant moderation effect, $\hat{b}$ = `r report_pars(agg_rob, row = 4, digits = 3)`.
</div>
Expand Down Expand Up @@ -557,7 +557,7 @@ When callous traits fall below $-17.10$, the values of *y* (the relationship bet
The simple slopes analysis reports three models: the model for time spent gaming as a predictor of aggression (1) when callous traits are low (to be precise when the value of callous traits is $-9.62$); (2) at the mean value of callous traits (because we centred callous traits its mean value is 0, as indicated in the output); and (3) when the value of callous traits is 9.62 (i.e., high). We interpret these models as we would any other linear model by looking at the value of b (called Est. in the output), and its significance.

<div class="reportbox">
`r pencil()` **Report it!**
`r pencil()` **Report**`r rproj()`

When callous traits are low, there is a non-significant negative relationship between time spent gaming and aggression, $\hat{b} = -0.09$, 95% CI [$-0.30$, $0.12$], $t = -0.86$, $p = 0.39$. At the mean value of callous traits, there is a significant positive relationship between time spent gaming and aggression, $\hat{b} = 0.17$, 95% CI [$0.02$, $0.32$], $t = 2.23$, $p = 0.03$. When callous traits are high, there is a significant positive relationship between time spent gaming and aggression, $\hat{b} = 0.43$, 95% CI [$0.23$, $0.63$], $t = 4.26$, $p < 0.01$.
</div>
Expand Down Expand Up @@ -817,7 +817,7 @@ In the second output, for the effects that we assigned labels (a, b, c, indirect
The bottom row shows the total effect of pornography consumption on infidelity (outcome). Remember that the total effect is the effect of the predictor on the outcome when the mediator is not present in the model. When relationship commitment is not in the model, pornography consumption significantly predicts infidelity, $\hat{b}$ = `r report_pars(porn_par, row = 11, digits = 2)`. As is the case when we include relationship commitment in the model, pornography consumption has a positive relationship with infidelity (as shown by the positive *b*-value). The most important part of the output is the penultimate row because it displays the results for the indirect effect of pornography consumption on infidelity (i.e., the effect via relationship commitment). The indirect effect is not quite significant, $\hat{b}$ = `r report_pars(porn_par, row = 10, digits = 2)`, suggesting that there isn't a significant mediation effect.

<div class="reportbox">
`r pencil()` **Report it!**
`r pencil()` **Report**`r rproj()`

When relationship commitment was not in the model, pornography consumption had a significant positive relationship with infidelity, $\hat{b}$ = `r report_pars(porn_par, row = 11, digits = 2)`. With relationship commitment included in the model, pornography consumption did not quite significantly predict infidelity, $\hat{c}$ = `r report_pars(porn_par, row = 1, digits = 2)`. Pornography consumption significantly predicted relationship commitment, $\hat{a}$ = `r report_pars(porn_par, row = 3, digits = 2)`, and relationship commitment significantly predicted infidelity, $\hat{b}$ = `r report_pars(porn_par, row = 2, digits = 2)`. Most important, the indirect of pornography consumtpion on infidelity was not quite significant, $\hat{b}$ = `r report_pars(porn_par, row = 10, digits = 2)`, suggesting that there a non-significant mediation effect.
</div>
Expand Down
6 changes: 3 additions & 3 deletions inst/tutorials/discovr_11/discovr_11.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ Moving onto the parameter estimates, $\hat{b}_0$ (the value in the column labell
The *b*-value for the second dummy variable (labelled [dose30 mins]{.alt}) is equal to the difference between the means of the 30-minute group and the control group (`r pup_sum$mean[3]` $−$ `r pup_sum$mean[1]` = `r get_par(pup_par, row = 3)`). These values demonstrate how dummy coding partitions the variance in happiness scores to compare specific group means. We can see from the significance values of the associated *t*-tests that the difference between the 30-minute group and the control group is significant because *p* = `r sprintf("%.3f", pup_par$p[3])`, which is less than 0.05; however, the difference between the 15-minute and the control group is not (*p* = `r sprintf("%.3f", pup_par$p[2])`).

<div class="reportbox">
`r pencil()` **Report it!**
`r pencil()` **Report**`r rproj()`

Overall, happiness was significantly different across the three therapy groups, `r report_aovf(pup_aov)`. Happiness was significantly different to zero in the no puppies group, $\hat{b}$ = `r report_pars(pup_par, row = 1)`, was not significantly higher in the 15-minute therapy group compared to the no puppy control, $\hat{b}$ = `r report_pars(pup_par, row = 2)`, but was significantly higher the 15-minute therapy group compared to the no puppy control, $\hat{b}$ = `r report_pars(pup_par, row = 3)`. A 30-minutes dose of puppies, therefore, appears to improve happiness compared to no puppies but a 15-minutes does does not.
</div>
Expand Down Expand Up @@ -775,7 +775,7 @@ The table of parameter estimates is different to before. Notice that the contras
The second contrast shows that the mean happiness across the people having 30-minutes of puppy therapy was `r sprintf("%.2f", con_par$estimate[3])` higher than those having 15 minutes. Again, if we assume this sample is one of the 95% that yields confidence intervals containing the population values then this difference could be anything between `r sprintf("%.2f", con_par$conf.low[3])` (people who have 30 minutes of puppy therapy are less happy than those having 15 minutes) and `r sprintf("%.2f", con_par$conf.high[3])` (people having 30 minutes of puppy therapy are a fair bit happier than those having 15 minutes). The observed difference of `r sprintf("%.2f", con_par$estimate[3])` is not statistically significantly different from 0 as shown by the *t*-test, which has a *p* = `r sprintf("%.3f", con_par$p.value[3])`. This contrast suggests that happiness was statistically comparable in those receiving 15- and 30-minutes of puppy therapy.

<div class="reportbox">
`r pencil()` **Report it!**
`r pencil()` **Report**`r rproj()`

Overall, happiness was significantly different across the three therapy groups, `r report_aovf(con_aov)`. Happiness was significantly different to zero in the no puppies group, $\hat{b}$ = `r report_pars(con_par, row = 1)`. Happiness was significantly higher for those that had any puppy therapy compared to the no puppy control, $\hat{b}$ = `r report_pars(con_par, row = 2)`, but was not significantly different in the 30-minute therapy group compared to the 15-minute group, $\hat{b}$ = `r report_pars(con_par, row = 3)`. A dose of puppies, therefore, appears to improve happiness compared to no puppies but the duration of therapy did not have a significant impact.
</div>
Expand Down Expand Up @@ -1006,7 +1006,7 @@ d_1530 <-puppy_tib |>
```

<div class="reportbox">
`r pencil()` **Report it!**
`r pencil()` **Report**`r rproj()`

Participants were significantly more happy after 30-minutes of puppy therapy compared to no puppies, $M_{\text{difference}}$ = `r report_pars(pup_ph, row = 3)`, `r report_es(d_con30, col = "Hedges_g")`. The effect size was suspiciously large. There was no significant difference in happiness between those exposed for 15-minutes compared to no puppies, $M_{\text{difference}}$ = `r report_pars(pup_ph, row = 2)`, `r report_es(d_con15, col = "Hedges_g")` although the effect was large. Also, there was no significant difference in happiness between those exposed for 15-minutes compared to 30-minutes, $M_{\text{difference}}$ = `r report_pars(pup_ph, row = 1)`, `r report_es(d_1530, col = "Hedges_g")` although the difference was greater than a standard deviation.

Expand Down
8 changes: 4 additions & 4 deletions inst/tutorials/discovr_13/discovr_13.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ gog_afx_tbl <- goggles_afx$anova_table
```

<div class="reportbox">
`r pencil()` **Report it!**
`r pencil()` **Report**`r rproj()`

There was a significant effects of the type of face used, `r report_afx(gog_afx_tbl, row = 1)`, and the dose of alcohol, `r report_afx(gog_afx_tbl, row = 2)`. However, these effects were superseded by a significant interaction between the type of face being rated and the dose of alcohol, `r report_afx(gog_afx_tbl, row = 3)`. This interaction suggests that the effect of alcohol is moderated by the type of face being rated (and vice versa). Based on the means (see plot) this interaction supports the 'beer-googles' hypothesis: when no alcohol is consumed symmetric faces were rated as more attractive than asymmetric faces but this difference diminishes as more alcohol is consumed.
</div>
Expand Down Expand Up @@ -778,7 +778,7 @@ There are two key effects here:
To sum up, the significant interaction is being driven by alcohol consumption (any dose compared to placebo, and high dose compared to low) affecting ratings of unattractive face stimuli significantly more than it affects ratings of attractive face stimuli.

<div class="reportbox">
`r pencil()` **Report it!**
`r pencil()` **Report**`r rproj()`

There was a significant effects of the type of face used, `r report_afx(gog_afx_tbl, row = 1)`, and the dose of alcohol, `r report_afx(gog_afx_tbl, row = 2)`. However, these effects were superseded by a significant interaction between the type of face being rated and the dose of alcohol, `r report_afx(gog_afx_tbl, row = 3)`. Contrasts suggested that the difference between ratings of symmetric and asymmetric faces was significantly smaller after any dose of alcohol compared to no alcohol, $\hat{b}$ = `r report_pars(goggles_par, row = 5)`, and became smaller still when comparing a high- to a low-dose of alcohol, $\hat{b}$ = `r report_pars(goggles_par, row = 6)`. These effects support the 'beer-googles' hypothesis: when no alcohol is consumed symmetric faces were rated as more attractive than asymmetric faces but this difference diminishes as more alcohol is consumed.
</div>
Expand Down Expand Up @@ -902,7 +902,7 @@ gog_se <- emmeans::joint_tests(goggles_afx, "alcohol")
```

<div class="reportbox">
`r pencil()` **Report it!**
`r pencil()` **Report**`r rproj()`

There was a significant effects of the type of face used, `r report_afx(gog_afx_tbl, row = 1)`, and the dose of alcohol, `r report_afx(gog_afx_tbl, row = 2)`. However, these effects were superseded by a significant interaction between the type of face being rated and the dose of alcohol, `r report_afx(gog_afx_tbl, row = 3)`. Simple effects analysis revealed that symmetric faces were rated as significant more attractive than asymmetric faces after no alcohol, `r report_se(gog_se, row = 1)`, and a low dose, `r report_se(gog_se, row = 2)`, but were rated comparably after a high dose of alcohol, `r report_se(gog_se, row = 3)`. These effects support the 'beer-googles' hypothesis: the standard tendency to rate symmetric faces as more attractive than asymmetric faces was present at low doses and no alcohol, but was eliminated by a high dose of alcohol.
</div>
Expand Down Expand Up @@ -1099,7 +1099,7 @@ gog_os <- goggles_afx |>
The effect sizes are slightly smaller than (as we'd expect) using omega-squared. The interaction effect now explains about 25% of variation in attractiveness ratings.

<div class="reportbox">
`r pencil()` **Report it!**
`r pencil()` **Report**`r rproj()`

There was a significant effects of the type of face used, `r report_afx(gog_afx_tbl, row = 1)`, `r report_es(gog_os, col = "Omega2_partial", row = 1)`, and the dose of alcohol, `r report_afx(gog_afx_tbl, row = 2)`, `r report_es(gog_os, col = "Omega2_partial", row = 2)`. However, these effects were superseded by a significant interaction between the type of face being rated and the dose of alcohol, `r report_afx(gog_afx_tbl, row = 3)`, `r report_es(gog_os, col = "Omega2_partial", row = 3)`. This interaction suggests that the effect of alcohol is moderated by the type of face being rated (and vice versa). Based on the means (see plot) this interaction supports the 'beer-googles' hypothesis: when no alcohol is consumed symmetric faces were rated as more attractive than asymmetric faces but this difference diminishes as more alcohol is consumed.
</div>
Expand Down
4 changes: 2 additions & 2 deletions inst/tutorials/discovr_14/discovr_14.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ bob_aov <- anova(cosmetic_bob) |> tibble::as_tibble(rownames = "effect")


<div class="reportbox">
`r pencil()` **Report it!**
`r pencil()` **Report**`r rproj()`

There are significant effects of baseline quality of life, `r report_aov(bob_aov, row = 3)` and the months × reason interaction, `r report_aov(bob_aov, row = 4)`, but not the overall effect of months, `r report_aov(bob_aov, row = 1)`, or the main effect of reason, `r report_aov(bob_aov, row = 2)`.
</div>
Expand Down Expand Up @@ -1203,7 +1203,7 @@ The resulting plot shows what we already know from the parameter estimates for t


<div class="reportbox">
`r pencil()` **Report it!**
`r pencil()` **Report**`r rproj()`

There was non-zero variability in intercepts and slopes. The estimate of standard deviation of intercepts across clinics was $\hat{\sigma}_{u_0}$ = `r report_pars(bob_coef, row = 6, fixed = F)`, the standard deviation of slopes across clinics was $\hat{\sigma}_{u_\text{months}}$ = `r report_pars(bob_coef, row = 8, fixed = F)`, and the residual standard deviation was $\sigma$ = `r report_pars(bob_coef, row = 9, fixed = F)`. The estimated correlation between slopes and intercepts was $r_{u_0, u_\text{months}}$ = `r report_pars(bob_coef, row = 7, fixed = F)` suggesting that clinics with large intercepts tended to have smaller slopes.

Expand Down
Loading

0 comments on commit 762788a

Please sign in to comment.