process_original_study {mmibain} | R Documentation |
Process Original Study Data for Analysis
Description
This function processes the original study data by performing ANOVA, post-hoc t-tests, and checking assumptions such as normality of residuals and homogeneity of variances.
Usage
process_original_study(df, alpha = 0.05)
Arguments
df |
A data frame containing the study data, with columns |
alpha |
Significance level for the statistical tests, by default set to 0.05. |
Details
The function starts by fitting an ANOVA model to the data to check for overall significance. If significant differences are found, it proceeds with pairwise t-tests to explore differences between individual conditions.
The function then checks for normality of residuals using the Shapiro-Wilk test and for homogeneity of variances using Levene's test. It constructs a hypothesis string based on the results of the pairwise t-tests.
A directed graph is created to represent the relationships between the conditions. The graph is then simplified to reflect the most direct relationships, which are used to construct the final hypothesis string.
Descriptive statistics are generated for each condition using the generate_descriptives() internal function.
The function returns a list with the following components:
-
hypothesis
: A string representing the simplified relationships between conditions. -
pairwise_t
: The result of pairwise t-tests, if performed. -
fit_summary
: The summary of the ANOVA model. -
descriptives
: Descriptive statistics for each condition. -
fit
: The ANOVA model object. -
shapiro_test
: The result of the Shapiro-Wilk normality test. -
levene_test
: The result of Levene's test for homogeneity of variances.
Value
A list containing elements for hypothesis, pairwise t-tests (if applicable), fit summary, descriptives, fit object, Shapiro-Wilk normality test result, and Levene's test result.
Examples
results <- process_original_study(df = generate_study_data(
x = deal_cards_to_rc_grid(n = 3),
sample_size = 30),
alpha = 0.05)