Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
timbeechey committed Mar 4, 2024
1 parent edcab91 commit c657e1d
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 46 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: opa
Type: Package
Title: An Implementation of Ordinal Pattern Analysis
Version: 0.8.2.026
Version: 0.8.2.027
Authors@R: person("Timothy", "Beechey", email = "[email protected]",
role = c("aut", "cre"), comment = c(ORCID = "0000-0001-8858-946X"))
Description: Quantifies hypothesis to data fit for repeated measures
Expand Down
10 changes: 2 additions & 8 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ knitr::opts_chunk$set(
)
# set plot colors
palette(c("#0072B2", "#999999", "#E69F00", "#56B4E9"))
palette(c("#0073C2FF", "#EFC000FF", "#868686FF", "#CD534CFF"))
```

# opa <a href="https://timbeechey.github.io/opa/"></a>
Expand Down Expand Up @@ -90,12 +90,6 @@ Individual-level model output can be plotted using:
plot(opamod)
```

To aid interpretation, individual PCCs and c-values can also be plotted relative to user-specified thresholds:

```{r threshold_plots, fig.width=9, fig.height=4.5, fig.align="center"}
plot(opamod, pcc_threshold = 90, cval_threshold = 0.1)
```

### Pairwise comparison of measurement conditions

Pairwise comparisons of measurement conditions can be calculated by applying the `compare_conditions()` function to an `opafit` object produced by a call to `opa()`:
Expand All @@ -111,7 +105,7 @@ print(condition_comparisons)
If the data consist of multiple groups a categorical grouping variable can be passed with the `group` keyword to produce results for each group within the data, in addition to individual results.

```{r group_data}
dat$group <- rep(c("A", "B", "C", "D"), 5)
dat$group <- rep(c("A", "B", "C", "D"), each = 5)
dat$group <- factor(dat$group, levels = c("A", "B", "C", "D"))
opamod2 <- opa(dat[, 1:4], h, group = dat$group)
Expand Down
65 changes: 28 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,6 @@ plot(opamod)

<img src="man/figures/README-plot_opamod1-1.png" style="display: block; margin: auto;" />

To aid interpretation, individual PCCs and c-values can also be plotted
relative to user-specified thresholds:

``` r
plot(opamod, pcc_threshold = 90, cval_threshold = 0.1)
```

<img src="man/figures/README-threshold_plots-1.png" style="display: block; margin: auto;" />

### Pairwise comparison of measurement conditions

Pairwise comparisons of measurement conditions can be calculated by
Expand Down Expand Up @@ -189,7 +180,7 @@ can be passed with the `group` keyword to produce results for each group
within the data, in addition to individual results.

``` r
dat$group <- rep(c("A", "B", "C", "D"), 5)
dat$group <- rep(c("A", "B", "C", "D"), each = 5)
dat$group <- factor(dat$group, levels = c("A", "B", "C", "D"))

opamod2 <- opa(dat[, 1:4], h, group = dat$group)
Expand All @@ -202,33 +193,33 @@ summary(opamod2, digits = 3)
#> Ordinal Pattern Analysis of 4 observations for 20 individuals in 4 groups
#>
#> Between subjects results:
#> PCC cval
#> A 100.000 <0.001
#> B 86.667 <0.001
#> C 93.333 <0.001
#> D 93.333 <0.001
#> PCC cval
#> A 96.667 <0.001
#> B 93.333 <0.001
#> C 86.667 0.002
#> D 96.667 <0.001
#>
#> Within subjects results:
#> Individual PCC cval
#> A 1 100.000 0.034
#> A.1 5 100.000 0.035
#> A.2 9 100.000 0.045
#> A.3 13 100.000 0.044
#> A.4 17 100.000 0.047
#> B 2 100.000 0.053
#> B.1 6 83.333 0.191
#> B.2 10 83.333 0.165
#> B.3 14 83.333 0.166
#> B.4 18 83.333 0.159
#> C 3 83.333 0.185
#> C.1 7 100.000 0.044
#> C.2 11 100.000 0.043
#> C.3 15 83.333 0.158
#> C.4 19 100.000 0.05
#> D 4 100.000 0.055
#> D.1 8 100.000 0.047
#> D.2 12 66.667 0.379
#> D.3 16 100.000 0.05
#> A.1 2 100.000 0.035
#> A.2 3 83.333 0.178
#> A.3 4 100.000 0.044
#> A.4 5 100.000 0.047
#> B 6 83.333 0.18
#> B.1 7 100.000 0.037
#> B.2 8 100.000 0.048
#> B.3 9 100.000 0.043
#> B.4 10 83.333 0.158
#> C 11 100.000 0.049
#> C.1 12 66.667 0.392
#> C.2 13 100.000 0.043
#> C.3 14 83.333 0.158
#> C.4 15 83.333 0.156
#> D 16 100.000 0.055
#> D.1 17 100.000 0.047
#> D.2 18 83.333 0.158
#> D.3 19 100.000 0.05
#> D.4 20 100.000 0.044
#>
#> PCCs were calculated for pairwise ordinal relationships using a difference threshold of 0.
Expand Down Expand Up @@ -261,10 +252,10 @@ summary(group_comp)
#> ********* Group Comparison **********
#> Group 1: A
#> Group 2: B
#> Group 1 PCC: 100
#> Group 2 PCC: 86.66667
#> PCC difference: 13.33333
#> cval: 0.43
#> Group 1 PCC: 96.66667
#> Group 2 PCC: 93.33333
#> PCC difference: 3.333333
#> cval: 0.776
#> Comparison type: two-tailed
```

Expand Down
Binary file modified man/figures/README-plot_hypothesis-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-plot_opamod1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-plot_opamod2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c657e1d

Please sign in to comment.