Skip to content

Commit c2ac0f7

Browse files
committed
add section about reporting the rsults
1 parent a8ff42b commit c2ac0f7

File tree

1 file changed

+91
-7
lines changed

1 file changed

+91
-7
lines changed

apps & wrappers/BRMS demo.Rmd

Lines changed: 91 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,17 @@ We demonstrate these two equivalent approaches in the following code:
233233
```{r}
234234
summary_stats_HRDT<-
235235
as_draws_df(fit_eip_HRDT) %>%
236-
select(b_alpha_conditiontreatment,,b_beta_conditiontreatment) %>%
236+
select(b_alpha_Intercept,b_beta_Intercept,b_alpha_conditiontreatment,b_beta_conditiontreatment) %>%
237+
mutate(
238+
mean_alpha_treatment=b_alpha_Intercept+b_alpha_conditiontreatment,
239+
mean_beta_treatment=b_beta_Intercept+b_beta_conditiontreatment
240+
) %>%
241+
rename(
242+
mean_alpha_control=b_alpha_Intercept,
243+
mean_beta_control=b_beta_Intercept,
244+
mean_alpha_diff=b_alpha_conditiontreatment,
245+
mean_beta_diff=b_beta_conditiontreatment
246+
) %>%
237247
pivot_longer(everything()) %>%
238248
group_by(name) %>%
239249
summarise(
@@ -245,8 +255,39 @@ summary_stats_HRDT<-
245255
)
246256
print(summary_stats_HRDT)
247257
```
248-
249-
These results indicate a "significant" effect of treatment on the threshold parameter alpha but not on the slope parameter beta. This corresponds to the group mean differences that we used to simulate the data, which were 5 and 0 for alpha and beta respectively.
258+
## Reporting the results
259+
If we use the conventional 5% threshold, these results indicate a significant effect of treatment on the threshold parameter alpha but not on the slope parameter beta. This corresponds to the group mean differences that we used to simulate the data, which were 5 and 0 for alpha and beta respectively.
260+
We could write something like this to report these results in a paper:
261+
```{r}
262+
sprintf(
263+
"Treatment led to a significant increase of the threshold (mean difference [95%% CI]: %0.2f [%0.2f ; %0.2f] ΔBPM, pseudo p-value: %0.3f), corresponding to a reduced tendency to underestimate one's heart rate (mean threshold for control: %0.2f [%0.2f ; %0.2f]; mean threshold for treatment: %0.2f [%0.2f ; %0.2f]). Conversely, the slope appeared unaffected by treatment (mean log(slope) difference: %0.2f [%0.2f ; %0.2f], pseudo p-value: %0.3f), indicating similar precision of judgements made under treatment or control (mean slope for control: %0.2f [%0.2f ; %0.2f]; mean slope for treatment: %0.2f [%0.2f ; %0.2f]).",
264+
summary_stats_HRDT$m[2],
265+
summary_stats_HRDT$LB[2],
266+
summary_stats_HRDT$UB[2],
267+
summary_stats_HRDT$pseudo_p_value[2],
268+
269+
summary_stats_HRDT$m[1],
270+
summary_stats_HRDT$LB[1],
271+
summary_stats_HRDT$UB[1],
272+
273+
summary_stats_HRDT$m[3],
274+
summary_stats_HRDT$LB[3],
275+
summary_stats_HRDT$UB[3],
276+
277+
summary_stats_HRDT$m[5],
278+
summary_stats_HRDT$LB[5],
279+
summary_stats_HRDT$UB[5],
280+
summary_stats_HRDT$pseudo_p_value[5],
281+
282+
exp(summary_stats_HRDT$m[4]),
283+
exp(summary_stats_HRDT$LB[4]),
284+
exp(summary_stats_HRDT$UB[4]),
285+
286+
exp(summary_stats_HRDT$m[6]),
287+
exp(summary_stats_HRDT$LB[6]),
288+
exp(summary_stats_HRDT$UB[6])
289+
)
290+
```
250291

251292
## Visualization
252293

@@ -641,7 +682,17 @@ We demonstrate these two equivalent approaches in the following code:
641682
```{r}
642683
summary_stats_RRST<-
643684
as_draws_df(fit_eip_RRST) %>%
644-
select(b_alpha_conditiontreatment,b_beta_conditiontreatment) %>%
685+
select(b_alpha_Intercept,b_beta_Intercept,b_alpha_conditiontreatment,b_beta_conditiontreatment) %>%
686+
mutate(
687+
mean_alpha_treatment=b_alpha_Intercept+b_alpha_conditiontreatment,
688+
mean_beta_treatment=b_beta_Intercept+b_beta_conditiontreatment
689+
) %>%
690+
rename(
691+
mean_alpha_control=b_alpha_Intercept,
692+
mean_beta_control=b_beta_Intercept,
693+
mean_alpha_diff=b_alpha_conditiontreatment,
694+
mean_beta_diff=b_beta_conditiontreatment
695+
) %>%
645696
pivot_longer(everything()) %>%
646697
group_by(name) %>%
647698
summarise(
@@ -654,7 +705,7 @@ summary_stats_RRST<-
654705
print(summary_stats_RRST)
655706
```
656707

