Title: | An Implementation of Ordinal Pattern Analysis |
---|---|
Description: | Quantifies hypothesis to data fit for repeated measures and longitudinal data, as described by Thorngate (1987) <doi:10.1016/S0166-4115(08)60083-7> and Grice et al., (2015) <doi:10.1177/2158244015604192>. Hypothesis and data are encoded as pairwise relative orderings which are then compared to determine the percentage of orderings in the data that are matched by the hypothesis. |
Authors: | Timothy Beechey [aut, cre] |
Maintainer: | Timothy Beechey <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.8.2.033 |
Built: | 2025-02-02 04:10:48 UTC |
Source: | https://github.com/timbeechey/opa |
A data frame with 20 rows and 14 columns containing times between visits to a mechanical flower by bees in two experimental conditions.
bees
bees
Unique identifier for each individual bee.
Factor identifying the two experimental conditions. In the frustrated condition bees were temporarily restricted from returning to the hive after collecting nectar, in the free condition bees were able to return to the hive without delay.
Time between visits to the mechanical flower (in seconds) in each of 12 consecutive trials.
Grice, J. W., Craig, D. P. A., & Abramson, C. I. (2015). A Simple and Transparent Alternative to Repeated Measures ANOVA. SAGE Open, 5(3), 215824401560419. https://doi.org/10.1177/2158244015604192
Calculates PCCs and c-values based on pairwise comparison of conditions.
compare_conditions(result, nreps = 1000L)
compare_conditions(result, nreps = 1000L)
result |
an object of class "opafit" produced by a call to opa(). |
nreps |
an integer |
compare_conditions
returns a list with the following elements
A lower triangle matrix containing PCCs calculated from each pairing of data columns.
A lower triangle matrix containing c-values calculated from each pairing of data columns.
A vector containing PCCs calculated from each pairing of data.
A vector containing c-values calculated from each pairing of data.
The number of permutations used to calculate the c-values.
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11), t4 = c(10, 5, 11, 12)) h <- hypothesis(1:4) opamod <- opa(dat, h) compare_conditions(opamod)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11), t4 = c(10, 5, 11, 12)) h <- hypothesis(1:4) opamod <- opa(dat, h) compare_conditions(opamod)
Calculate the c-value of the difference in PCCs produced by two groups
compare_groups(m, group1, group2, two_tailed)
compare_groups(m, group1, group2, two_tailed)
m |
an object of class "opafit" produced by a call to opa(). |
group1 |
a character string which matches a group level passed to opa(). |
group2 |
a character string which matches a group level passed to opa(). |
two_tailed |
a boolean indicating whether the comparison is two-tailed. |
an object of class "opaGroupComparison".
dat <- data.frame(group = c("a", "b", "a", "b"), t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) dat$group <- factor(dat$group, levels = c("a", "b")) h <- hypothesis(1:3) opamod <- opa(dat[,2:4], h, group = dat$group) compare_groups(opamod, "a", "b")
dat <- data.frame(group = c("a", "b", "a", "b"), t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) dat$group <- factor(dat$group, levels = c("a", "b")) h <- hypothesis(1:3) opamod <- opa(dat[,2:4], h, group = dat$group) compare_groups(opamod, "a", "b")
Calculate the c-value of the difference in PCCs produced by two hypotheses
compare_hypotheses(m1, m2, two_tailed)
compare_hypotheses(m1, m2, two_tailed)
m1 |
an object of class "opafit" produced by a call to opa(). |
m2 |
an object of class "opafit" produced by a call to opa(). |
two_tailed |
a boolean indicating whether the comparison is two-tailed. |
an object of class "opaHypothesisComparison".
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11), t4 = c(10, 5, 11, 12)) h1 <- hypothesis(c(1, 2, 3, 4)) h2 <- hypothesis(c(1, 4, 2, 3)) opamod1 <- opa(dat, h1) opamod2 <- opa(dat, h2) compare_hypotheses(opamod1, opamod2, two_tailed = TRUE)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11), t4 = c(10, 5, 11, 12)) h1 <- hypothesis(c(1, 2, 3, 4)) h2 <- hypothesis(c(1, 4, 2, 3)) opamod1 <- opa(dat, h1) opamod2 <- opa(dat, h2) compare_hypotheses(opamod1, opamod2, two_tailed = TRUE)
Return the number of pairs of observations matched by the hypothesis
correct_pairs(m)
correct_pairs(m)
m |
an object of class "opafit" |
a non-negative integer
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) correct_pairs(opamod)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) correct_pairs(opamod)
Plot individual chance values
cval_plot(m)
cval_plot(m)
m |
an object of class "opafit" |
No return value, called for side effects.
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) cval_plot(opamod)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) cval_plot(opamod)
Return the group chance values of the specified model
group_cvals(m)
group_cvals(m)
m |
an object of class "opafit" |
a numeric vector
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) group_cvals(opamod)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) group_cvals(opamod)
Return the group PCCs of the specified model
group_pccs(m)
group_pccs(m)
m |
an object of class "opafit" |
a numeric vector
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) group_pccs(opamod)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) group_pccs(opamod)
Group-level PCC and chance values.
group_results(m, digits)
group_results(m, digits)
m |
an object of class "opafit" produced by |
digits |
a positive integer. |
If the model was fitted with no grouping variable, a single PCC and c-value
are returned. If a grouping variable was specified in the call to opa
then PCCs and c-values are returned for each factor level of the grouping
variable.
a matrix with 1 row per group.
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) group_results(opamod)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) group_results(opamod)
Create a hypothesis object
hypothesis(xs, type = "pairwise")
hypothesis(xs, type = "pairwise")
xs |
a numeric vector |
type |
a string |
a list containing the following elements
h1 <- hypothesis(c(2, 1, 3, 4), type = "pairwise") h2 <- hypothesis(c(2, 1, 3, 4), type = "adjacent")
h1 <- hypothesis(c(2, 1, 3, 4), type = "pairwise") h2 <- hypothesis(c(2, 1, 3, 4), type = "adjacent")
Return the number of pairs of observations not matched by the hypothesis
incorrect_pairs(m)
incorrect_pairs(m)
m |
an object of class "opafit" |
a non-negative integer
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) incorrect_pairs(opamod)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) incorrect_pairs(opamod)
Return the individual chance values of the specified model
individual_cvals(m)
individual_cvals(m)
m |
an object of class "opafit" |
a numeric vector
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) individual_cvals(opamod)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) individual_cvals(opamod)
Return the individual PCCs of the specified model
individual_pccs(m)
individual_pccs(m)
m |
an object of class "opafit" |
a numeric vector
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) individual_pccs(opamod)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) individual_pccs(opamod)
Individual-level PCC and chance values.
individual_results(m, digits)
individual_results(m, digits)
m |
an object of class "opafit" produced by |
digits |
an integer |
If the opa
model was fitted with no grouping variable, a matrix of PCCs
and c-values are returned corresponding to the order of rows in the data. If
the opa
model was fitted with a grouping variable specified, a table of
PCCs and c-values is returned ordered by factor level of the grouping
variable.
a matrix containing a column of PCC values and a column of c-values with 1 row per row of data.
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) individual_results(opamod)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) individual_results(opamod)
opa
is used to fit ordinal pattern analysis models by computing the
percentage of pair orderings in each row of data which are matched by
corresponding pair orderings in an hypothesis, in addition the chance of a
permutation of the data producing a percentage match as great.
opa( dat, hypothesis, group = NULL, pairing_type = "pairwise", diff_threshold = 0, nreps = 1000L, shuffle_across_individuals = FALSE )
opa( dat, hypothesis, group = NULL, pairing_type = "pairwise", diff_threshold = 0, nreps = 1000L, shuffle_across_individuals = FALSE )
dat |
a data frame |
hypothesis |
a numeric vector |
group |
an optional factor vector |
pairing_type |
a string |
diff_threshold |
a positive integer or floating point number |
nreps |
an integer, ignored if |
shuffle_across_individuals |
a boolean indicating whether to randomize data across individuals in c-value computation. |
Data is expected in wide format with 1 row per individual and 1 column per measurement condition. Data must contain only columns consisting of numerical values of the dependent variable.
The length of the hypothesis
must be equal to the number of columns in
the dependent variable data.frame dat
.
Any independent variable must be passed separately as a vector with the
group
keyword. The grouping vector must be a factor.
pairing_type
must be either "pairwise" or "adjacent". The "pairwise"
option considered the relative ordering of every pair of observations in
the data and every pair of elements of the hypothesis. The "adjacent" option
considers the ordering of adjacent pairs only. If unspecified, the default
is "pairwise".
diff_threshold
may be a positive integer or double. If unspecified
a default zero threshold is used. The diff_threshold
is never applied
to the hypothesis.
nreps
specifies the number of random reorderigs to use in the
calculation of chance-values.
opa
returns an object of class "opafit".
An object of class "opafit" is a list containing the folllowing components:
the percentage of pairwise orderings from all pooled data rows which were correctly classified by the hypothesis.
a vector containing the percentage of pairwise orderings that were correctly classified by the hypothesis for each data row.
an integer representing the number of pairwise orderings pooled across all data rows that were correctly classified by the hypothesis.
an integer, the number of pair orderings contained in the data.
the group-level chance value.
a vector containing chance values for each data row
A vector of PCCS calculated from each random ordering
with length equal to nreps, a list of vectors if a group
vector
was passed to opa()
.
The matched call
The hypothesis vector passed to opa()
A string indicating the method of pairing passed
to opa()
.
The numeric difference threshold used to calculate
PCCs. If no value was passed in the diff_threshold
, the default of
0 is used.
The data.frame passed to opa()
.
The vector of groups passed to opa
. If no group vector
was passed to opa()
the default of NULL is used.
an integer, the number of random re-orderings of the data used to compute chance values.
Grice, J. W., Craig, D. P. A., & Abramson, C. I. (2015). A Simple and Transparent Alternative to Repeated Measures ANOVA. SAGE Open, 5(3), 215824401560419. <https://doi.org/10.1177/2158244015604192>
Thorngate, W. (1987). Ordinal Pattern Analysis: A Method for Assessing Theory-Data Fit. Advances in Psychology, 40, 345–364. <https://doi.org/10.1016/S0166-4115(08)60083-7>
dat <- data.frame(group = c("a", "b", "a", "b"), t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) dat$group <- factor(dat$group, levels = c("a", "b")) h <- hypothesis(1:3) opamod <- opa(dat[,2:4], h, group = dat$group)
dat <- data.frame(group = c("a", "b", "a", "b"), t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) dat$group <- factor(dat$group, levels = c("a", "b")) h <- hypothesis(1:3) opamod <- opa(dat[,2:4], h, group = dat$group)
Plot individual PCCs.
pcc_plot(m)
pcc_plot(m)
m |
an object of class "opafit" |
No return value, called for side effects.
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) pcc_plot(opamod)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) pcc_plot(opamod)
A data frame with 108 rows and 4 columns containing data on the distance from the the pituitary to the pteryo-maxillary fissure in children.
pituitary
pituitary
Distance in mm from the pituitary to the pteryo-maxillary fissure.
Age in years.
Unique identifier for each individual.
Biological sex of each individual.
Potthoff, R. F., & Roy, S. N. (1964). A Generalized Multivariate Analysis of Variance Model Useful Especially for Growth Curve Problems. Biometrika, 51(3/4), 313–326. https://doi.org/10.2307/2334137
Plots individual-level PCCs and chance-values.
## S3 method for class 'opafit' plot(x, ...)
## S3 method for class 'opafit' plot(x, ...)
x |
an object of class "opafit" produced by |
... |
ignored |
No return value, called for side effects.
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) plot(opamod)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) plot(opamod)
Plot group comparison PCC replicates.
## S3 method for class 'opaGroupComparison' plot(x, ...)
## S3 method for class 'opaGroupComparison' plot(x, ...)
x |
an object of class "oparandpccs" produced by |
... |
ignored |
Plot a histogram of PCCs computed from randomly reordered data used to calculate the chance-value for a group comparison.
no return value, called for side effects only.
dat <- data.frame(group = c("a", "b", "a", "b"), t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) dat$group <- factor(dat$group, levels = c("a", "b")) h <- hypothesis(1:3) opamod <- opa(dat[,2:4], h, group = dat$group) z <- compare_groups(opamod, "a", "b") plot(z)
dat <- data.frame(group = c("a", "b", "a", "b"), t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) dat$group <- factor(dat$group, levels = c("a", "b")) h <- hypothesis(1:3) opamod <- opa(dat[,2:4], h, group = dat$group) z <- compare_groups(opamod, "a", "b") plot(z)
Plot a hypothesis.
## S3 method for class 'opahypothesis' plot(x, title = TRUE, ...)
## S3 method for class 'opahypothesis' plot(x, title = TRUE, ...)
x |
an object of class "opaHypothesis" |
title |
a boolean indicating whether to include a plot title |
... |
ignored |
No return value, called for side effects.
h <- hypothesis(c(1,2,3,3,3)) plot(h)
h <- hypothesis(c(1,2,3,3,3)) plot(h)
Plot hypothesis comparison PCC replicates.
## S3 method for class 'opaHypothesisComparison' plot(x, ...)
## S3 method for class 'opaHypothesisComparison' plot(x, ...)
x |
an object of class "oparandpccs" produced by |
... |
ignored |
Plot a histogram of PCCs computed from randomly reordered data used to calculate the chance-value for a hypothesis comparison.
no return value, called for side effects only.
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11), t4 = c(10, 5, 11, 12)) h1 <- hypothesis(c(1, 2, 3, 4)) h2 <- hypothesis(c(1, 4, 2, 3)) opamod1 <- opa(dat, h1) opamod2 <- opa(dat, h2) z <- compare_hypotheses(opamod1, opamod2) plot(z)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11), t4 = c(10, 5, 11, 12)) h1 <- hypothesis(c(1, 2, 3, 4)) h2 <- hypothesis(c(1, 4, 2, 3)) opamod1 <- opa(dat, h1) opamod2 <- opa(dat, h2) z <- compare_hypotheses(opamod1, opamod2) plot(z)
Plot PCC replicates.
## S3 method for class 'oparandpccs' plot(x, ...)
## S3 method for class 'oparandpccs' plot(x, ...)
x |
an object of class "oparandpccs" produced by |
... |
ignored |
Plot a histogram of PCCs computed from randomly reordered data used to calculate the chance-value.
no return value, called for side effects only.
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) plot(random_pccs(opamod))
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) plot(random_pccs(opamod))
Displays the call used to fit an ordinal pattern analysis model.
## S3 method for class 'opafit' print(x, ...)
## S3 method for class 'opafit' print(x, ...)
x |
an object of class "opafit". |
... |
ignored |
No return value, called for side effects.
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) print(opamod)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) print(opamod)
Prints a summary of results from hypothesis comparison.
## S3 method for class 'opaGroupComparison' print(x, ...)
## S3 method for class 'opaGroupComparison' print(x, ...)
x |
an object of class "opaHypothesisComparison". |
... |
ignored |
No return value, called for side effects.
dat <- data.frame(group = c("a", "b", "a", "b"), t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) dat$group <- factor(dat$group, levels = c("a", "b")) h <- hypothesis(1:3) opamod <- opa(dat[,2:4], h, group = dat$group) z <- compare_groups(opamod, "a", "b") print(z)
dat <- data.frame(group = c("a", "b", "a", "b"), t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) dat$group <- factor(dat$group, levels = c("a", "b")) h <- hypothesis(1:3) opamod <- opa(dat[,2:4], h, group = dat$group) z <- compare_groups(opamod, "a", "b") print(z)
Print details of a hypothesis
## S3 method for class 'opahypothesis' print(x, ...)
## S3 method for class 'opahypothesis' print(x, ...)
x |
an object of type "opaHypothesis" |
... |
ignored |
No return value, called for side-effects.
h1 <- hypothesis(c(2, 1, 3, 4), type = "pairwise") print(h1) h2 <- hypothesis(c(2, 1, 3, 4), type = "adjacent") print(h2)
h1 <- hypothesis(c(2, 1, 3, 4), type = "pairwise") print(h1) h2 <- hypothesis(c(2, 1, 3, 4), type = "adjacent") print(h2)
Prints a summary of results from hypothesis comparison.
## S3 method for class 'opaHypothesisComparison' print(x, ...)
## S3 method for class 'opaHypothesisComparison' print(x, ...)
x |
an object of class "opaHypothesisComparison". |
... |
ignored |
No return value, called for side effects.
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11), t4 = c(10, 5, 11, 12)) h1 <- hypothesis(c(1, 2, 3, 4)) h2 <- hypothesis(c(1, 4, 2, 3)) opamod1 <- opa(dat, h1) opamod2 <- opa(dat, h2) z <- compare_hypotheses(opamod1, opamod2) print(z)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11), t4 = c(10, 5, 11, 12)) h1 <- hypothesis(c(1, 2, 3, 4)) h2 <- hypothesis(c(1, 4, 2, 3)) opamod1 <- opa(dat, h1) opamod2 <- opa(dat, h2) z <- compare_hypotheses(opamod1, opamod2) print(z)
Displays the results of a pairwise ordinal pattern analysis.
## S3 method for class 'pairwiseopafit' print(x, ...)
## S3 method for class 'pairwiseopafit' print(x, ...)
x |
an object of class "pairwiseopafit". |
... |
ignored |
No return value, called for side effects.
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) pw <- compare_conditions(opamod) print(pw, digits = 2)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) pw <- compare_conditions(opamod) print(pw, digits = 2)
Return the random order generated PCCs used to calculate the group chance value
random_pccs(m)
random_pccs(m)
m |
an object of class "opafit" |
a numeric vector
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) random_pccs(opamod)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) random_pccs(opamod)
Prints a summary of results from a fitted ordinal pattern analysis model.
## S3 method for class 'opafit' summary(object, ..., digits = 2L)
## S3 method for class 'opafit' summary(object, ..., digits = 2L)
object |
an object of class "opafit". |
... |
ignored |
digits |
an integer used for rounding values in the output. |
No return value, called for side effects.
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) summary(opamod) summary(opamod, digits = 3)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) h <- hypothesis(1:3) opamod <- opa(dat, h) summary(opamod) summary(opamod, digits = 3)
Prints a summary of results from hypothesis comparison.
## S3 method for class 'opaGroupComparison' summary(object, ...)
## S3 method for class 'opaGroupComparison' summary(object, ...)
object |
an object of class "opaHypothesisComparison". |
... |
ignored |
No return value, called for side effects.
dat <- data.frame(group = c("a", "b", "a", "b"), t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) dat$group <- factor(dat$group, levels = c("a", "b")) h <- hypothesis(1:3) opamod <- opa(dat[,2:4], h, group = dat$group) z <- compare_groups(opamod, "a", "b") summary(z)
dat <- data.frame(group = c("a", "b", "a", "b"), t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11)) dat$group <- factor(dat$group, levels = c("a", "b")) h <- hypothesis(1:3) opamod <- opa(dat[,2:4], h, group = dat$group) z <- compare_groups(opamod, "a", "b") summary(z)
Prints a summary of results from hypothesis comparison.
## S3 method for class 'opaHypothesisComparison' summary(object, ...)
## S3 method for class 'opaHypothesisComparison' summary(object, ...)
object |
an object of class "opaHypothesisComparison". |
... |
ignored |
No return value, called for side effects.
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11), t4 = c(10, 5, 11, 12)) h1 <- hypothesis(c(1, 2, 3, 4)) h2 <- hypothesis(c(1, 4, 2, 3)) opamod1 <- opa(dat, h1) opamod2 <- opa(dat, h2) z <- compare_hypotheses(opamod1, opamod2) summary(z)
dat <- data.frame(t1 = c(9, 4, 8, 10), t2 = c(8, 8, 12, 10), t3 = c(8, 5, 10, 11), t4 = c(10, 5, 11, 12)) h1 <- hypothesis(c(1, 2, 3, 4)) h2 <- hypothesis(c(1, 4, 2, 3)) opamod1 <- opa(dat, h1) opamod2 <- opa(dat, h2) z <- compare_hypotheses(opamod1, opamod2) summary(z)