Skip to content

Commit

Permalink
docs: improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-titz committed Nov 10, 2023
1 parent 77b0a26 commit 9d3166b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
10 changes: 6 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -326,19 +326,21 @@ And now the contrast analysis:

```{r}
contr_wi <- calc_contrast(
dv = reading_test, within = music,
dv = reading_test,
within = music,
lambda_within = round(lambda_diff, 2),
id = participant, data = sedlmeier_p537
id = participant,
data = sedlmeier_p537
)
summary(contr_wi)
contr_wi
```

@sedlmeier2013 found a t-value of -3.75 and a g_contrast of -1.33. Again, there are slight differences to our calculation, likely due to rounding errors. Further note, that hypothesis 1 fits better, because the statistic and effect are negative.
@sedlmeier2013 found a t-value of -3.75 and a g_contrast of -1.33. Again, there is a slight difference for the t-value when compared to our calculation, likely due to rounding errors. Further note, that hypothesis 1 fits better because the statistic and effect are negative.

## Aggregated Data

Sometimes you would like to run a contrast analysis on aggregated data (e.g. when no raw data is available). If you have the means, standard deviations and sample sizes for every condition, you can do this with cofad. For instance, if we take our first example and aggregate it, we can still calculate the contrast analysis:
Sometimes you would like to run a contrast analysis on aggregated data (e.g. when no raw data is available). If you have the means, standard deviations and sample sizes for every condition, you can do this with cofad. For instance, if we take our first example and aggregate it, we can still run the contrast analysis:

```{r message=FALSE}
library(dplyr)
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,11 @@ And now the contrast analysis:

``` r
contr_wi <- calc_contrast(
dv = reading_test, within = music,
dv = reading_test,
within = music,
lambda_within = round(lambda_diff, 2),
id = participant, data = sedlmeier_p537
id = participant,
data = sedlmeier_p537
)
#> lambdas are centered and rounded to 3 digits
summary(contr_wi)
Expand All @@ -588,17 +590,18 @@ contr_wi
```

Sedlmeier & Renkewitz (2013) found a t-value of -3.75 and a g_contrast
of -1.33. Again, there are slight differences to our calculation, likely
due to rounding errors. Further note, that hypothesis 1 fits better,
because the statistic and effect are negative.
of -1.33. Again, there is a slight difference for the t-value when
compared to our calculation, likely due to rounding errors. Further
note, that hypothesis 1 fits better because the statistic and effect are
negative.

## Aggregated Data

Sometimes you would like to run a contrast analysis on aggregated data
(e.g. when no raw data is available). If you have the means, standard
deviations and sample sizes for every condition, you can do this with
cofad. For instance, if we take our first example and aggregate it, we
can still calculate the contrast analysis:
can still run the contrast analysis:

``` r
library(dplyr)
Expand Down

0 comments on commit 9d3166b

Please sign in to comment.