657-
These results indicate a "significant" effect of treatment on the threshold parameter alpha but not on the slope parameter beta. This corresponds to the group mean differences that we used to simulate the data, which were -0.07 and 0 for alpha and beta respectively.
708+
If we use the conventional 5% threshold, these results indicate a significant effect of treatment on the threshold parameter alpha but not on the slope parameter beta. This corresponds to the group mean differences that we used to simulate the data, which were -0.07 and 0 for alpha and beta respectively.
658709

659710
Here we need to warn you about a specificity of non-symmetrical PFs such as the Weibull or the Gumbell. For these functions, the slope parameter beta is a shape parameter rather than a dispersion/precision parameter like in the case of the Gaussian CDF. As a consequence the actual dispersion/precision/slope of the PF is set by both the threshold parameter alpha and the "slope" parameter beta.
660711

@@ -739,9 +790,42 @@ print(spread_diffs_stats)
739790
```
740791

741792
Despite having no significant effect of treatment on parameter beta, we have a significant reduction of the spread by treatment.
742-
This corresponds to the parameters with simulations.
793+
This corresponds to the parameters we usd for simulations.
743794
When we plot the group mean PFs later, we will see that, indeed, the treatment PF is steeper than the control one, indexing more precise or reliable perception under the treatment condition.
744795

796+
## Reporting the results
797+
798+
We could write something like this to report these results in a paper:
799+
```{r}
800+
sprintf(
801+
"Treatment led to a significant decrease of the threshold (mean [95%% CI] log(threshold) difference: %0.2f [%0.2f ; %0.2f] arbitrary occlusion units, pseudo p-value: %0.3f), indexing increased sensitivity to occlusion under treatment (mean threshold for control: %0.2f%% [%0.2f%% ; %0.2f%%] occlusion; for treatment: %0.2f%% [%0.2f%% ; %0.2f%%]). Additionnaly, the spread of the function was also reduced (mean spread difference: %0.2f%% [%0.2f%% ; %0.2f%%] occlusion, pseudo p-value: %0.3f), indicating increased precision of judgements made under treatment compared to control (mean spread for control: %0.2f%% [%0.2f%% ; %0.2f%%]; for treatment: %0.2f%% [%0.2f%% ; %0.2f%%]).",
802+
summary_stats_RRST$m[2],
803+
summary_stats_RRST$LB[2],
804+
summary_stats_RRST$UB[2],
805+
summary_stats_RRST$pseudo_p_value[2],
806+
807+
100*exp(summary_stats_RRST$m[1])/17,
808+
100*exp(summary_stats_RRST$LB[1])/17,
809+
100*exp(summary_stats_RRST$UB[1])/17,
810+
811+
100*exp(summary_stats_RRST$m[3])/17,
812+
100*exp(summary_stats_RRST$LB[3])/17,
813+
100*exp(summary_stats_RRST$UB[3])/17,
814+
815+
100*spread_diffs_stats$m/17,
816+
100*spread_diffs_stats$LB/17,
817+
100*spread_diffs_stats$UB/17,
818+
spread_diffs_stats$pseudo_p_value,
819+
820+
100*spreads_stats$m[1]/17,
821+
100*spreads_stats$LB[1]/17,
822+
100*spreads_stats$UB[1]/17,
823+
824+
100*spreads_stats$m[2]/17,
825+
100*spreads_stats$LB[2]/17,
826+
100*spreads_stats$UB[2]/17
827+
)
828+
```
745829
## Visualization
746830

747831
### Group mean differences
@@ -766,7 +850,7 @@ as_draws_df(fit_eip_RRST) %>%
766850
full_join(summary_stats_RRST) %>%
767851
filter(name=='b_alpha_conditiontreatment') %>%
768852
full_join(spread_differences_long) %>%
769-
mutate(name=factor(name,c('b_alpha_conditiontreatment','spread_difference'),c('Threshold','Spread'))) %>%
853+
mutate(name=factor(name,c('b_alpha_conditiontreatment','spread_difference'),c('Log(Threshold)','Spread'))) %>%
770854
ggplot()+
771855
geom_histogram(aes(x=value),color='black')+
772856
geom_vline(aes(xintercept = 0),linetype='dotted',color='grey',linewidth=1)+

0 commit comments

Comments
 (0)