process_replication_study {mmibain} | R Documentation |
Process Replication Study Data
Description
This function processes the data from a replication study by comparing it
with the results from an original study, using the bain
package for Bayesian
inference.
Usage
process_replication_study(replication_data, original_study_results)
Arguments
replication_data |
A data frame containing the replication study data,
with columns |
original_study_results |
A list containing the results of an original study, including the hypothesis and pairwise t-test results, if applicable. |
Details
The function begins by extracting the original hypothesis (Horiginal
) from
the original_study_results
. It then generates the null hypothesis (Ho
)
using the generate_Ho_from_pairwise_t
function.
A hypothesis string for the Bayesian analysis is prepared by comparing Ho
and Horiginal
. If they are the same, only Horiginal
is used; otherwise,
both are included in the Bayesian analysis via bain
.
An ANOVA model is fitted to the replication data, which is then passed to
the bain
function along with the hypothesis string. The Bayesian analysis
results are returned along with any message regarding the comparison of
hypotheses.
Value
A list containing the results from the Bayesian analysis (bain_results
)
and a message indicating if the null hypothesis and the original hypothesis were
the same (message
).
Examples
replication_results <- process_replication_study(
replication_data = generate_study_data(
x = deal_cards_to_rc_grid(n = 3),
sample_size = 30
),
original_study_results = process_original_study(
df = generate_study_data(
x = deal_cards_to_rc_grid(n = 3),
sample_size = 30
),
alpha = 0.05
)
)