diff --git a/.Rbuildignore b/.Rbuildignore index 5f75dbbb..9c9f3e7e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -27,6 +27,7 @@ ^Makefile$ ^revdep$ ^vignettes/template_instructions.txt$ -^vignettes/random_reports.txt$ -^vignettes/plots.txt$ -^vignettes/distributions.txt$ +^vignettes/random_reports.Rmd$ +^vignettes/plots.Rmd$ +^vignettes/distributions.Rmd$ +^vignettes/sim_mixed.Rmd$ diff --git a/CRAN-RELEASE b/CRAN-RELEASE new file mode 100644 index 00000000..f2457ff8 --- /dev/null +++ b/CRAN-RELEASE @@ -0,0 +1,2 @@ +This package was submitted to CRAN on 2021-09-13. +Once it is accepted, delete this file and tag the release (commit 40d23d7). diff --git a/README.Rmd b/README.Rmd index 2f8ccade..27cb5df2 100644 --- a/README.Rmd +++ b/README.Rmd @@ -3,14 +3,13 @@ output: github_document always_allow_html: yes --- -# faux [![DOI](https://zenodo.org/badge/163506566.svg)](https://zenodo.org/badge/latestdoi/163506566) -[![CRAN version](https://www.r-pkg.org/badges/version-last-release/faux)]() -[![Downloads](https://cranlogs.r-pkg.org/badges/grand-total/faux)]() +![CRAN version](https://www.r-pkg.org/badges/version-last-release/faux) +![Downloads](https://cranlogs.r-pkg.org/badges/grand-total/faux) [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) [![Travis build status](https://travis-ci.org/debruine/faux.svg?branch=master)](https://travis-ci.org/debruine/faux) [![Coverage status](https://codecov.io/gh/debruine/faux/branch/master/graph/badge.svg)](https://codecov.io/github/debruine/faux?branch=master) @@ -52,7 +51,5 @@ And the development version from [GitHub](https://github.com/debruine/faux) with devtools::install_github("debruine/faux") ``` -See the [development version manual](https://debruine.github.io/faux/dev/). - -Please note that the [34m'faux'[39m project is released with a [Contributor Code of Conduct](https://github.com/debruine/faux/blob/master/CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms. +Please note that the 'faux' project is released with a [Contributor Code of Conduct](https://github.com/debruine/faux/blob/master/CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms. diff --git a/README.html b/README.html index 8336ab5d..eed6f4d4 100644 --- a/README.html +++ b/README.html @@ -5,7 +5,7 @@ -faux +Installation +

Contrasts other than treatment coding for factors with more than two levels have always confused me. I try to design all my own studies to never have more than two levels per categorical factor, but students in my data skills class are always trying to analyse data with three-level categories (or worse).

+

I thought it was just me, but some recent Twitter discussion showed me I’m not alone. There’s a serious jingle-jangle problem with contrasts. Here are some of the explainers that I found useful (thanks to everyone who recommended them).

+
    +
  1. +Contrasts in R by Marissa Barlaz
  2. +
  3. +Coding categorical predictor variables in factorial designs by Dale Barr
  4. +
  5. +Contrast Coding in Multiple Regression Analysis by Matthew Davis
  6. +
  7. +R Library Contrast Coding Systems for categorical variables by UCLA Statistical Consulting
  8. +
  9. +Rosetta store: Contrasts by GAMLj
  10. +
  11. +Coding Schemes for Categorical Variables by Phillip Alday
  12. +
  13. +Experimental personality designs: analyzing categorical by continuous variable interactions by West, Aiken & Krull
  14. +
+
+

+Terminology

+

Contrasts often have multiple names. The names I’m using try to maintain the relationship with the base R function, apart from anova coding, which was suggested by Dale Barr after I got frustrated that people use so many different labels for that (extremely useful) coding and each of the terms used is also used to refer to totally different codings by others.

+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
My nameOther namesR functionfaux function
TreatmentTreatment (2), Dummy (1, 4, 6), Simple (5)contr.treatmentcontr_code_treatment
AnovaDeviation (2), Contrast (1), Simple (4)contr.treatment - 1/kcontr_code_anova
SumSum (1, 2, 6), Effects (3), Deviation (4, 5), Unweighted Effects (7)contr.sumcontr_code_sum
DifferenceContrast (3), Forward/Backward (4), Repeated (5)MASS::contr.sdifcontr_code_difference
HelmertReverse Helmert (1, 4), Difference (5), Contrast (7)contr.helmert / (column_i+1)contr_code_helmert
PolynomialPolynomial (5), Orthogonal Polynomial (4), Trend (3)contr.polycontr_code_poly
+
+
+

+Faux Contrast Functions

+

These functions are under development

+

First, we’ll set up a simple experimental design and analyse it with lm(). I set empirical = TRUE to make interpreting the estimates easier.

+
+df <- sim_design(between = list(pet = c("cat", "dog", "ferret")), 
+                 n = c(50), mu = c(2, 4, 9), empirical = TRUE)
+

+

Notice that the default contrast is treatment coding, with “cat” as the baseline condition. The estimate for the intercept is the mean value for cats (\(2\)), while the term petdog is the mean value for dogs minus cats (\(4 - 2\)), and the term petferret is the mean value for ferrets minus cats (\(9 - 2\)).

+ + + + + + + + + +
+Contrasts + +lm(y ~ pet, df) +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +dog + +ferret +
+cat + +0 + +0 +
+dog + +1 + +0 +
+ferret + +0 + +1 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +2 + +0.141 + +14.1 + +0 +
+petdog + +2 + +0.200 + +10.0 + +0 +
+petferret + +7 + +0.200 + +35.0 + +0 +
+
+

In all the subsequent examples, try putting into words what the estimates for the intercept and terms mean in relation to the mean values for each group in the data.

+
+

+
+

+Treatment

+

Treatment coding (also called dummy coding) sets the mean of the reference group as the intercept. It is straightforward to interpret, especially when your factors have an obvious default or baseline value. This is the same type of coding as the default for factors shown above (unless you change your default using options()), but with clearer term labels.

+
+df$pet <- contr_code_treatment(df$pet)
+ + + + + + + + + +
+Contrasts + +lm(y ~ pet, df) +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +.dog-cat + +.ferret-cat +
+cat + +0 + +0 +
+dog + +1 + +0 +
+ferret + +0 + +1 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +2 + +0.141 + +14.1 + +0 +
+pet.dog-cat + +2 + +0.200 + +10.0 + +0 +
+pet.ferret-cat + +7 + +0.200 + +35.0 + +0 +
+
+

Each contrast compares one level with the reference level, which defaults to the first level, but you can set with the base argument. Now the intercept estimates the mean value for dogs (\(4\)).

+
+df$pet <- contr_code_treatment(df$pet, base = "dog")
+ + + + + + + + + +
+Contrasts + +lm(y ~ pet, df) +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +.cat-dog + +.ferret-dog +
+cat + +1 + +0 +
+dog + +0 + +0 +
+ferret + +0 + +1 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +4 + +0.141 + +28.3 + +0 +
+pet.cat-dog + +-2 + +0.200 + +-10.0 + +0 +
+pet.ferret-dog + +5 + +0.200 + +25.0 + +0 +
+
+

Set the reference level to the third level (“ferret”).

+
+df$pet <- contr_code_treatment(df$pet, base = 3)
+ + + + + + + + + +
+Contrasts + +lm(y ~ pet, df) +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +.cat-ferret + +.dog-ferret +
+cat + +1 + +0 +
+dog + +0 + +1 +
+ferret + +0 + +0 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +9 + +0.141 + +63.6 + +0 +
+pet.cat-ferret + +-7 + +0.200 + +-35.0 + +0 +
+pet.dog-ferret + +-5 + +0.200 + +-25.0 + +0 +
+
+
+
+

+Anova

+

Anova coding is identical to treatment coding, but sets the grand mean as the intercept. Each contrast compares one level with a reference level. This gives us values that are relatively easy to interpret and map onto ANOVA values.

+

Below is anova coding with the first level (“cat”) as the default base. Now the intercept is the grand mean, which is the mean of the three group means (\((2 + 4 + 9)/3\)). Notice that this is different from the mean value of y in our dataset (5, since the number of pets in each group is unbalanced. The term pet_dog-cat is the mean value for dogs minus cats (\(4 - 2\)) and the term pet_ferret-cat is the mean value for ferrets minus cats (\(9 - 2\)).

+
+df$pet <- contr_code_anova(df$pet)
+ + + + + + + + + +
+Contrasts + +lm(y ~ pet, df) +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +.dog-cat + +.ferret-cat +
+cat + +-0.333 + +-0.333 +
+dog + +0.667 + +-0.333 +
+ferret + +-0.333 + +0.667 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +5 + +0.082 + +61.2 + +0 +
+pet.dog-cat + +2 + +0.200 + +10.0 + +0 +
+pet.ferret-cat + +7 + +0.200 + +35.0 + +0 +
+
+

Anova coding with “dog” as the base. How does the interpretation of the terms change?

+
+df$pet <- contr_code_anova(df$pet, base = "dog")
+ + + + + + + + + +
+Contrasts + +lm(y ~ pet, df) +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +.cat-dog + +.ferret-dog +
+cat + +0.667 + +-0.333 +
+dog + +-0.333 + +-0.333 +
+ferret + +-0.333 + +0.667 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +5 + +0.082 + +61.2 + +0 +
+pet.cat-dog + +-2 + +0.200 + +-10.0 + +0 +
+pet.ferret-dog + +5 + +0.200 + +25.0 + +0 +
+
+

Anova coding with the third level (“ferret”) as the base.

+
+df$pet <- contr_code_anova(df$pet, base = 3)
+ + + + + + + + + +
+Contrasts + +lm(y ~ pet, df) +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +.cat-ferret + +.dog-ferret +
+cat + +0.667 + +-0.333 +
+dog + +-0.333 + +0.667 +
+ferret + +-0.333 + +-0.333 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +5 + +0.082 + +61.2 + +0 +
+pet.cat-ferret + +-7 + +0.200 + +-35.0 + +0 +
+pet.dog-ferret + +-5 + +0.200 + +-25.0 + +0 +
+
+
+
+

+Sum

+

Sum coding also sets the grand mean as the intercept. Each contrast compares one level with the grand mean. Therefore, the estimate for pet_cat-intercept is the difference between the mean value for cats and the grand mean (\(2 - 5\)).

+
+df$pet <- contr_code_sum(df$pet)
+ + + + + + + + + +
+Contrasts + +lm(y ~ pet, df) +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +.cat-intercept + +.dog-intercept +
+cat + +1 + +0 +
+dog + +0 + +1 +
+ferret + +-1 + +-1 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +5 + +0.082 + +61.24 + +0 +
+pet.cat-intercept + +-3 + +0.115 + +-25.98 + +0 +
+pet.dog-intercept + +-1 + +0.115 + +-8.66 + +0 +
+
+

You can’t compare all levels with the grand mean, and have to omit one level. This is the last level by default, but you can change it with the omit argument.

+
+df$pet <- contr_code_sum(df$pet, omit = "dog")
+ + + + + + + + + +
+Contrasts + +lm(y ~ pet, df) +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +.cat-intercept + +.ferret-intercept +
+cat + +1 + +0 +
+dog + +-1 + +-1 +
+ferret + +0 + +1 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +5 + +0.082 + +61.2 + +0 +
+pet.cat-intercept + +-3 + +0.115 + +-26.0 + +0 +
+pet.ferret-intercept + +4 + +0.115 + +34.6 + +0 +
+
+

Omit the first level (“cat”).

+
+df$pet <- contr_code_sum(df$pet, omit = 1)
+ + + + + + + + + +
+Contrasts + +lm(y ~ pet, df) +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +.dog-intercept + +.ferret-intercept +
+cat + +-1 + +-1 +
+dog + +1 + +0 +
+ferret + +0 + +1 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +5 + +0.082 + +61.24 + +0 +
+pet.dog-intercept + +-1 + +0.115 + +-8.66 + +0 +
+pet.ferret-intercept + +4 + +0.115 + +34.64 + +0 +
+
+
+
+

+Difference

+

A slightly different form of contrast coding is difference coding, also called forward, backward, or successive differences coding. It compares each level to the previous one, rather than to a baseline level.

+
+df$pet <- contr_code_difference(df$pet)
+ + + + + + + + + +
+Contrasts + +lm(y ~ pet, df) +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +.dog-cat + +.ferret-dog +
+cat + +-0.667 + +-0.333 +
+dog + +0.333 + +-0.333 +
+ferret + +0.333 + +0.667 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +5 + +0.082 + +61.2 + +0 +
+pet.dog-cat + +2 + +0.200 + +10.0 + +0 +
+pet.ferret-dog + +5 + +0.200 + +25.0 + +0 +
+
+

If you want to change which levels are compared, you can re-order the factor levels.

+
+df$pet <- contr_code_difference(df$pet, levels = c("ferret", "cat", "dog"))
+ + + + + + + + + +
+Contrasts + +lm(y ~ pet, df) +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +.cat-ferret + +.dog-cat +
+ferret + +-0.667 + +-0.333 +
+cat + +0.333 + +-0.333 +
+dog + +0.333 + +0.667 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +5 + +0.082 + +61.2 + +0 +
+pet.cat-ferret + +-7 + +0.200 + +-35.0 + +0 +
+pet.dog-cat + +2 + +0.200 + +10.0 + +0 +
+
+
+
+

+Helmert

+

Helmert coding sets the grand mean as the intercept. Each contrast compares one level with the mean of previous levels. This coding is somewhat different than the results from stats::contr.helmert() to make it easier to interpret the estimates. Thus, pet_ferret-cat.dog is the mean value for ferrets minus the mean value for cats and dogs averaged together (\(9-(2+4)/2\)).

+
+df$pet <- contr_code_helmert(df$pet)
+ + + + + + + + + +
+Contrasts + +lm(y ~ pet, df) +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +.dog-cat + +.ferret-cat.dog +
+cat + +-0.5 + +-0.333 +
+dog + +0.5 + +-0.333 +
+ferret + +0.0 + +0.667 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +5 + +0.082 + +61.2 + +0 +
+pet.dog-cat + +2 + +0.200 + +10.0 + +0 +
+pet.ferret-cat.dog + +6 + +0.173 + +34.6 + +0 +
+
+

You can change the comparisons by reordering the levels.

+
+df$pet <- contr_code_helmert(df$pet, levels = c("ferret", "dog", "cat"))
+ + + + + + + + + +
+Contrasts + +lm(y ~ pet, df) +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +.dog-ferret + +.cat-ferret.dog +
+ferret + +-0.5 + +-0.333 +
+dog + +0.5 + +-0.333 +
+cat + +0.0 + +0.667 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +5.0 + +0.082 + +61.2 + +0 +
+pet.dog-ferret + +-5.0 + +0.200 + +-25.0 + +0 +
+pet.cat-ferret.dog + +-4.5 + +0.173 + +-26.0 + +0 +
+
+
+
+

+Polynomial

+

Polynomial coding is the default for ordered factors in R. We’ll set up a new data simulation with five ordered times.

+
+df <- sim_design(list(time = 1:5),
+                 mu = 1:5 * 0.25 + (1:5 - 3)^2 * 0.5,
+                 sd = 5, long = TRUE)
+

+

The function contr_code_poly() uses contr.poly() to set up the polynomial contrasts for the linear (^1), quadratic (^2), cubic (^3), and quartic (^4) components.

+
+df$time <- contr_code_poly(df$time)
+ + + + + + + + + +
+Contrasts + +lm(y ~ pet, df) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+^1 + +^2 + +^3 + +^4 +
+-0.632 + +0.535 + +-0.316 + +0.120 +
+-0.316 + +-0.267 + +0.632 + +-0.478 +
+0.000 + +-0.535 + +0.000 + +0.717 +
+0.316 + +-0.267 + +-0.632 + +-0.478 +
+0.632 + +0.535 + +0.316 + +0.120 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +2.031 + +0.223 + +9.110 + +0.000 +
+time^1 + +0.239 + +0.498 + +0.480 + +0.631 +
+time^2 + +1.946 + +0.498 + +3.905 + +0.000 +
+time^3 + +-0.198 + +0.498 + +-0.397 + +0.692 +
+time^4 + +-0.004 + +0.498 + +-0.009 + +0.993 +
+
+
+
+
+
+

+Add Contrasts

+

The function add_contrasts() lets you add contrasts to a column in a data frame and also adds new columns for each contrast (unless add_cols = FALSE). This is especially helpful if you want to test only a subset of the contrasts.

+
+df <- sim_design(list(time = 1:5),
+                 mu = 1:5 * 0.25 + (1:5 - 3)^2 * 0.5,
+                 sd = 5, long = TRUE, plot = FALSE) %>%
+  add_contrast("time", "poly")
+
+# test only the linear and quadratic contrasts
+lm(y ~ `time^1` + `time^2`, df) %>% broom::tidy()
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +1.69 + +0.239 + +7.09 + +0.000 +
+time^1 + +0.78 + +0.534 + +1.46 + +0.145 +
+time^2 + +2.06 + +0.534 + +3.85 + +0.000 +
+

You can set colnames to change the default column names for the contrasts. This can be useful if you want to add different codings for the same factor or if the default names are too long.

+
+btwn <- list(condition = c("control", "experimental")) 
+
+df <- sim_design(between = btwn, n = 1, plot = FALSE) %>%
+  add_contrast("condition", "treatment", colnames = "cond.tr") %>%
+  add_contrast("condition", "anova", colnames = "cond.aov") %>%
+  add_contrast("condition", "difference", colnames = "cond.dif") %>%
+  add_contrast("condition", "sum", colnames = "cond.sum") %>%
+  add_contrast("condition", "helmert", colnames = "cond.hmt") %>%
+  add_contrast("condition", "poly", colnames = "cond.poly")
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+id + +condition + +y + +cond.tr + +cond.aov + +cond.dif + +cond.sum + +cond.hmt + +cond.poly +
+S1 + +control + +0.697 + +0 + +-0.5 + +-0.5 + +1 + +-0.5 + +-0.707 +
+S2 + +experimental + +0.512 + +1 + +0.5 + +0.5 + +-1 + +0.5 + +0.707 +
+

However, if a new column has a duplicate name to an existing column, add_contrast() will automatically add a contrast suffix to the new column.

+
+btwn <- list(pet = c("cat", "dog", "ferret")) 
+
+df <- sim_design(between = btwn, n = 1, plot = FALSE) %>%
+  add_contrast("pet", "treatment") %>% 
+  add_contrast("pet", "anova") %>%
+  add_contrast("pet", "sum") %>%
+  add_contrast("pet", "difference") %>%
+  add_contrast("pet", "helmert") %>%
+  add_contrast("pet", "poly")
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+id + +pet + +y + +pet.dog-cat + +pet.ferret-cat + +pet.dog-cat.aov + +pet.ferret-cat.aov + +pet.cat-intercept + +pet.dog-intercept + +pet.dog-cat.dif + +pet.ferret-dog + +pet.dog-cat.hmt + +pet.ferret-cat.dog + +pet^1 + +pet^2 +
+S1 + +cat + +-0.72 + +0 + +0 + +-0.33 + +-0.33 + +1 + +0 + +-0.67 + +-0.33 + +-0.5 + +-0.33 + +-0.71 + +0.41 +
+S2 + +dog + +-0.36 + +1 + +0 + +0.67 + +-0.33 + +0 + +1 + +0.33 + +-0.33 + +0.5 + +-0.33 + +0.00 + +-0.82 +
+S3 + +ferret + +-1.43 + +0 + +1 + +-0.33 + +0.67 + +-1 + +-1 + +0.33 + +0.67 + +0.0 + +0.67 + +0.71 + +0.41 +
+
+
+

+Examples

+
+

+2x2 Design

+

Let’s use simulated data with empirical = TRUE to explore how to interpret interactions between two 2-level factors coded in different ways.

+
+mu <- c(0, 4, 6, 10)
+df <- sim_design(between = list(time = c("am", "pm"),
+                                pet = c("cat", "dog")),
+                 n = c(50, 60, 70, 80), mu = mu, empirical = TRUE)
+

+

The table below shows the cell and marginal means. The notation \(Y_{..}\) is used to denote a mean for a specific grouping. The . is used to indicate the mean over all groups of that factor; Y.. is the grand mean. While you’ll usually see the subscripts written as numbers to indicate the factor levels, we’re using letters here so you don’t have to keep referring to the order of factors and levels.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
catdogmean
am\(Y_{ca} = 0\)\(Y_{da} = 4\)\(Y_{.a} = 2\)
pm\(Y_{cp} = 6\)\(Y_{dp} = 10\)\(Y_{.p} = 8\)
mean\(Y_{c.} = 3\)\(Y_{d.} = 7\)\(Y_{..} = 5\)
+
+

+
+
+Treatment
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
terminterpretationformulavalue
interceptcat when am\(Y_{ca}\)\(0\)
pet.dog-catdog minus cat, when am\(Y_{da} - Y_{ca}\)\(4 - 0 = 4\)
time.pm-ampm minus am, for cats\(Y_{cp} - Y_{ca}\)\(6 - 0 = 6\)
pet.dog-cat:time.pm-amdog minus cat when pm, minus dog minus cat when am\((Y_{dp} - Y_{cp}) - (Y_{da} - Y_{ca})\)\((10 - 6) - (4 - 0) = 0\)
+
+df %>%
+  add_contrast("pet", "treatment") %>%
+  add_contrast("time", "treatment") %>%
+  lm(y ~ pet * time, .) %>% 
+  broom::tidy() %>% kable() %>% kable_styling()
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +0 + +0.141 + +0.0 + +1 +
+pet.dog-cat + +4 + +0.191 + +20.9 + +0 +
+time.pm-am + +6 + +0.185 + +32.4 + +0 +
+pet.dog-cat:time.pm-am + +0 + +0.252 + +0.0 + +1 +
+
+
+
+Anova
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
terminterpretationformulavalue
interceptgrand mean\(Y_{..}\)\(5\)
pet.dog-catmean dog minus mean cat\(Y_{d.} - Y_{c.}\)\(7 - 3 = 4\)
time.pm-ammean pm minus mean am\(Y_{.p} - Y_{.a}\)\(8 - 2 = 6\)
pet.dog-cat:time.pm-amdog minus cat when pm, minus dog minus cat when am\((Y_{dp} - Y_{cp}) - (Y_{da} - Y_{ca})\)\((10 - 6) - (4 - 0) = 0\)
+
+df %>%
+  add_contrast("pet", "anova") %>%
+  add_contrast("time", "anova") %>%
+  lm(y ~ pet * time, .) %>% 
+  broom::tidy() %>% kable() %>% kable_styling()
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +5 + +0.063 + +79.4 + +0 +
+pet.dog-cat + +4 + +0.126 + +31.8 + +0 +
+time.pm-am + +6 + +0.126 + +47.6 + +0 +
+pet.dog-cat:time.pm-am + +0 + +0.252 + +0.0 + +1 +
+
+
+
+Sum
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
terminterpretationformulavalue
interceptgrand mean\(Y_{..}\)\(3\)
pet.cat-interceptmean cat minus grand mean\(Y_{c.} - Y_{..}\)\(3 - 5 = -2\)
time.am-interceptmean am minus grand mean\(Y_{.a} - Y_{..}\)\(2 - 5 = -3\)
pet.cat-intercept:time.am-interceptcat minus mean when am, minus cat minus mean when pm, divided by 2\(\frac{(Y_{ca} - Y_{.a}) - (Y_{cp} - Y_{.p})}{2}\)\(\frac{(0 - 2) - (6 - 8)}{2} = 0\)
+
+df %>%
+  add_contrast("pet", "sum") %>%
+  add_contrast("time", "sum") %>%
+  lm(y ~ pet * time, .) %>%  
+  broom::tidy() %>% kable() %>% kable_styling()
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +5 + +0.063 + +79.4 + +0 +
+pet.cat-intercept + +-2 + +0.063 + +-31.8 + +0 +
+time.am-intercept + +-3 + +0.063 + +-47.6 + +0 +
+pet.cat-intercept:time.am-intercept + +0 + +0.063 + +0.0 + +1 +
+
+
+
+Difference
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
terminterpretationformulavalue
interceptgrand mean\(Y_{..}\)\(5\)
pet.dog-catmean dog minus mean cat\(Y_{d.} - Y_{c.}\)\(7 - 3 = 4\)
time.pm-ammean pm minus mean am\(Y_{.p} - Y_{.a}\)\(8 - 2 = 6\)
pet.dog-cat:time.pm-amdog minus cat when pm, minus dog minus cat when am\((Y_{dp} - Y_{cp}) - (Y_{da} - Y_{ca})\)\((10 - 6) - (4 - 0) = 0\)
+
+df %>%
+  add_contrast("pet", "difference") %>%
+  add_contrast("time", "difference") %>%
+  lm(y ~ pet * time, .) %>% 
+  broom::tidy() %>% kable() %>% kable_styling()
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +5 + +0.063 + +79.4 + +0 +
+pet.dog-cat + +4 + +0.126 + +31.8 + +0 +
+time.pm-am + +6 + +0.126 + +47.6 + +0 +
+pet.dog-cat:time.pm-am + +0 + +0.252 + +0.0 + +1 +
+
+
+
+Helmert
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
terminterpretationformulavalue
interceptgrand mean\(Y_{..}\)\(5\)
pet.dog-catmean dog minus mean cat\(Y_{d.} - Y_{c.}\)\(7 - 3 = 4\)
time.pm-ammean pm minus mean am\(Y_{.p} - Y_{.a}\)\(8 - 2 = 6\)
pet.dog-cat:time.pm-amdog minus cat when pm, minus dog minus cat when am\((Y_{dp} - Y_{cp}) - (Y_{da} - Y_{ca})\)\((10 - 6) - (4 - 0) = 0\)
+
+df %>%
+  add_contrast("pet", "helmert") %>%
+  add_contrast("time", "helmert") %>%
+  lm(y ~ pet * time, .) %>% 
+  broom::tidy() %>% kable() %>% kable_styling()
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +5 + +0.063 + +79.4 + +0 +
+pet.dog-cat + +4 + +0.126 + +31.8 + +0 +
+time.pm-am + +6 + +0.126 + +47.6 + +0 +
+pet.dog-cat:time.pm-am + +0 + +0.252 + +0.0 + +1 +
+
+
+
+
+

+

N.B. In the case of 2-level factors, anova, difference, and Helmert coding are identical. Treatment coding differs only in the intercept.

+

Remember that interactions can always be described in two ways, since (A1 - A2) - (B1 - B2) == (A1 - B1) - (A2 - B2). Therefore, “dog minus cat when pm, minus dog minus cat when am” is the same as “pm minus am for dogs, minus pm minus am for cats”. The way you describe it in a paper depends on which version maps onto your hypothesis more straightforwardly. The examples above might be written as “the difference between dogs and cats was bigger in the evening than the morning” or “the difference between evening and morning was bigger for dogs than for cats”. Make sure you check the plots to make sure you are describing the relationships in the right direction.

+
+
+

+2x3 Design

+

Let’s use simulated data with empirical = TRUE to explore how to interpret interactions between a 2-level factor and a 3-level factor coded in different ways.

+
+mu <- c(0, 5, 7, 6, 2, 1)
+df <- sim_design(between = list(time = c("am", "pm"),
+                                pet = c("cat", "dog", "ferret")),
+                 n = c(50, 60, 70, 80, 90, 100), mu = mu, empirical = TRUE)
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
catdogferretmean
am\(Y_{ca} = 0\)\(Y_{da} = 5\)\(Y_{fa} = 7\)\(Y_{.a} = 4\)
pm\(Y_{cp} = 6\)\(Y_{dp} = 2\)\(Y_{fp} = 1\)\(Y_{.p} = 3\)
mean\(Y_{c.} = 3\)\(Y_{d.} = 3.5\)\(Y_{f.} = 4\)\(Y_{..} = 3.5\)
+
+

+
+
+Treatment
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
terminterpretationformulavalue
interceptcat when am\(Y_{ca}\)\(0\)
pet.dog-catdog minus cat, when am\(Y_{da} - Y_{ca}\)\(5 - 0 = 5\)
pet.ferret-catferret minus cat, when am\(Y_{fa} - Y_{ca}\)\(7 - 0 = 7\)
time.pm-ampm minus am, for cats\(Y_{cp} - Y_{ca}\)\(6 - 0 = 6\)
pet.dog-cat:time.pm-amdog minus cat when pm, minus dog minus cat when am\((Y_{dp} - Y_{cp}) - (Y_{da} - Y_{ca})\)\((2 - 6) - (5 - 0) = -9\)
pet.ferret-cat:time.pm-amferret minus cat when pm, minus ferret minus cat when am\((Y_{fp} - Y_{cp}) - (Y_{fa} - Y_{ca})\)\((1 - 6) - (7 - 0) = -12\)
+
+df %>%
+  add_contrast("pet", "treatment") %>%
+  add_contrast("time", "treatment") %>%
+  lm(y ~ pet * time, .) %>% 
+  broom::tidy() %>% kable() %>% kable_styling()
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +0 + +0.141 + +0.0 + +1 +
+pet.dog-cat + +5 + +0.191 + +26.1 + +0 +
+pet.ferret-cat + +7 + +0.185 + +37.8 + +0 +
+time.pm-am + +6 + +0.180 + +33.3 + +0 +
+pet.dog-cat:time.pm-am + +-9 + +0.246 + +-36.7 + +0 +
+pet.ferret-cat:time.pm-am + +-12 + +0.238 + +-50.4 + +0 +
+
+
+
+Anova
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
terminterpretationformulavalue
interceptgrand mean\(Y_{..}\)\(3.5\)
pet.dog-catmean dog minus mean cat\(Y_{d.} - Y_{c.}\)\(3.5 - 3 = 0.5\)
pet.ferret-catmean ferret minus mean cat\(Y_{f.} - Y_{c.}\)\(4 - 3 = 1\)
time.pm-ammean pm minus mean am\(Y_{.p} - Y_{.a}\)\(3 - 4 = -1\)
pet.dog-cat:time.pm-amdog minus cat when pm, minus dog minus cat when am\((Y_{dp} - Y_{cp}) - (Y_{da} - Y_{ca})\)\((2 - 6) - (5 - 0) = -9\)
pet.ferret-cat:time.pm-amferret minus cat when pm, minus ferret minus cat when am\((Y_{fp} - Y_{cp}) - (Y_{fa} - Y_{ca})\)\((1 - 6) - (7 - 0) = -12\)
+
+df %>%
+  add_contrast("pet", "anova") %>%
+  add_contrast("time", "anova") %>%
+  lm(y ~ pet * time, .) %>% 
+  broom::tidy() %>% kable() %>% kable_styling()
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +3.5 + +0.048 + +72.22 + +0 +
+pet.dog-cat + +0.5 + +0.123 + +4.07 + +0 +
+pet.ferret-cat + +1.0 + +0.119 + +8.39 + +0 +
+time.pm-am + +-1.0 + +0.097 + +-10.32 + +0 +
+pet.dog-cat:time.pm-am + +-9.0 + +0.246 + +-36.66 + +0 +
+pet.ferret-cat:time.pm-am + +-12.0 + +0.238 + +-50.36 + +0 +
+
+
+
+Sum
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
terminterpretationformulavalue
interceptgrand mean\(Y_{..}\)\(3\)
pet.cat-interceptmean cat minus grand mean\(Y_{c.} - Y_{..}\)\(3 - 3.5 = -0.5\)
pet.dog-interceptmean dog minus grand mean\(Y_{d.} - Y_{..}\)\(3.5 - 3.5 = 0\)
time.am-interceptmean am minus grand mean\(Y_{.a} - Y_{..}\)\(4 - 3.5 = 0.5\)
pet.cat-intercept:time.am-interceptcat minus mean when am, minus cat minus mean when pm, divided by 2\(\frac{(Y_{ca} - Y_{.a}) - (Y_{cp} - Y_{.p})}{2}\)\(\frac{(0 - 4) - (6 - 3)}{2} = -3.5\)
pet.dog-intercept:time.am-interceptdog minus mean when am, minus dog minus mean when pm, divided by 2\(\frac{(Y_{da} - Y_{.a}) - (Y_{dp} - Y_{.p})}{2}\)\(\frac{(5 - 4) - (2 - 3)}{2} = 1\)
+
+df %>%
+  add_contrast("pet", "sum") %>%
+  add_contrast("time", "sum") %>%
+  lm(y ~ pet * time, .) %>% 
+  broom::tidy() %>% kable() %>% kable_styling()
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +3.5 + +0.048 + +72.22 + +0 +
+pet.cat-intercept + +-0.5 + +0.071 + +-7.03 + +0 +
+pet.dog-intercept + +0.0 + +0.068 + +0.00 + +1 +
+time.am-intercept + +0.5 + +0.048 + +10.32 + +0 +
+pet.cat-intercept:time.am-intercept + +-3.5 + +0.071 + +-49.22 + +0 +
+pet.dog-intercept:time.am-intercept + +1.0 + +0.068 + +14.64 + +0 +
+
+
+
+Difference
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
terminterpretationformulavalue
interceptgrand mean\(Y_{..}\)\(3.5\)
pet.dog-catmean dog minus mean cat\(Y_{d.} - Y_{c.}\)\(3.5 - 3 = 0.5\)
pet.ferret-dogmean ferret minus mean dog\(Y_{f.} - Y_{d.}\)\(4 - 3.5 = 0.5\)
time.pm-ammean pm minus mean am\(Y_{.p} - Y_{.a}\)\(3 - 4 = -1\)
pet.dog-cat:time.pm-amdog minus cat when pm, minus dog minus cat when am\((Y_{dp} - Y_{cp}) - (Y_{da} - Y_{ca})\)\((2 - 6) - (5 - 0) = -9\)
pet.ferret-dog:time.pm-amferret minus dog when pm, minus ferret minus dog when am\((Y_{fp} - Y_{dp}) - (Y_{fa} - Y_{da})\)\((1 - 2) - (7 - 5) = -3\)
+
+df %>%
+  add_contrast("pet", "difference") %>%
+  add_contrast("time", "difference") %>%
+  lm(y ~ pet * time, .) %>% 
+  broom::tidy() %>% kable() %>% kable_styling()
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +3.5 + +0.048 + +72.22 + +0 +
+pet.dog-cat + +0.5 + +0.123 + +4.07 + +0 +
+pet.ferret-dog + +0.5 + +0.114 + +4.38 + +0 +
+time.pm-am + +-1.0 + +0.097 + +-10.32 + +0 +
+pet.dog-cat:time.pm-am + +-9.0 + +0.246 + +-36.66 + +0 +
+pet.ferret-dog:time.pm-am + +-3.0 + +0.228 + +-13.15 + +0 +
+
+
+
+Helmert
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
terminterpretationformulavalue
interceptgrand mean\(Y_{..}\)\(3.5\)
pet.dog-catmean dog minus mean cat\(Y_{d.} - Y_{c.}\)\(3.5 - 3 = 0.5\)
pet.ferret-cat.dogmean ferret minus mean of cat and dog\(Y_{f.} - \frac{Y_{c.} + Y_{d.}}{2}\)\(4 - \frac{3 + 3.5}{2} = 0.75\)
time.pm-ammean pm minus mean am\(Y_{.p} - Y_{.a}\)\(3 - 4 = -1\)
pet.dog-cat:time.pm-amdog minus cat when pm, minus dog minus cat when am\((Y_{dp} - Y_{cp}) - (Y_{da} - Y_{ca})\)\((2 - 6) - (5 - 0) = -9\)
pet.ferret-cat.dog:time.pm-amferret minus mean of cat and dog when pm, minus ferret minus mean of cat and dog when am\((Y_{fp} - \frac{Y_{cp} + Y_{dp}}{2}) - (Y_{fa} - \frac{Y_{ca} + Y_{da}}{2})\)\((1 - \frac{6 + 2}{2}) - (7 - \frac{0 + 5}{2}) = -7.5\)
+
+df %>%
+  add_contrast("pet", "helmert") %>%
+  add_contrast("time", "helmert") %>%
+  lm(y ~ pet * time, .) %>% 
+  broom::tidy() %>% kable() %>% kable_styling()
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+term + +estimate + +std.error + +statistic + +p.value +
+(Intercept) + +3.50 + +0.048 + +72.22 + +0 +
+pet.dog-cat + +0.50 + +0.123 + +4.07 + +0 +
+pet.ferret-cat.dog + +0.75 + +0.099 + +7.56 + +0 +
+time.pm-am + +-1.00 + +0.097 + +-10.32 + +0 +
+pet.dog-cat:time.pm-am + +-9.00 + +0.246 + +-36.66 + +0 +
+pet.ferret-cat.dog:time.pm-am + +-7.50 + +0.198 + +-37.81 + +0 +
+
+
+
+
+

+

N.B. In this case, difference coding is identical to anova coding except that the second pet contrast is ferret versus dog instead of ferret versus cat.

+
+
+

+3x3 Design

+

Please just don’t. You’re going to break my head.

+
+
+ + + + + + + + + + + + + + + + diff --git a/docs/articles/contrasts_files/figure-html/unnamed-chunk-1-1.png b/docs/articles/contrasts_files/figure-html/unnamed-chunk-1-1.png new file mode 100644 index 00000000..fb9beb41 Binary files /dev/null and b/docs/articles/contrasts_files/figure-html/unnamed-chunk-1-1.png differ diff --git a/docs/articles/contrasts_files/figure-html/unnamed-chunk-16-1.png b/docs/articles/contrasts_files/figure-html/unnamed-chunk-16-1.png new file mode 100644 index 00000000..57061735 Binary files /dev/null and b/docs/articles/contrasts_files/figure-html/unnamed-chunk-16-1.png differ diff --git a/docs/articles/contrasts_files/figure-html/unnamed-chunk-23-1.png b/docs/articles/contrasts_files/figure-html/unnamed-chunk-23-1.png new file mode 100644 index 00000000..ebc5f0f8 Binary files /dev/null and b/docs/articles/contrasts_files/figure-html/unnamed-chunk-23-1.png differ diff --git a/docs/articles/contrasts_files/figure-html/unnamed-chunk-30-1.png b/docs/articles/contrasts_files/figure-html/unnamed-chunk-30-1.png new file mode 100644 index 00000000..82890866 Binary files /dev/null and b/docs/articles/contrasts_files/figure-html/unnamed-chunk-30-1.png differ diff --git a/docs/articles/contrasts_files/header-attrs-2.10.6/header-attrs.js b/docs/articles/contrasts_files/header-attrs-2.10.6/header-attrs.js new file mode 100644 index 00000000..dd57d92e --- /dev/null +++ b/docs/articles/contrasts_files/header-attrs-2.10.6/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/articles/contrasts_files/kePrint-0.0.1/kePrint.js b/docs/articles/contrasts_files/kePrint-0.0.1/kePrint.js new file mode 100644 index 00000000..e6fbbfc4 --- /dev/null +++ b/docs/articles/contrasts_files/kePrint-0.0.1/kePrint.js @@ -0,0 +1,8 @@ +$(document).ready(function(){ + if (typeof $('[data-toggle="tooltip"]').tooltip === 'function') { + $('[data-toggle="tooltip"]').tooltip(); + } + if ($('[data-toggle="popover"]').popover === 'function') { + $('[data-toggle="popover"]').popover(); + } +}); diff --git a/docs/articles/contrasts_files/lightable-0.0.1/lightable.css b/docs/articles/contrasts_files/lightable-0.0.1/lightable.css new file mode 100644 index 00000000..3be3be90 --- /dev/null +++ b/docs/articles/contrasts_files/lightable-0.0.1/lightable.css @@ -0,0 +1,272 @@ +/*! + * lightable v0.0.1 + * Copyright 2020 Hao Zhu + * Licensed under MIT (https://github.com/haozhu233/kableExtra/blob/master/LICENSE) + */ + +.lightable-minimal { + border-collapse: separate; + border-spacing: 16px 1px; + width: 100%; + margin-bottom: 10px; +} + +.lightable-minimal td { + margin-left: 5px; + margin-right: 5px; +} + +.lightable-minimal th { + margin-left: 5px; + margin-right: 5px; +} + +.lightable-minimal thead tr:last-child th { + border-bottom: 2px solid #00000050; + empty-cells: hide; + +} + +.lightable-minimal tbody tr:first-child td { + padding-top: 0.5em; +} + +.lightable-minimal.lightable-hover tbody tr:hover { + background-color: #f5f5f5; +} + +.lightable-minimal.lightable-striped tbody tr:nth-child(even) { + background-color: #f5f5f5; +} + +.lightable-classic { + border-top: 0.16em solid #111111; + border-bottom: 0.16em solid #111111; + width: 100%; + margin-bottom: 10px; + margin: 10px 5px; +} + +.lightable-classic tfoot tr td { + border: 0; +} + +.lightable-classic tfoot tr:first-child td { + border-top: 0.14em solid #111111; +} + +.lightable-classic caption { + color: #222222; +} + +.lightable-classic td { + padding-left: 5px; + padding-right: 5px; + color: #222222; +} + +.lightable-classic th { + padding-left: 5px; + padding-right: 5px; + font-weight: normal; + color: #222222; +} + +.lightable-classic thead tr:last-child th { + border-bottom: 0.10em solid #111111; +} + +.lightable-classic.lightable-hover tbody tr:hover { + background-color: #F9EEC1; +} + +.lightable-classic.lightable-striped tbody tr:nth-child(even) { + background-color: #f5f5f5; +} + +.lightable-classic-2 { + border-top: 3px double #111111; + border-bottom: 3px double #111111; + width: 100%; + margin-bottom: 10px; +} + +.lightable-classic-2 tfoot tr td { + border: 0; +} + +.lightable-classic-2 tfoot tr:first-child td { + border-top: 3px double #111111; +} + +.lightable-classic-2 caption { + color: #222222; +} + +.lightable-classic-2 td { + padding-left: 5px; + padding-right: 5px; + color: #222222; +} + +.lightable-classic-2 th { + padding-left: 5px; + padding-right: 5px; + font-weight: normal; + color: #222222; +} + +.lightable-classic-2 tbody tr:last-child td { + border-bottom: 3px double #111111; +} + +.lightable-classic-2 thead tr:last-child th { + border-bottom: 1px solid #111111; +} + +.lightable-classic-2.lightable-hover tbody tr:hover { + background-color: #F9EEC1; +} + +.lightable-classic-2.lightable-striped tbody tr:nth-child(even) { + background-color: #f5f5f5; +} + +.lightable-material { + min-width: 100%; + white-space: nowrap; + table-layout: fixed; + font-family: Roboto, sans-serif; + border: 1px solid #EEE; + border-collapse: collapse; + margin-bottom: 10px; +} + +.lightable-material tfoot tr td { + border: 0; +} + +.lightable-material tfoot tr:first-child td { + border-top: 1px solid #EEE; +} + +.lightable-material th { + height: 56px; + padding-left: 16px; + padding-right: 16px; +} + +.lightable-material td { + height: 52px; + padding-left: 16px; + padding-right: 16px; + border-top: 1px solid #eeeeee; +} + +.lightable-material.lightable-hover tbody tr:hover { + background-color: #f5f5f5; +} + +.lightable-material.lightable-striped tbody tr:nth-child(even) { + background-color: #f5f5f5; +} + +.lightable-material.lightable-striped tbody td { + border: 0; +} + +.lightable-material.lightable-striped thead tr:last-child th { + border-bottom: 1px solid #ddd; +} + +.lightable-material-dark { + min-width: 100%; + white-space: nowrap; + table-layout: fixed; + font-family: Roboto, sans-serif; + border: 1px solid #FFFFFF12; + border-collapse: collapse; + margin-bottom: 10px; + background-color: #363640; +} + +.lightable-material-dark tfoot tr td { + border: 0; +} + +.lightable-material-dark tfoot tr:first-child td { + border-top: 1px solid #FFFFFF12; +} + +.lightable-material-dark th { + height: 56px; + padding-left: 16px; + padding-right: 16px; + color: #FFFFFF60; +} + +.lightable-material-dark td { + height: 52px; + padding-left: 16px; + padding-right: 16px; + color: #FFFFFF; + border-top: 1px solid #FFFFFF12; +} + +.lightable-material-dark.lightable-hover tbody tr:hover { + background-color: #FFFFFF12; +} + +.lightable-material-dark.lightable-striped tbody tr:nth-child(even) { + background-color: #FFFFFF12; +} + +.lightable-material-dark.lightable-striped tbody td { + border: 0; +} + +.lightable-material-dark.lightable-striped thead tr:last-child th { + border-bottom: 1px solid #FFFFFF12; +} + +.lightable-paper { + width: 100%; + margin-bottom: 10px; + color: #444; +} + +.lightable-paper tfoot tr td { + border: 0; +} + +.lightable-paper tfoot tr:first-child td { + border-top: 1px solid #00000020; +} + +.lightable-paper thead tr:last-child th { + color: #666; + vertical-align: bottom; + border-bottom: 1px solid #00000020; + line-height: 1.15em; + padding: 10px 5px; +} + +.lightable-paper td { + vertical-align: middle; + border-bottom: 1px solid #00000010; + line-height: 1.15em; + padding: 7px 5px; +} + +.lightable-paper.lightable-hover tbody tr:hover { + background-color: #F9EEC1; +} + +.lightable-paper.lightable-striped tbody tr:nth-child(even) { + background-color: #00000008; +} + +.lightable-paper.lightable-striped tbody td { + border: 0; +} + diff --git a/docs/articles/distributions.html b/docs/articles/distributions.html index 5c0605de..258e11b5 100644 --- a/docs/articles/distributions.html +++ b/docs/articles/distributions.html @@ -17,9 +17,9 @@ - + - + @@ -42,7 +42,7 @@ faux - 1.0.0 + 1.1.0 @@ -82,12 +82,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -111,7 +117,7 @@ -
    +
    @@ -123,12 +125,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -175,10 +183,14 @@

    Demos

    Mixed Design Simulation
    +
    Randomised Reports
    +
    Distribution Conversions
    Codebook Demo
    +
    Contrasts
    +
    diff --git a/docs/articles/plots.html b/docs/articles/plots.html index 96da2ce2..0f7058d6 100644 --- a/docs/articles/plots.html +++ b/docs/articles/plots.html @@ -17,9 +17,9 @@ - + - + @@ -42,7 +42,7 @@ faux - 1.0.0 + 1.1.0 @@ -82,12 +82,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -111,7 +117,7 @@ -
    +

    Plotting Designs

    @@ -222,25 +229,99 @@

    plot_design(data)

    +
    +

    +Palettes

    +

    You can change the default brewer palette from “Dark2” to any of the options (see ?ggplot2::scale_colour_brewer for the options).

    +
    +data <- sim_design(5, n = 20, mu = 1:5, plot = FALSE)
    +cowplot::plot_grid(
    +  plot_design(data, palette = "Purples") + ggtitle("Purples"),
    +  plot_design(data, palette = "Pastel2") + ggtitle("Pastel2"),
    +  plot_design(data, palette = "Spectral") + ggtitle("Spectral"),
    +  nrow = 1
    +)
    +

    +

    You can also add a non-brewer palette (or any other ggplot function). You will get a message about a duplicate scale, but you can suppress this with suppressMessages() or in the r chunk.

    +
    +plot_design(data) + 
    +  scale_fill_viridis_d() +
    +  theme_classic() +
    +  xlab("") +
    +  ggtitle("Plot with viridis fill and classic theme")
    +#> Scale for 'fill' is already present. Adding another scale for 'fill', which
    +#> will replace the existing scale.
    +

    +

    Change order of factors

    -
    +

    List the factors you want to show in the order of fill/colour, x-axis, facet row(s), facet column(s).

    +
     data <- sim_design(c(2,2,2), n = 50, mu = 1:8, sd = 16, plot = FALSE)
    -abc <- plot_design(data, "A", "B", "C", geoms = "violin")
    -acb <- plot_design(data, "A", "C", "B", geoms = "violin")
    -bac <- plot_design(data, "B", "A", "C", geoms = "violin")
    -bca <- plot_design(data, "B", "C", "A", geoms = "violin")
    -cab <- plot_design(data, "C", "A", "B", geoms = "violin")
    -cba <- plot_design(data, "C", "B", "A", geoms = "violin")
    +abc <- plot_design(data, "W1", "W2", "W3", geoms = "violin")
    +acb <- plot_design(data, "W1", "W3", "W2", geoms = "violin")
    +bac <- plot_design(data, "W2", "W1", "W3", geoms = "violin")
    +bca <- plot_design(data, "W2", "W3", "W1", geoms = "violin")
    +cab <- plot_design(data, "W3", "W1", "W2", geoms = "violin")
    +cba <- plot_design(data, "W3", "W2", "W1", geoms = "violin")
     
     cowplot::plot_grid(abc, acb, bac, bca, cab, cba, nrow = 3, 
    -                   labels = c("abc", "acb", "bac", "bca", "cab", "cba"))
    -

    -
    -sim_design(c(2,2,2,5), mu = 1:40, sd = 5, plot = FALSE) %>% 
    -  plot_design("D", "B", "C", "A")
    -

    + labels = c("123", "132", "213", "231", "312", "321"))
    +

    +

    You can also plot a subset of the factors.

    +
    +# main effects, no interactions
    +intercept <- 0
    +effect_code <- list(a = -.5, b = .5)
    +W1 <- lapply(effect_code, `*`, 2)
    +W2 <- lapply(effect_code, `*`, -1)
    +W3 <- lapply(effect_code, `*`, 0)
    +
    +mu <- list(W1a_W2a_W3a = intercept + W1$a + W2$a + W3$a,
    +           W1b_W2a_W3a = intercept + W1$b + W2$a + W3$a,
    +           W1a_W2b_W3a = intercept + W1$a + W2$b + W3$a,
    +           W1b_W2b_W3a = intercept + W1$b + W2$b + W3$a,
    +           W1a_W2a_W3b = intercept + W1$a + W2$a + W3$b,
    +           W1b_W2a_W3b = intercept + W1$b + W2$a + W3$b,
    +           W1a_W2b_W3b = intercept + W1$a + W2$b + W3$b,
    +           W1b_W2b_W3b = intercept + W1$b + W2$b + W3$b)
    +
    +data <- sim_design(c(2,2,2), n = 50, mu = mu, sd = 2, plot = FALSE)
    +
    +# make plots
    +geoms <- c("pointrangeSD")
    +W1 <- plot_design(data, "W1", geoms = geoms) + ggtitle("W1")
    +W2 <- plot_design(data, "W2", geoms = geoms) + ggtitle("W2")
    +W3 <- plot_design(data, "W3", geoms = geoms) + ggtitle("W3")
    +W12 <- plot_design(data, "W1", "W2", geoms = geoms) + ggtitle("W1 & W2")
    +W13 <- plot_design(data, "W1", "W3", geoms = geoms) + ggtitle("W1 & W3")
    +W23 <- plot_design(data, "W2", "W3", geoms = geoms) + ggtitle("W2 & W3")
    +
    +cowplot::plot_grid(W1, W2, W3, W12, W13, W23, nrow = 2)
    +

    +
    +
    +

    +Facet Labels

    +

    Set the labeller to “label_both” if you want facets to include the factor label.

    +
    +within <- list(
    +  pet = c(cat = "Cats", dog = "Dogs"),
    +  time = c(am = "Morning", pm = "Night"),
    +  grp = c(ctl = "Control", exp = "Experimental"),
    +  dose = 1:5
    +)
    +  
    +factor_labels  <- list(pet = "Type of Pet",
    +                       time = "Time of Day",
    +                       grp = "Group",
    +                       dose = "Treatment Dose")
    +
    +sim_design(within, vardesc = factor_labels,
    +           mu = 1:40, sd = 5, plot = FALSE) %>% 
    +  plot_design("dose", "pet", "time", "grp", labeller = "label_both", palette = "Spectral")
    +

    diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-10-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-10-1.png index 87ca4a78..402847bd 100644 Binary files a/docs/articles/plots_files/figure-html/unnamed-chunk-10-1.png and b/docs/articles/plots_files/figure-html/unnamed-chunk-10-1.png differ diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-11-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-11-1.png index f04c007b..e81305a2 100644 Binary files a/docs/articles/plots_files/figure-html/unnamed-chunk-11-1.png and b/docs/articles/plots_files/figure-html/unnamed-chunk-11-1.png differ diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-12-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-12-1.png index 318d4843..0ca03ae9 100644 Binary files a/docs/articles/plots_files/figure-html/unnamed-chunk-12-1.png and b/docs/articles/plots_files/figure-html/unnamed-chunk-12-1.png differ diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-13-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-13-1.png index 6064097f..bfc2495c 100644 Binary files a/docs/articles/plots_files/figure-html/unnamed-chunk-13-1.png and b/docs/articles/plots_files/figure-html/unnamed-chunk-13-1.png differ diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-14-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-14-1.png index 3268bb0d..fb663aa9 100644 Binary files a/docs/articles/plots_files/figure-html/unnamed-chunk-14-1.png and b/docs/articles/plots_files/figure-html/unnamed-chunk-14-1.png differ diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-15-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-15-1.png index 6cddc030..d1596aa3 100644 Binary files a/docs/articles/plots_files/figure-html/unnamed-chunk-15-1.png and b/docs/articles/plots_files/figure-html/unnamed-chunk-15-1.png differ diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-16-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-16-1.png index 7983a1b4..c15fdd12 100644 Binary files a/docs/articles/plots_files/figure-html/unnamed-chunk-16-1.png and b/docs/articles/plots_files/figure-html/unnamed-chunk-16-1.png differ diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-17-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-17-1.png new file mode 100644 index 00000000..e4e7ed35 Binary files /dev/null and b/docs/articles/plots_files/figure-html/unnamed-chunk-17-1.png differ diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-18-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-18-1.png new file mode 100644 index 00000000..cfe04d65 Binary files /dev/null and b/docs/articles/plots_files/figure-html/unnamed-chunk-18-1.png differ diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-19-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-19-1.png new file mode 100644 index 00000000..865965eb Binary files /dev/null and b/docs/articles/plots_files/figure-html/unnamed-chunk-19-1.png differ diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-2-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-2-1.png index 91d85294..e4654b8d 100644 Binary files a/docs/articles/plots_files/figure-html/unnamed-chunk-2-1.png and b/docs/articles/plots_files/figure-html/unnamed-chunk-2-1.png differ diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-3-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-3-1.png index fb3bafa3..2dc1c361 100644 Binary files a/docs/articles/plots_files/figure-html/unnamed-chunk-3-1.png and b/docs/articles/plots_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-4-1.png index f2f1155a..8e0f9b14 100644 Binary files a/docs/articles/plots_files/figure-html/unnamed-chunk-4-1.png and b/docs/articles/plots_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-5-1.png index 5b99cbf2..b08cf662 100644 Binary files a/docs/articles/plots_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/plots_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-6-1.png index 71eb6b4a..c5e8a0db 100644 Binary files a/docs/articles/plots_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/plots_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-7-1.png index f58e93a4..67568685 100644 Binary files a/docs/articles/plots_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/plots_files/figure-html/unnamed-chunk-7-1.png differ diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-8-1.png index e1147899..749b80bb 100644 Binary files a/docs/articles/plots_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/plots_files/figure-html/unnamed-chunk-8-1.png differ diff --git a/docs/articles/plots_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/plots_files/figure-html/unnamed-chunk-9-1.png index c8796a39..62472d6a 100644 Binary files a/docs/articles/plots_files/figure-html/unnamed-chunk-9-1.png and b/docs/articles/plots_files/figure-html/unnamed-chunk-9-1.png differ diff --git a/docs/articles/plots_files/header-attrs-2.10.6/header-attrs.js b/docs/articles/plots_files/header-attrs-2.10.6/header-attrs.js new file mode 100644 index 00000000..dd57d92e --- /dev/null +++ b/docs/articles/plots_files/header-attrs-2.10.6/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/articles/random_reports.html b/docs/articles/random_reports.html new file mode 100644 index 00000000..e61e6cc3 --- /dev/null +++ b/docs/articles/random_reports.html @@ -0,0 +1,1278 @@ + + + + + + + +Randomised Reports • faux + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    +
    + + + + +

    Have you ever wanted to create unique versions of datasets for each student in a class? This vignette walks through the process of setting up a simple study with a subject table and a questionnaire table.

    +

    The subjects have varying demographic attributes and are assigned to a counterbalanced condition and version of the study. Some of the demographic data is missing.

    +

    The questionnaire has a variable number of questions, answered on a 7-point Likert scale. Some of the questions are reverse-coded, indicated by the column names. There are some missing observations.

    +

    The data is set up with fixed effects for condition, version, and subject language that you can vary between students. The DV is created using a mixed effects model formula to simulate realistic random intercepts and slopes, so these data would be suitable for analysis with mixed effects models, or you can instruct students to aggregate the questionnaire data to analyse with single-level models.

    +

    A custom assignment is created for each student, where they are told the questionnaire contains scores on one of three topics, and are asked to determine if there is an effect of one factor for a subgroup of another factor. The categories chosen here are pretty arbitrary, but you can change this to make sense for your subject area.

    +

    Finally, the subject table, questionnaire table, and instructions are saved to a folder with the student ID for distribution to each student. The simulation is seeded with the student ID, ensuring that each student gets a unique, but reproducible assignment.

    +
    +

    +Setup

    +

    Some of the functions below require version 1.1.0 of faux (add_random(), add_between(), add_ranef() and add_contrast()). This version has been submitted to CRAN, and is available on github. Any feedback would be welcome.

    +
    +# devtools::install_github("debruine/faux")
    +library(faux)
    +library(dplyr)
    +library(tidyr)
    +library(purrr)
    +library(ggplot2)
    +library(readr)
    +library(glue)
    +theme_set(theme_minimal())
    +

    Start your script by setting a seed that is unique to each student. Below is a useful function you can use to generate a seed from a student ID, even if it contains letters.

    +
    +seed_from_string <- function(seed) {
    +  if (is.numeric(seed)) return(set.seed(seed))
    +  
    +  # otherwise set from characters
    +  seed %>%
    +    openssl::md5() %>%       # turn into something with lots of numbers
    +    gsub("[a-z]", "", .) %>% # get rid of letters
    +    substr(1, 8) %>%         # select the first 8 numbers
    +    set.seed()
    +}
    +
    +student_id <- "8675309J"
    +seed_from_string(student_id)
    +
    +
    +

    +Simulate subjects

    +

    Now, make a table of subjects.

    +
    +

    +Random factor

    +

    In this example, I’m going to choose a random number of subjects between 300 and 400.

    +
    +subj_n <- sample(300:400, 1)
    +

    The function add_random() creates the random effects structure.

    +
    +subjects <- add_random(subj_id = subj_n)
    + + + + + + + + + + + + + + + + + + + + + + + + +
    +subj_id +
    +s001 +
    +s002 +
    +s003 +
    +s004 +
    +s005 +
    +s006 +
    +
    +
    +

    +Gender

    +

    Now add a between-subject factor of gender with three levels: “female”, “male”, and “nonbinary”. If you set the probability of each as proportions, they will be randomly sampled.

    +
    +subjects <- subjects %>%
    +  add_between(gender = c("female", "male", "nonbinary"),
    +              .prob = c(.3, .6, .1))
    + + + + + + + + + + + + + + + + + + + +
    +gender + +n +
    +female + +129 +
    +male + +215 +
    +nonbinary + +52 +
    +

    It’s realistic for some people to not want to disclose their gender, so you can use messy() to set some proportion of the gender column to NAs.

    +
    +subjects <- subjects %>%
    +  messy(prop = 0.05, "gender")
    + + + + + + + + + + + + + + + + + + + + + + + +
    +gender + +n +
    +female + +125 +
    +male + +202 +
    +nonbinary + +50 +
    +NA + +19 +
    +
    +
    +

    +Age

    +

    Now add an age column. I’m using 18 + rpois(nrow(.), 3) to make a distribution that’s pretty typical of undergraduate students, but you can choose a simulation function that is relevant to your questions. I’m also replacing 5% of the values with the word “missing”, which will convert this to a chaacter column because I want students to practice dealing with non-standard missing values.

    +
    +subjects <- subjects %>%
    +  mutate(age = 18 + rpois(nrow(.), 3)) %>%
    +  messy(prop = 0.05, "age", replace = "missing")
    +

    +
    +
    +

    +Language

    +

    Add a between-subjects factor of language, with 70% monolingual and 30% bilingual.

    +
    +subjects <- subjects %>%
    +  add_between(language = c("monolingual", "bilingual"),
    +              .prob = c(.7, .3))
    +
    +
    +

    +Experiment factors

    +

    I want condition and version to be crossed so that there’s an equal number of subjects in each cell. Specifying both in the same add_between() accomplishes this.

    +
    +subjects <- subjects %>%
    +  add_between(condition = c("A", "B"),
    +              version = c("V1", "V2"))
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +condition + +version + +n +
    +A + +V1 + +99 +
    +A + +V2 + +99 +
    +B + +V1 + +99 +
    +B + +V2 + +99 +
    +
    +
    +

    +Subject function

    +

    Now wrap the code for making the subject table in a function. This makes it easy to make more than one subject table for a simulated study, for example, to have students practice combining tables.

    +

    You can also add other arguments that you might want to vary, like the names of the condition and version levels. Set the defaults to what we used in the example above.

    +
    +make_subjects <- function(subj_n = sample(300:400, 1),
    +                          cond_levels = c("A", "B"),
    +                          vers_levels = c("V1", "V2")) {
    +  add_random(subj_id = subj_n) %>%
    +    add_between(gender = c("female", "male", "nonbinary"),
    +                .prob = c(.3, .6, .1)) %>%
    +    messy(prop = 0.05, "gender") %>%
    +    mutate(age = 18 + rpois(nrow(.), 3)) %>%
    +    messy(prop = 0.05, "age", replace = "missing") %>%
    +    add_between(language = c("monolingual", "bilingual"),
    +                .prob = c(.7, .3)) %>%
    +    add_between(condition = cond_levels,
    +                version = vers_levels)
    +}
    +
    +subjects <- make_subjects()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +subj_id + +gender + +age + +language + +condition + +version +
    +s001 + +female + +20 + +bilingual + +A + +V1 +
    +s002 + +female + +19 + +monolingual + +A + +V2 +
    +s003 + +male + +23 + +bilingual + +B + +V1 +
    +s004 + +female + +21 + +monolingual + +B + +V2 +
    +s005 + +male + +22 + +monolingual + +A + +V1 +
    +s006 + +male + +24 + +bilingual + +A + +V2 +
    +
    +
    +
    +

    +Simulate questions

    +

    Next, we need to set up the questionnaire. I’m going to do this by adding the question data to the subject table. We’ll extract the questions into a separate table later, but this will make it easier to set up the DV using a mixed effects model equation.

    +
    +

    +Random factor

    +

    First, we’ll add the random factor of question, randomly creating 5 to 15 question IDs. The code below adds a cross-classified random factor, where each subject sees all of the questions. See the Mixed Design Simulation tutorial to see how to add nested random factors.

    +
    +quest_n <- sample(5:15, 1)
    +
    +questions <- subjects %>%
    +  add_random(quest_id = quest_n)
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +subj_id + +gender + +age + +language + +condition + +version + +quest_id +
    +s001 + +female + +20 + +bilingual + +A + +V1 + +q1 +
    +s001 + +female + +20 + +bilingual + +A + +V1 + +q2 +
    +s001 + +female + +20 + +bilingual + +A + +V1 + +q3 +
    +s001 + +female + +20 + +bilingual + +A + +V1 + +q4 +
    +s001 + +female + +20 + +bilingual + +A + +V1 + +q5 +
    +s002 + +female + +19 + +monolingual + +A + +V2 + +q1 +
    +
    +
    +

    +Question reversing

    +

    I want some of the questions to be reverse-coded, so I’m adding a between-question factor of reversed with levels “F” and “R”. Here, we specify the .by = argument to show that this factor should vary by question. We didn’t need this in the code above because there was only one random factor to vary over, but by default this function varies over all random factors if there is more than one.

    +

    I set .shuffle = TRUE so that the questions are randomly assigned forward and reversed values, rather than odd questions being forward and even questions being reversed. This will require a more sophisticated method to wrangle the resulting data, and the randomisation means that different students’ datasets need different code.

    +
    +questions <- questions %>%
    +  add_between(.by = "quest_id", reversed = c("F", "R"), .shuffle = TRUE)
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +quest_id + +reversed +
    +q1 + +R +
    +q2 + +F +
    +q3 + +R +
    +q4 + +F +
    +q5 + +F +
    +
    +
    +

    +Random effects

    +

    Now we set the random effects structure. The function add_ranef() lets you add columns that sample values from a normal distribution with a mean of 0 and the specified SD. If you have example data, you can get realistic values for the random effects SDs from a mixed effects model (see this tutorial).

    +

    Here, we’re setting the SD for the subject’s random intercept to 2, and the SDs for the random slopes of language, condition, and version to 1. We set a small, positive correlation among all of these random effect. Each time you run this function, different values from this joint distribution will be sampled.

    +

    We also add a random intercept by question to account for the fact that some questions will have higher or lower values than the mean.

    +

    Finally add an overall error term, sigma, which will vary by subject and question (so you can skip the first .by argument).

    +
    +questions <- questions %>%
    +  add_ranef(.by = "subj_id", 
    +            s0i = 2, 
    +            s_lang = 1,
    +            s_cond = 1,
    +            s_vers = 1, 
    +            .cors = 0.2) %>%
    +  add_ranef(.by = "quest_id", q0i = 1) %>%
    +  add_ranef(sigma = 3)
    +
    +
    +

    +Fixed effects

    +

    Now we can calculate the DV. First, I want the fixed effects in each dataset to vary, so I’m setting the fixed effect values by sampling from -05., 0 and +0.5 for each of language, condition, and version.

    +
    +lang_effect <- sample(c(-0.5, 0, 0.5), 1)
    +cond_effect <- sample(c(-0.5, 0, 0.5), 1)
    +vers_effect <- sample(c(-0.5, 0, 0.5), 1)
    +
    +
    +

    +Factor contrasts

    +

    Next, we add contrasts to recode the fixed factors into numbers. See the contrasts vignette for more details. For a 2-level factor, this sets the first level of the factor to a value of -0.5 and the second level to +0.5.

    +
    +questions <- questions %>%
    +  add_contrast("language", add_cols = T, colnames = "lang") %>%
    +  add_contrast("condition", add_cols = T, colnames = "cond") %>%
    +  add_contrast("version", add_cols = T, colnames = "vers")
    +
    +
    +

    +Calculate DV

    +

    Now, we can calculate the DV as the sum of the grand mean (0), plus the random intercepts (s0i and q0i). This simulates how some subjects tend to use higher or lower points on the scale, and some questions have higher or lower mean values.

    +

    Next, we add the coded versions of each fixed factor, multiplied by their effect size plus the subject’s random slope for that effect. This simulates how some subjects show systematically larger or smaller effects.

    +

    Finally, we add the error term (sigma).

    +
    +questions <- questions %>%
    +  mutate(dv = 0 + s0i + q0i +
    +           (s_lang + lang_effect) * lang + 
    +           (s_cond + cond_effect) * cond + 
    +           (s_vers + vers_effect) * vers +
    +           sigma)
    +

    +
    +
    +

    +Recode DV

    +

    For this assignment, I want the DV to be from a Likert scale, so I’m going to convert dv from a normal distribution to a Likert scale with 7 points with the proportions below. The second mutate reverses the questions that should be reverse-coded.

    +
    +questions <- questions %>%
    +  mutate(dv = norm2likert(dv, prob = c(1, 2, 4, 6, 10, 5, 1)),
    +         dv = ifelse(reversed == "R", abs(dv - 8), dv)
    +  )
    +

    +
    +
    +

    +Reshape data

    +

    Here, I’m creating a quest_name column from the quest_id and reversed columns. sample(2:3) returns these columns in a random order. I then unite the columns with a randomly sampled separator. This will produce question names like F-q04 or q10 R. While putting information about the questions in the name isn’t great practice for recording data, it’s unfortunately very common and dealing with it is a skill I want my students to practice.

    +
    +sep <- sample(c("_", "", "-", " "), 1)
    +
    +questions <- questions %>% 
    +  select(subj_id, quest_id, reversed, dv) %>%
    +  unite(col = quest_name, sample(2:3), sep = sep) 
    +

    I then make 0.5% of the observations missing, pivot the table from long to wide format, and sample 95% of the subjects, so that the number of subjects in the subjects table doesn’t exactly match the number in the questions table, and is in a different order.

    +
    +questions <- questions %>% 
    +  messy(prop = .005, "dv") %>%
    +  pivot_wider(names_from = quest_name, values_from = dv) %>%
    +  slice_sample(prop = .95)
    +
    +
    +

    +Questionnaire function

    +

    Now wrap the code for making the questionnaire table in a function. You can use this to make several questionnaires per student to practice joining tables.

    +

    This code needs the subjects table as an argument. You can add the other randomised values as arguments. I also added likert_prob as an argument so you can easily customise the number of points on the Likert scale and their relative proportions.

    +
    +# randomise between students
    +make_quest <- function(subjects,
    +                       quest_n = 5:15,
    +                       sep = c("_", "", "-", " "),
    +                       lang_effect = c(-0.5, 0, 0.5),
    +                       cond_effect = c(-0.5, 0, 0.5),
    +                       vers_effect = c(-0.5, 0, 0.5),
    +                       likert_prob = c(.05, .1, .2, .3, .2, .1, .05)
    +                       ) {
    +  # sample values
    +  quest_n <- sample(quest_n, 1)
    +  sep <- sample(sep, 1)
    +  lang_effect <- sample(lang_effect, 1)
    +  cond_effect <- sample(cond_effect, 1)
    +  vers_effect <- sample(vers_effect, 1)
    +
    +  subjects %>%
    +    add_random(quest_id = quest_n) %>%
    +    add_between("quest_id", reversed = c("F", "R")) %>%
    +    add_ranef("subj_id", 
    +              s0i = 2, 
    +              s_lang = 1,
    +              s_cond = 1,
    +              s_vers = 1, 
    +              .cors = 0.2) %>%
    +    add_ranef("quest_id", q0i = 1) %>%
    +    add_ranef(sigma = 3) %>%
    +    add_contrast("language", add_cols = T, colnames = "lang") %>%
    +    add_contrast("condition", add_cols = T, colnames = "cond") %>%
    +    add_contrast("version", add_cols = T, colnames = "vers") %>%
    +    mutate(dv = s0i + q0i + sigma +
    +             (s_lang + lang_effect) * lang + 
    +             (s_cond + cond_effect) * cond + 
    +             (s_vers + vers_effect) * vers,
    +           dv = norm2likert(dv, prob = likert_prob),
    +           dv = ifelse(reversed == "R", abs(dv - 8), dv)
    +    ) %>%
    +    select(subj_id, quest_id, reversed, dv) %>%
    +    unite(quest_name, sample(2:3), sep = sep) %>%
    +    messy(prop = .005, "dv") %>%
    +    pivot_wider(names_from = quest_name, values_from = dv) %>%
    +    slice_sample(prop = .95)
    +}
    +
    +questions <- make_quest(subjects)
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +subj_id + +F-q1 + +R-q2 + +F-q3 + +R-q4 + +F-q5 + +R-q6 + +F-q7 +
    +s267 + +4 + +5 + +1 + +6 + +5 + +6 + +2 +
    +s098 + +5 + +1 + +6 + +2 + +4 + +3 + +5 +
    +s023 + +5 + +5 + +7 + +5 + +6 + +6 + +2 +
    +s259 + +5 + +1 + +3 + +4 + +4 + +7 + +3 +
    +s249 + +7 + +2 + +7 + +4 + +5 + +3 + +5 +
    +s008 + +6 + +5 + +6 + +3 + +6 + +5 + +3 +
    +
    +
    +
    +

    +Generate random assignment

    +

    I also want each student to have a different research question to answer with these data.

    +
    +

    +Write text

    +

    First, write the text you want to give to the students. You can use fancier methods for this, like parametrised R Markdown reports, but this is a simple and effective strategy. Put variables you want to randomise inside curly brackets, and we’ll sample those and insert the using glue::glue().

    +
    +research_question_text <- paste(sep = "\n\n",
    +  "=== Reproducible Report for {student_id} ===",
    +  
    +  "Your questionnaire measures {topic}. Your research question is to determine if the {topic} score differs by {iv} for the subset of the sample where {subset} is {level}.",
    +  
    +  "The {quest_n} {topic} questionnaire items are on a scale from 1 (low) to 7 (high), but some of the items need to be reverse-coded. This is indicated by the letter R in the question column name. You create the {topic} score by summing the questions.",
    +  
    +  "Watch out for missing data. You can decide whether to omit subjects with missing data or replace the missing data; just explain your choice and its consequences in the report.",
    +  
    +  "The report should be written like a summary document for your PI. You don't need to show your code in the rendered report. Include summary tables and/or plots with subject demographics from both the full data set and the subset you'll analyse. Visualise the relationship of interest. Conduct a GLM analysis to answer the research question above. Finally, do a power analysis to determine the sample size you would need to have {power}% power to detect a 0.5-point difference between the levels of {iv} with an alpha criterion of {alpha}."
    +)
    +

    You can save this to an external file if you want and read it from there. In this way, you can create more than one set of template instructions and also randomly assign that.

    +
    +# write to a template file
    +write(research_question_text, "template_instructions.txt")
    +
    +
    +

    +Define random aspects

    +

    Now define the variables from the text above. I want the iv and subset to be two different factors from the list of “language”, “condition”, and “version”. Then I sample one of the levels of the subset factor.

    +

    I sample a topic from “stress”, “extroversion”, and “disgust”. You can choose relevant topics for your discipline, of course.

    +

    I also sample an alpha level and power for the power calculation aspect of the assessment. This reinforces a lesson I want to teach about alpha = 0.5 and target power = 0.8 being mindless defaults that we should question. Justify everything.

    +
    +factors <- c("language", "condition", "version")
    +two_factors <- sample(factors, 2)
    +iv <- two_factors[[1]]
    +subset <- two_factors[[2]]
    +level <- subjects[[subset]] %>% unique() %>% sample(1)
    +topic <- sample(c("stress", "extroversion", "disgust"), 1)
    +alpha <- sample(c(.005, .01, .05), 1)
    +power <- sample(c(80, 85, 90), 1)
    +

    This will produce the following text.

    +
    +instructions <- readLines("template_instructions.txt") %>%
    +  paste(collapse = "\n") %>%
    +  glue::glue()
    +
    +

    === Reproducible Report for 8675309J ===

    +

    Your questionnaire measures extroversion. Your research question is to determine if the extroversion score differs by version for the subset of the sample where condition is A.

    +

    The 5 extroversion questionnaire items are on a scale from 1 (low) to 7 (high), but some of the items need to be reverse-coded. This is indicated by the letter R in the question column name. You create the extroversion score by summing the questions.

    +

    Watch out for missing data. You can decide whether to omit subjects with missing data or replace the missing data; just explain your choice and its consequences in the report.

    +

    The report should be written like a summary document for your PI. You don’t need to show your code in the rendered report. Include summary tables and/or plots with subject demographics from both the full data set and the subset you’ll analyse. Visualise the relationship of interest. Conduct a GLM analysis to answer the research question above. Finally, do a power analysis to determine the sample size you would need to have 80% power to detect a 0.5-point difference between the levels of version with an alpha criterion of 0.01.

    +
    +
    +
    +

    +Instructions function

    +

    As before, wrap this code in a function.

    +
    +make_instructions <- function(template, 
    +                              factors = c("language", "condition", "version")) {
    +  two_factors <- sample(factors, 2)
    +  iv <- two_factors[[1]]
    +  subset <- two_factors[[2]]
    +  level <- subjects[[subset]] %>% unique() %>% sample(1)
    +  topic <- sample(c("stress", "extroversion", "disgust"), 1)
    +  alpha <- sample(c(.005, .01, .05), 1)
    +  power <- sample(c(80, 85, 90), 1)
    +
    +  readLines(template) %>%
    +    paste(collapse = "\n") %>%
    +    glue::glue()
    +}
    +
    +
    +
    +

    +Save files

    +

    Now you need to create a directory for the student’s files and save the subject table, question table, and instructions. I’m saving the files in a directory that contains the student ID so I can upload them to Moodle easily.

    +
    +dir <- paste0("exam_", student_id)
    +dir.create(dir, showWarnings = FALSE)
    +readr::write_csv(subjects, file.path(dir, "subjects.csv"))
    +readr::write_csv(questions, file.path(dir, "questions.csv"))
    +write(instructions, file.path(dir, "instructions.txt"))
    +
    +
    +

    +Simulation function

    +

    Once you’ve debugged your code above, put each step inside a function with the argument student_id.

    +
    +random_project <- function(student_id) {
    +  # set seed using student ID
    +  seed_from_string(student_id)
    +  
    +  # simulate subjects
    +  subjects <- make_subjects()
    +  
    +  # simulate questionnaire
    +  questions <- make_quest(subjects)
    +  
    +  # customise instructions
    +  instructions <- make_instructions("template_instructions.txt")
    +  
    +  # write files to a new directory
    +  dir <- paste0("exam_", student_id)
    +  dir.create(dir, showWarnings = FALSE)
    +  readr::write_csv(subjects, file.path(dir, "subjects.csv"))
    +  readr::write_csv(questions, file.path(dir, "questions.csv"))
    +  write(instructions, file.path(dir, "instructions.txt"))
    +  
    +  return(dir)
    +}
    +

    Now you can map over a list of student IDs to create personalised data and research questions for each student. Here is the pattern if you have student IDs in a table in a column called Student ID.

    +
    +# load student IDs
    +student_list <- tibble(
    +  `Student ID` = 1:5
    +)
    +
    +# iterate over the IDs to create a random project
    +purrr::map_chr(student_list$`Student ID`, random_project)
    +
    +
    + + + +
    + + + +
    + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + diff --git a/docs/articles/random_reports_files/figure-html/unnamed-chunk-19-1.png b/docs/articles/random_reports_files/figure-html/unnamed-chunk-19-1.png new file mode 100644 index 00000000..e986bf38 Binary files /dev/null and b/docs/articles/random_reports_files/figure-html/unnamed-chunk-19-1.png differ diff --git a/docs/articles/random_reports_files/figure-html/unnamed-chunk-21-1.png b/docs/articles/random_reports_files/figure-html/unnamed-chunk-21-1.png new file mode 100644 index 00000000..abf63ff7 Binary files /dev/null and b/docs/articles/random_reports_files/figure-html/unnamed-chunk-21-1.png differ diff --git a/docs/articles/random_reports_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/random_reports_files/figure-html/unnamed-chunk-8-1.png new file mode 100644 index 00000000..82b19d79 Binary files /dev/null and b/docs/articles/random_reports_files/figure-html/unnamed-chunk-8-1.png differ diff --git a/docs/articles/random_reports_files/header-attrs-2.10.6/header-attrs.js b/docs/articles/random_reports_files/header-attrs-2.10.6/header-attrs.js new file mode 100644 index 00000000..dd57d92e --- /dev/null +++ b/docs/articles/random_reports_files/header-attrs-2.10.6/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/articles/rnorm_multi.html b/docs/articles/rnorm_multi.html index 9bb9c824..6088a3ee 100644 --- a/docs/articles/rnorm_multi.html +++ b/docs/articles/rnorm_multi.html @@ -17,9 +17,9 @@ - + - + @@ -42,7 +42,7 @@ faux - 1.0.0 + 1.1.0 @@ -82,12 +82,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -111,13 +117,13 @@ -
    +
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -111,13 +117,13 @@ -
    +
    + empirical = TRUE, vardesc = vardesc, plot = TRUE)

    @@ -220,73 +230,28 @@

    time = c(day = "Tested during the day", night = "Tested at night") ) df <- sim_design(within, between, mu = 1:4)

    -

    -
    - -
    -

    -check_design

    -

    The check_design() function converts this to the fully expanded version; it checks your design specification when you run sim_design() or you can run it on its own to create a validated design list. You can view this in JSON format using the function json_design().

    +

    #### Factor labels

    +

    Add factor labels with the vardesc argument. You can also customise the ID and DV column names (they default to c(id = "id") and c(y = "value")).

    -design <- check_design(within, between, n = 10, 
    -                       mu = 1:4, sd = 1:4, r = 0.5, plot = FALSE)
    -
    -json_design(design, pretty = TRUE)
    -#> {
    -#>   "within": {
    -#>     "time": {
    -#>       "day": "Tested during the day",
    -#>       "night": "Tested at night"
    -#>     }
    -#>   },
    -#>   "between": {
    -#>     "pet": {
    -#>       "cat": "Is a cat person",
    -#>       "dog": "Is a dog person"
    -#>     }
    -#>   },
    -#>   "dv": {
    -#>     "y": "value"
    -#>   },
    -#>   "id": {
    -#>     "id": "id"
    -#>   },
    -#>   "n": {
    -#>     "cat": 10,
    -#>     "dog": 10
    -#>   },
    -#>   "mu": {
    -#>     "cat": {
    -#>       "day": 1,
    -#>       "night": 2
    -#>     },
    -#>     "dog": {
    -#>       "day": 3,
    -#>       "night": 4
    -#>     }
    -#>   },
    -#>   "sd": {
    -#>     "cat": {
    -#>       "day": 1,
    -#>       "night": 2
    -#>     },
    -#>     "dog": {
    -#>       "day": 3,
    -#>       "night": 4
    -#>     }
    -#>   },
    -#>   "r": {
    -#>     "cat": [
    -#>       [1, 0.5],
    -#>       [0.5, 1]
    -#>     ],
    -#>     "dog": [
    -#>       [1, 0.5],
    -#>       [0.5, 1]
    -#>     ]
    -#>   },
    -#>   "sep": "_"
    -#> }
    +vardesc <- c(pet = "Type of Pet", + time = "Time of Day") + +df <- sim_design(within, between, mu = 1:4, + id = c(pet_id = "Pet ID"), + dv = c(score = "Score on the Test"), + vardesc = vardesc)
    +

    +

    If you have any within-subjects factors and your table is in wide format, you will only see the DV name in plots. But it will be used if you convert the table from wide to long.

    +
    +wide2long(df) %>% head()
    +#>   pet_id pet time      score
    +#> 1   S001 cat  day  2.1304574
    +#> 2   S002 cat  day  2.1080727
    +#> 3   S003 cat  day  0.6007963
    +#> 4   S004 cat  day -0.6186662
    +#> 5   S005 cat  day  0.1293905
    +#> 6   S006 cat  day  1.1489877
    +

    @@ -296,75 +261,75 @@

    Single number

    You usually want to specify n as a single number. This is N per cell, not total sample size.

    -
    +
     n <- 20 # n per cell, not total
     design <- check_design(2, c(2,2), n = n, plot = FALSE)
     str(design$n)
     #> List of 4
    -#>  $ B1_C1: num 20
    -#>  $ B1_C2: num 20
    -#>  $ B2_C1: num 20
    -#>  $ B2_C2: num 20
    +#> $ B1a_B2a: num 20 +#> $ B1a_B2b: num 20 +#> $ B1b_B2a: num 20 +#> $ B1b_B2b: num 20

    Named list

    You can also specify n as a named list of Ns per between-subject cell.

    -
    +
     n <- list(
    -  B1_C1 = 10, 
    -  B1_C2 = 20, 
    -  B2_C1 = 30, 
    -  B2_C2 = 40
    +  B1a_B2a = 10, 
    +  B1a_B2b = 20, 
    +  B1b_B2a = 30, 
    +  B1b_B2b = 40
     )
     design <- check_design(2, c(2,2), n = n, plot = FALSE)
     str(design$n)
     #> List of 4
    -#>  $ B1_C1: num 10
    -#>  $ B1_C2: num 20
    -#>  $ B2_C1: num 30
    -#>  $ B2_C2: num 40
    +#> $ B1a_B2a: num 10 +#> $ B1a_B2b: num 20 +#> $ B1b_B2a: num 30 +#> $ B1b_B2b: num 40

    Dataframe

    Or as a data frame. You just need to get the row or column names right, but they don’t have to be in the right order.

    -
    +
     n <- data.frame(
    -  B2_C2 = 40,
    -  B1_C1 = 10, 
    -  B1_C2 = 20, 
    -  B2_C1 = 30
    +  B1b_B2b = 40,
    +  B1a_B2a = 10, 
    +  B1a_B2b = 20, 
    +  B1b_B2a = 30
     )
     design <- check_design(2, c(2,2), n = n, plot = FALSE)
     str(design$n)
     #> List of 4
    -#>  $ B1_C1: num 10
    -#>  $ B1_C2: num 20
    -#>  $ B2_C1: num 30
    -#>  $ B2_C2: num 40
    +#> $ B1a_B2a: num 10 +#> $ B1a_B2b: num 20 +#> $ B1b_B2a: num 30 +#> $ B1b_B2b: num 40

    You can specify the cells as row names or column names and check_design() will fix them. Since n has to be the same for each within-subject factor, you can specify n as a single column with any name.

    -
    +
     n <- data.frame(n = c(10, 20, 30, 40),
    -                row.names = c("B1_C1", "B1_C2", "B2_C1", "B2_C2"))
    +                row.names = c("B1a_B2a", "B1a_B2b", "B1b_B2a", "B1b_B2b"))
     design <- check_design(2, c(2,2), n = n, plot = FALSE)
     str(design$n)
     #> List of 4
    -#>  $ B1_C1: num 10
    -#>  $ B1_C2: num 20
    -#>  $ B2_C1: num 30
    -#>  $ B2_C2: num 40
    +#> $ B1a_B2a: num 10 +#> $ B1a_B2b: num 20 +#> $ B1b_B2a: num 30 +#> $ B1b_B2b: num 40

    Mu and SD

    -

    The specifications for mu and sd need both within-subect and between-subject cells. You can specify these as a single numbers, a vector, a named list of named vectors or a data frame.

    +

    The specifications for mu and sd need both within-subject and between-subject cells. You can specify these as a single numbers, a vector, a named list of named vectors or a data frame.

    Unnamed vector

    An unnamed vector is a quick way to specify means and SDs, but the order relative to your between- and within-subject cells can be confusing.

    -
    +
     between <- list(pet       = c("cat", "dog"), 
                     condition = c("A",   "B"))
     within  <- list(time      = c("day", "night"))
    @@ -389,7 +354,7 @@ 

    Named list of named vectors

    A named list of named vectors prevents confusion due to order. The levels of the between-subject factors are the list names and the levels of the within-subject factors are the vector names, but their order doesn’t matter.

    -
    +
     mu <- list(
       cat_B = c(night = 40, day = 30),
       cat_A = c(day = 10, night = 20),
    @@ -412,7 +377,7 @@ 

    #> ..$ day : num 70 #> ..$ night: num 80

    Alternatively, you can specify them as data frames.

    -
    +
     mu <- data.frame(
       cat_A = c(10, 20),
       cat_B = c(30, 40),
    @@ -436,7 +401,7 @@ 

    #> ..$ day : num 70 #> ..$ night: num 80

    If you transpose the dataframe, this works out fine unless your within- and between-subject cells have identical names.

    -
    +
     mu <- data.frame(
       day = c(10, 30, 50, 70),
       night = c(20, 40, 60, 80),
    @@ -463,7 +428,7 @@ 

    Correlations

    If you have any within-subject factors, you need to set the correlation for each between-cell. Here, we only have two levels of one within-subject factor, so can only set one correlation per between-cell.

    -
    +
     r <- list(
       cat_A = .5,
       cat_B = .5,
    @@ -495,36 +460,36 @@ 

    Upper right triangle

    If you have more than 2 within-subject cells, you can specify each specific correlation in the upper right triangle of the correlation matrix as a vector.

    -
    +
     r <- list(
    -  B1 = c(.10, .20, .30, 
    +  B1a = c(.10, .20, .30, 
                   .40, .50, 
                        .60),
    -  B2 = c(.15, .25, .35, 
    +  B1b = c(.15, .25, .35, 
                   .45, .55, 
                        .65)
     )
     design <- check_design(4, 2, r = r, plot = FALSE)
     design$r
    -#> $B1
    -#>     A1  A2  A3  A4
    -#> A1 1.0 0.1 0.2 0.3
    -#> A2 0.1 1.0 0.4 0.5
    -#> A3 0.2 0.4 1.0 0.6
    -#> A4 0.3 0.5 0.6 1.0
    +#> $B1a
    +#>     W1a W1b W1c W1d
    +#> W1a 1.0 0.1 0.2 0.3
    +#> W1b 0.1 1.0 0.4 0.5
    +#> W1c 0.2 0.4 1.0 0.6
    +#> W1d 0.3 0.5 0.6 1.0
     #> 
    -#> $B2
    -#>      A1   A2   A3   A4
    -#> A1 1.00 0.15 0.25 0.35
    -#> A2 0.15 1.00 0.45 0.55
    -#> A3 0.25 0.45 1.00 0.65
    -#> A4 0.35 0.55 0.65 1.00
    +#> $B1b +#> W1a W1b W1c W1d +#> W1a 1.00 0.15 0.25 0.35 +#> W1b 0.15 1.00 0.45 0.55 +#> W1c 0.25 0.45 1.00 0.65 +#> W1d 0.35 0.55 0.65 1.00

    Correlation matrix

    You can also enter the correlation matrix from cor().

    -
    +
     within <- list(cars = c("speed", "dist"))
     between <- list(half = c("first", "last"))
     r <- list(
    @@ -549,7 +514,7 @@ 

    Empirical

    If you set empirical = TRUE, you will get the exact means, SDs and correlations you specified. If you set empirical = FALSE or omit that argument, your data will be sampled from a population with those parameters, but your dataset will not have exactly those values (just on average).

    -
    +
     between <- list(pet  = c("cat", "dog"))
     within  <- list(time = c("day", "night"))
     mu <- list(
    @@ -625,7 +590,7 @@ 

    Here is a 2w*3w*2b*2b example. When you have multiple within or between factors, you need to specify parameters by cell. Cell names are the level names, in the order they are listed in the within or between arguments, separated by underscores.

    Foe example, if you have one within-subject factor of condition with levels con and inc, and another within-subject factor of version with levels easy, med, and hard, your cell labels will be: con_easy, inc_easy, con_med, inc_med, con_hard, and inc_hard.

    If you have any characters in your level names except letters and numbers, they will be replaced by a full stop (e.g., my super-good level_name will become my.super.good.level.name).

    -
    +
     within <- list(
       condition = c(con = "Mean of congruent trials", 
                     inc = "Mean of incongruent trials"),
    @@ -648,7 +613,7 @@ 

    expert_night = 10:15 )

    You can set the correlation for each between-cell to a single number.

    -
    +
     r <- list(
       novice_day = 0.3,
       novice_night = 0.2,
    @@ -656,7 +621,7 @@ 

    expert_night = 0.4 )

    Or you can set the full correlation matrix with a vector or matrix. Since we have 6 within-cells, this is a 6x6 matrix or a vector of the upper right 15 values.

    -
    +
     # upper right triangle correlation specification
     # inc and con have r = 0.5 within each difficultly level, 0.2 otherwise
     #          ce,  ie,  cm,  im,  ch,  ih
    @@ -674,7 +639,7 @@ 

    expert_night = triangle )

    You can set long = TRUE to return the data frame in long format, which is usually easier for plotting.

    -
    +
     df <- sim_design(within, between, n = 100, 
                      mu = mu, sd = 2, r = r, 
                      dv = c(rt = "Reaction Time"), 
    @@ -682,19 +647,23 @@ 

    head(df) #> id experience time condition version rt -#> 1 S001 novice day con easy 11.009948 -#> 2 S002 novice day con easy 10.514269 -#> 3 S003 novice day con easy 8.175229 -#> 4 S004 novice day con easy 6.696232 -#> 5 S005 novice day con easy 10.703293 -#> 6 S006 novice day con easy 8.694598

    +#> 1 S001 novice day con easy 9.612842 +#> 2 S002 novice day con easy 9.339860 +#> 3 S003 novice day con easy 8.146942 +#> 4 S004 novice day con easy 11.587107 +#> 5 S005 novice day con easy 7.536527 +#> 6 S006 novice day con easy 11.726081

    Multiple datasets

    -

    You can simulate multiple datasets by setting the rep argument of sim_design() to a number greater than 1. This will return a nested data frame with one column called rep and another column called data, that contains each individual data frame. This method is ** much** faster than repeatedly calling sim_design(), which will check the syntax of your design each time.

    +

    You might want to make multiple datasets with the same design for simulations. It can be inefficient to just put sim_design() in an apply function or a for loop (especially if you leave plot = TRUE). The patterns below make this faster.

    +
    +

    +rep argument

    +

    You can simulate multiple datasets by setting the rep argument of sim_design() to a number greater than 1. This will return a nested data frame with one column called rep and another column called data, that contains each individual data frame. This method is faster than repeatedly calling sim_design(), which will check the syntax of your design each time, and returns a nested dataset that makes it easy to apply the same analysis to each replicate.

    The code below creates 5 data frames with a 2W*2B design.

    -
    +
     df <- sim_design(within = 2, between = 2, 
                      n = 50, mu = c(1, 1, 1, 1.5), 
                      sd = 1, r = 0.5, plot = FALSE, 
    @@ -707,17 +676,17 @@ 

    #> 3 3 #> 4 4 #> 5 5 -#> data -#> 1 S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1.55555571602532, 0.0678412512309989, 0.824784318236322, -0.21116394176769, 2.98742413116723, 1.34579079329966, 0.216349670116093, 0.858316394258301, 1.51539463829532, 0.25295344885721, 0.930802578691947, 1.67863592082209, 1.28239562289491, 3.58989827527106, -0.536049980961986, 0.912435698464094, 0.567825749991729, 3.12458284361277, 1.47808672113212, 1.24674411962637, 0.853839199140551, 2.02565973003708, 0.176667123122524, 0.926896001409594, 1.9575875039278, -0.136750384368066, 1.0181391418141, -0.00840950060611623, 1.67658507582363, -0.0809264903226259, 1.69114761898573, 1.01246378445797, 2.24862223844115, 0.669661694674195, 1.65604015428598, 2.46250610647223, 0.0740177798766469, 1.51226187580388, 0.14421454582005, 2.11310272348989, 2.03265583757928, 2.79846829963914, 0.580471719879456, 1.3043978252603, 1.8512085808481, 3.48174421298289, 1.94984106304598, 1.7469267801916, 1.78728896254775, 1.48606017028732, 0.187193273682921, 0.00521669823583093, 1.98176443413773, 0.652079391864872, 1.51715865532515, 0.113149482725347, 0.347706871718426, 0.740881814513999, 1.11572356981118, 1.27090333636724, 1.78564100071517, 1.49996490092148, 0.0288668227264472, 1.71112579357579, 1.5207249247374, 1.55860366936381, 1.20894760335609, 1.0311174625074, -1.07796286535925, 0.788719816989015, -0.0808795153720332, 0.329994777259719, 0.480146146972041, -0.713780227245707, 1.95104174075826, 1.59347282746002, 1.71913466584771, -1.53634174823672, 1.90368327198272, 2.83826042943864, 2.07759232014894, 2.13273408709688, 0.299713735481763, -0.137842946912594, 2.79942499935449, 1.19833265832241, 2.62753607675824, -1.42328585234192, -0.0751050704871141, -0.419131625229273, 2.26747599027497, 1.31444154719025, 0.0592524927023319, 0.697627497974621, 1.27542258928792, 2.37024292304769, 0.910474623322396, 1.0619053350265, 1.22786082522735, 1.63010570443739, 1.61636482104558, 0.314737959506601, 0.610610857411289, 0.978080137170315, 2.07724142140141, 0.870158507424624, 0.650050911103034, 1.65411585714978, 1.04851181239876, -0.262815456588478, 0.517149988488461, 0.615174602156726, 2.23192034874723, 1.48769423829932, -0.670503013516685, 2.18476512306939, 2.107521150466, 3.13712362590908, 1.21487628815697, -0.927529850035151, 0.341069525120829, 0.634587191771041, 0.296797450390694, 1.17629476306581, 2.25683110918589, 0.15937681754783, 0.523505955316098, -0.775667666851521, 0.937025837272826, 0.308955659616285, 1.84970121232851, 0.950704493703558, 1.72180598547482, 0.816031298210658, 1.89580607184869, 1.19319146924009, 0.557120161642448, 1.34044413855533, 0.334913386195707, 1.6726694132779, 1.89261991943725, 2.19222066076322, 1.07131824975875, 0.136732640954999, 2.30898194632543, 2.83266265977988, 0.616003624661114, 1.46755333797166, 0.923288211053076, 1.20404444697448, 0.930891000542466, 0.257133366450483, 2.53870169992066, 1.28314001417363, 2.31721376747408, 2.4612983146769, 0.411409964091945, 2.46734319119753, 2.47445501290471, 2.27488163296988, 1.44733884329197, 1.30618803144898, 1.68933169278773, 2.86559409242167, 2.91316244290878, 0.391579294143113, -0.531395720912208, 0.819933797537597, 1.6375368932878, 2.34239590411921, 1.37653478494178, -0.973876543164723, 1.96027977390228, 1.05392626059997, 1.56403436523351, 1.67965257062466, 0.102591367486628, 1.08012067681808, 0.627244564275662, 0.542071630524208, 1.91361822544832, 1.83921865944467, 0.66860729411856, 1.54885303624584, 2.30907762707209, 2.34028907187091, 3.8588329107384, -0.407795257952801, 0.945663733013778, 0.245372379515269, 2.12307834447353, 2.17693289976844, 3.29671375034928, 0.957153408378284, 1.63550733378903, 1.59506459001335, 2.56240270031904, 1.91428484685566, 0.669686217024428, 1.06695169855839 -#> 2 S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0.274597483602684, 2.3041046279882, 1.64937329892712, 0.29277880264983, 1.45707780912013, 1.92600833321635, 0.14343496930095, -0.0410422200740344, 0.577849300855402, 2.94285057220627, 0.642217401414322, 1.89312508085027, 0.446240808547264, 1.73321639234968, -0.444025699233098, -0.304104743326664, 0.884727341779028, 0.965797688368736, 2.37185296081076, 1.81197931676832, 1.47363261827041, 1.40697820732509, 1.47206886485763, 1.2853576295202, 1.05998840884548, 0.711531533212812, 1.75705422054549, 2.61352435730733, -0.522139819819426, -0.173870927671993, 1.49872828585865, 0.890996281615026, 2.18940724624871, 2.33226265188192, -0.146916949244605, 1.94862164578978, 2.77043953399926, 1.8741685484351, 1.29073654322569, 0.141657483595086, 0.207692983054185, 0.980336502316774, 0.0166150834614402, 0.858578726341674, 2.51232583472212, 2.17294024126455, 0.108988510580001, 0.402327223541102, 1.9957532741992, 1.18001477174048, 2.25272464392933, -1.58716388132745, 0.3234887989706, 1.99841333836271, 0.495562913049905, 1.17540706076005, 2.00488254386561, 0.624797984071452, 1.65879389710818, 2.17386864460148, 0.348542171578429, 0.300420260224959, 1.44588838118724, 1.26534420788543, 1.31882694467246, 0.842149212115294, 2.65570281833476, 0.968879137686063, -0.168391674765493, 1.42320580002002, 1.05906782493745, 1.21841095379987, 1.07395089122099, 0.660280738543209, 1.91535452567508, 2.38120273332891, -0.478919738424654, 1.62935271570309, 0.960572221510141, 0.219630482211196, -0.209884316544704, 1.83510654308755, 0.990454137548804, -0.448247518991062, 0.375566741128188, 0.0579632798123522, 1.14606417969848, -0.373241711931985, 1.59729926295591, 1.12144039309028, 1.05504184288596, 1.63335585993035, 0.55768897026735, 1.79649304097524, 0.27755995122694, -0.756677199164531, 1.28263861034264, 1.05236117430963, 0.114584055449265, 0.105660809589348, 0.0868063965144955, 0.289278505712419, 2.41521653479917, 1.38657808866785, 2.43391096428193, 1.38521504415553, 0.941023686981752, 0.128236533937771, 0.634576619535881, 2.29768027797921, 1.33672358889517, 2.88805976937666, 1.86686231610821, 0.852070070592644, 1.43906515705534, -0.650119434343972, 1.82408844970255, 2.9457955124156, 2.27463595323148, 1.24961358439756, 0.511890439693217, 0.231569014049616, 1.04693323342495, 0.66197386675558, 1.66028912404966, 1.13050901245377, 1.73705262853697, 1.43256627186732, -0.304693339971221, 0.571594868932559, 1.14295015041952, 0.449253405808299, 0.31914362987185, 1.8888053300515, 0.593674403119682, 4.20229457087046, 1.86275801121652, 0.941883839795328, 1.79896546277292, -1.55427195059537, 0.162879768905411, 1.43079386376183, -0.223140718690683, 1.56768371103242, 1.69672123928028, 2.11226814284778, 1.10823625436038, 1.17602544704559, 1.6486649328267, 1.27894508518429, 1.46137448075515, 1.37678909341986, 1.35614685340228, 3.4786553683335, 0.0150129395563319, 2.54054557534694, 2.87715070296517, 2.24873147592593, 2.94468632613517, 2.70297608458527, 2.64803975047436, 1.62510095093551, 0.431754905150053, 1.15685876976003, 1.05912158085869, 1.52438431287023, 1.54069963900027, 2.10040695007657, 1.289153772757, 0.773738146156229, 1.86752875421309, 1.47116132059646, 0.122823108198833, 1.83452240810754, 1.53236249957893, 2.63234928929376, -0.681627462146765, 0.0106386586869087, 0.856544967047931, 1.76100664663376, 2.48976547444479, 2.10169455379797, 2.00546276450994, 1.11194401681127, 1.37409309280963, 1.30503637970657, 1.50350553430563, 1.6792343156228, 1.78625766016618, 0.741552137976666, 0.879667001162837, 1.97614662380762, 2.64873238208901, 1.7773572187115, 0.199038654867019, -0.110722709112553, 2.56826863487328, 1.5975360077436, 2.48556708766107, 1.48701655366298 -#> 3 S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0.550413222022478, 1.61583799090606, 0.773754294892718, -0.296550207030592, 3.5771208375988, -0.685938157355141, 1.40682230373394, 2.56899317136945, 0.709567627665215, 0.763906288535319, 0.477138262448875, 0.893707829626418, 1.39364435723424, -0.224957353979768, -0.646546202668539, 0.447347463031584, 1.17701757781005, 0.871135644149221, 0.381948497707559, 0.698197636623797, 1.39686590810314, 0.494092568372154, 1.01283988432699, 1.82210085756558, 0.463486665798118, 1.17447865047739, 1.78471394015306, 2.05734981079573, 0.210387520362077, 0.772172054958352, 1.58341898323948, 0.838987455542111, -0.011503604355185, 0.662968967647211, 0.439067173616001, 0.414768290571787, 0.397185601854675, 1.95811851976869, 0.104361685289255, 0.845067169670795, 1.58846959988102, -0.458578600116502, 2.52764661696732, 1.57370868197922, -0.423227990022345, 2.59973297624124, 0.397097245119179, -0.334375031191431, 1.16466412277652, 2.59390961132783, 1.88911515752494, 0.280584999076221, 1.85603337335616, 0.663058902680745, 1.11678187910985, 0.64277422925776, -0.170724196618885, 1.00746123229656, 1.63902174970356, -0.303639574874986, 2.40077159004381, 0.430279368179888, 1.06674557817744, 1.02566865422564, 0.763894600110417, 1.76412697977973, 1.17931914178395, -0.646222082569841, -0.772573046829946, 1.38279535184653, 1.9599045621739, 1.72068595995715, 1.00653732211496, 2.10088960580065, 0.438117420808502, 1.67167997919109, 1.07358925482232, 2.37456852051297, -0.641381931847302, 1.35556123922147, -0.747571797527282, 3.01546462449756, 2.47829308104287, 1.07076615821898, 1.47040852104524, 0.663595040895812, 1.12725972296597, 2.13599812465308, 0.464229303832989, 0.457362549796007, 0.901708242847028, 1.40113841344744, 1.21151593172823, 1.37230223886873, 0.411545364443991, 1.29448175697229, 0.216151885101102, -0.367111531046889, 1.66685141055219, 0.488240286973031, 1.14780562518222, 1.76897866357223, 1.25757760704722, 2.27508748897553, 1.81591562633206, -0.821360717496915, 1.60792545878455, -0.0841183004805761, 1.375493724645, 0.993889443274648, 0.239434704280945, 1.15830073724926, 1.23961522025369, 0.0247943877696292, 0.73223923387347, -0.441290920163084, 1.18957279100201, 2.12480373600532, 0.373296739234301, -1.01333861490413, 2.08975218158712, 0.230288914905233, -0.861285660097009, 1.25198033644645, 0.373398540308062, -0.0615927955065252, 0.703085517870669, 2.02568231172187, 0.427335347322088, 0.493163030690889, 2.22101047561475, 2.05498584487132, 0.441966715960555, 0.519619005113056, -1.07334656749816, 1.03169933401495, 1.95254698843533, 1.60971534814947, -0.453006521501111, 1.00952364939589, 0.82106949174107, 0.336587830754553, 2.02689281512126, 1.3350335535639, -0.347154237226831, 2.20743288179336, 0.321874225836974, -0.10979447997377, 1.13600490991684, 1.77897097695262, 1.15514671814166, 0.422605615133064, 2.72392678353301, 1.41033781119604, 3.23133285769391, 1.49058516242709, 1.12704562581311, 0.415329109797291, 2.21174688512289, 0.27484933451402, 2.71107814341565, 0.1752627634665, 2.24453031837406, 2.79685268960555, 1.02408462492638, 1.38351420543146, 0.65905184860277, 1.30062390293669, -0.0488074839705284, 0.486356414400519, 1.87334485987901, 1.85748783070623, -0.0634658907493812, 2.1440228161651, 1.50730626341272, 1.7414325725302, 2.09424158656654, 4.65771587015342, 0.52208351745439, 1.91444895641158, -0.377127370618453, 3.72125190739308, 0.755477380868362, 0.507437537934955, 2.3611644635486, 1.66871761963952, 1.21612059489918, 2.71924917865619, 1.58454066687407, 1.25328458553362, -0.0770936965554871, 2.00539773180439, 1.95456281902327, 2.0514182024728, 0.847532368860552, 1.48988783214528, 2.28035167692883, 0.847979684729701, 0.722643807346016, 0.605767146169493 -#> 4 S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1.12949402942326, 1.29802177675141, 1.55175219510753, 1.77202445444268, 0.366101788050593, -0.579076421658499, 1.33344244031851, 2.6378676442245, 0.715718350675688, 1.98115043631984, 0.803318365702809, 1.21862156323307, 1.49317953496738, 0.44885001466015, 0.574344406846549, -0.155672089699947, 1.20224936755554, 2.04943959996531, 2.39834884350793, 1.43743772271096, -0.431894744443609, 1.1836115954987, 2.80114148456863, 0.813990188456619, 1.31972232954933, 1.51395001425472, 0.88662153956814, 2.12725816099768, 0.754045265891047, 1.10841835933957, 2.1091696661521, -1.88476944886359, 2.857582668913, 2.62413686324617, 1.49999656809069, -0.399527020411841, 3.16096166700591, 0.691472215338797, 0.429384150746721, -0.463078862598585, 2.98046413307311, 0.599056504718399, 0.498767405538802, -0.140138909216813, -1.23915621409111, -0.0113074123296455, 0.705519503210596, 1.55728829908019, 0.504245796123365, 1.8067113138288, 0.989113880467812, 1.21485711788118, 0.516046071485557, 0.563912952082183, 1.15248403269996, 1.25335720999887, 0.788252373680053, 2.52266425581994, 0.715446573335971, 1.53168175576095, -0.178721629920463, 2.1755911090123, -0.341945630118678, -0.248703924518402, 0.804493384916684, 0.0752387645536146, 1.21961583316857, -0.867423006342873, 1.4792858074688, -1.46747680353047, 1.48474501659346, -0.377571707058062, 0.489414948662824, -0.738705509904769, -0.718520137035565, -0.431499413990145, 0.874717542634119, 0.480281217592187, 0.710774882549559, -1.25147560432514, 1.14182319409107, 0.702519187190701, 1.09292236303731, 0.601196448158943, -0.359921378201032, 0.825568529604021, 1.03759789193137, -0.452489942274749, 2.16709792477145, 0.428742005663283, 1.24558365704105, -0.482419496822476, 1.19749713799122, -0.265583966183068, 2.69731133394042, -1.162986965741, 1.22515349805838, 2.88370730931277, 1.08809737057613, 1.75194105804495, 0.214758991887311, 1.56251785102642, 2.13010701341805, 1.27118194310312, -1.27076259989263, -1.1361794301866, 0.966120791293217, 2.13970409525879, 1.60970553222607, -0.0562401182236494, -0.297011477147581, 1.30592169878453, 1.45927217455387, -0.883979138994741, -0.425532294612248, -0.297194011955109, 0.419488223071307, -1.11946410444315, 1.86521212664601, 1.64123892333741, 1.23327885673155, 1.52739794827957, 0.784735845830889, 1.95223903780375, 2.19993267400091, 1.977130407007, 1.04402410857569, 0.368206844680403, 0.820403793057239, 0.499010219349716, 2.52587860012603, -1.03501112902685, 1.75308843971871, 2.297183265199, 1.92625723245484, -1.20974521982865, 3.11933295523007, 0.118010828682067, -0.161709686801402, -1.06649496053252, 2.17612003101046, 0.527828838520761, 0.658256482477541, 0.932641567050463, 0.776990799266115, 2.64543001347118, -0.127039814898073, 2.72386239509239, 2.5496394737302, -0.0319900408713809, 2.53075132455008, 0.72669598854135, 3.0260724680522, 1.29619767140609, 0.0449350241004942, 1.64795963672854, 0.168977775276824, 1.99152656066922, 0.704026265226296, 3.71954936870082, 0.867700357500838, 1.65465513191518, 1.40176296421777, 1.33291371780505, 1.65237205864944, 0.69530944994102, 1.30331406850434, 2.10362009490491, 1.64394965383917, 0.459439301572765, 1.62782791172094, 0.414139870176326, 2.0439804214662, 0.684913363220659, 1.00495383740312, 1.03341782348267, 1.30530982678473, 1.54348551603395, 0.3707543374806, 0.467724102772808, 0.731027604811263, -0.224109145492854, 1.59159587518749, 1.5834963365499, 1.17365340495633, 2.46995541201241, 1.88998399156306, -0.0499752306297689, 1.46127069078905, 0.551024969538967, 0.470234824637613, 1.21030202713216, 2.54203720533004, 0.862505229636993, 3.67634736101758, 1.34762179784224, -0.248798048283042, 2.63313265833205, 0.171674737148905, 2.51360387464864 -#> 5 S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0.823628416606036, 1.04947775580423, 2.14830047764618, 1.2746143971463, 1.85528774323286, 0.287939677300414, -1.27415818354606, 1.35855179067829, 0.903614515067483, 1.12671889162066, 0.353474382511494, 1.20954835734338, 1.89912794546735, 1.35203136557311, 2.1778106637565, 0.451015637372707, 2.31046707184244, -0.888552646978253, 0.72149642539336, -0.669736179991179, 0.769872970303931, 1.20474880438577, 1.37968594771501, 0.240252828701029, 0.50185382952182, 0.44855979013257, 1.15458135761622, 1.3566380728204, 1.70198218026366, 0.754409303867608, 0.694858402572212, -0.273090219641491, -0.245883352029218, 0.0802483363202747, -0.25998108734952, 1.20445939086955, 0.837588857408504, -0.0994548351456142, -0.371990312540926, 1.95394843334331, 0.119557697448772, 0.840296366318227, 0.564219478920604, -0.169958089890487, 1.04128828676752, 2.05358703106541, 0.330591650499939, 0.290976662359473, 2.22606719773034, 1.63952582998424, 1.36110578262358, 1.81680440451965, 2.08567609750736, 1.16649125163109, 1.03160165204683, 1.51589513092244, 0.688866730527635, 0.330481547665992, 1.05337427336241, 2.89128544728883, 1.09803816918536, 2.59603752908679, 3.27721369070762, -0.0197106839195025, 0.992087370598539, 2.22000991912815, 0.278801046148988, -1.04299701393165, 2.11240965152578, -0.315332071101054, 2.33207963166107, 0.547941301633339, 2.85417747031179, 1.03741353356912, 0.725190043569734, 1.52037837047341, 1.15865622411926, 0.375213759851367, 2.19144331741016, -0.0719439849573331, 1.15291306563139, 0.752495033684313, 1.48462290848953, 0.785400153053635, 0.402325303408856, 1.90031589608581, 2.00698734577334, 2.58434245812388, 0.0471156655267447, 1.00138217081603, -0.533397534037533, 0.897328379823144, 1.119312040762, 2.57769083116132, 0.364739008436025, 0.735669130080452, 2.7898897544857, -0.429289201622085, 2.59767391322935, 0.0220715593972221, 1.42812632814137, 1.83180834945825, 2.64162416822216, 0.212839425921167, 2.24875193767116, 1.22786654052047, -0.188304336636493, 2.5696922567609, 1.58161994529385, 0.404785156091983, 1.07639480873454, 1.93495974279469, 0.0948050906749599, 1.03280358196676, 0.0753688565096863, 1.04452915854102, 1.88942971006669, 0.625224368661162, 1.73127378137021, 1.28363253679448, 0.673196841819345, 1.04864492482672, 0.461438348496473, 0.986367086001815, -0.211442452191251, 1.28667862271651, -0.110032234471713, -0.0947216795574568, 2.1686629710495, 0.275433394090764, -0.176141163688576, -0.574154094435054, -0.960123019911506, -0.975125226852169, 1.76424174921601, 1.18195181449038, 0.770030114124141, 0.312944956892903, 0.416400233385417, 1.94574445806849, -1.17892799703716, 1.73827512620301, 0.375855960938711, 1.18768790361655, 1.54069496704814, 0.326973544732288, 0.439392210654003, 0.073356333081424, 0.516475961724828, 0.914867537592882, 1.99746734949878, 1.85616256296007, 2.02083527576117, 1.97394463939547, 0.646851279799486, 1.41004654431424, 2.57452245155355, 2.862770251989, 2.37656180852146, 2.81359435224678, 2.90271372803568, 4.24607694141317, 2.56824427297405, 2.44821346577655, 1.90329274465825, 1.52160314267697, 0.883615478398367, 0.46297273564758, 3.09078322946075, 0.0890925281198609, 1.70389349506644, 0.548169024441266, 2.59595777336759, 1.48315485280796, 1.30629470392602, 1.71339526948514, 1.4296509635746, 1.1968885644779, 0.426794630739931, -0.0567084559451141, 1.376783160249, 1.18483730604954, 0.71919921099173, 0.189789684221004, 0.0747130429313805, 1.85368037073154, 4.08709192712577, 1.01974252859095, -0.674030240437482, 0.737642837155642, -0.587726221725291, 0.0581842238237242, 0.42808908803952, 2.0560740961566, 2.16921532062153, 0.975203201587821, 0.124257751487148, -0.72530985168842, 1.03518732483913, 1.029223113283

    +#> data +#> 1 S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0.823628416606036, 1.04947775580423, 2.14830047764618, 1.2746143971463, 1.85528774323286, 0.287939677300414, -1.27415818354606, 1.35855179067829, 0.903614515067483, 1.12671889162066, 0.353474382511494, 1.20954835734338, 1.89912794546735, 1.35203136557311, 2.1778106637565, 0.451015637372707, 2.31046707184244, -0.888552646978253, 0.72149642539336, -0.669736179991179, 0.769872970303931, 1.20474880438577, 1.37968594771501, 0.240252828701029, 0.50185382952182, 0.44855979013257, 1.15458135761622, 1.3566380728204, 1.70198218026366, 0.754409303867608, 0.694858402572212, -0.273090219641491, -0.245883352029218, 0.0802483363202747, -0.25998108734952, 1.20445939086955, 0.837588857408504, -0.0994548351456142, -0.371990312540926, 1.95394843334331, 0.119557697448772, 0.840296366318227, 0.564219478920604, -0.169958089890487, 1.04128828676752, 2.05358703106541, 0.330591650499939, 0.290976662359473, 2.22606719773034, 1.63952582998424, 1.36110578262358, 1.81680440451965, 2.08567609750736, 1.16649125163109, 1.03160165204683, 1.51589513092244, 0.688866730527635, 0.330481547665992, 1.05337427336241, 2.89128544728883, 1.09803816918536, 2.59603752908679, 3.27721369070762, -0.0197106839195025, 0.992087370598539, 2.22000991912815, 0.278801046148988, -1.04299701393165, 2.11240965152578, -0.315332071101054, 2.33207963166107, 0.547941301633339, 2.85417747031179, 1.03741353356912, 0.725190043569734, 1.52037837047341, 1.15865622411926, 0.375213759851367, 2.19144331741016, -0.0719439849573331, 1.15291306563139, 0.752495033684313, 1.48462290848953, 0.785400153053635, 0.402325303408856, 1.90031589608581, 2.00698734577334, 2.58434245812388, 0.0471156655267447, 1.00138217081603, -0.533397534037533, 0.897328379823144, 1.119312040762, 2.57769083116132, 0.364739008436025, 0.735669130080452, 2.7898897544857, -0.429289201622085, 2.59767391322935, 0.0220715593972221, 1.42812632814137, 1.83180834945825, 2.64162416822216, 0.212839425921167, 2.24875193767116, 1.22786654052047, -0.188304336636493, 2.5696922567609, 1.58161994529385, 0.404785156091983, 1.07639480873454, 1.93495974279469, 0.0948050906749599, 1.03280358196676, 0.0753688565096863, 1.04452915854102, 1.88942971006669, 0.625224368661162, 1.73127378137021, 1.28363253679448, 0.673196841819345, 1.04864492482672, 0.461438348496473, 0.986367086001815, -0.211442452191251, 1.28667862271651, -0.110032234471713, -0.0947216795574568, 2.1686629710495, 0.275433394090764, -0.176141163688576, -0.574154094435054, -0.960123019911506, -0.975125226852169, 1.76424174921601, 1.18195181449038, 0.770030114124141, 0.312944956892903, 0.416400233385417, 1.94574445806849, -1.17892799703716, 1.73827512620301, 0.375855960938711, 1.18768790361655, 1.54069496704814, 0.326973544732288, 0.439392210654003, 0.073356333081424, 0.516475961724828, 0.914867537592882, 1.99746734949878, 1.85616256296007, 2.02083527576117, 1.97394463939547, 0.646851279799486, 1.41004654431424, 2.57452245155355, 2.862770251989, 2.37656180852146, 2.81359435224678, 2.90271372803568, 4.24607694141317, 2.56824427297405, 2.44821346577655, 1.90329274465825, 1.52160314267697, 0.883615478398367, 0.46297273564758, 3.09078322946075, 0.0890925281198609, 1.70389349506644, 0.548169024441266, 2.59595777336759, 1.48315485280796, 1.30629470392602, 1.71339526948514, 1.4296509635746, 1.1968885644779, 0.426794630739931, -0.0567084559451141, 1.376783160249, 1.18483730604954, 0.71919921099173, 0.189789684221004, 0.0747130429313805, 1.85368037073154, 4.08709192712577, 1.01974252859095, -0.674030240437482, 0.737642837155642, -0.587726221725291, 0.0581842238237242, 0.42808908803952, 2.0560740961566, 2.16921532062153, 0.975203201587821, 0.124257751487148, -0.72530985168842, 1.03518732483913, 1.029223113283 +#> 2 S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1.90465229732828, 1.06198784411447, -1.11993218857811, 0.10242812527078, -0.851647815261025, 3.17117992735718, 2.67709080859294, -0.930150861728016, 1.17585719528139, -0.343487427451215, 1.33991145588199, 0.918930239273988, 1.38010508577914, 1.28945122292931, -0.065455607974511, 2.6552426764415, 2.63750888770195, 0.749008148851663, -0.127844636693301, 0.958155681939372, -0.944154614445071, 0.0710215710963019, -0.401764310467773, -0.865460826185294, -0.0184753076039441, 2.3899277037351, 0.907444731029447, 0.861376532762667, 2.4604006232517, 2.95818582912113, 0.619097698737209, -0.110836004144444, -0.323162882406991, 0.473686499983562, 1.37097524031067, 1.23182645854664, 1.83777054900764, 1.44070370739898, 1.31361693710181, -0.0137106899245247, 1.8399173900601, 0.0812437106573605, 0.34424511093412, 0.237446739868993, 0.946574602328317, 1.55686402952348, 0.673138543684497, 0.132403127996968, 0.789356383015864, -0.696622019463734, 1.65631812715454, 1.77105895200328, 1.17996076387191, 0.373869402280734, 1.02586355081287, 0.694893062115468, 3.35665857817994, 1.95223086788051, 0.130890281076721, 2.01523883715557, 2.62966939824132, 2.73726960164887, 1.13084464016922, 0.708515621742369, 2.07789990148477, 1.36370803258267, 2.63272560167718, 0.883272356853168, 0.611053859244452, 0.64420148060547, 1.264210420005, -0.0537151911755669, -0.449965354997748, 0.885924663246442, 0.566284955480372, 2.21140638635234, 0.93305588032562, 1.14270520563204, 1.39482892569309, 1.15404250926349, 0.78391613183892, 2.33673913140353, 1.38039127840802, 2.72238567112031, 2.93115786210439, -0.866154402912144, -0.812316368059252, 1.63864879593345, 0.597713575840404, 1.44671608752152, 1.99647052468985, 1.88622662158374, 0.899859571603906, 0.710873362886771, 0.441183190706073, 0.671481416640846, -0.0817108705961334, 0.322575188368267, 0.231564191621544, 3.14406672620753, 1.42291481377734, 1.92046190790218, -0.54809953951236, -1.33960373079946, 0.415128346254614, 1.07813733079041, 1.21011513696181, 0.0691247143161282, -0.254278672794543, 0.50225627448203, 0.685962782349445, 2.72497446167223, 2.39754377596228, 0.410593212203332, 0.341317866799366, 1.19580679192877, 1.6268446613244, 2.46402195242323, 0.571513821838305, 1.83733807723985, -0.319479650862979, 0.766003368330817, 0.306461952369043, 0.230875177783035, 1.2736666384873, 1.93333641621109, 1.83080748042965, 1.20677449603872, 2.22583038747998, 1.71975891005644, 1.85539009020169, 0.237130019626108, 0.142156838274743, 1.46858387111842, 1.71627887560387, -0.0923515385599889, 0.767649774454755, 1.19603256795815, 1.01844421697097, 0.760156729085601, 1.93824700607915, 1.35322813416232, 1.09466562856273, -0.0799817017628586, 0.637771368724645, -0.052353217990607, -0.147804185065258, -0.197415121737115, 1.42754558327861, -0.522921002376816, 2.20941961568005, 2.78294055957259, 0.472966226025793, 0.351779052096493, 1.34474587605048, 1.26859190535215, 1.79551256708872, 2.74107948209215, 1.642726717989, 1.67748231945323, 2.46597650743427, -0.148492406484585, 0.267729233234942, 1.14799802339491, 3.15117044291975, 1.71500570620158, 2.61072144604461, 1.62330464812291, 0.24326661543679, 1.89653061434271, 1.25477377972854, -0.638562031383791, 0.323076526188073, 2.31952878593284, 2.12317362913381, 1.34194256664925, 1.28396417550097, 1.63274147222502, 1.85193603750414, 1.93624715220635, 2.16305511162732, 3.60993486166158, 2.29342358616731, 1.96576969922615, 2.6473893957396, 0.0870145873234263, -0.219903223950104, 0.720768921720583, 1.22943688315488, 1.69224444719971, 2.46979494140074, 1.24554263474835, 1.48073646336263, 0.201056478818837, 0.0870052993966877, 1.46737086460298, -0.0621263034376274, 0.851661850192684, 1.83673370195333, 2.5315240256722 +#> 3 S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1.9737450918103, 1.64320906841127, 0.958676179557793, 0.294754067057176, -0.112546834606141, -0.201173472840118, 1.49795020202022, 1.45795373282259, 0.0385146042864689, 0.287447187570144, 0.380138179924483, 1.63603622022354, 0.748738273851613, 0.174412420674836, 1.94500766667424, 0.156739459323396, 2.07760410858934, 2.3236660616101, 0.0654116822593307, 2.20543010681263, 0.558884611299277, 1.00204635812021, 1.37344218397735, 0.31659323481872, 0.799269775778175, -0.656969665362632, 1.66855447294793, -0.210377597021361, 1.3106759388556, 1.66527539621559, 0.801839268171165, 1.20968016790627, 0.905106373028091, -0.752754443229771, 0.943893012815787, 0.915889636924835, 1.16391721595452, 1.57115168787737, 1.56858534538085, 1.06244886426909, 0.396278003390966, 2.17481515871821, 1.0303292837572, 1.9512571334894, 1.30980025270411, 0.690248942574886, 4.94860054846248, 1.20439258847645, -0.354697073697517, -1.57562689714456, 0.418332710178813, 1.44143583649402, -0.0279331287363278, 1.71913335238061, 0.761008632164523, 0.911907366447158, 0.860476400950227, 1.07332614379804, -0.0707820511345212, 0.967791773527854, 0.372930811416405, -0.861923171304875, 0.127699798404964, 0.513548510247477, 0.343708177492247, -0.069482468898433, 2.101115779921, 0.398077149501514, 0.448135406734009, 0.820790408530792, 0.90407612564314, 1.29041508591675, 1.79209342832725, 1.6747957971092, 2.88851921104752, 1.67127512092513, 1.64366109603636, 0.996146079905438, 2.63919884185081, 0.0593736664465006, 3.17472553605963, 2.93218238306114, 1.1257449602024, 0.515697667081752, 2.42064765757116, 1.76851386693002, 0.686115511981994, 1.21485084395878, -1.67605600564177, 1.73794934274063, 0.225157086889011, 1.72805611336854, -1.41097996813186, 0.166324099135176, 1.06231317742006, 1.02478719546407, 0.941554762018201, 0.886087284972219, 1.68378657046218, 0.534075372070759, 0.0769958145717444, 0.870687019548965, 0.886569709949101, 0.663422318749611, 1.18373933864069, 0.0232502180595517, 2.24546932264582, 0.210001155932983, 0.264462958686605, 0.525044734783659, 1.97635622586246, -0.283312285948857, -0.0466883104342943, 1.42288546102119, 1.47642658830485, 0.133982785502962, 1.21755298503097, 2.67315349148364, 0.371391155097052, 0.716624796288705, 0.310002147447957, 0.0512183426905735, 1.61611037794153, 0.134652439622188, 0.90690160417093, 1.37639459100847, 0.834840850201426, 0.476586219882975, 0.876753394144688, 1.40004121923938, 1.4385504743226, -0.242384830035351, -0.0936999265519012, -0.321207251585891, 2.31684685023459, 1.83037859770428, 0.0103174190381249, 1.01112069132805, 0.253528027050705, 1.07051035614793, 1.3014462028851, 1.53025587981684, 1.64496339460888, 2.19695554982165, 1.44204992420213, 0.681328174173575, 2.68997237989256, 1.2285065120897, 0.695507528045564, -1.05403669535038, 1.7116695010068, 1.55753699721284, 0.931532302627625, 0.892171541726528, 1.09587938231459, 1.19176109090001, 0.698063345659408, 0.796335246675921, 0.528059817407198, 0.993186938215116, 2.06166568699501, 2.28723159296839, 2.11891742177647, 1.90007237252346, 0.649820317671236, 0.931355170985388, 1.16459881336835, 2.84618374008527, 2.19779051507682, -0.71520374558115, 1.21107518490257, 0.691884844901935, 2.27825898961737, 1.16481196373126, 3.93974046754938, 3.26703070843019, 3.12936126376486, 1.87383282035814, 1.82923528839767, -0.211735484159459, 3.79570786692933, 1.63977943370158, 0.731736425377912, 1.72718404539228, 2.54888073310448, 2.36666705532102, 1.68692635016056, 1.08085321085718, 0.571589731702317, 0.320904956811594, -0.123411091029727, 2.8265953050602, -1.15163182879684, 2.63108930653715, 1.28586646202123, 2.63390687209281, 0.216384383454463, 2.65994666732998, 2.30064601518556, 2.11950251627486 +#> 4 S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0.390996737022794, 0.514419279322078, 0.465219941640955, 3.11701542636532, 0.544508779491317, 1.26640342605438, 0.709468434016184, 0.484091606530019, 0.340539327010012, 2.12816657988586, 0.526209660745157, 4.11955918681923, 0.586072991553786, 0.445353388305301, 1.2873722573024, 2.42438100691483, 1.46376969611168, 0.244762961808145, 0.992138814536005, 1.60642717441871, 0.538123401841899, 0.0520964369671474, 2.3940425280377, -0.10812510122673, 2.69834325728841, 2.47191522038167, 1.70335072085337, 2.12887526887032, 0.109412156214895, 2.39913712451626, 0.422345527805536, 0.30639868683018, 1.62093820625479, 1.38401069001983, 1.38952311927667, 1.73279772123413, 1.48328138825603, 3.26329836805232, 3.04693384236406, 0.824473231486417, 0.885141996232264, 1.6606545062688, 2.59548844818765, 1.75364937350649, 1.38058410232143, 1.39653311665508, 1.07671098458765, -0.240137130147369, 2.33861232245748, 0.524135561249644, 0.821194691692955, 1.00171076830003, -0.788958644559531, 1.72205053035894, 1.95019581302341, -1.75211040818413, 1.67495167058991, 0.530876972948112, -0.773195598832142, 0.670528408487344, 0.530897768872627, 2.93232396847259, 1.18433869678288, 0.206317111442945, 0.627277699948352, -0.125484460442242, 2.13128060856378, 2.40178193039027, 0.14264046642039, 0.688007299088954, 1.50221960058724, 3.05611986163872, 0.507409391923066, 0.50014671867989, 0.329414866172453, 0.375249435746574, 1.99288730939544, 2.22757555228064, 1.25644770007495, -1.19489410365346, 1.9729220247366, 1.59073470778152, 0.112214778600658, 2.56296082138495, 2.40843012347995, 1.82161350871862, 2.49908459645729, -0.0660931867045258, 0.794847035690629, -0.0279214365944875, 1.49282759605946, 2.51887477996389, 0.303306762375942, 3.08205144041933, 0.965129427962902, 2.20452112879489, 0.675904589942106, 1.01629357199723, 0.0757747164006191, 2.87673218842204, 1.80706953821955, 0.112349601830626, 0.889576594319076, 3.23924763347067, 1.41234686276884, 2.91733964106671, -0.540123510184444, -0.0722300541322409, 0.242944347089705, 1.62368508335076, 1.71282694532638, 2.52503981722833, -0.469895996129148, -0.3399012383782, 0.821157755788413, 1.21211609539506, -0.656061212239198, 0.260009604272351, 0.585975452392078, 2.34563582174388, 0.241786060637767, -0.955628614675378, 0.286133672767774, 0.128647112456209, 2.66439296745249, 2.21504152597742, 1.85192628707628, 0.954779196420469, 0.851312800839909, 1.73615771942524, -0.259875702852075, 0.79563883733003, 1.96980049479768, 2.14284616963924, 0.740454361686355, 1.39041287644043, 2.21889790881344, 1.98804601079687, 1.62167543173107, 1.76704974044433, 0.68066488343528, 0.597515070229046, 2.26728221582283, 1.34308906106656, 1.52427451863171, 2.34570853078019, 1.16521984857001, 0.598396492444016, 2.6518136907934, 0.753180837150408, 1.98132637774831, 1.06056822187545, 0.496894518169738, 0.723168221627451, 2.3862145904786, 0.46598433377952, 2.61939620009976, 2.08246382528877, 1.12884724884493, 1.43479191708313, 0.56514850543195, 1.500884252108, 3.4389201262876, 2.22532226264786, -0.566105049094095, -0.400617203104187, 1.19544869077937, 2.58837268506061, 1.61630764483899, 2.80649984607692, 2.63043262439607, 1.05777389527377, 2.69908701788188, 1.32700894914053, 1.72148809914738, 0.703069282348873, 2.65255437281893, 2.67604032597864, 2.37044918275909, 0.332395475810734, 2.95554256560293, 2.61711303339079, 1.03952339983093, 2.48095970276917, 1.03064469012436, 3.26327110809061, 1.32943769209757, 0.24527908086878, 2.22153278482233, 0.169005762196623, -0.336406939332894, 3.08851131198831, 0.759081882205124, 2.24000933805869, 1.84716178368636, 2.29595154065351, 2.53493545171893, 2.11185580974179, 1.44669225916909, 1.99719258745106 +#> 5 S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015, S016, S017, S018, S019, S020, S021, S022, S023, S024, S025, S026, S027, S028, S029, S030, S031, S032, S033, S034, S035, S036, S037, S038, S039, S040, S041, S042, S043, S044, S045, S046, S047, S048, S049, S050, S051, S052, S053, S054, S055, S056, S057, S058, S059, S060, S061, S062, S063, S064, S065, S066, S067, S068, S069, S070, S071, S072, S073, S074, S075, S076, S077, S078, S079, S080, S081, S082, S083, S084, S085, S086, S087, S088, S089, S090, S091, S092, S093, S094, S095, S096, S097, S098, S099, S100, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0.486725659372221, 1.64357556082774, 0.263194494557383, 1.0296548031938, 0.811726875438496, 0.5976157581421, 1.90602786838901, 1.28057058318111, 1.56624339125893, 0.998155969775003, 0.00170289563711612, 0.509547462735587, -0.00706356580588374, -0.797435868547153, 1.13284344760021, 1.03035461094415, 1.10535438489287, -0.197824348260161, 1.75269621759939, 1.72800465262085, 1.76707520038246, 0.851881340610244, 1.54363125075404, 1.85215533890089, 0.594390665563255, 2.35970532918645, 0.947998324970383, 0.81567240073653, 0.332835046674711, 0.620404809444938, 1.78989750836414, 2.02759270156495, 2.54545630808485, -0.828374732911002, -0.801094510975028, 1.08107571453343, -1.21899807157319, 0.37450302180007, 1.18473667818687, -0.166122980632638, 0.159384167235982, -0.922610427995531, -0.832063998534347, 0.387313458504679, 0.670837122851231, 3.39890689453518, 0.685587046958218, 0.137996866146473, 2.75580651598626, 0.381296723364541, -0.571471926350737, 1.56372990933579, 0.811422647695064, 1.74820580179273, 1.06426592792395, 1.45976091883044, 0.0632732127200647, -0.656127063017977, 1.63700995639338, 2.74432467786927, 0.0881414374420042, 0.861670915448589, -1.48247489988499, 1.43163376124232, 2.14987611850804, 0.226800595386425, 0.901575222264706, 0.859722443799302, 1.00484933846561, 0.413386452147952, 1.50345968290061, -0.0209971611468218, 0.945624780088165, 1.39596168009528, 2.11555398525582, 0.969177721547276, 0.33167730810068, 0.848772768889905, 1.53101851479371, -1.04671261247307, 0.522985902823807, -0.222720595890356, 0.885180815996636, 2.93302537522913, -0.199168974987085, 0.667713043850799, 1.24269930424188, -0.363755940323252, 1.96356421280043, 2.17718086781351, 0.332970913207297, 2.93843475564905, 0.327973766128561, -0.0247523761572936, 0.906337422630317, 3.03178302946813, -0.079281092050191, 2.40821815755792, 1.00828963972639, 1.52366884910225, 0.752723204745463, 2.54143078897211, 1.63348422870709, 1.49668266374234, 1.56191299075821, 1.90084447585914, 1.19130863286561, 1.23380201228986, 1.07177867507661, 0.990674913375293, 1.2029157469686, 0.942211223315491, 1.077593960246, 1.692175031131, 1.63680871096879, 2.23186244841482, 1.51016555011943, 0.298784108846654, 2.39172384433106, 0.926277183435013, 3.60965377132057, 0.357507986215217, 1.19820585650051, -0.0815578789434006, 1.20773770169254, 2.30332999548949, 0.615194661374982, 0.60178399709971, 0.061198013531931, 1.11195739753951, 1.87050391331559, 1.77392005091269, 1.10592976678195, -0.492546742240126, -0.996543170563963, -0.0743749228705897, -1.26406223534939, 0.117735044120884, 2.71285713441115, -0.0316282020028198, 0.410455710338117, 0.173880619460838, 0.714667321650425, 1.03675268218041, -0.231031745450341, 3.14028996613381, -0.175721448321136, 0.930082019065776, 2.64735159540688, 1.18845643623468, -0.630265793191784, 0.935619809552062, 0.460192276556114, 2.8485302708645, 1.87192007126775, 1.59236896995704, 1.364872838976, -0.022774803626495, 1.71767714223523, 1.80575660305377, 2.54316072533052, 1.84593828861636, -1.66331966871552, 1.96958863560675, 2.52384276217459, 1.00190361237165, 1.65407460075167, 1.78667552036777, 1.33320784401231, 0.605333408261912, 3.45962136980245, 0.244187071485811, 2.10622652276742, 2.40770063778364, 2.2704631768497, 0.849843375257935, 0.774647774582052, 1.81455437244012, 1.89079024112148, 0.318784320738019, 1.74159036091936, 0.840666949567401, 1.81279632464054, 3.77251434407046, -0.346018184183341, 1.70069180204209, 0.834905078486252, 0.255960460856275, 1.31640195037946, 1.25880932188798, 1.14145511912438, 1.45723490194377, -0.0818208655607746, 1.13210993968314, 1.76896305566814, 3.48572911798513, 1.41233612186743, 2.82461287595284, 0.766380639932241, 2.04150889429403

    You can access an individual data frame using df$data[[1]] or run the same function on each data frame using a pattern like below:

    -
    +
     # using tidyverse functions
     analyse <- function(data) {
    -  stats::aov(y ~ B * A + Error(id/A), data = data) %>% 
    +  stats::aov(y ~ B1 * W1 + Error(id/W1), data = data) %>% 
         broom::tidy()
     }
     
    @@ -726,19 +695,94 @@ 

    dplyr::select(-data) %>% tidyr::unnest(analysis) #> # A tibble: 25 x 8 -#> rep stratum term df sumsq meansq statistic p.value -#> <int> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 1 id B 1 0.0778 0.0778 0.0552 0.815 -#> 2 1 id Residuals 98 138. 1.41 NA NA -#> 3 1 id:A A 1 1.25 1.25 2.46 0.120 -#> 4 1 id:A B:A 1 6.70 6.70 13.2 0.000444 -#> 5 1 id:A Residuals 98 49.7 0.507 NA NA -#> 6 2 id B 1 0.145 0.145 0.119 0.731 -#> 7 2 id Residuals 98 120. 1.22 NA NA -#> 8 2 id:A A 1 6.22 6.22 12.6 0.000606 -#> 9 2 id:A B:A 1 4.60 4.60 9.29 0.00297 -#> 10 2 id:A Residuals 98 48.5 0.495 NA NA +#> rep stratum term df sumsq meansq statistic p.value +#> <int> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 1 id B1 1 11.9 11.9 8.52 0.00436 +#> 2 1 id Residuals 98 137. 1.40 NA NA +#> 3 1 id:W1 W1 1 0.550 0.550 1.01 0.316 +#> 4 1 id:W1 B1:W1 1 0.464 0.464 0.855 0.357 +#> 5 1 id:W1 Residuals 98 53.2 0.542 NA NA +#> 6 2 id B1 1 12.4 12.4 8.03 0.00558 +#> 7 2 id Residuals 98 151. 1.54 NA NA +#> 8 2 id:W1 W1 1 1.39 1.39 3.18 0.0776 +#> 9 2 id:W1 B1:W1 1 0.266 0.266 0.611 0.436 +#> 10 2 id:W1 Residuals 98 42.8 0.436 NA NA #> # … with 15 more rows

    +
    +
    +

    +Unnested reps

    +

    You can also get an unnested data frame by setting nested = FALSE. This is a bit faster to return, but less useful for the pattern above.

    +
    +df <- sim_design(within = 2, between = 2, 
    +                 n = 2, mu = c(1, 1, 1, 1.5), 
    +                 sd = 1, r = 0.5, plot = FALSE, 
    +                 long = TRUE, rep = 2, nested = FALSE)
    +
    +df
    +#>    rep id  B1  W1          y
    +#> 1    1 S1 B1a W1a -0.6145438
    +#> 2    1 S2 B1a W1a  1.5815508
    +#> 3    1 S3 B1b W1a -0.9296229
    +#> 4    1 S4 B1b W1a  0.9573383
    +#> 5    1 S1 B1a W1b -0.2703416
    +#> 6    1 S2 B1a W1b  1.4611508
    +#> 7    1 S3 B1b W1b  2.0628431
    +#> 8    1 S4 B1b W1b  2.5993118
    +#> 9    2 S1 B1a W1a  0.7399179
    +#> 10   2 S2 B1a W1a  1.5328323
    +#> 11   2 S3 B1b W1a  0.2531167
    +#> 12   2 S4 B1b W1a  2.1176671
    +#> 13   2 S1 B1a W1b -0.3890839
    +#> 14   2 S2 B1a W1b  1.6844656
    +#> 15   2 S3 B1b W1b  1.9668646
    +#> 16   2 S4 B1b W1b  2.5087846
    +
    +
    +

    +Simulate by design

    +

    The check_design() function converts any abbreviated design specification to the fully expanded version; it checks your design specification when you run sim_design() or you can run it on its own to create a validated design list.

    +
    +between <- list(pet = c("cat", "dog"))
    +within <- list(time = c("day", "night"))
    +vardesc <- c(pet = "Type of Pet",
    +             time = "Time of Day")
    +design <- check_design(within, between, n = 10, 
    +                       mu = 1:4, sd = 1:4, r = 0.5, 
    +                       vardesc = vardesc, plot = FALSE)
    +
    +design
    +
      +
    • [DV] y: value
      +
    • +
    • [ID] id: id
      +
    • +
    • Within-subject variables: +
        +
      • time: Time of Day: +
          +
        • day: day
        • +
        • night: night
        • +
        +
      • +
      +
    • +
    • Between-subject variables: +
        +
      • pet: Type of Pet: +
          +
        • cat: cat
        • +
        • dog: dog
        • +
        +
      • +
      +
    • +
    • Parameters: |pet |time | day| night| n| mu| sd| |:—|:—–|—:|—–:|–:|–:|–:| |cat |day | 1.0| 0.5| 10| 1| 1| |cat |night | 0.5| 1.0| 10| 2| 2| |dog |day | 1.0| 0.5| 10| 3| 3| |dog |night | 0.5| 1.0| 10| 4| 4|
    • +
    +

    You can then use the design object to create simulated datasets. If you set the design for sim_design() with the design argument instead of specifying parameters, it will skip the time-consuming checks, which can speed up simulations by 30% or more.

    +
    +data <- sim_design(design = design)
    +
    diff --git a/docs/articles/sim_design_files/figure-html/anon-1.png b/docs/articles/sim_design_files/figure-html/anon-1.png index bbc0e6f3..a1f59be6 100644 Binary files a/docs/articles/sim_design_files/figure-html/anon-1.png and b/docs/articles/sim_design_files/figure-html/anon-1.png differ diff --git a/docs/articles/sim_design_files/figure-html/plot-sim-design-1.png b/docs/articles/sim_design_files/figure-html/plot-sim-design-1.png index f6a0b7ca..d69bb7d0 100644 Binary files a/docs/articles/sim_design_files/figure-html/plot-sim-design-1.png and b/docs/articles/sim_design_files/figure-html/plot-sim-design-1.png differ diff --git a/docs/articles/sim_design_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/sim_design_files/figure-html/unnamed-chunk-5-1.png new file mode 100644 index 00000000..013f02f8 Binary files /dev/null and b/docs/articles/sim_design_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/docs/articles/sim_design_files/header-attrs-2.10.6/header-attrs.js b/docs/articles/sim_design_files/header-attrs-2.10.6/header-attrs.js new file mode 100644 index 00000000..dd57d92e --- /dev/null +++ b/docs/articles/sim_design_files/header-attrs-2.10.6/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/articles/sim_df.html b/docs/articles/sim_df.html index fbc99871..fa302763 100644 --- a/docs/articles/sim_df.html +++ b/docs/articles/sim_df.html @@ -17,9 +17,9 @@ - + - + @@ -42,7 +42,7 @@ faux - 1.0.0 + 1.1.0
    @@ -82,12 +82,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -111,13 +117,13 @@ -
    +
    - - - - - - + + - - - - - - + + - - - - - - + + - - - - - - + + - - - - - - + + + + + + + + + +
    effectgrouptermestimatestd.errorstatisticsubjitem
    fixedNA(Intercept)10.1290.26138.836s1i1
    ran_parssub_idsd__(Intercept)0.940NANAs1i2
    ran_parsitem_idsd__(Intercept)1.693NANAs1i3
    ran_parsResidualsd__Observation3.063NANAs2i1
    s2i2
    s2i3
    -

    For example, changing grand_i to 0 changes the estimate for the fixed effect of the intercept (Intercept). Changing sub_sd to 1.5 and item_sd to 3 change the estimate for the SD of their corresponding random effects. Changing error_sd to 10 changes the estimate from the Residual SD.

    +
    +
    +

    +Adding fixed factors

    +

    Add within factors with add_within().

    -dat_cc <- sim_mixed_cc(100, 50, 0, 1.5, 3, 10)
    -
    -lme4::lmer(y ~ 1 + (1 | sub_id) + (1 | item_id), data = dat_cc) %>%
    -  broom.mixed::tidy() %>%
    -  knitr::kable(digits = 3)
    +data <- add_random(subj = 2) %>% + add_within("subj", time = c("pre", "post"), + condition = c("control", "test"))
    - - - - - - + + + - - - - - - + + + - - - - - - + + + - - - - - - + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + +
    effectgrouptermestimatestd.errorstatisticsubjtimecondition
    fixedNA(Intercept)0.6330.4561.387s1precontrol
    ran_parssub_idsd__(Intercept)1.537NANAs1pretest
    ran_parsitem_idsd__(Intercept)2.870NANAs1postcontrol
    ran_parsResidualsd__Observation9.950NANAs1posttest
    s2precontrol
    s2pretest
    s2postcontrol
    s2posttest
    +

    Add between factors with add_between(). If you have more than one factor, they will be crossed. If you set .shuffle = TRUE, the factors will be added randomly (not in “order”), and separately added factors may end up confounded. This simulates true random allocation.

    +
    +data <- add_random(subj = 4, item = 2) %>%
    +  add_between("subj", cond = c("control", "test"), gen = c("X", "Z")) %>%
    +  add_between("item", version = c("A", "B")) %>%
    +  add_between(c("subj", "item"), shuffled = 1:4, .shuffle = TRUE) %>%
    +  add_between(c("subj", "item"), not_shuffled = 1:4, .shuffle = FALSE)
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    subjitemcondgenversionshufflednot_shuffled
    s1i1controlXA21
    s1i2controlXB32
    s2i1controlZA23
    s2i2controlZB14
    s3i1testXA31
    s3i2testXB42
    s4i1testZA43
    s4i2testZB14
    +
    +

    +Unequal cells

    +

    If the levels of a factor don’t have equal probability, set the probability with .prob. If the sum of the values equals the number of groups, you will always get those exact numbers (e.g., always 8 control and 2 test; set shuffle = TRUE to get them in a random order). Otherwise, the values are sampled and the exact proportions will change for each simulation.

    +
    +data <- add_random(subj = 10) %>%
    +  add_between("subj", cond = c("control", "test"), .prob = c(8, 2)) %>%
    +  add_between("subj", age = c("young", "old"), .prob = c(.8, .2))
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    subjcondage
    s01controlold
    s02controlyoung
    s03controlold
    s04controlyoung
    s05controlyoung
    s06controlyoung
    s07controlyoung
    s08controlold
    s09testyoung
    s10testyoung
    +

    If you have more than one between-subject factor, setting them together allows you to set joint proportions for each cell.

    +
    +data <- add_random(subj = 10) %>%
    +  add_between("subj", 
    +              cond = c("control", "test"),
    +              age = c("young", "old"), 
    +              .prob = c(2, 3, 4, 1))
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    subjcondage
    s01controlyoung
    s02controlyoung
    s03controlold
    s04controlold
    s05controlold
    s06testyoung
    s07testyoung
    s08testyoung
    s09testyoung
    s10testold
    +
    +
    +

    +Counterbalanced designs

    +

    You can use the filter() function from dplyr to create counterbalanced designs. For example, if your items are grouped into A and B counterbalanced groups, add a between-subjects and a between-items factor with the same levels and filter only rows where the subject value matches the item value. In the example below, odd-numbered subjects only respond to odd-numbered items.

    +
    +data <- add_random(subj = 4, item = 4) %>%
    +  add_between("subj", subj_cb = c("odd", "even")) %>%
    +  add_between("item", item_cb = c("odd", "even")) %>%
    +  dplyr::filter(subj_cb == item_cb)
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    subjitemsubj_cbitem_cb
    s1i1oddodd
    s1i3oddodd
    s2i2eveneven
    s2i4eveneven
    s3i1oddodd
    s3i3oddodd
    s4i2eveneven
    s4i4eveneven
    +
    +
    +

    +Recoding

    +

    To set up data for analysis, you often need to recode categorical variables. Use the helper function add_contrast() for this. The code below creates anova-coded and treatment-coded versions of “cond” and the two variables needed to treatment-code the 3-level variable “type”. See the contrasts vignette for more details.

    +

    You can add_recode() for setting a manual contrast that isn’t available in add_contrast(), such as weighted contrasts.

    +
    +data <- add_random(subj = 2, item = 3) %>%
    +  add_between("subj", cond = c("A", "B")) %>%
    +  add_between("item", type = c("X", "Y", "Z")) %>%
    +  # add contrasts
    +  add_contrast("cond", "anova", add_cols = TRUE) %>%
    +  add_contrast("cond", "treatment", add_cols = TRUE) %>%
    +  # you can change the default column names
    +  add_contrast("type", "treatment", add_cols = TRUE, colnames = c("Y", "Z")) %>%
    +  add_recode("type", "type.w", X = -1.3, Y = 0, Z = 0.92)
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    subjitemcondtypecond.B-Acond.B-A.trYZtype.w
    s1i1AX-0.5000-1.30
    s1i2AY-0.50100.00
    s1i3AZ-0.50010.92
    s2i1BX0.5100-1.30
    s2i2BY0.51100.00
    s2i3BZ0.51010.92
    -
    +
    +

    -sim_mixed_df

    -

    This function uses lme4::lmer() to get subject, item and error SDs from an existing dataset and simulates a new dataset with the specified number of subjects and items with distributions drawn from the example data.

    -

    This example uses the fr4 dataset from this package to simulate 100 new subjects viewing 50 new faces.

    -
    -
    -new_dat <- sim_mixed_df(fr4, 
    -                        sub_n = 100, 
    -                        item_n = 50, 
    -                        dv = "rating", 
    -                        sub_id = "rater_id", 
    -                        item_id = "face_id")
    +Adding random effects +

    To simulate multilevel data, you need to add random intercepts and slopes for each random factor (or combination of random factors). These are randomly sampled each time you simulate a new sample, so you can only characterise them by their standard deviation. You can use the function add_ranef() to add random effects with specified SDs. If you add more than one random effect for the same group (e.g., a random intercept and a random slope), you can specify their correlation with .cors (you can specify correlations in the same way as for rnorm_multi()).

    +

    The code below sets up a simple cross-classified design where 2 subjects are crossed with 2 items. It adds a between-subject, within-item factor of “version”. Then it adds random effects by subject, item, and their interaction, as well as an error term (sigma).

    +
    +data <- add_random(subj = 4, item = 2) %>%
    +  add_between("subj", version = 1:2) %>%
    +  # add by-subject random intercept
    +  add_ranef("subj", u0s = 1.3) %>%
    +  # add by-item random intercept and slope
    +  add_ranef("item", u0i = 1.5, u1i = 1.5, .cors = 0.3) %>%
    +  # add by-subject:item random intercept
    +  add_ranef(c("subj", "item"), u0si = 1.7) %>%
    +  # add error term (by observation)
    +  add_ranef(sigma = 2.2)
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    subjitemversionu0su0iu1iu0sisigma
    s1i111.175-2.5490.952-1.5311.503
    s1i211.175-0.811-1.595-0.2561.518
    s2i12-2.014-2.5490.952-1.4071.174
    s2i22-2.014-0.811-1.5953.376-0.409
    s3i111.329-2.5490.9520.0750.842
    s3i211.329-0.811-1.595-0.6870.828
    s4i120.195-2.5490.952-0.8042.538
    s4i220.195-0.811-1.595-0.7053.465
    +
    +
    +

    +Simulating data

    +

    Now you can define your data-generating parameters and put everything together to simulate a dataset. In this example,subject are crossed with items, and there is a single treatment-coded between-subject, within-item fixed factor of condition with levels “control” and “test”. The intercept and effect of condition are both set to 0. The SDs of the random intercepts and slopes are all set to 1 (you will need pilot data to estimate realistic values for your design), the correlation between the random intercept and slope by items is set to 0. The SD of the error term is set to 2.

    +
    +# define parameters
    +subj_n = 10  # number of subjects
    +item_n = 10  # number of items
    +b0 = 0       # intercept
    +b1 = 0       # fixed effect of condition
    +u0s_sd = 1   # random intercept SD for subjects
    +u0i_sd = 1   # random intercept SD for items
    +u1i_sd = 1   # random b1 slope SD for items
    +r01i = 0     # correlation between random effects 0 and 1 for items
    +sigma_sd = 2 # error SD
    +  
    +# set up data structure
    +data <- add_random(subj = subj_n, item = item_n) %>%
    +  # add and recode categorical variables
    +  add_between("subj", cond = c("control", "test")) %>%
    +  add_recode("cond", "cond.t", control = 0, test = 1) %>%
    +  # add random effects 
    +  add_ranef("subj", u0s = u0s_sd) %>%
    +  add_ranef("item", u0i = u0i_sd, u1i = u1i_sd, .cors = r01i) %>%
    +  add_ranef(sigma = sigma_sd) %>%
    +  # calculate DV
    +  mutate(dv = b0 + u0s + u0i + (b1 + u1i) * cond.t + sigma)
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    subjitemcondcond.tu0su0iu1isigmadv
    s01i01control00.5892.1350.684-2.3510.373
    s01i02control00.589-0.214-0.252-0.2840.090
    s01i03control00.5890.947-0.1511.8023.337
    s01i04control00.5890.652-0.8750.7161.957
    s01i05control00.589-0.729-1.977-1.837-1.977
    s01i06control00.589-1.0500.238-2.644-3.105
    +
    +
    +

    +Analysing your multilevel data

    +

    You can analyse these data with lme4::lmer().

    +
    +m <- lmer(dv ~ cond.t + (1 | subj) + (1 + cond.t | item), data = data)
    +
    +summary(m)
    +#> Linear mixed model fit by REML. t-tests use Satterthwaite's method [
    +#> lmerModLmerTest]
    +#> Formula: dv ~ cond.t + (1 | subj) + (1 + cond.t | item)
    +#>    Data: data
    +#> 
    +#> REML criterion at convergence: 421
    +#> 
    +#> Scaled residuals: 
    +#>      Min       1Q   Median       3Q      Max 
    +#> -1.94554 -0.66137  0.03661  0.66655  2.39501 
    +#> 
    +#> Random effects:
    +#>  Groups   Name        Variance Std.Dev. Corr 
    +#>  subj     (Intercept) 0.3239   0.5691        
    +#>  item     (Intercept) 0.7649   0.8746        
    +#>           cond.t      1.1253   1.0608   -0.66
    +#>  Residual             3.2817   1.8115        
    +#> Number of obs: 100, groups:  subj, 10; item, 10
    +#> 
    +#> Fixed effects:
    +#>             Estimate Std. Error       df t value Pr(>|t|)
    +#> (Intercept) -0.05392    0.45486  9.66296  -0.119    0.908
    +#> cond.t      -0.58770    0.61102  9.08258  -0.962    0.361
    +#> 
    +#> Correlation of Fixed Effects:
    +#>        (Intr)
    +#> cond.t -0.690
    +
    +
    +

    +Power simulation

    +

    Include this code in a function so you can easily change the Ns, fixed effects, and random effects to any values. Then run a mixed effects model on the data and return the model.

    +
    +sim <- function(subj_n = 10, item_n = 10,
    +                b0 = 0, b1 = 0,         # fixed effects 
    +                u0s_sd = 1, u0i_sd = 1, # random intercepts
    +                u1i_sd = 1, r01i = 0,   # random slope and cor
    +                sigma_sd = 2,           # error term
    +                ... # helps the function work with pmap() below
    +                ) {
    +
    +  # set up data structure
    +  data <- add_random(subj = subj_n, item = item_n) %>%
    +    # add and recode categorical variables
    +    add_between("subj", cond = c("control", "test")) %>%
    +    add_recode("cond", "cond.t", control = 0, test = 1) %>%
    +    # add random effects 
    +    add_ranef("subj", u0s = u0s_sd) %>%
    +    add_ranef("item", u0i = u0i_sd, u1i = u1i_sd, .cors = r01i) %>%
    +    add_ranef(sigma = sigma_sd) %>%
    +    # calculate DV
    +    mutate(dv = b0 + u0s + u0i + (b1 + u1i) * cond.t + sigma)
    +
    +  # run mixed effect model and return relevant values
    +  m <- lmer(dv ~ cond.t + (1 | subj) + (1 + cond.t | item), data = data)
    +
    +  broom.mixed::tidy(m)
    +}
    +

    Check the function. Here, we’re simulating a fixed effect of condition (b1) of 0.5 for 50 subjects and 40 items, with a correlation between the random intercept and slope for items of 0.2, and the default values for all other parameters that we set above.

    +
    +sim(subj_n = 50, item_n = 40, b1 = 0.5, r01i = 0.2)
    +#> # A tibble: 7 x 8
    +#>   effect   group   term               estimate std.error statistic    df p.value
    +#>   <chr>    <chr>   <chr>                 <dbl>     <dbl>     <dbl> <dbl>   <dbl>
    +#> 1 fixed    <NA>    (Intercept)         -0.0715     0.286    -0.250  71.4   0.803
    +#> 2 fixed    <NA>    cond.t               0.499      0.395     1.27   68.1   0.210
    +#> 3 ran_pars subj    sd__(Intercept)      1.19      NA        NA      NA    NA    
    +#> 4 ran_pars item    sd__(Intercept)      0.913     NA        NA      NA    NA    
    +#> 5 ran_pars item    cor__(Intercept).…   0.256     NA        NA      NA    NA    
    +#> 6 ran_pars item    sd__cond.t           1.16      NA        NA      NA    NA    
    +#> 7 ran_pars Residu… sd__Observation      2.08      NA        NA      NA    NA
    +

    Run the simulation repeatedly. I’m only running it 50 times per parameter combination here so my demo doesn’t take forever to run, but once you are done testing a range of parameters, you probably want to run the final simulation 100-1000 times. You might get a few warnings like “Model failed to converge” or “singular boundary”. You don’t need to worry too much if you only get a few of these. If most of your models have warnings, the simulation parameters are likely to be off.

    +
    +x <- crossing(
    +  rep = 1:50, # number of replicates
    +  subj_n = c(50, 100), # range of subject N
    +  item_n = 25, # fixed item N
    +  b1 = c(0.25, 0.5, 0.75), # range of effects
    +  r01i = 0.2 # fixed correlation
    +) %>%
    +  mutate(analysis = pmap(., sim)) %>%
    +  unnest(analysis)
    +

    Filter and/or group the resulting table and calculate the proportion of p.values above your alpha threshold to get power for the fixed effects.

    +
    +# calculate power for alpha = 0.05
    +filter(x, effect == "fixed", term == "cond.t") %>%
    +  group_by(b1, subj_n) %>% 
    +  summarise(power = mean(p.value < .05), 
    +            .groups = "drop") %>%
    +  ggplot(aes(b1, subj_n, fill = power)) +
    +  geom_tile() +
    +  geom_text(aes(label = sprintf("%.2f", power)), color = "white", size = 10) +
    +  scale_fill_viridis_c(limits = c(0, 1))
    +

    diff --git a/docs/articles/sim_mixed_files/figure-html/powerplot-1.png b/docs/articles/sim_mixed_files/figure-html/powerplot-1.png new file mode 100644 index 00000000..1003fb21 Binary files /dev/null and b/docs/articles/sim_mixed_files/figure-html/powerplot-1.png differ diff --git a/docs/articles/sim_mixed_files/header-attrs-2.10.6/header-attrs.js b/docs/articles/sim_mixed_files/header-attrs-2.10.6/header-attrs.js new file mode 100644 index 00000000..dd57d92e --- /dev/null +++ b/docs/articles/sim_mixed_files/header-attrs-2.10.6/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/authors.html b/docs/authors.html index 1f636fd2..9c99f40e 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -45,6 +45,8 @@ + + @@ -83,7 +85,7 @@ faux - 1.0.0 + 1.1.0
    @@ -123,12 +125,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -159,14 +167,14 @@

    Citation

    Source: inst/CITATION -

    Lisa DeBruine, (2021). faux: Simulation for Factorial Designs R package version 1.0.0. Zenodo. http://doi.org/10.5281/zenodo.2669586

    +

    Lisa DeBruine, (2021). faux: Simulation for Factorial Designs R package version 1.1.0. Zenodo. http://doi.org/10.5281/zenodo.2669586

    @Manual{,
       title = {faux: Simulation for Factorial Designs},
       author = {Lisa DeBruine},
       doi = {10.5281/zenodo.2669586},
       publisher = {Zenodo},
       year = {2021},
    -  note = {R package version 1.0.0},
    +  note = {R package version 1.1.0},
       url = {https://debruine.github.io/faux/},
     }
    diff --git a/docs/extra.js b/docs/extra.js new file mode 100644 index 00000000..a7bf9fc1 --- /dev/null +++ b/docs/extra.js @@ -0,0 +1,166 @@ +/** + * adapted from rmarkdown/inst/rmd/h/navigation-1.1/tabsets.js + * + * jQuery Plugin: Sticky Tabs + * + * @author Aidan Lister + * adapted by Ruben Arslan to activate parent tabs too + * http://www.aidanlister.com/2014/03/persisting-the-tab-state-in-bootstrap/ + */ +(function($) { + "use strict"; + $.fn.rmarkdownStickyTabs = function() { + var context = this; + // Show the tab corresponding with the hash in the URL, or the first tab + var showStuffFromHash = function() { + var hash = window.location.hash; + var selector = hash ? 'a[href="' + hash + '"]' : 'li.active > a'; + var $selector = $(selector, context); + if($selector.data('toggle') === "tab") { + $selector.tab('show'); + // walk up the ancestors of this element, show any hidden tabs + $selector.parents('.section.tabset').each(function(i, elm) { + var link = $('a[href="#' + $(elm).attr('id') + '"]'); + if(link.data('toggle') === "tab") { + link.tab("show"); + } + }); + } + }; + + + // Set the correct tab when the page loads + showStuffFromHash(context); + + // Set the correct tab when a user uses their back/forward button + $(window).on('hashchange', function() { + showStuffFromHash(context); + }); + + // Change the URL when tabs are clicked + $('a', context).on('click', function(e) { + history.pushState(null, null, this.href); + showStuffFromHash(context); + }); + + return this; + }; +}(jQuery)); + +window.buildTabsets = function(tocID) { + // build a tabset from a section div with the .tabset class + function buildTabset(tabset) { + + // check for fade and pills options + var fade = tabset.hasClass("tabset-fade"); + var pills = tabset.hasClass("tabset-pills"); + var navClass = pills ? "nav-pills" : "nav-tabs"; + + // determine the heading level of the tabset and tabs + var match = tabset.attr('class').match(/level(\d) /); + if (match === null) + return; + var tabsetLevel = Number(match[1]); + var tabLevel = tabsetLevel + 1; + + // find all subheadings immediately below + var tabs = tabset.find("div.section.level" + tabLevel); + if (!tabs.length) + return; + + // create tablist and tab-content elements + var tabList = $(''); + $(tabs[0]).before(tabList); + var tabContent = $('
    '); + $(tabs[0]).before(tabContent); + + // build the tabset + var activeTab = 0; + tabs.each(function(i) { + + // get the tab div + var tab = $(tabs[i]); + + // get the id then sanitize it for use with bootstrap tabs + var id = tab.attr('id'); + + // see if this is marked as the active tab + if (tab.hasClass('active')) + activeTab = i; + + // remove any table of contents entries associated with + // this ID (since we'll be removing the heading element) + // TODO: the -1 at the end could be any -{digit}, use filter to select? + $("#" + tocID + " li a[href='#" + id + "-1']").parent().remove(); + + // sanitize the id for use with bootstrap tabs + id = id.replace(/[.\/?&!#<>]/g, '').replace(/\s/g, '_'); + tab.attr('id', id); + + // get the heading element within it, grab it's text, then remove it + var heading = tab.find('h' + tabLevel + ':first'); + var headingText = heading.text(); + heading.remove(); + + // build and append the tab list item + var a = $('' + headingText + ''); + a.attr('href', '#' + id); + a.attr('aria-controls', id); + var li = $('
  • '); + li.append(a); + tabList.append(li); + + // set it's attributes + tab.attr('role', 'tabpanel'); + tab.addClass('tab-pane'); + tab.addClass('tabbed-pane'); + if (fade) + tab.addClass('fade'); + + // move it into the tab content div + tab.detach().appendTo(tabContent); + }); + + // set active tab + $(tabList.children('li')[activeTab]).addClass('active'); + var active = $(tabContent.children('div.section')[activeTab]); + active.addClass('active'); + if (fade) + active.addClass('in'); + + if (tabset.hasClass("tabset-sticky")) + tabset.rmarkdownStickyTabs(); + } + + // convert section divs with the .tabset class to tabsets + var tabsets = $("div.section.tabset"); + tabsets.each(function(i) { + buildTabset($(tabsets[i])); + }); +}; + +$(document).ready(function () { + window.buildTabsets("toc"); + }); + + $(document).ready(function () { + $('.tabset-dropdown > .nav-tabs > li').click(function () { + $(this).parent().toggleClass('nav-tabs-open'); + }); +}); + +$(document).ready(function () { + /** + * The tabset creation above sometimes relies on empty headers to stop the + * tabbing. Though they shouldn't be included in the TOC in the first place, + * this will remove empty headers from the TOC after it's created. + */ + + // find all the empty elements and remove them (and their parents) + var empty_a = $("#toc").find("a").filter(":empty"); + empty_a.parent().remove(); + + // now find any empty
  • @@ -124,10 +130,10 @@

    Installation

    -

    You can install the released version of faux (1.0.0) from CRAN with:

    +

    You can install the released version of faux from CRAN with:

    -

    And the development version (1.0.0.9000) from GitHub with:

    +

    And the development version from GitHub with:

     # install.packages("devtools")
     devtools::install_github("debruine/faux")
    @@ -138,6 +144,7 @@

    Simulate data for a factorial design

    +

    See the Simulate by Design vignette for more details.

     between <- list(pet = c(cat = "Cat Owners", 
                             dog = "Dog Owners"))
    @@ -164,10 +171,66 @@ 

    Simulate new data from an existing data table

    +

    See the Simulate from Existing Data vignette for more details.

     new_iris <- sim_df(iris, 50, between = "Species") 

    Simulated iris dataset

    +
    +

    +Simulate data for a mixed design

    +

    You can build up a cross-classified or nested mixed effects design using piped functions. See the contrasts vignette for more details.

    +
    +# simulate 20 classes with 20 to 30 students per class
    +data <- add_random(class = 20) %>%
    +  add_random(student = sample(20:30, 20, replace = TRUE), 
    +             .nested_in = "class") %>%
    +  add_between(.by = "class", 
    +              school_type = c("private","public"), 
    +              .prob = c(5, 15)) %>%
    +  add_between(.by = "student",
    +              gender = c("M", "F", "NB"),
    +              .prob = c(.49, .49, .02))
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    school_typegendern
    privateM66
    privateF54
    privateNB1
    publicM186
    publicF187
    publicNB8
    +

    diff --git a/docs/news/index.html b/docs/news/index.html index e9fc53ae..b1d2a398 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -45,9 +45,11 @@ + + - + @@ -83,7 +85,7 @@ faux - 1.0.0 + 1.1.0

    @@ -123,12 +125,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -159,6 +167,116 @@

    Changelog

    Source: NEWS.md +
    +

    +faux 1.1.0 (2021-09-13) Unreleased +

    +
    +

    +Breaking changes

    +
      +
    • +sim_design() now names anonymous within and between factors like W and B or W1, W2, W3, …, and B1, B2, … instead of A, B, C, …
    • +
    +
    +
    +

    +New features

    + +
    +
    +

    +Minor improvements and fixes

    +
      +
    • +get_params() doesn’t need between, within, id, and dv set for date created by sim_design() +
    • +
    • +plot_design() can display a subset of factors
    • +
    • +sim_design() fixed a bug in when setting n with an unnamed vector and within-subjects factors
    • +
    +
    +
    +
    +

    +faux 1.0.0.9006 (2021-09-13) Unreleased +

    +
      +
    • Added a vignette about creating random reports using the mixed effects building functions.
    • +
    +
    +
    +

    +faux 1.0.0.9006 (2021-08-30) Unreleased +

    +
      +
    • fixed a bug in sim_design() when setting n with an unnamed vector and within-subjects factors (wouldn’t run before).
    • +
    • Updated add_between() and add_within() to make new columns factors with the same ordering as the specification
    • +
    • Updated contrast functions to work with non-factor columns
    • +
    • +add_between() .prob argument works as expected now (and has tests)
    • +
    +
    +
    +

    +faux 1.0.0.9005 (2021-08-11) Unreleased +

    + +
    +
    +

    +faux 1.0.0.9004 (2021-08-10) Unreleased +

    +
      +
    • Updated contrasts vignette
    • +
    • new add_contrast() function
    • +
    • renamed the contrast functions to all start with contr_code_ +
    • +
    +
    +
    +

    +faux 1.0.0.9003 (2021-08-09) Unreleased +

    +
      +
    • added new contrast functions and changed labelling of others
    • +
    • updated contrasts vignette
    • +
    +
    +
    +

    +faux 1.0.0.9002 (2021-08-08) Unreleased +

    +
      +
    • +plot_design() can display a subset of factors
    • +
    • updated plotting vignette to explain changing palettes
    • +
    • updated mixed effects builder functions to avoid column name clashes
    • +
    • added experimental contrast functions and vignette
    • +
    +
    +
    +

    +faux 1.0.0.9001 (2021-03-27) Unreleased +

    +
      +
    • added new mixed effect builder functions
    • +
    • updated mixed effects vignette
    • +
    • anonymous within and between factors in sim_design() are now named W and B or W1, W2, W3, …, B1, B2, … instead of A, B, C, … (and fixed relevant tests and vignette code)
    • +
    • fixed get_params() so it doesn’t need between, within, id, and dv set for date created by sim_design() +
    • +
    +

    faux 1.0.0 (2021-03-27) 2021-03-26 diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index faa395b5..c5fc690f 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -4,11 +4,16 @@ pkgdown_sha: ~ articles: codebook: codebook.html continuous: continuous.html + contrasts: contrasts.html distributions: distributions.html plots: plots.html + random_reports: random_reports.html rnorm_multi: rnorm_multi.html sim_design: sim_design.html sim_df: sim_df.html sim_mixed: sim_mixed.html -last_built: 2021-03-27T13:30Z +last_built: 2021-09-13T21:51Z +urls: + reference: https://debruine.github.io/faux/reference + article: https://debruine.github.io/faux/articles diff --git a/docs/reference/OR.html b/docs/reference/OR.html new file mode 100644 index 00000000..e8abd2a7 --- /dev/null +++ b/docs/reference/OR.html @@ -0,0 +1,228 @@ + + + + + + + + +Piped OR — OR • faux + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    LHS if not NULL, otherwise RHS

    +
    + +
    l %||% r
    + +

    Arguments

    + + + + + + + + + + +
    l

    LHS.

    r

    RHS.

    + +

    Value

    + +

    LHS if not NULL, otherwise RHS.

    + +

    Examples

    +
    x <- list(b = 2, c = 3) +x$a %||% x$b %||% x$c +
    #> [1] 2
    x$a %||% "default_value" +
    #> [1] "default_value"
    +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/Rplot002.png b/docs/reference/Rplot002.png index 160eb6a0..cd64f695 100644 Binary files a/docs/reference/Rplot002.png and b/docs/reference/Rplot002.png differ diff --git a/docs/reference/add_between.html b/docs/reference/add_between.html new file mode 100644 index 00000000..68f03858 --- /dev/null +++ b/docs/reference/add_between.html @@ -0,0 +1,249 @@ + + + + + + + + +Add between factors — add_between • faux + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Add between factors

    +
    + +
    add_between(.data, .by = NULL, ..., .shuffle = FALSE, .prob = NULL)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    .data

    the data frame

    .by

    the grouping column (groups by row if NULL)

    ...

    the names and levels of the new factors

    .shuffle

    whether to assign cells randomly or in "order"

    .prob

    probability of each level, equal if NULL

    + +

    Value

    + +

    data frame

    + +

    Examples

    +
    add_random(subj = 4, item = 2) %>% + add_between("subj", condition = c("cntl", "test")) %>% + add_between("item", version = c("A", "B")) +
    #> # A tibble: 8 x 4 +#> subj item condition version +#> <chr> <chr> <fct> <fct> +#> 1 s1 i1 cntl A +#> 2 s1 i2 cntl B +#> 3 s2 i1 test A +#> 4 s2 i2 test B +#> 5 s3 i1 cntl A +#> 6 s3 i2 cntl B +#> 7 s4 i1 test A +#> 8 s4 i2 test B
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/add_contrast.html b/docs/reference/add_contrast.html new file mode 100644 index 00000000..37f01edc --- /dev/null +++ b/docs/reference/add_contrast.html @@ -0,0 +1,273 @@ + + + + + + + + +Add a contrast to a data frame — add_contrast • faux + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Add a contrast to a data frame

    +
    + +
    add_contrast(
    +  data,
    +  col,
    +  contrast = c("anova", "sum", "treatment", "helmert", "poly", "difference"),
    +  levels = NULL,
    +  ...,
    +  add_cols = TRUE,
    +  colnames = NULL
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    data

    the data frame

    col

    the column to recode

    contrast

    the contrast to recode to

    levels

    the levels of the factor in order

    ...

    arguments to pass to the contrast function (base or omit)

    add_cols

    whether to just add the contrast to the existing column or also to create new explicit columns in the dataset (default)

    colnames

    optional list of column names for the added contrasts

    + +

    Value

    + +

    the data frame with the recoded column and added columns (if add_cols == TRUE)

    + +

    Examples

    +
    df <- sim_design(between = list(time = 1:6), plot = FALSE) %>% + add_contrast("time", "poly") + +# test all polynomial contrasts +lm(y ~ time, df) %>% broom::tidy() +
    #> # A tibble: 6 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 0.0193 0.0416 0.465 0.642 +#> 2 time^1 -0.152 0.102 -1.49 0.137 +#> 3 time^2 -0.0521 0.102 -0.511 0.609 +#> 4 time^3 0.0412 0.102 0.405 0.686 +#> 5 time^4 0.0985 0.102 0.968 0.334 +#> 6 time^5 0.222 0.102 2.18 0.0298
    +# test only the linear and quadratic contrasts +lm(y ~ `time^1` + `time^2`, df) %>% broom::tidy() +
    #> # A tibble: 3 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 0.0193 0.0417 0.464 0.643 +#> 2 `time^1` -0.152 0.102 -1.49 0.138 +#> 3 `time^2` -0.0521 0.102 -0.510 0.610
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/add_random.html b/docs/reference/add_random.html new file mode 100644 index 00000000..9265f61d --- /dev/null +++ b/docs/reference/add_random.html @@ -0,0 +1,261 @@ + + + + + + + + +Add random factors to a data structure — add_random • faux + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Add random factors to a data structure

    +
    + +
    add_random(.data = NULL, ..., .nested_in = NULL)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    .data

    the data frame

    ...

    the new random factor column name and the number of values of the random factor (if crossed) or the n per group (if nested); can be a vector of n per group if nested

    .nested_in

    the column(s) to nest in (if NULL, the factor is crossed with all columns)

    + +

    Value

    + +

    a data frame

    + +

    Examples

    +
    # start a data frame +data1 <- add_random(school = 3) +# nest classes in schools (2 classes per school) +data2 <- add_random(data1, class = 2, .nested_in = "school") +# nest pupils in each class (different n per class) +data3 <- add_random(data2, pupil = c(20, 24, 23, 21, 25, 24), .nested_in = "class") +# cross each pupil with 10 questions +data4 <- add_random(data3, question = 10) + +# compare nesting in 2 different factors +data <- add_random(A = 2, B = 2) +add_random(data, C = 2, .nested_in = "A") +
    #> # A tibble: 8 x 3 +#> A B C +#> <chr> <chr> <chr> +#> 1 A1 B1 C1 +#> 2 A1 B1 C2 +#> 3 A1 B2 C1 +#> 4 A1 B2 C2 +#> 5 A2 B1 C3 +#> 6 A2 B1 C4 +#> 7 A2 B2 C3 +#> 8 A2 B2 C4
    add_random(data, C = 2, .nested_in = "B") +
    #> # A tibble: 8 x 3 +#> A B C +#> <chr> <chr> <chr> +#> 1 A1 B1 C1 +#> 2 A1 B1 C2 +#> 3 A1 B2 C3 +#> 4 A1 B2 C4 +#> 5 A2 B1 C1 +#> 6 A2 B1 C2 +#> 7 A2 B2 C3 +#> 8 A2 B2 C4
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/add_ranef.html b/docs/reference/add_ranef.html new file mode 100644 index 00000000..d1d59cda --- /dev/null +++ b/docs/reference/add_ranef.html @@ -0,0 +1,250 @@ + + + + + + + + +Add random effects to a data frame — add_ranef • faux + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Add random effects to a data frame

    +
    + +
    add_ranef(.data, .by = NULL, ..., .cors = 0, .empirical = FALSE)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    .data

    the data frame

    .by

    the grouping column (groups by row if NULL)

    ...

    the name and standard deviation of each random effect

    .cors

    the correlations among multiple random effects, to be passed to rnorm_multi as r

    .empirical

    logical. To be passed to rnorm_multi as empirical

    + +

    Value

    + +

    data frame with new random effects columns

    + +

    Examples

    +
    add_random(rater = 2, stimulus = 2, time = 2) %>% + add_ranef("rater", u0r = 1.5) %>% + add_ranef("stimulus", u0s = 2.2, u1s = 0.75, .cors = 0.5) %>% + add_ranef(c("rater", "stimulus"), u0sr = 1.2) +
    #> # A tibble: 8 x 7 +#> rater stimulus time u0r u0s u1s u0sr +#> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 r1 s1 t1 0.354 -0.977 0.147 -1.14 +#> 2 r1 s1 t2 0.354 -0.977 0.147 -1.14 +#> 3 r1 s2 t1 0.354 -4.47 -0.111 0.572 +#> 4 r1 s2 t2 0.354 -4.47 -0.111 0.572 +#> 5 r2 s1 t1 0.943 -0.977 0.147 -0.954 +#> 6 r2 s1 t2 0.943 -0.977 0.147 -0.954 +#> 7 r2 s2 t1 0.943 -4.47 -0.111 0.281 +#> 8 r2 s2 t2 0.943 -4.47 -0.111 0.281
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/add_recode.html b/docs/reference/add_recode.html new file mode 100644 index 00000000..44171d83 --- /dev/null +++ b/docs/reference/add_recode.html @@ -0,0 +1,253 @@ + + + + + + + + +Recode a categorical column — add_recode • faux + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Recode a categorical column

    +
    + +
    add_recode(.data, .col, .newcol = paste0(col, ".c"), ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    .data

    the data frame

    .col

    the column to recode

    .newcol

    the name of the recoded column (defaults to col.c)

    ...

    coding for categorical column

    + +

    Value

    + +

    data frame with new fixed effects columns

    + +

    Examples

    +
    add_random(subj = 4, item = 4) %>% + add_between("subj", cond = c("cntl", "test")) %>% + add_recode("cond", "cond.t", cntl = 0, test = 1) +
    #> # A tibble: 16 x 4 +#> subj item cond cond.t +#> <chr> <chr> <fct> <dbl> +#> 1 s1 i1 cntl 0 +#> 2 s1 i2 cntl 0 +#> 3 s1 i3 cntl 0 +#> 4 s1 i4 cntl 0 +#> 5 s2 i1 test 1 +#> 6 s2 i2 test 1 +#> 7 s2 i3 test 1 +#> 8 s2 i4 test 1 +#> 9 s3 i1 cntl 0 +#> 10 s3 i2 cntl 0 +#> 11 s3 i3 cntl 0 +#> 12 s3 i4 cntl 0 +#> 13 s4 i1 test 1 +#> 14 s4 i2 test 1 +#> 15 s4 i3 test 1 +#> 16 s4 i4 test 1
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/add_within.html b/docs/reference/add_within.html new file mode 100644 index 00000000..49dc9ee0 --- /dev/null +++ b/docs/reference/add_within.html @@ -0,0 +1,240 @@ + + + + + + + + +Add within factors — add_within • faux + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Add within factors

    +
    + +
    add_within(.data, .by = NULL, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    .data

    the data frame

    .by

    the grouping column (groups by row if NULL)

    ...

    the names and levels of the new factors

    + +

    Value

    + +

    data frame

    + +

    Examples

    +
    add_random(subj = 2, item = 2) %>% + add_within("subj", time = c("pre", "post")) +
    #> # A tibble: 8 x 3 +#> subj item time +#> <chr> <chr> <fct> +#> 1 s1 i1 pre +#> 2 s1 i1 post +#> 3 s1 i2 pre +#> 4 s1 i2 post +#> 5 s2 i1 pre +#> 6 s2 i1 post +#> 7 s2 i2 pre +#> 8 s2 i2 post
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/average_r2tau_0.html b/docs/reference/average_r2tau_0.html index 113b8134..8b00cf5c 100644 --- a/docs/reference/average_r2tau_0.html +++ b/docs/reference/average_r2tau_0.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0

    @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/beta2norm-1.png b/docs/reference/beta2norm-1.png index 0446df7b..1f52f84b 100644 Binary files a/docs/reference/beta2norm-1.png and b/docs/reference/beta2norm-1.png differ diff --git a/docs/reference/beta2norm.html b/docs/reference/beta2norm.html index d1067af6..518f36a2 100644 --- a/docs/reference/beta2norm.html +++ b/docs/reference/beta2norm.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -200,10 +208,10 @@

    Examp
    x <- rbeta(10000, 2, 3) y <- beta2norm(x) -
    #> shape1 was set to 2.02135934170718
    #> shape2 was set to 3.03809647001309
    g <- ggplot2::ggplot() + ggplot2::geom_point(ggplot2::aes(x, y)) +
    #> shape1 was set to 2.03064148701798
    #> shape2 was set to 3.06478809294635
    g <- ggplot2::ggplot() + ggplot2::geom_point(ggplot2::aes(x, y)) ggExtra::ggMarginal(g, type = "histogram")
    -
    + @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/cell_combos.html b/docs/reference/cell_combos.html index b5533836..4771c2db 100644 --- a/docs/reference/cell_combos.html +++ b/docs/reference/cell_combos.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/check_design-1.png b/docs/reference/check_design-1.png index 92f7e4e6..1a7e69ec 100644 Binary files a/docs/reference/check_design-1.png and b/docs/reference/check_design-1.png differ diff --git a/docs/reference/check_design-2.png b/docs/reference/check_design-2.png index a8019c0f..d5e6ff7b 100644 Binary files a/docs/reference/check_design-2.png and b/docs/reference/check_design-2.png differ diff --git a/docs/reference/check_design.html b/docs/reference/check_design.html index 3c2553b6..f951e5cb 100644 --- a/docs/reference/check_design.html +++ b/docs/reference/check_design.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/check_mixed_design.html b/docs/reference/check_mixed_design.html index 81ce76c1..e7e62913 100644 --- a/docs/reference/check_mixed_design.html +++ b/docs/reference/check_mixed_design.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/codebook.html b/docs/reference/codebook.html index dbc356e6..e7e9c8e4 100644 --- a/docs/reference/codebook.html +++ b/docs/reference/codebook.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -223,7 +231,7 @@

    Examp type = c("float", "float", "float", "float", "string") ) codebook(iris, vardesc = vardesc) -
    #> Warning: The following variable properties are not standard: type
    #> Sepal.Length set to dataType float
    #> Sepal.Width set to dataType float
    #> Petal.Length set to dataType float
    #> Petal.Width set to dataType float
    #> Species set to dataType string
    #> { +
    #> Warning: The following variable properties are not standard: type
    #> Sepal.Length set to dataType float
    #> Sepal.Width set to dataType float
    #> Petal.Length set to dataType float
    #> Petal.Width set to dataType float
    #> Species set to dataType string
    #> { #> "@context": "https://schema.org/", #> "@type": "Dataset", #> "name": "iris", @@ -273,7 +281,7 @@

    Examp #> ] #> } #>

    -
    + @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/contr_code_anova.html b/docs/reference/contr_code_anova.html new file mode 100644 index 00000000..088edf0d --- /dev/null +++ b/docs/reference/contr_code_anova.html @@ -0,0 +1,265 @@ + + + + + + + + +Anova code a factor — contr_code_anova • faux + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Anova coding (also called deviation or simple coding) sets the grand mean as the intercept. +Each contrast compares one level with the reference level (base).

    +
    + +
    contr_code_anova(fct, levels = NULL, base = 1)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    fct

    the factor to contrast code (or a vector)

    levels

    the levels of the factor in order

    base

    the index of the level to use as baseline

    + +

    Value

    + +

    the factor with contrasts set

    + +

    Examples

    +
    df <- sim_design(between = list(pet = c("cat", "dog")), + mu = c(10, 20), plot = FALSE) +df$pet <- contr_code_anova(df$pet) +lm(y ~ pet, df) %>% broom::tidy() +
    #> # A tibble: 2 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 15.1 0.0639 236. 1.74e-244 +#> 2 pet.dog-cat 9.84 0.128 77.0 1.61e-149
    +df <- sim_design(between = list(pet = c("cat", "dog", "ferret")), + mu = c(2, 4, 9), empirical = TRUE, plot = FALSE) + +df$pet <- contr_code_anova(df$pet, base = 1) +lm(y ~ pet, df) %>% broom::tidy() +
    #> # A tibble: 3 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 5.00 0.0577 86.6 8.45e-213 +#> 2 pet.dog-cat 2.00 0.141 14.1 4.53e- 35 +#> 3 pet.ferret-cat 7.00 0.141 49.5 1.67e-145
    +df$pet <- contr_code_anova(df$pet, base = 2) +lm(y ~ pet, df) %>% broom::tidy() +
    #> # A tibble: 3 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 5.00 0.0577 86.6 8.45e-213 +#> 2 pet.cat-dog -2.00 0.141 -14.1 4.53e- 35 +#> 3 pet.ferret-dog 5 0.141 35.4 1.89e-108
    +df$pet <- contr_code_anova(df$pet, base = "ferret") +lm(y ~ pet, df) %>% broom::tidy() +
    #> # A tibble: 3 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 5 0.0577 86.6 8.45e-213 +#> 2 pet.cat-ferret -7.00 0.141 -49.5 1.67e-145 +#> 3 pet.dog-ferret -5.00 0.141 -35.4 1.89e-108
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/contr_code_difference.html b/docs/reference/contr_code_difference.html new file mode 100644 index 00000000..bd2b2cbf --- /dev/null +++ b/docs/reference/contr_code_difference.html @@ -0,0 +1,237 @@ + + + + + + + + +Difference code a factor — contr_code_difference • faux + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Difference coding sets the grand mean as the intercept. +Each contrast compares one level with the previous level.

    +
    + +
    contr_code_difference(fct, levels = NULL)
    + +

    Arguments

    + + + + + + + + + + +
    fct

    the factor to contrast code (or a vector)

    levels

    the levels of the factor in order

    + +

    Value

    + +

    the factor with contrasts set

    + +

    Examples

    +
    df <- sim_design(between = list(pet = c("cat", "dog", "ferret")), + mu = c(2, 4, 9), empirical = TRUE, plot = FALSE) + +df$pet <- contr_code_difference(df$pet) +lm(y ~ pet, df) %>% broom::tidy() +
    #> # A tibble: 3 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 5.0 0.0577 86.6 8.45e-213 +#> 2 pet.dog-cat 2.00 0.141 14.1 4.53e- 35 +#> 3 pet.ferret-dog 5 0.141 35.4 1.89e-108
    +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/contr_code_helmert.html b/docs/reference/contr_code_helmert.html new file mode 100644 index 00000000..06190475 --- /dev/null +++ b/docs/reference/contr_code_helmert.html @@ -0,0 +1,262 @@ + + + + + + + + +Helmert code a factor — contr_code_helmert • faux + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Helmert coding sets the grand mean as the intercept. +Each contrast compares one level with the mean of previous levels.

    +
    + +
    contr_code_helmert(fct, levels = NULL)
    + +

    Arguments

    + + + + + + + + + + +
    fct

    the factor to contrast code (or a vector)

    levels

    the levels of the factor in order

    + +

    Value

    + +

    the factor with contrasts set

    + +

    Examples

    +
    df <- sim_design(between = list(pet = c("cat", "dog")), + mu = c(10, 20), plot = FALSE) +df$pet <- contr_code_helmert(df$pet) +lm(y ~ pet, df) %>% broom::tidy() +
    #> # A tibble: 2 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 15.1 0.0731 206. 4.51e-233 +#> 2 pet.dog-cat 9.91 0.146 67.8 5.82e-139
    +df <- sim_design(between = list(pet = c("cat", "dog", "ferret")), + mu = c(2, 4, 9), empirical = TRUE, plot = FALSE) + +df$pet <- contr_code_helmert(df$pet) +lm(y ~ pet, df) %>% broom::tidy() +
    #> # A tibble: 3 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 5.0 0.0577 86.6 8.45e-213 +#> 2 pet.dog-cat 2.00 0.141 14.1 4.53e- 35 +#> 3 pet.ferret-cat.dog 6 0.122 49.0 2.56e-144
    +# reorder the levels to change the comparisons +df$pet <- contr_code_helmert(df$pet, levels = c("dog", "cat", "ferret")) +lm(y ~ pet, df) %>% broom::tidy() +
    #> # A tibble: 3 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 5.0 0.0577 86.6 8.45e-213 +#> 2 pet.cat-dog -2.00 0.141 -14.1 4.53e- 35 +#> 3 pet.ferret-dog.cat 6 0.122 49.0 2.56e-144
    +df$pet <- contr_code_helmert(df$pet, levels = c("ferret", "dog", "cat")) +lm(y ~ pet, df) %>% broom::tidy() +
    #> # A tibble: 3 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 5 0.0577 86.6 8.45e-213 +#> 2 pet.dog-ferret -5 0.141 -35.4 1.89e-108 +#> 3 pet.cat-ferret.dog -4.50 0.122 -36.7 1.71e-112
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/contr_code_poly.html b/docs/reference/contr_code_poly.html new file mode 100644 index 00000000..fe898722 --- /dev/null +++ b/docs/reference/contr_code_poly.html @@ -0,0 +1,241 @@ + + + + + + + + +Polynomial code a factor — contr_code_poly • faux + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Polynomial coding sets the grand mean as the intercept. +Each contrast tests a trend (linear, quadratic, cubic, etc.). This is only suitable for ordered factors.

    +
    + +
    contr_code_poly(fct, levels = NULL)
    + +

    Arguments

    + + + + + + + + + + +
    fct

    the factor to contrast code (or a vector)

    levels

    the levels of the factor in order

    + +

    Value

    + +

    the factor with contrasts set

    + +

    Examples

    +
    df <- sim_design(within = list(time = 1:6), + mu = 1:6 + (1:6-3.5)^2, + long = TRUE, plot = FALSE) + +df$time <- contr_code_poly(df$time) +lm(y ~ time, df) %>% broom::tidy() +
    #> # A tibble: 6 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 6.38 0.0409 156. 0 +#> 2 time^1 4.15 0.100 41.4 2.91e-177 +#> 3 time^2 6.17 0.100 61.6 5.45e-260 +#> 4 time^3 -0.0449 0.100 -0.448 6.55e- 1 +#> 5 time^4 0.00516 0.100 0.0515 9.59e- 1 +#> 6 time^5 -0.000218 0.100 -0.00217 9.98e- 1
    +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/contr_code_sum.html b/docs/reference/contr_code_sum.html new file mode 100644 index 00000000..20aa9564 --- /dev/null +++ b/docs/reference/contr_code_sum.html @@ -0,0 +1,259 @@ + + + + + + + + +Sum code a factor — contr_code_sum • faux + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Sum coding sets the grand mean as the intercept. +Each contrast compares one level with the grand mean.

    +
    + +
    contr_code_sum(fct, levels = NULL, omit = length(levels))
    + +

    Arguments

    + + + + + + + + + + + + + + +
    fct

    the factor to contrast code (or a vector)

    levels

    the levels of the factor in order

    omit

    the level to omit (defaults to the last level)

    + +

    Value

    + +

    the factor with contrasts set

    + +

    Examples

    +
    df <- sim_design(between = list(pet = c("cat", "dog", "bird", "ferret")), + mu = c(2, 4, 9, 13), empirical = TRUE, plot = FALSE) + +df$pet <- contr_code_sum(df$pet) +lm(y ~ pet, df) %>% broom::tidy() +
    #> # A tibble: 4 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 7 0.0500 140. 0 +#> 2 pet.cat-intercept -5.00 0.0866 -57.7 6.13e-195 +#> 3 pet.dog-intercept -3.00 0.0866 -34.6 6.42e-122 +#> 4 pet.bird-intercept 2.00 0.0866 23.1 2.33e- 75
    +df$pet <- contr_code_sum(df$pet, omit = "cat") +lm(y ~ pet, df) %>% broom::tidy() +
    #> # A tibble: 4 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 7 0.0500 140. 0 +#> 2 pet.dog-intercept -3.00 0.0866 -34.6 6.42e-122 +#> 3 pet.bird-intercept 2.00 0.0866 23.1 2.33e- 75 +#> 4 pet.ferret-intercept 6 0.0866 69.3 1.82e-223
    +df$pet <- contr_code_sum(df$pet, omit = 1) +lm(y ~ pet, df) %>% broom::tidy() +
    #> # A tibble: 4 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 7 0.0500 140. 0 +#> 2 pet.dog-intercept -3.00 0.0866 -34.6 6.42e-122 +#> 3 pet.bird-intercept 2.00 0.0866 23.1 2.33e- 75 +#> 4 pet.ferret-intercept 6 0.0866 69.3 1.82e-223
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/contr_code_treatment.html b/docs/reference/contr_code_treatment.html new file mode 100644 index 00000000..84d4913f --- /dev/null +++ b/docs/reference/contr_code_treatment.html @@ -0,0 +1,265 @@ + + + + + + + + +Treatment code a factor — contr_code_treatment • faux + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Treatment coding sets the mean of the reference level (base) as the intercept. +Each contrast compares one level with the reference level.

    +
    + +
    contr_code_treatment(fct, levels = NULL, base = 1)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    fct

    the factor to contrast code (or a vector)

    levels

    the levels of the factor in order

    base

    the index of the level to use as baseline

    + +

    Value

    + +

    the factor with contrasts set

    + +

    Examples

    +
    df <- sim_design(between = list(pet = c("cat", "dog")), + mu = c(10, 20), plot = FALSE) +df$pet <- contr_code_treatment(df$pet) +lm(y ~ pet, df) %>% broom::tidy() +
    #> # A tibble: 2 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 10.1 0.110 91.8 3.19e-164 +#> 2 pet.dog-cat 9.76 0.156 62.5 2.48e-132
    +df <- sim_design(between = list(pet = c("cat", "dog", "ferret")), + mu = c(2, 4, 9), empirical = TRUE, plot = FALSE) + +df$pet <- contr_code_treatment(df$pet) +lm(y ~ pet, df) %>% broom::tidy() +
    #> # A tibble: 3 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 2.00 0.100 20.0 5.87e- 57 +#> 2 pet.dog-cat 2.00 0.141 14.1 4.53e- 35 +#> 3 pet.ferret-cat 7.00 0.141 49.5 1.67e-145
    +df$pet <- contr_code_treatment(df$pet, base = 2) +lm(y ~ pet, df) %>% broom::tidy() +
    #> # A tibble: 3 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 4.00 0.100 40.0 1.30e-121 +#> 2 pet.cat-dog -2.00 0.141 -14.1 4.53e- 35 +#> 3 pet.ferret-dog 5.00 0.141 35.4 1.89e-108
    +df$pet <- contr_code_treatment(df$pet, base = "ferret") +lm(y ~ pet, df) %>% broom::tidy() +
    #> # A tibble: 3 x 5 +#> term estimate std.error statistic p.value +#> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 (Intercept) 9.00 0.1 90.0 1.40e-217 +#> 2 pet.cat-ferret -7.00 0.141 -49.5 1.67e-145 +#> 3 pet.dog-ferret -5 0.141 -35.4 1.89e-108
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.6.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/convert_param.html b/docs/reference/convert_param.html index 87b6bf0f..7c1542fe 100644 --- a/docs/reference/convert_param.html +++ b/docs/reference/convert_param.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/cormat.html b/docs/reference/cormat.html index 9e800e98..d3ce3b25 100644 --- a/docs/reference/cormat.html +++ b/docs/reference/cormat.html @@ -45,11 +45,13 @@ + + - + @@ -85,7 +87,7 @@ faux - 1.0.0 + 1.1.0 @@ -125,12 +127,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/cormat_from_triangle.html b/docs/reference/cormat_from_triangle.html index f5898106..59be3eb7 100644 --- a/docs/reference/cormat_from_triangle.html +++ b/docs/reference/cormat_from_triangle.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/faceratings.html b/docs/reference/faceratings.html index 43f4719b..2a1d9977 100644 --- a/docs/reference/faceratings.html +++ b/docs/reference/faceratings.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/faux.html b/docs/reference/faux.html index cd3b2c8c..dfedab5c 100644 --- a/docs/reference/faux.html +++ b/docs/reference/faux.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/faux_options.html b/docs/reference/faux_options.html index f9d3a4b1..a12a81d2 100644 --- a/docs/reference/faux_options.html +++ b/docs/reference/faux_options.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/figures/card.png b/docs/reference/figures/card.png index 2aaa216a..2308f870 100644 Binary files a/docs/reference/figures/card.png and b/docs/reference/figures/card.png differ diff --git a/docs/reference/figures/get-design-long-1.png b/docs/reference/figures/get-design-long-1.png index 07014458..7e4a2dd8 100644 Binary files a/docs/reference/figures/get-design-long-1.png and b/docs/reference/figures/get-design-long-1.png differ diff --git a/docs/reference/figures/plot-design-1.png b/docs/reference/figures/plot-design-1.png index 5b19b8d4..f9f00111 100644 Binary files a/docs/reference/figures/plot-design-1.png and b/docs/reference/figures/plot-design-1.png differ diff --git a/docs/reference/figures/plot-iris-sim-1.png b/docs/reference/figures/plot-iris-sim-1.png index 048a9fcd..5904a2dc 100644 Binary files a/docs/reference/figures/plot-iris-sim-1.png and b/docs/reference/figures/plot-iris-sim-1.png differ diff --git a/docs/reference/figures/plot-rnorm-pre-1.png b/docs/reference/figures/plot-rnorm-pre-1.png index ea6b2e82..3bcdc9f0 100644 Binary files a/docs/reference/figures/plot-rnorm-pre-1.png and b/docs/reference/figures/plot-rnorm-pre-1.png differ diff --git a/docs/reference/fix_name_labels.html b/docs/reference/fix_name_labels.html index 72373d53..07736306 100644 --- a/docs/reference/fix_name_labels.html +++ b/docs/reference/fix_name_labels.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/fr4.html b/docs/reference/fr4.html index e31a5e61..bd27e970 100644 --- a/docs/reference/fr4.html +++ b/docs/reference/fr4.html @@ -45,11 +45,13 @@ + + - + @@ -85,7 +87,7 @@ faux - 1.0.0 + 1.1.0 @@ -125,12 +127,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/gamma2norm-1.png b/docs/reference/gamma2norm-1.png index d6a1bb4f..3f0f30f7 100644 Binary files a/docs/reference/gamma2norm-1.png and b/docs/reference/gamma2norm-1.png differ diff --git a/docs/reference/gamma2norm.html b/docs/reference/gamma2norm.html index 87e9a0b7..8f649998 100644 --- a/docs/reference/gamma2norm.html +++ b/docs/reference/gamma2norm.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -204,10 +212,10 @@

    Examp
    x <- rgamma(10000, 2) y <- gamma2norm(x) -
    #> shape was set to 1.99715252111198
    g <- ggplot2::ggplot() + ggplot2::geom_point(ggplot2::aes(x, y)) +
    #> shape was set to 1.99570416249303
    g <- ggplot2::ggplot() + ggplot2::geom_point(ggplot2::aes(x, y)) ggExtra::ggMarginal(g, type = "histogram")
    -
    + @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/get_params.html b/docs/reference/get_params.html index 8efe56b3..15b15862 100644 --- a/docs/reference/get_params.html +++ b/docs/reference/get_params.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -170,7 +178,7 @@

    Get parameters from a data table

    between = NULL, within = NULL, dv = NULL, - id = "id", + id = NULL, digits = 2 ) @@ -179,7 +187,7 @@

    Get parameters from a data table

    between = NULL, within = NULL, dv = NULL, - id = "id", + id = NULL, digits = 2 ) diff --git a/docs/reference/getcols.html b/docs/reference/getcols.html index a90e453e..28295827 100644 --- a/docs/reference/getcols.html +++ b/docs/reference/getcols.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/index.html b/docs/reference/index.html index c9a14f73..93a0351b 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -45,9 +45,11 @@ + + - + @@ -83,7 +85,7 @@ faux - 1.0.0 + 1.1.0 @@ -123,12 +125,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -204,6 +212,55 @@

    sim_joint_dist()

    + +

    Simulate category joint distribution

    + + + + +

    Mixed effects functions

    +

    + + + + + + + + + + +

    add_random()

    + +

    Add random factors to a data structure

    + + + +

    add_within()

    + +

    Add within factors

    + + + +

    add_between()

    + +

    Add between factors

    + + + +

    add_recode()

    + +

    Recode a categorical column

    + + + +

    add_ranef()

    + +

    Add random effects to a data frame

    + +

    sim_mixed_cc()

    @@ -214,12 +271,61 @@

    sim_mixed_df()

    Generate a mixed design from existing data

    + + + + +

    Contrasts

    +

    + + + + + + + + + + +

    add_contrast()

    + +

    Add a contrast to a data frame

    -

    sim_joint_dist()

    +

    contr_code_treatment()

    -

    Simulate category joint distribution

    +

    Treatment code a factor

    + + + +

    contr_code_anova()

    + +

    Anova code a factor

    + + + +

    contr_code_sum()

    + +

    Sum code a factor

    + + + +

    contr_code_difference()

    + +

    Difference code a factor

    + + + +

    contr_code_helmert()

    + +

    Helmert code a factor

    + + + +

    contr_code_poly()

    + +

    Polynomial code a factor

    @@ -351,6 +457,12 @@

    get_design()

    + +

    Get design

    + +

    get_design_long()

    @@ -406,9 +518,9 @@

    sim_data()

    +

    set_design()

    -

    Simulate data from design (internal)

    +

    Set design

    diff --git a/docs/reference/interactive_design.html b/docs/reference/interactive_design.html index 68ff634a..fa0114ab 100644 --- a/docs/reference/interactive_design.html +++ b/docs/reference/interactive_design.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/is_pos_def.html b/docs/reference/is_pos_def.html index f517dcce..39dc7804 100644 --- a/docs/reference/is_pos_def.html +++ b/docs/reference/is_pos_def.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/json_design-1.png b/docs/reference/json_design-1.png index 78a74cd9..0ccfcab3 100644 Binary files a/docs/reference/json_design-1.png and b/docs/reference/json_design-1.png differ diff --git a/docs/reference/json_design.html b/docs/reference/json_design.html index 62f46dc4..0dd717c5 100644 --- a/docs/reference/json_design.html +++ b/docs/reference/json_design.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -199,18 +207,18 @@

    Value

    Examples

    des <- check_design(2,2)
    json_design(des) -
    #> {"within":{"A":{"A1":"A1","A2":"A2"}},"between":{"B":{"B1":"B1","B2":"B2"}},"dv":{"y":"value"},"id":{"id":"id"},"n":{"B1":100,"B2":100},"mu":{"B1":{"A1":0,"A2":0},"B2":{"A1":0,"A2":0}},"sd":{"B1":{"A1":1,"A2":1},"B2":{"A1":1,"A2":1}},"r":{"B1":[[1,0],[0,1]],"B2":[[1,0],[0,1]]},"sep":"_"}
    json_design(des, pretty = TRUE) +
    #> {"within":{"W1":{"W1a":"W1a","W1b":"W1b"}},"between":{"B1":{"B1a":"B1a","B1b":"B1b"}},"dv":{"y":"value"},"id":{"id":"id"},"vardesc":{"W1":"W1","B1":"B1"},"n":{"B1a":100,"B1b":100},"mu":{"B1a":{"W1a":0,"W1b":0},"B1b":{"W1a":0,"W1b":0}},"sd":{"B1a":{"W1a":1,"W1b":1},"B1b":{"W1a":1,"W1b":1}},"r":{"B1a":[[1,0],[0,1]],"B1b":[[1,0],[0,1]]},"sep":"_"}
    json_design(des, pretty = TRUE)
    #> { #> "within": { -#> "A": { -#> "A1": "A1", -#> "A2": "A2" +#> "W1": { +#> "W1a": "W1a", +#> "W1b": "W1b" #> } #> }, #> "between": { -#> "B": { -#> "B1": "B1", -#> "B2": "B2" +#> "B1": { +#> "B1a": "B1a", +#> "B1b": "B1b" #> } #> }, #> "dv": { @@ -219,36 +227,40 @@

    Examp #> "id": { #> "id": "id" #> }, +#> "vardesc": { +#> "W1": "W1", +#> "B1": "B1" +#> }, #> "n": { -#> "B1": 100, -#> "B2": 100 +#> "B1a": 100, +#> "B1b": 100 #> }, #> "mu": { -#> "B1": { -#> "A1": 0, -#> "A2": 0 +#> "B1a": { +#> "W1a": 0, +#> "W1b": 0 #> }, -#> "B2": { -#> "A1": 0, -#> "A2": 0 +#> "B1b": { +#> "W1a": 0, +#> "W1b": 0 #> } #> }, #> "sd": { -#> "B1": { -#> "A1": 1, -#> "A2": 1 +#> "B1a": { +#> "W1a": 1, +#> "W1b": 1 #> }, -#> "B2": { -#> "A1": 1, -#> "A2": 1 +#> "B1b": { +#> "W1a": 1, +#> "W1b": 1 #> } #> }, #> "r": { -#> "B1": [ +#> "B1a": [ #> [1, 0], #> [0, 1] #> ], -#> "B2": [ +#> "B1b": [ #> [1, 0], #> [0, 1] #> ] diff --git a/docs/reference/long2wide-1.png b/docs/reference/long2wide-1.png index 78a74cd9..0ccfcab3 100644 Binary files a/docs/reference/long2wide-1.png and b/docs/reference/long2wide-1.png differ diff --git a/docs/reference/long2wide.html b/docs/reference/long2wide.html index 75de0ee8..beda5b39 100644 --- a/docs/reference/long2wide.html +++ b/docs/reference/long2wide.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0

    @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -199,207 +207,207 @@

    Value

    Examples

    df_long <- sim_design(2, 2, long = TRUE)
    long2wide(df_long, "A", "B") -
    #> id B A1 A2 -#> 1 S001 B1 0.613187230 1.9106195582 -#> 2 S002 B1 -0.179933367 -0.2969882692 -#> 3 S003 B1 1.133582984 -0.7703411434 -#> 4 S004 B1 0.635179949 1.3104291868 -#> 5 S005 B1 0.666901608 0.8611578173 -#> 6 S006 B1 -0.160632856 -0.6264580296 -#> 7 S007 B1 -1.671074830 -0.1398622943 -#> 8 S008 B1 -0.487399761 -0.8764930975 -#> 9 S009 B1 0.642124419 -1.3168408654 -#> 10 S010 B1 0.444649174 1.6731753010 -#> 11 S011 B1 -0.350526284 1.3976308713 -#> 12 S012 B1 0.282726109 -1.5419109096 -#> 13 S013 B1 -1.239881220 0.6092452612 -#> 14 S014 B1 2.012575597 1.0797085829 -#> 15 S015 B1 1.335759193 0.2311554997 -#> 16 S016 B1 0.926957478 1.4191247301 -#> 17 S017 B1 0.516930020 -0.6915881966 -#> 18 S018 B1 1.071716788 -0.5379507755 -#> 19 S019 B1 -2.249973680 -1.3387502864 -#> 20 S020 B1 -1.327947035 -0.1475615007 -#> 21 S021 B1 -0.758965683 -1.8100006453 -#> 22 S022 B1 -0.888389832 -1.9324943042 -#> 23 S023 B1 -2.060091001 1.3516303589 -#> 24 S024 B1 -0.224279977 0.1194188927 -#> 25 S025 B1 0.306530384 -0.7553464950 -#> 26 S026 B1 -1.194083986 -0.0770005965 -#> 27 S027 B1 -0.034152252 -0.0883556681 -#> 28 S028 B1 0.571040255 -0.2196270385 -#> 29 S029 B1 0.978230906 0.8092446120 -#> 30 S030 B1 -0.838369867 0.6445582746 -#> 31 S031 B1 0.582223479 0.0718035273 -#> 32 S032 B1 -0.830228190 -0.1990091894 -#> 33 S033 B1 1.441069732 -0.0199050432 -#> 34 S034 B1 0.272081976 1.2717371014 -#> 35 S035 B1 0.669618980 0.2588167568 -#> 36 S036 B1 1.421458242 1.0827317549 -#> 37 S037 B1 -0.960650891 1.3436242474 -#> 38 S038 B1 0.633370765 -1.3521061224 -#> 39 S039 B1 -0.675763344 0.6589390744 -#> 40 S040 B1 -1.000097015 1.5140795970 -#> 41 S041 B1 0.501855463 1.4268040198 -#> 42 S042 B1 1.799742979 0.6929177828 -#> 43 S043 B1 -0.122429288 0.1027531773 -#> 44 S044 B1 -0.004124262 0.8437954531 -#> 45 S045 B1 2.292894116 -1.0977438379 -#> 46 S046 B1 -0.447379299 0.6058856205 -#> 47 S047 B1 -1.113314289 0.1804840574 -#> 48 S048 B1 -1.259792428 0.1373741345 -#> 49 S049 B1 1.312047455 -0.9384119167 -#> 50 S050 B1 -0.306531380 1.2208777319 -#> 51 S051 B1 1.901949305 2.5092085898 -#> 52 S052 B1 1.291079359 0.4090430570 -#> 53 S053 B1 0.145287246 1.1649998335 -#> 54 S054 B1 0.729037097 -1.8848579760 -#> 55 S055 B1 1.631088688 2.3481862203 -#> 56 S056 B1 1.389249855 -1.6011408027 -#> 57 S057 B1 -1.233701500 0.3732923093 -#> 58 S058 B1 2.236463446 2.4294791289 -#> 59 S059 B1 -0.273403071 -0.2322175650 -#> 60 S060 B1 0.347461121 -0.6047093827 -#> 61 S061 B1 -0.616986773 0.1946852816 -#> 62 S062 B1 0.059350026 -0.7440694919 -#> 63 S063 B1 -0.331595959 0.1971806734 -#> 64 S064 B1 0.913824889 -1.2601021120 -#> 65 S065 B1 1.942621031 -1.6193215266 -#> 66 S066 B1 -1.617594450 -0.3818115542 -#> 67 S067 B1 3.394357751 1.6095799923 -#> 68 S068 B1 -1.101087059 0.3673612333 -#> 69 S069 B1 -0.701072124 -2.0182989323 -#> 70 S070 B1 -0.477678049 0.0634809454 -#> 71 S071 B1 -1.411992488 0.0146489700 -#> 72 S072 B1 -0.304166644 0.7067924707 -#> 73 S073 B1 1.567349754 -1.9071859671 -#> 74 S074 B1 2.019994913 -0.7075477194 -#> 75 S075 B1 -0.170600904 0.1342983226 -#> 76 S076 B1 -1.607758803 1.3368682549 -#> 77 S077 B1 0.976335296 1.2747550458 -#> 78 S078 B1 -0.363419932 -0.2979366371 -#> 79 S079 B1 -0.320870258 0.6587456664 -#> 80 S080 B1 -0.143224468 -1.2880518298 -#> 81 S081 B1 1.456105216 0.1648196815 -#> 82 S082 B1 1.205638012 0.3205917968 -#> 83 S083 B1 -0.960804860 -0.2511991442 -#> 84 S084 B1 -0.200748839 -0.2818844386 -#> 85 S085 B1 1.054191010 0.0447665278 -#> 86 S086 B1 -0.741105960 0.1468067364 -#> 87 S087 B1 -0.112561403 1.0193438528 -#> 88 S088 B1 -0.393942235 0.7781726783 -#> 89 S089 B1 1.386486320 -0.3434223399 -#> 90 S090 B1 1.317375445 0.0005007825 -#> 91 S091 B1 -0.808622443 0.3809080236 -#> 92 S092 B1 -0.176767498 -0.2026552675 -#> 93 S093 B1 -0.396235963 0.0978633753 -#> 94 S094 B1 -0.137863714 -1.8803685371 -#> 95 S095 B1 0.611704091 1.2583368889 -#> 96 S096 B1 -0.132440716 -0.8033285466 -#> 97 S097 B1 0.998092023 0.9195714166 -#> 98 S098 B1 0.611799641 -1.0327346213 -#> 99 S099 B1 0.720432614 -1.4067310036 -#> 100 S100 B1 1.432083120 -2.2786092611 -#> 101 S101 B2 0.827832110 1.0217776770 -#> 102 S102 B2 1.201613541 1.5896830453 -#> 103 S103 B2 -0.215900624 -1.3490153808 -#> 104 S104 B2 -0.204605125 2.1844782749 -#> 105 S105 B2 -0.053534741 1.5268502490 -#> 106 S106 B2 0.846052696 1.4442267147 -#> 107 S107 B2 1.501333706 -2.4592434349 -#> 108 S108 B2 1.365915719 0.4506918741 -#> 109 S109 B2 -0.674457846 0.2985255422 -#> 110 S110 B2 1.686417255 0.1378628106 -#> 111 S111 B2 -0.036679356 0.6879922515 -#> 112 S112 B2 -0.352235435 -0.6859268337 -#> 113 S113 B2 1.847360738 -0.1069480851 -#> 114 S114 B2 -0.500159015 0.2379403087 -#> 115 S115 B2 -0.166739453 -1.1796278805 -#> 116 S116 B2 -1.013832333 -1.0882386316 -#> 117 S117 B2 1.674486641 -1.2036422842 -#> 118 S118 B2 1.320279206 0.5083470751 -#> 119 S119 B2 -0.362841486 -0.1902117127 -#> 120 S120 B2 -0.402005941 1.1211146105 -#> 121 S121 B2 -2.119173921 0.0399752026 -#> 122 S122 B2 0.507692461 0.8932877812 -#> 123 S123 B2 1.498141072 -0.6264716142 -#> 124 S124 B2 -0.634933624 1.6515041872 -#> 125 S125 B2 -0.104848980 -0.3740912072 -#> 126 S126 B2 -0.849374474 -0.3589459810 -#> 127 S127 B2 -1.779499489 -0.0212239686 -#> 128 S128 B2 -1.280840874 -0.0946037378 -#> 129 S129 B2 0.756611260 -0.6666520564 -#> 130 S130 B2 0.142295158 0.2248327688 -#> 131 S131 B2 0.480657221 0.2753382148 -#> 132 S132 B2 -1.011170453 -0.4985572139 -#> 133 S133 B2 0.984260416 -1.8631237810 -#> 134 S134 B2 -1.780679803 1.3139224758 -#> 135 S135 B2 0.687780279 0.6067097311 -#> 136 S136 B2 1.823299662 0.5491306196 -#> 137 S137 B2 -0.016812687 -2.0242251569 -#> 138 S138 B2 -0.095992757 0.2115254223 -#> 139 S139 B2 1.026208950 -0.2651370096 -#> 140 S140 B2 -0.388606162 -1.8398867564 -#> 141 S141 B2 0.867638252 0.6785481394 -#> 142 S142 B2 -0.393649326 0.3739040657 -#> 143 S143 B2 0.018159936 2.2795316706 -#> 144 S144 B2 0.233680002 -0.7883332609 -#> 145 S145 B2 1.626963606 -0.2532943799 -#> 146 S146 B2 0.316153881 0.4872212163 -#> 147 S147 B2 1.239951591 0.6268803721 -#> 148 S148 B2 -1.651883491 0.0027024945 -#> 149 S149 B2 -0.248851030 -0.6030287879 -#> 150 S150 B2 0.043992264 0.6984731653 -#> 151 S151 B2 0.529422896 -0.9674002389 -#> 152 S152 B2 0.590721157 -1.2173738927 -#> 153 S153 B2 0.735728888 0.4768882554 -#> 154 S154 B2 -1.827579072 -1.2837823449 -#> 155 S155 B2 0.352266817 0.2847971593 -#> 156 S156 B2 -1.968809083 0.5641358567 -#> 157 S157 B2 0.306473238 0.4578477178 -#> 158 S158 B2 -0.726380240 0.5778987515 -#> 159 S159 B2 -0.894885643 -0.4120557246 -#> 160 S160 B2 1.055975589 1.1773076655 -#> 161 S161 B2 -0.903981521 -0.6887394616 -#> 162 S162 B2 -1.228789742 0.5471972925 -#> 163 S163 B2 -1.152545674 -1.0564953585 -#> 164 S164 B2 0.031078645 1.4214451134 -#> 165 S165 B2 -0.578520706 -0.9972059786 -#> 166 S166 B2 1.436787928 -0.8160310631 -#> 167 S167 B2 -1.067211695 -1.0555395515 -#> 168 S168 B2 0.387615229 0.4094187765 -#> 169 S169 B2 -0.119479061 0.6372446443 -#> 170 S170 B2 -1.420763432 -1.0947420842 -#> 171 S171 B2 -0.515818057 2.0544470226 -#> 172 S172 B2 -0.935398492 1.0875582196 -#> 173 S173 B2 -0.028935338 -0.9425638706 -#> 174 S174 B2 0.286621432 0.3677656922 -#> 175 S175 B2 0.014645020 0.4588224279 -#> 176 S176 B2 -0.324573918 -1.3499839450 -#> 177 S177 B2 -1.021553670 1.1857234833 -#> 178 S178 B2 -1.462921829 0.0564806542 -#> 179 S179 B2 2.335112884 1.0255712949 -#> 180 S180 B2 -2.702861145 0.6133630407 -#> 181 S181 B2 -0.763880437 0.4255899750 -#> 182 S182 B2 -0.197631969 -0.4470380392 -#> 183 S183 B2 -1.179044408 -1.3948932569 -#> 184 S184 B2 -0.841051451 1.1204255598 -#> 185 S185 B2 0.088078345 -0.5052734504 -#> 186 S186 B2 -0.026999250 -1.2207567921 -#> 187 S187 B2 1.539674518 -1.2417427938 -#> 188 S188 B2 -0.955715150 -0.2117128372 -#> 189 S189 B2 -0.897473964 -0.0463989645 -#> 190 S190 B2 -0.386334128 -0.8268994274 -#> 191 S191 B2 -0.146336790 -1.4186609837 -#> 192 S192 B2 -0.826905687 0.0400629021 -#> 193 S193 B2 -1.248554588 1.5506109399 -#> 194 S194 B2 0.170841823 -0.4252312968 -#> 195 S195 B2 -0.831916258 -0.1471970154 -#> 196 S196 B2 -0.967443161 1.0607757778 -#> 197 S197 B2 -1.127598190 -0.6505442531 -#> 198 S198 B2 1.141745362 -0.1810296810 -#> 199 S199 B2 0.989802027 -2.1983265069 -#> 200 S200 B2 0.379263182 3.2366617843
    +
    #> id B1 W1a W1b +#> 1 S001 B1a -0.561044856 -0.067743796 +#> 2 S002 B1a -0.955580037 -0.061628242 +#> 3 S003 B1a 0.039318227 -0.327068341 +#> 4 S004 B1a -1.537200399 -0.586337201 +#> 5 S005 B1a -0.503352702 0.080772347 +#> 6 S006 B1a 1.495785769 -0.081205745 +#> 7 S007 B1a -2.208285546 0.080741605 +#> 8 S008 B1a -0.637660519 -0.435609700 +#> 9 S009 B1a -0.605023743 1.129986579 +#> 10 S010 B1a -1.610085543 -0.106612308 +#> 11 S011 B1a 0.883714238 -0.437467138 +#> 12 S012 B1a -0.348751360 -1.418810778 +#> 13 S013 B1a 0.271425938 -1.273201588 +#> 14 S014 B1a 0.403532799 0.631287576 +#> 15 S015 B1a -1.026214387 0.350247495 +#> 16 S016 B1a 1.345134981 -0.543296497 +#> 17 S017 B1a -0.554977264 0.544729665 +#> 18 S018 B1a 0.349426667 0.264547171 +#> 19 S019 B1a 0.970020764 -1.694445781 +#> 20 S020 B1a -0.914753543 0.211148382 +#> 21 S021 B1a 0.594447679 -0.646201647 +#> 22 S022 B1a 1.131169405 0.886762842 +#> 23 S023 B1a 1.053350198 1.113846198 +#> 24 S024 B1a 2.964111438 -0.962914615 +#> 25 S025 B1a -0.220933309 -1.933753037 +#> 26 S026 B1a 1.117488796 -0.295290976 +#> 27 S027 B1a -1.503175421 0.505101561 +#> 28 S028 B1a 0.444605007 0.695229906 +#> 29 S029 B1a -1.176259379 -0.113347824 +#> 30 S030 B1a 0.902264764 1.834801450 +#> 31 S031 B1a 0.598462839 -1.559696894 +#> 32 S032 B1a -0.214258960 -0.459248424 +#> 33 S033 B1a -1.840855418 -0.555029580 +#> 34 S034 B1a 1.926654901 0.400128103 +#> 35 S035 B1a 0.494739020 1.395495312 +#> 36 S036 B1a 0.234367155 -0.195856160 +#> 37 S037 B1a -2.361566186 -0.139955727 +#> 38 S038 B1a 0.555965086 -1.296048005 +#> 39 S039 B1a 1.291934073 -0.959045774 +#> 40 S040 B1a -0.344258968 0.693449207 +#> 41 S041 B1a -1.360185885 1.128387059 +#> 42 S042 B1a -0.127969092 -0.561140257 +#> 43 S043 B1a 0.588768575 0.275048939 +#> 44 S044 B1a -0.355222322 0.155088061 +#> 45 S045 B1a -0.228973924 0.123818994 +#> 46 S046 B1a 0.235617779 -0.035139669 +#> 47 S047 B1a 1.223832613 0.569432079 +#> 48 S048 B1a 0.282154083 0.777783370 +#> 49 S049 B1a -0.224043654 -0.395218519 +#> 50 S050 B1a 0.571548737 0.322016771 +#> 51 S051 B1a -0.199729322 -0.772685742 +#> 52 S052 B1a 0.084945040 -1.044849154 +#> 53 S053 B1a -0.700166306 0.630794954 +#> 54 S054 B1a -1.281917853 -0.145344815 +#> 55 S055 B1a -1.019882660 0.713118611 +#> 56 S056 B1a 0.538725643 0.462901352 +#> 57 S057 B1a -0.462920492 -0.856131394 +#> 58 S058 B1a -0.332265059 -2.592398585 +#> 59 S059 B1a 1.556430905 0.888614643 +#> 60 S060 B1a 0.499134263 -0.005280646 +#> 61 S061 B1a -1.070937430 -0.928316581 +#> 62 S062 B1a -0.585242910 -1.264616879 +#> 63 S063 B1a -3.393653115 -0.356325787 +#> 64 S064 B1a 0.097221897 -0.702354491 +#> 65 S065 B1a -0.696467446 -1.111686569 +#> 66 S066 B1a -1.395599647 -0.629743461 +#> 67 S067 B1a -0.750289772 -0.546170384 +#> 68 S068 B1a 0.978366236 1.339658777 +#> 69 S069 B1a 0.178296535 -1.111758494 +#> 70 S070 B1a -1.818850319 0.632365476 +#> 71 S071 B1a 0.113891672 -1.629810776 +#> 72 S072 B1a 0.602333314 -0.732086231 +#> 73 S073 B1a -1.048859576 0.519499951 +#> 74 S074 B1a 0.124395876 -0.305188122 +#> 75 S075 B1a -0.514549458 -0.111255936 +#> 76 S076 B1a -0.498468885 0.320241668 +#> 77 S077 B1a 0.399589722 -0.802742742 +#> 78 S078 B1a -0.179220424 2.768944265 +#> 79 S079 B1a 0.324444454 -1.059423476 +#> 80 S080 B1a -1.312568161 -0.423068492 +#> 81 S081 B1a -0.718698267 -0.108480840 +#> 82 S082 B1a -1.343676655 0.652918513 +#> 83 S083 B1a 0.234152237 1.876700646 +#> 84 S084 B1a 0.197814391 -0.432864653 +#> 85 S085 B1a 0.263662997 0.273858033 +#> 86 S086 B1a 0.753537630 -1.644339360 +#> 87 S087 B1a -0.235015368 -0.336246671 +#> 88 S088 B1a -1.957455012 -0.010633320 +#> 89 S089 B1a -1.630344565 0.307734180 +#> 90 S090 B1a 0.243616710 -0.015988482 +#> 91 S091 B1a 0.252004977 0.499460470 +#> 92 S092 B1a 0.309686069 -0.603364283 +#> 93 S093 B1a -1.170226874 1.278243191 +#> 94 S094 B1a -0.230998088 0.361813666 +#> 95 S095 B1a 0.237706649 0.448465695 +#> 96 S096 B1a 0.021477686 -0.494731193 +#> 97 S097 B1a 1.650199536 -0.810799484 +#> 98 S098 B1a 0.289963195 -0.761809449 +#> 99 S099 B1a -0.440366645 0.828295779 +#> 100 S100 B1a -0.278318312 0.711687575 +#> 101 S101 B1b 0.905925849 -0.859828141 +#> 102 S102 B1b -0.933821185 0.919848057 +#> 103 S103 B1b -0.489236621 -0.565824768 +#> 104 S104 B1b 0.335391647 -1.041792692 +#> 105 S105 B1b 1.002756033 -0.124056402 +#> 106 S106 B1b -1.088923841 0.730815113 +#> 107 S107 B1b -0.397576234 -0.207696326 +#> 108 S108 B1b -1.003661428 0.072046360 +#> 109 S109 B1b -0.035319701 -0.527011953 +#> 110 S110 B1b 0.428891351 -0.389977885 +#> 111 S111 B1b 0.976788426 -1.039323978 +#> 112 S112 B1b 0.277220683 1.670893083 +#> 113 S113 B1b 0.589028701 0.386994643 +#> 114 S114 B1b -0.107724484 1.846751430 +#> 115 S115 B1b -1.490353743 -1.352247754 +#> 116 S116 B1b -1.196542456 1.205712340 +#> 117 S117 B1b 1.737516335 2.699706099 +#> 118 S118 B1b -1.047905546 0.019411344 +#> 119 S119 B1b 0.147858623 0.955414897 +#> 120 S120 B1b -0.361711738 0.087925908 +#> 121 S121 B1b 0.471737781 -0.211673532 +#> 122 S122 B1b -1.306261717 -0.162167440 +#> 123 S123 B1b 0.740614625 1.424081988 +#> 124 S124 B1b 0.264646364 0.851511382 +#> 125 S125 B1b -0.076394021 -0.276438463 +#> 126 S126 B1b -0.305043660 -0.728834249 +#> 127 S127 B1b -0.329298434 0.415327295 +#> 128 S128 B1b -0.008202456 -0.890512852 +#> 129 S129 B1b 0.829182081 0.527159198 +#> 130 S130 B1b -1.152251014 -0.233007500 +#> 131 S131 B1b 0.549441693 -0.132153815 +#> 132 S132 B1b -0.500263259 1.398360973 +#> 133 S133 B1b -0.691583165 -0.845290792 +#> 134 S134 B1b -0.909173317 1.324094781 +#> 135 S135 B1b 1.401614765 -0.632392864 +#> 136 S136 B1b 1.239768017 -0.298730658 +#> 137 S137 B1b -0.404602320 0.440929160 +#> 138 S138 B1b -0.605443885 -1.260691284 +#> 139 S139 B1b 0.665241949 0.579530319 +#> 140 S140 B1b -0.271291637 -1.860578205 +#> 141 S141 B1b 1.008558073 0.173750589 +#> 142 S142 B1b -0.726037972 -1.103425898 +#> 143 S143 B1b -0.725390484 -0.100468046 +#> 144 S144 B1b 1.037987233 0.301444296 +#> 145 S145 B1b -0.081066695 -1.704065962 +#> 146 S146 B1b 0.097899190 -0.885581452 +#> 147 S147 B1b -0.259936995 -0.260309270 +#> 148 S148 B1b 0.177857608 1.962835179 +#> 149 S149 B1b 0.008903474 -0.607698936 +#> 150 S150 B1b -0.248527828 0.299987317 +#> 151 S151 B1b 0.817020939 -0.144736191 +#> 152 S152 B1b 1.104046808 -0.166373505 +#> 153 S153 B1b 0.595241633 -0.124459316 +#> 154 S154 B1b -0.139628054 1.671253386 +#> 155 S155 B1b 0.263667489 0.206824918 +#> 156 S156 B1b -1.072606970 -0.279648587 +#> 157 S157 B1b 0.096526046 0.278634512 +#> 158 S158 B1b 0.660922507 -1.107440570 +#> 159 S159 B1b 0.323955131 -1.628652288 +#> 160 S160 B1b -1.239748780 0.002250468 +#> 161 S161 B1b 0.095789936 0.481704787 +#> 162 S162 B1b -0.596132459 -1.089634943 +#> 163 S163 B1b 1.399395747 -0.883646757 +#> 164 S164 B1b 0.182832295 0.594609965 +#> 165 S165 B1b -0.252475349 -0.788684759 +#> 166 S166 B1b 0.325117678 -0.932985118 +#> 167 S167 B1b -0.807716432 1.862734497 +#> 168 S168 B1b -1.355430028 0.465117083 +#> 169 S169 B1b -0.162677528 -0.854586388 +#> 170 S170 B1b -0.853893116 -0.437564600 +#> 171 S171 B1b 0.166592447 -0.718701275 +#> 172 S172 B1b 1.158059104 -0.484888395 +#> 173 S173 B1b -1.655377733 -0.271242524 +#> 174 S174 B1b -0.175625648 0.528316135 +#> 175 S175 B1b -0.536672734 -0.161209762 +#> 176 S176 B1b -0.507832362 -0.251623271 +#> 177 S177 B1b 0.032870219 -0.010398814 +#> 178 S178 B1b -0.201284274 0.332947951 +#> 179 S179 B1b -1.271830844 1.083528054 +#> 180 S180 B1b 0.421794630 0.142100613 +#> 181 S181 B1b -0.757559590 1.334435262 +#> 182 S182 B1b -0.439114165 0.842600292 +#> 183 S183 B1b 1.233383244 -0.551539196 +#> 184 S184 B1b -0.236755474 0.916787383 +#> 185 S185 B1b -0.311255364 -0.085723443 +#> 186 S186 B1b 0.230902599 1.511008766 +#> 187 S187 B1b -0.387382898 0.861649259 +#> 188 S188 B1b -1.445034511 -0.697742751 +#> 189 S189 B1b -2.343398745 1.481552313 +#> 190 S190 B1b 0.177141129 -2.211246252 +#> 191 S191 B1b 0.458774227 -0.889326238 +#> 192 S192 B1b -1.479368394 -0.163205684 +#> 193 S193 B1b -0.107714666 -1.155713860 +#> 194 S194 B1b -0.697122390 -0.373243181 +#> 195 S195 B1b 0.625983395 -1.405725195 +#> 196 S196 B1b 0.662072731 -0.671037529 +#> 197 S197 B1b -0.231464090 1.669532484 +#> 198 S198 B1b 1.051310015 0.862072669 +#> 199 S199 B1b 1.532396909 0.442988792 +#> 200 S200 B1b -0.022095753 0.840473380
    @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/message.html b/docs/reference/message.html index c3fd9cac..391c90b1 100644 --- a/docs/reference/message.html +++ b/docs/reference/message.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/messy.html b/docs/reference/messy.html index b401e1c3..91d57501 100644 --- a/docs/reference/messy.html +++ b/docs/reference/messy.html @@ -45,11 +45,13 @@ + + - + @@ -85,7 +87,7 @@ faux - 1.0.0 + 1.1.0 @@ -125,12 +127,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -208,8 +216,8 @@

    Examp #> 9 4.4 2.9 1.4 0.2 setosa #> 10 4.9 3.1 1.5 0.1 setosa #> 11 5.4 3.7 1.5 0.2 setosa -#> 12 4.8 3.4 1.6 0.2 setosa -#> 13 4.8 3.0 1.4 0.1 setosa +#> 12 4.8 3.4 1.6 0.2 NO SPECIES +#> 13 4.8 3.0 1.4 0.1 NO SPECIES #> 14 4.3 3.0 1.1 0.1 setosa #> 15 5.8 4.0 1.2 0.2 setosa #> 16 5.7 4.4 1.5 0.4 setosa @@ -219,23 +227,23 @@

    Examp #> 20 5.1 3.8 1.5 0.3 setosa #> 21 5.4 3.4 1.7 0.2 setosa #> 22 5.1 3.7 1.5 0.4 setosa -#> 23 4.6 3.6 1.0 0.2 NO SPECIES +#> 23 4.6 3.6 1.0 0.2 setosa #> 24 5.1 3.3 1.7 0.5 setosa #> 25 4.8 3.4 1.9 0.2 setosa -#> 26 5.0 3.0 1.6 0.2 NO SPECIES +#> 26 5.0 3.0 1.6 0.2 setosa #> 27 5.0 3.4 1.6 0.4 setosa -#> 28 5.2 3.5 1.5 0.2 NO SPECIES +#> 28 5.2 3.5 1.5 0.2 setosa #> 29 5.2 3.4 1.4 0.2 setosa #> 30 4.7 3.2 1.6 0.2 setosa #> 31 4.8 3.1 1.6 0.2 setosa -#> 32 5.4 3.4 1.5 0.4 setosa -#> 33 5.2 4.1 1.5 0.1 NO SPECIES +#> 32 5.4 3.4 1.5 0.4 NO SPECIES +#> 33 5.2 4.1 1.5 0.1 setosa #> 34 5.5 4.2 1.4 0.2 setosa #> 35 4.9 3.1 1.5 0.2 setosa #> 36 5.0 3.2 1.2 0.2 setosa #> 37 5.5 3.5 1.3 0.2 setosa #> 38 4.9 3.6 1.4 0.1 setosa -#> 39 4.4 3.0 1.3 0.2 setosa +#> 39 4.4 3.0 1.3 0.2 NO SPECIES #> 40 5.1 3.4 1.5 0.2 setosa #> 41 5.0 3.5 1.3 0.3 setosa #> 42 4.5 2.3 1.3 0.3 setosa @@ -243,7 +251,7 @@

    Examp #> 44 5.0 3.5 1.6 0.6 setosa #> 45 5.1 3.8 1.9 0.4 setosa #> 46 4.8 3.0 1.4 0.3 setosa -#> 47 5.1 3.8 1.6 0.2 NO SPECIES +#> 47 5.1 3.8 1.6 0.2 setosa #> 48 4.6 3.2 1.4 0.2 setosa #> 49 5.3 3.7 1.5 0.2 setosa #> 50 5.0 3.3 1.4 0.2 setosa @@ -252,9 +260,9 @@

    Examp #> 53 6.9 3.1 4.9 1.5 versicolor #> 54 5.5 2.3 4.0 1.3 versicolor #> 55 6.5 2.8 4.6 1.5 NO SPECIES -#> 56 5.7 2.8 4.5 1.3 NO SPECIES -#> 57 6.3 3.3 4.7 1.6 NO SPECIES -#> 58 4.9 2.4 3.3 1.0 versicolor +#> 56 5.7 2.8 4.5 1.3 versicolor +#> 57 6.3 3.3 4.7 1.6 versicolor +#> 58 4.9 2.4 3.3 1.0 NO SPECIES #> 59 6.6 2.9 4.6 1.3 versicolor #> 60 5.2 2.7 3.9 1.4 versicolor #> 61 5.0 2.0 3.5 1.0 versicolor @@ -266,7 +274,7 @@

    Examp #> 67 5.6 3.0 4.5 1.5 versicolor #> 68 5.8 2.7 4.1 1.0 versicolor #> 69 6.2 2.2 4.5 1.5 versicolor -#> 70 5.6 2.5 3.9 1.1 versicolor +#> 70 5.6 2.5 3.9 1.1 NO SPECIES #> 71 5.9 3.2 4.8 1.8 versicolor #> 72 6.1 2.8 4.0 1.3 versicolor #> 73 6.3 2.5 4.9 1.5 versicolor @@ -283,7 +291,7 @@

    Examp #> 84 6.0 2.7 5.1 1.6 versicolor #> 85 5.4 3.0 4.5 1.5 versicolor #> 86 6.0 3.4 4.5 1.6 versicolor -#> 87 6.7 3.1 4.7 1.5 versicolor +#> 87 6.7 3.1 4.7 1.5 NO SPECIES #> 88 6.3 2.3 4.4 1.3 versicolor #> 89 5.6 3.0 4.1 1.3 versicolor #> 90 5.5 2.5 4.0 1.3 versicolor @@ -291,36 +299,36 @@

    Examp #> 92 6.1 3.0 4.6 1.4 versicolor #> 93 5.8 2.6 4.0 1.2 versicolor #> 94 5.0 2.3 3.3 1.0 versicolor -#> 95 5.6 2.7 4.2 1.3 NO SPECIES -#> 96 5.7 3.0 4.2 1.2 NO SPECIES +#> 95 5.6 2.7 4.2 1.3 versicolor +#> 96 5.7 3.0 4.2 1.2 versicolor #> 97 5.7 2.9 4.2 1.3 versicolor #> 98 6.2 2.9 4.3 1.3 versicolor #> 99 5.1 2.5 3.0 1.1 versicolor #> 100 5.7 2.8 4.1 1.3 NO SPECIES -#> 101 6.3 3.3 6.0 2.5 virginica +#> 101 6.3 3.3 6.0 2.5 NO SPECIES #> 102 5.8 2.7 5.1 1.9 virginica #> 103 7.1 3.0 5.9 2.1 virginica #> 104 6.3 2.9 5.6 1.8 virginica #> 105 6.5 3.0 5.8 2.2 virginica -#> 106 7.6 3.0 6.6 2.1 virginica +#> 106 7.6 3.0 6.6 2.1 NO SPECIES #> 107 4.9 2.5 4.5 1.7 virginica #> 108 7.3 2.9 6.3 1.8 virginica #> 109 6.7 2.5 5.8 1.8 virginica -#> 110 7.2 3.6 6.1 2.5 virginica +#> 110 7.2 3.6 6.1 2.5 NO SPECIES #> 111 6.5 3.2 5.1 2.0 virginica #> 112 6.4 2.7 5.3 1.9 virginica -#> 113 6.8 3.0 5.5 2.1 virginica +#> 113 6.8 3.0 5.5 2.1 NO SPECIES #> 114 5.7 2.5 5.0 2.0 virginica #> 115 5.8 2.8 5.1 2.4 virginica #> 116 6.4 3.2 5.3 2.3 virginica #> 117 6.5 3.0 5.5 1.8 virginica #> 118 7.7 3.8 6.7 2.2 virginica -#> 119 7.7 2.6 6.9 2.3 NO SPECIES +#> 119 7.7 2.6 6.9 2.3 virginica #> 120 6.0 2.2 5.0 1.5 virginica #> 121 6.9 3.2 5.7 2.3 virginica #> 122 5.6 2.8 4.9 2.0 virginica #> 123 7.7 2.8 6.7 2.0 virginica -#> 124 6.3 2.7 4.9 1.8 NO SPECIES +#> 124 6.3 2.7 4.9 1.8 virginica #> 125 6.7 3.3 5.7 2.1 virginica #> 126 7.2 3.2 6.0 1.8 virginica #> 127 6.2 2.8 4.8 1.8 virginica @@ -340,164 +348,164 @@

    Examp #> 141 6.7 3.1 5.6 2.4 virginica #> 142 6.9 3.1 5.1 2.3 virginica #> 143 5.8 2.7 5.1 1.9 virginica -#> 144 6.8 3.2 5.9 2.3 NO SPECIES +#> 144 6.8 3.2 5.9 2.3 virginica #> 145 6.7 3.3 5.7 2.5 virginica #> 146 6.7 3.0 5.2 2.3 virginica #> 147 6.3 2.5 5.0 1.9 virginica -#> 148 6.5 3.0 5.2 2.0 virginica +#> 148 6.5 3.0 5.2 2.0 NO SPECIES #> 149 6.2 3.4 5.4 2.3 virginica #> 150 5.9 3.0 5.1 1.8 virginica
    messy(iris, 0.5, 1:4)
    #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species -#> 1 5.1 NA 1.4 NA setosa -#> 2 NA 3.0 NA NA setosa -#> 3 4.7 NA NA NA setosa -#> 4 4.6 3.1 NA 0.2 setosa +#> 1 NA NA NA NA setosa +#> 2 4.9 3.0 NA 0.2 setosa +#> 3 NA NA NA 0.2 setosa +#> 4 NA 3.1 NA NA setosa #> 5 5.0 3.6 NA 0.2 setosa -#> 6 5.4 NA 1.7 NA setosa -#> 7 4.6 3.4 NA 0.3 setosa -#> 8 5.0 3.4 1.5 0.2 setosa -#> 9 NA 2.9 NA NA setosa -#> 10 4.9 NA NA 0.1 setosa -#> 11 NA NA 1.5 NA setosa -#> 12 4.8 3.4 1.6 NA setosa -#> 13 NA 3.0 NA NA setosa -#> 14 NA 3.0 NA 0.1 setosa -#> 15 5.8 4.0 1.2 NA setosa -#> 16 NA NA NA NA setosa -#> 17 NA 3.9 NA NA setosa -#> 18 NA 3.5 NA NA setosa +#> 6 5.4 3.9 1.7 0.4 setosa +#> 7 4.6 NA NA NA setosa +#> 8 NA 3.4 NA 0.2 setosa +#> 9 NA 2.9 NA 0.2 setosa +#> 10 4.9 3.1 NA NA setosa +#> 11 NA NA 1.5 0.2 setosa +#> 12 NA NA NA 0.2 setosa +#> 13 NA 3.0 1.4 NA setosa +#> 14 4.3 NA NA NA setosa +#> 15 5.8 NA 1.2 0.2 setosa +#> 16 5.7 4.4 NA 0.4 setosa +#> 17 5.4 3.9 1.3 0.4 setosa +#> 18 NA 3.5 1.4 0.3 setosa #> 19 NA NA NA 0.3 setosa -#> 20 NA NA 1.5 0.3 setosa -#> 21 NA NA 1.7 0.2 setosa -#> 22 NA NA 1.5 NA setosa -#> 23 4.6 3.6 NA 0.2 setosa -#> 24 5.1 3.3 1.7 NA setosa -#> 25 NA 3.4 NA 0.2 setosa +#> 20 5.1 NA NA 0.3 setosa +#> 21 5.4 3.4 NA NA setosa +#> 22 NA NA NA 0.4 setosa +#> 23 NA NA 1.0 NA setosa +#> 24 NA NA NA 0.5 setosa +#> 25 NA 3.4 1.9 NA setosa #> 26 NA NA 1.6 NA setosa -#> 27 NA 3.4 1.6 NA setosa -#> 28 5.2 NA NA NA setosa -#> 29 5.2 NA NA 0.2 setosa -#> 30 4.7 NA 1.6 0.2 setosa -#> 31 NA 3.1 NA 0.2 setosa -#> 32 5.4 3.4 NA 0.4 setosa -#> 33 5.2 4.1 1.5 NA setosa -#> 34 5.5 4.2 NA NA setosa -#> 35 NA NA 1.5 0.2 setosa -#> 36 NA NA NA 0.2 setosa -#> 37 5.5 3.5 1.3 0.2 setosa -#> 38 4.9 NA NA 0.1 setosa -#> 39 4.4 NA NA NA setosa -#> 40 5.1 3.4 NA NA setosa -#> 41 NA 3.5 1.3 0.3 setosa +#> 27 5.0 NA NA NA setosa +#> 28 5.2 3.5 NA 0.2 setosa +#> 29 NA 3.4 1.4 0.2 setosa +#> 30 4.7 3.2 NA 0.2 setosa +#> 31 4.8 NA 1.6 NA setosa +#> 32 NA NA 1.5 0.4 setosa +#> 33 5.2 NA 1.5 NA setosa +#> 34 NA 4.2 NA NA setosa +#> 35 NA 3.1 1.5 NA setosa +#> 36 5.0 NA NA 0.2 setosa +#> 37 5.5 3.5 1.3 NA setosa +#> 38 NA 3.6 NA NA setosa +#> 39 NA NA 1.3 NA setosa +#> 40 5.1 NA 1.5 0.2 setosa +#> 41 5.0 3.5 NA 0.3 setosa #> 42 NA 2.3 1.3 0.3 setosa -#> 43 4.4 NA NA 0.2 setosa -#> 44 5.0 3.5 NA NA setosa +#> 43 4.4 3.2 1.3 NA setosa +#> 44 5.0 NA 1.6 0.6 setosa #> 45 NA 3.8 NA NA setosa -#> 46 4.8 NA NA NA setosa -#> 47 NA 3.8 NA NA setosa -#> 48 4.6 3.2 NA 0.2 setosa -#> 49 5.3 NA NA 0.2 setosa +#> 46 NA 3.0 NA NA setosa +#> 47 NA NA 1.6 0.2 setosa +#> 48 4.6 NA NA NA setosa +#> 49 NA 3.7 1.5 0.2 setosa #> 50 5.0 NA 1.4 NA setosa -#> 51 NA 3.2 NA NA versicolor -#> 52 NA NA NA NA versicolor -#> 53 6.9 3.1 NA NA versicolor -#> 54 5.5 2.3 NA NA versicolor -#> 55 NA 2.8 4.6 NA versicolor -#> 56 NA NA NA 1.3 versicolor -#> 57 6.3 NA NA 1.6 versicolor -#> 58 NA NA 3.3 1.0 versicolor -#> 59 6.6 NA NA NA versicolor -#> 60 NA NA 3.9 1.4 versicolor -#> 61 NA 2.0 3.5 1.0 versicolor +#> 51 7.0 NA 4.7 NA versicolor +#> 52 6.4 NA 4.5 NA versicolor +#> 53 6.9 3.1 4.9 1.5 versicolor +#> 54 NA 2.3 NA 1.3 versicolor +#> 55 6.5 NA 4.6 1.5 versicolor +#> 56 5.7 NA NA NA versicolor +#> 57 6.3 3.3 NA NA versicolor +#> 58 NA 2.4 3.3 NA versicolor +#> 59 6.6 2.9 NA 1.3 versicolor +#> 60 5.2 NA 3.9 NA versicolor +#> 61 NA NA 3.5 1.0 versicolor #> 62 5.9 NA 4.2 1.5 versicolor -#> 63 NA 2.2 4.0 NA versicolor -#> 64 NA 2.9 NA 1.4 versicolor -#> 65 NA NA NA 1.3 versicolor -#> 66 NA NA 4.4 NA versicolor -#> 67 NA 3.0 4.5 1.5 versicolor -#> 68 NA 2.7 4.1 NA versicolor -#> 69 NA 2.2 NA 1.5 versicolor -#> 70 5.6 2.5 NA 1.1 versicolor -#> 71 NA 3.2 4.8 NA versicolor -#> 72 NA 2.8 NA 1.3 versicolor -#> 73 NA 2.5 NA 1.5 versicolor -#> 74 6.1 NA 4.7 NA versicolor -#> 75 6.4 2.9 4.3 1.3 versicolor -#> 76 6.6 3.0 4.4 1.4 versicolor -#> 77 NA 2.8 NA 1.4 versicolor -#> 78 NA 3.0 NA 1.7 versicolor -#> 79 6.0 2.9 4.5 1.5 versicolor -#> 80 5.7 NA NA NA versicolor -#> 81 5.5 2.4 NA 1.1 versicolor -#> 82 5.5 NA 3.7 1.0 versicolor +#> 63 6.0 NA NA 1.0 versicolor +#> 64 6.1 NA NA 1.4 versicolor +#> 65 NA 2.9 3.6 NA versicolor +#> 66 NA NA NA NA versicolor +#> 67 NA NA NA NA versicolor +#> 68 5.8 2.7 4.1 NA versicolor +#> 69 6.2 NA 4.5 NA versicolor +#> 70 NA NA NA 1.1 versicolor +#> 71 NA NA NA NA versicolor +#> 72 NA 2.8 NA NA versicolor +#> 73 NA NA NA 1.5 versicolor +#> 74 NA NA 4.7 NA versicolor +#> 75 6.4 NA 4.3 NA versicolor +#> 76 6.6 NA NA 1.4 versicolor +#> 77 6.8 2.8 NA 1.4 versicolor +#> 78 6.7 NA NA 1.7 versicolor +#> 79 NA 2.9 4.5 1.5 versicolor +#> 80 5.7 NA NA 1.0 versicolor +#> 81 NA NA NA NA versicolor +#> 82 NA NA 3.7 NA versicolor #> 83 5.8 NA NA NA versicolor -#> 84 NA NA NA NA versicolor -#> 85 NA NA NA 1.5 versicolor -#> 86 6.0 3.4 NA NA versicolor -#> 87 NA NA 4.7 NA versicolor -#> 88 6.3 2.3 NA NA versicolor -#> 89 NA NA NA NA versicolor -#> 90 5.5 2.5 4.0 NA versicolor -#> 91 NA 2.6 4.4 NA versicolor -#> 92 6.1 3.0 4.6 NA versicolor -#> 93 5.8 NA NA NA versicolor -#> 94 NA 2.3 3.3 NA versicolor -#> 95 5.6 2.7 4.2 1.3 versicolor +#> 84 6.0 2.7 5.1 NA versicolor +#> 85 5.4 NA NA NA versicolor +#> 86 NA 3.4 NA NA versicolor +#> 87 6.7 NA 4.7 1.5 versicolor +#> 88 6.3 2.3 4.4 NA versicolor +#> 89 5.6 3.0 4.1 1.3 versicolor +#> 90 NA 2.5 NA NA versicolor +#> 91 NA 2.6 4.4 1.2 versicolor +#> 92 6.1 3.0 NA 1.4 versicolor +#> 93 5.8 2.6 4.0 1.2 versicolor +#> 94 NA NA 3.3 NA versicolor +#> 95 NA 2.7 NA NA versicolor #> 96 NA 3.0 4.2 1.2 versicolor -#> 97 5.7 2.9 NA NA versicolor -#> 98 6.2 NA 4.3 NA versicolor -#> 99 NA NA NA 1.1 versicolor -#> 100 NA NA 4.1 NA versicolor -#> 101 NA 3.3 6.0 2.5 virginica -#> 102 5.8 NA NA NA virginica -#> 103 NA NA 5.9 2.1 virginica -#> 104 NA NA NA 1.8 virginica -#> 105 NA NA NA 2.2 virginica -#> 106 NA NA 6.6 2.1 virginica +#> 97 NA 2.9 4.2 1.3 versicolor +#> 98 NA NA NA 1.3 versicolor +#> 99 5.1 NA 3.0 NA versicolor +#> 100 NA NA 4.1 1.3 versicolor +#> 101 6.3 NA NA 2.5 virginica +#> 102 5.8 2.7 5.1 NA virginica +#> 103 NA 3.0 NA NA virginica +#> 104 6.3 2.9 5.6 NA virginica +#> 105 6.5 3.0 NA 2.2 virginica +#> 106 NA 3.0 NA 2.1 virginica #> 107 4.9 2.5 4.5 1.7 virginica -#> 108 NA NA 6.3 NA virginica -#> 109 NA NA 5.8 1.8 virginica -#> 110 NA NA 6.1 NA virginica -#> 111 6.5 NA 5.1 NA virginica -#> 112 6.4 2.7 5.3 1.9 virginica -#> 113 6.8 3.0 5.5 2.1 virginica -#> 114 NA NA NA 2.0 virginica -#> 115 5.8 2.8 5.1 NA virginica +#> 108 NA NA 6.3 1.8 virginica +#> 109 NA 2.5 NA NA virginica +#> 110 NA 3.6 6.1 2.5 virginica +#> 111 NA 3.2 5.1 NA virginica +#> 112 NA 2.7 5.3 NA virginica +#> 113 NA NA 5.5 NA virginica +#> 114 5.7 2.5 NA NA virginica +#> 115 NA NA 5.1 2.4 virginica #> 116 NA NA NA NA virginica -#> 117 6.5 3.0 5.5 NA virginica -#> 118 7.7 3.8 6.7 NA virginica +#> 117 6.5 3.0 5.5 1.8 virginica +#> 118 NA NA 6.7 2.2 virginica #> 119 7.7 NA 6.9 NA virginica -#> 120 NA NA 5.0 1.5 virginica -#> 121 6.9 NA NA NA virginica -#> 122 5.6 2.8 4.9 2.0 virginica -#> 123 7.7 2.8 6.7 2.0 virginica -#> 124 6.3 2.7 4.9 1.8 virginica +#> 120 6.0 NA NA 1.5 virginica +#> 121 NA 3.2 5.7 NA virginica +#> 122 5.6 2.8 NA NA virginica +#> 123 NA NA NA NA virginica +#> 124 NA 2.7 NA 1.8 virginica #> 125 NA 3.3 NA NA virginica -#> 126 7.2 3.2 NA NA virginica -#> 127 6.2 2.8 4.8 NA virginica -#> 128 NA NA NA NA virginica -#> 129 NA NA NA NA virginica -#> 130 7.2 NA 5.8 1.6 virginica -#> 131 NA 2.8 NA 1.9 virginica -#> 132 NA NA NA 2.0 virginica -#> 133 NA 2.8 5.6 NA virginica -#> 134 6.3 NA 5.1 1.5 virginica -#> 135 6.1 NA 5.6 1.4 virginica -#> 136 NA 3.0 6.1 2.3 virginica -#> 137 NA NA NA NA virginica -#> 138 6.4 NA 5.5 1.8 virginica -#> 139 NA NA 4.8 1.8 virginica -#> 140 6.9 NA NA 2.1 virginica -#> 141 6.7 3.1 5.6 2.4 virginica -#> 142 NA 3.1 NA NA virginica -#> 143 NA NA NA 1.9 virginica -#> 144 NA NA 5.9 NA virginica -#> 145 6.7 NA NA NA virginica -#> 146 6.7 NA 5.2 NA virginica -#> 147 6.3 NA 5.0 NA virginica -#> 148 6.5 NA 5.2 NA virginica -#> 149 NA NA 5.4 2.3 virginica -#> 150 NA NA NA 1.8 virginica
    +#> 126 NA NA NA NA virginica +#> 127 6.2 NA 4.8 NA virginica +#> 128 NA 3.0 4.9 1.8 virginica +#> 129 NA NA NA 2.1 virginica +#> 130 7.2 NA 5.8 NA virginica +#> 131 NA NA 6.1 NA virginica +#> 132 NA NA 6.4 2.0 virginica +#> 133 NA NA NA 2.2 virginica +#> 134 6.3 2.8 NA NA virginica +#> 135 6.1 2.6 5.6 1.4 virginica +#> 136 NA 3.0 NA NA virginica +#> 137 NA 3.4 NA NA virginica +#> 138 6.4 3.1 NA 1.8 virginica +#> 139 6.0 3.0 4.8 1.8 virginica +#> 140 6.9 NA 5.4 2.1 virginica +#> 141 6.7 NA NA 2.4 virginica +#> 142 6.9 NA NA NA virginica +#> 143 NA 2.7 5.1 1.9 virginica +#> 144 6.8 3.2 NA NA virginica +#> 145 NA 3.3 5.7 2.5 virginica +#> 146 6.7 3.0 5.2 NA virginica +#> 147 NA NA NA 1.9 virginica +#> 148 6.5 3.0 NA NA virginica +#> 149 6.2 NA 5.4 2.3 virginica +#> 150 5.9 NA 5.1 NA virginica @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -201,7 +209,7 @@

    Examp f = "single item vector", g = list() ) -nested_list(x) +nested_list(x)
    #> * a: #> * a1: Named #> * a2: List diff --git a/docs/reference/norm2beta-1.png b/docs/reference/norm2beta-1.png index dff08791..5272d900 100644 Binary files a/docs/reference/norm2beta-1.png and b/docs/reference/norm2beta-1.png differ diff --git a/docs/reference/norm2beta.html b/docs/reference/norm2beta.html index 06db4626..29e679fb 100644 --- a/docs/reference/norm2beta.html +++ b/docs/reference/norm2beta.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0
    @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/norm2binom-1.png b/docs/reference/norm2binom-1.png index 74798c06..128599fa 100644 Binary files a/docs/reference/norm2binom-1.png and b/docs/reference/norm2binom-1.png differ diff --git a/docs/reference/norm2binom.html b/docs/reference/norm2binom.html index c4659148..67a69320 100644 --- a/docs/reference/norm2binom.html +++ b/docs/reference/norm2binom.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/norm2gamma-1.png b/docs/reference/norm2gamma-1.png index 0d496d67..c3700695 100644 Binary files a/docs/reference/norm2gamma-1.png and b/docs/reference/norm2gamma-1.png differ diff --git a/docs/reference/norm2gamma.html b/docs/reference/norm2gamma.html index 6a996e97..378ca3cb 100644 --- a/docs/reference/norm2gamma.html +++ b/docs/reference/norm2gamma.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/norm2likert-1.png b/docs/reference/norm2likert-1.png index 0ba9693e..82246862 100644 Binary files a/docs/reference/norm2likert-1.png and b/docs/reference/norm2likert-1.png differ diff --git a/docs/reference/norm2likert.html b/docs/reference/norm2likert.html index d0908a9c..b201b504 100644 --- a/docs/reference/norm2likert.html +++ b/docs/reference/norm2likert.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/norm2pois-1.png b/docs/reference/norm2pois-1.png index 95ad1df3..391e955d 100644 Binary files a/docs/reference/norm2pois-1.png and b/docs/reference/norm2pois-1.png differ diff --git a/docs/reference/norm2pois.html b/docs/reference/norm2pois.html index f23d396d..b40113bb 100644 --- a/docs/reference/norm2pois.html +++ b/docs/reference/norm2pois.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/norm2trunc-1.png b/docs/reference/norm2trunc-1.png index 3de025db..995230a7 100644 Binary files a/docs/reference/norm2trunc-1.png and b/docs/reference/norm2trunc-1.png differ diff --git a/docs/reference/norm2trunc.html b/docs/reference/norm2trunc.html index be78ecee..bac1a6a1 100644 --- a/docs/reference/norm2trunc.html +++ b/docs/reference/norm2trunc.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/norm2unif-1.png b/docs/reference/norm2unif-1.png index bd8f9cd8..b0ca6fc2 100644 Binary files a/docs/reference/norm2unif-1.png and b/docs/reference/norm2unif-1.png differ diff --git a/docs/reference/norm2unif.html b/docs/reference/norm2unif.html index 6283f5e0..00f450ce 100644 --- a/docs/reference/norm2unif.html +++ b/docs/reference/norm2unif.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/pipe.html b/docs/reference/pipe.html index 9e9f107d..754df4b5 100644 --- a/docs/reference/pipe.html +++ b/docs/reference/pipe.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/plot_design-2.png b/docs/reference/plot_design-2.png index 6d640715..e1191790 100644 Binary files a/docs/reference/plot_design-2.png and b/docs/reference/plot_design-2.png differ diff --git a/docs/reference/plot_design.html b/docs/reference/plot_design.html index f16958fd..e2728ce7 100644 --- a/docs/reference/plot_design.html +++ b/docs/reference/plot_design.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -165,7 +173,7 @@

    Plot design

    Plots the specified within and between design. See vignette("plots", package = "faux") for examples and details.

    -
    plot_design(x, ..., geoms = NULL, palette = "Dark2")
    +    
    plot_design(x, ..., geoms = NULL, palette = "Dark2", labeller = "label_value")
     
     # S3 method for design
     plot(x, ...)
    @@ -182,7 +190,7 @@ 

    Arg ... -

    A list of factor names to determine visualisation (see vignette)

    +

    A list of factor names to determine visualisation (see vignette) in the order color, x, facet row(s), facet col(s)

    geoms @@ -190,7 +198,11 @@

    Arg palette -

    A brewer palette, defaults to "Dark2"

    +

    A brewer palette, defaults to "Dark2" (see ggplot2::scale_colour_brewer)

    + + + labeller +

    How to label the facets (see ggplot2::facet_grid). "label_value" is used by default.

    diff --git a/docs/reference/pos_def_limits.html b/docs/reference/pos_def_limits.html index 5d320b1a..5345d9db 100644 --- a/docs/reference/pos_def_limits.html +++ b/docs/reference/pos_def_limits.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/print.design.html b/docs/reference/print.design.html index 9c5f43be..68646344 100644 --- a/docs/reference/print.design.html +++ b/docs/reference/print.design.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/print.nested_list.html b/docs/reference/print.nested_list.html index 51280764..ac788372 100644 --- a/docs/reference/print.nested_list.html +++ b/docs/reference/print.nested_list.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/print.psychds_codebook.html b/docs/reference/print.psychds_codebook.html index b4835ba0..6d1ed8d2 100644 --- a/docs/reference/print.psychds_codebook.html +++ b/docs/reference/print.psychds_codebook.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/readline_check.html b/docs/reference/readline_check.html index 1c2c917b..6e02bd08 100644 --- a/docs/reference/readline_check.html +++ b/docs/reference/readline_check.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/rnorm_multi.html b/docs/reference/rnorm_multi.html index 03332e7e..cf0b1b9c 100644 --- a/docs/reference/rnorm_multi.html +++ b/docs/reference/rnorm_multi.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -225,26 +233,26 @@

    Value

    Examples

    # 4 10-item vectors each correlated r = .5 rnorm_multi(10, 4, r = 0.5) -
    #> X1 X2 X3 X4 -#> 1 0.45739527 0.8994046 -0.96948437 0.03884443 -#> 2 0.22708900 1.1959369 1.45527042 2.29606358 -#> 3 -0.06813446 -0.2700352 0.01537602 -0.26163959 -#> 4 -0.57440414 -1.7155499 -1.20389427 -1.50454873 -#> 5 -0.70123083 -1.2190659 0.21736094 -0.40004893 -#> 6 1.48536823 1.6847372 1.00499651 0.20763006 -#> 7 -0.34937463 0.1976291 -0.75879876 0.09282251 -#> 8 -1.15331203 -0.3250870 -0.29305162 -2.21427244 -#> 9 0.07559776 0.6463190 0.91047591 0.78581872 -#> 10 -0.67463688 1.2230990 -0.62793740 -0.34783835
    +
    #> X1 X2 X3 X4 +#> 1 0.61095292 -1.26859860 -1.0473425 -0.93833481 +#> 2 1.00786700 -0.01045278 0.8011351 0.07257914 +#> 3 0.82667232 1.04795522 0.4644770 -0.28091812 +#> 4 -0.05394007 -1.44029737 -0.6811783 -0.30994736 +#> 5 -1.41605036 -1.64280302 -0.4406393 -1.01325211 +#> 6 0.46223117 2.18896422 1.5182443 0.46917235 +#> 7 0.78039022 0.39089482 -0.2903739 -0.13676273 +#> 8 0.63844483 0.07108052 0.5376613 -0.53491812 +#> 9 0.72890749 -1.52370263 0.8834245 0.55849515 +#> 10 -0.04290407 -0.28051289 -0.5307138 1.53489728
    # set r with the upper right triangle b <- rnorm_multi(100, 3, c(0, .5, 1), 1, r = c(0.2, -0.5, 0.5), varnames=c("A", "B", "C")) cor(b) -
    #> A B C -#> A 1.000000 0.4183250 -0.2670150 -#> B 0.418325 1.0000000 0.4560207 -#> C -0.267015 0.4560207 1.0000000
    +
    #> A B C +#> A 1.0000000 0.3994863 -0.5147966 +#> B 0.3994863 1.0000000 0.3896981 +#> C -0.5147966 0.3896981 1.0000000
    # set r with a correlation matrix and column names from mu names c <- rnorm_multi( n = 100, @@ -255,9 +263,9 @@

    Examp ) cor(c)

    #> A B C -#> A 1.0000000 0.1866261 -0.6052581 -#> B 0.1866261 1.0000000 0.3732939 -#> C -0.6052581 0.3732939 1.0000000
    +#> A 1.0000000 0.1615419 -0.5165878 +#> B 0.1615419 1.0000000 0.5451974 +#> C -0.5165878 0.5451974 1.0000000
    @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -204,14 +212,14 @@

    Examp
    v1 <- rnorm(10) v2 <- rnorm_pre(v1, 0, 1, 0.5) cor(v1, v2) -
    #> [1] 0.320861
    +
    #> [1] 0.7712965
    x <- rnorm_multi(50, 2, .5) x$y <- rnorm_pre(x, r = c(0.5, 0.25)) cor(x)
    #> X1 X2 y -#> X1 1.0000000 -0.2845362 0.4339307 -#> X2 -0.2845362 1.0000000 0.1814306 -#> y 0.4339307 0.1814306 1.0000000
    +#> X1 1.00000000 0.01447404 0.5566679 +#> X2 0.01447404 1.00000000 0.2687557 +#> y 0.55666790 0.26875572 1.0000000 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -195,13 +203,13 @@

    Value

    Examples

    sample_from_pop(10)
    #> $mu -#> [1] 0.4999385 +#> [1] 0.1417399 #> #> $sd -#> [1] 0.9422441 +#> [1] 1.131078 #> #> $r -#> [1] 0.2655221 +#> [1] -0.3914457 #>
    @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -165,7 +173,14 @@

    Simulate data from design (internal)

    Simulate data from design (internal)

    -
    sim_data(design, empirical = FALSE, long = FALSE, rep = 1, seed = NULL)
    +
    sim_data(
    +  design,
    +  empirical = FALSE,
    +  long = FALSE,
    +  rep = 1,
    +  nested = TRUE,
    +  seed = NULL
    +)

    Arguments

    @@ -186,6 +201,10 @@

    Arg

    + + + + diff --git a/docs/reference/sim_design.html b/docs/reference/sim_design.html index fa1e2bc9..096f37a8 100644 --- a/docs/reference/sim_design.html +++ b/docs/reference/sim_design.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -162,7 +170,7 @@

    Simulate data from design

    -

    Generates a data table with a specified within and between design. See vignette("sim_design", package = "faux") for examples and details.

    +

    Generates a data table with a specified within and between design. See vignette("sim_design", package = "faux") for examples and details.

    sim_design(
    @@ -176,10 +184,12 @@ 

    Simulate data from design

    long = FALSE, dv = list(y = "value"), id = list(id = "id"), + vardesc = list(), plot = faux_options("plot"), interactive = FALSE, design = NULL, rep = 1, + nested = TRUE, seed = NULL, sep = faux_options("sep") )
    @@ -209,7 +219,7 @@

    Arg

  • - + @@ -227,6 +237,10 @@

    Arg

    + + + + @@ -237,11 +251,15 @@

    Arg

    - + - + + + + + diff --git a/docs/reference/sim_df.html b/docs/reference/sim_df.html index de096931..195e083b 100644 --- a/docs/reference/sim_df.html +++ b/docs/reference/sim_df.html @@ -45,11 +45,13 @@ + + - + @@ -85,7 +87,7 @@ faux - 1.0.0 + 1.1.0 @@ -125,12 +127,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/sim_joint_dist.html b/docs/reference/sim_joint_dist.html index 9e43de38..db6cf8e2 100644 --- a/docs/reference/sim_joint_dist.html +++ b/docs/reference/sim_joint_dist.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -194,19 +202,19 @@

    Value

    Examples

    sim_joint_dist(ggplot2::diamonds, cut, color, n = 10) -
    #> # A tibble: 10 x 2 +
    #> # A tibble: 10 x 2 #> cut color -#> <ord> <ord> -#> 1 Ideal E -#> 2 Very Good I -#> 3 Ideal F -#> 4 Very Good H -#> 5 Very Good I -#> 6 Ideal G -#> 7 Ideal H -#> 8 Premium J -#> 9 Ideal F -#> 10 Ideal E
    +#> <ord> <ord> +#> 1 Ideal D +#> 2 Very Good H +#> 3 Ideal F +#> 4 Ideal H +#> 5 Premium D +#> 6 Premium E +#> 7 Premium E +#> 8 Ideal G +#> 9 Premium E +#> 10 Ideal I @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -220,107 +228,107 @@

    Value

    Examples

    sim_mixed_cc(10, 10) -
    #> sub_id item_id y grand_i sub_i item_i err -#> 1 S01 I01 0.89827035 0 1.048229287 -0.52749074 0.377531800 -#> 15 S01 I02 2.47217957 0 1.048229287 1.31276628 0.111183999 -#> 29 S01 I03 1.05929178 0 1.048229287 -0.17919260 0.190255093 -#> 31 S01 I04 2.15097086 0 1.048229287 0.08841686 1.014324708 -#> 44 S01 I05 0.56495004 0 1.048229287 -0.89309805 0.409818809 -#> 58 S01 I06 1.95621377 0 1.048229287 0.41655671 0.491427768 -#> 61 S01 I07 0.87490660 0 1.048229287 0.21130684 -0.384629521 -#> 73 S01 I08 3.03999440 0 1.048229287 0.01882627 1.972938844 -#> 87 S01 I09 1.75630202 0 1.048229287 0.89066536 -0.182592624 -#> 91 S01 I10 -2.66525581 0 1.048229287 -1.30699432 -2.406490772 -#> 7 S02 I01 -0.13923821 0 1.154815105 -0.52749074 -0.766562581 -#> 17 S02 I02 1.42489922 0 1.154815105 1.31276628 -1.042682165 -#> 30 S02 I03 0.63421037 0 1.154815105 -0.17919260 -0.341412133 -#> 36 S02 I04 1.51462496 0 1.154815105 0.08841686 0.271392995 -#> 46 S02 I05 0.96941465 0 1.154815105 -0.89309805 0.707697596 -#> 59 S02 I06 2.23799364 0 1.154815105 0.41655671 0.666621818 -#> 69 S02 I07 0.68983159 0 1.154815105 0.21130684 -0.676290351 -#> 75 S02 I08 1.42758730 0 1.154815105 0.01882627 0.253945923 -#> 88 S02 I09 2.22227749 0 1.154815105 0.89066536 0.176797026 -#> 98 S02 I10 1.65926688 0 1.154815105 -1.30699432 1.811446100 -#> 4 S03 I01 -1.41759580 0 -0.033129970 -0.52749074 -0.856975100 -#> 18 S03 I02 0.95539174 0 -0.033129970 1.31276628 -0.324244567 -#> 23 S03 I03 -0.41709532 0 -0.033129970 -0.17919260 -0.204772748 -#> 33 S03 I04 -1.92889127 0 -0.033129970 0.08841686 -1.984178161 -#> 47 S03 I05 -0.18995863 0 -0.033129970 -0.89309805 0.736269389 -#> 60 S03 I06 1.56481856 0 -0.033129970 0.41655671 1.181391813 -#> 62 S03 I07 0.73548655 0 -0.033129970 0.21130684 0.557309683 -#> 76 S03 I08 -1.49415277 0 -0.033129970 0.01882627 -1.479849077 -#> 89 S03 I09 1.66076221 0 -0.033129970 0.89066536 0.803226825 -#> 95 S03 I10 -1.50938413 0 -0.033129970 -1.30699432 -0.169259840 -#> 5 S04 I01 -0.14256186 0 0.083385100 -0.52749074 0.301543775 -#> 19 S04 I02 0.94031877 0 0.083385100 1.31276628 -0.455832607 -#> 21 S04 I03 -1.69108481 0 0.083385100 -0.17919260 -1.595277311 -#> 34 S04 I04 -2.24301539 0 0.083385100 0.08841686 -2.414817352 -#> 48 S04 I05 -2.75963581 0 0.083385100 -0.89309805 -1.949922857 -#> 51 S04 I06 0.60833909 0 0.083385100 0.41655671 0.108397276 -#> 63 S04 I07 0.94168449 0 0.083385100 0.21130684 0.646992551 -#> 77 S04 I08 -1.57671213 0 0.083385100 0.01882627 -1.678923499 -#> 90 S04 I09 1.50857829 0 0.083385100 0.89066536 0.534527830 -#> 92 S04 I10 -1.83683229 0 0.083385100 -1.30699432 -0.613223062 -#> 2 S05 I01 -2.64653523 0 -2.275104427 -0.52749074 0.156059929 -#> 16 S05 I02 -0.83811458 0 -2.275104427 1.31276628 0.124223563 -#> 22 S05 I03 -2.39899884 0 -2.275104427 -0.17919260 0.055298184 -#> 35 S05 I04 -0.96313400 0 -2.275104427 0.08841686 1.223553567 -#> 45 S05 I05 -3.26866748 0 -2.275104427 -0.89309805 -0.100464996 -#> 52 S05 I06 -0.31017921 0 -2.275104427 0.41655671 1.548368507 -#> 64 S05 I07 -1.22899982 0 -2.275104427 0.21130684 0.834797766 -#> 74 S05 I08 -3.18863932 0 -2.275104427 0.01882627 -0.932361163 -#> 81 S05 I09 -1.13500449 0 -2.275104427 0.89066536 0.249434583 -#> 93 S05 I10 -4.05573998 0 -2.275104427 -1.30699432 -0.473641226 -#> 8 S06 I01 -0.02984267 0 1.246547000 -0.52749074 -0.748898930 -#> 20 S06 I02 3.12396856 0 1.246547000 1.31276628 0.564655280 -#> 27 S06 I03 1.98674858 0 1.246547000 -0.17919260 0.919394185 -#> 37 S06 I04 1.32638050 0 1.246547000 0.08841686 -0.008583359 -#> 49 S06 I05 1.87239055 0 1.246547000 -0.89309805 1.518941602 -#> 56 S06 I06 0.95842246 0 1.246547000 0.41655671 -0.704681259 -#> 66 S06 I07 1.48125405 0 1.246547000 0.21130684 0.023400212 -#> 79 S06 I08 2.41723359 0 1.246547000 0.01882627 1.151860320 -#> 85 S06 I09 1.51485686 0 1.246547000 0.89066536 -0.622355502 -#> 99 S06 I10 -0.10136916 0 1.246547000 -1.30699432 -0.040921834 -#> 9 S07 I01 -0.83750414 0 0.006142866 -0.52749074 -0.316156270 -#> 11 S07 I02 0.11777263 0 0.006142866 1.31276628 -1.201136514 -#> 24 S07 I03 -2.05910492 0 0.006142866 -0.17919260 -1.886055183 -#> 38 S07 I04 -0.99545727 0 0.006142866 0.08841686 -1.090017001 -#> 50 S07 I05 -0.97913941 0 0.006142866 -0.89309805 -0.092184224 -#> 53 S07 I06 1.46091601 0 0.006142866 0.41655671 1.038216432 -#> 67 S07 I07 0.87899112 0 0.006142866 0.21130684 0.661541419 -#> 80 S07 I08 0.90819538 0 0.006142866 0.01882627 0.883226238 -#> 82 S07 I09 0.72309500 0 0.006142866 0.89066536 -0.173713227 -#> 96 S07 I10 -1.00720629 0 0.006142866 -1.30699432 0.293645170 -#> 6 S08 I01 -0.40259237 0 -0.059806157 -0.52749074 0.184704522 -#> 12 S08 I02 0.96079823 0 -0.059806157 1.31276628 -0.292161891 -#> 25 S08 I03 -0.97600570 0 -0.059806157 -0.17919260 -0.737006942 -#> 39 S08 I04 -0.20732179 0 -0.059806157 0.08841686 -0.235932500 -#> 41 S08 I05 -0.15902016 0 -0.059806157 -0.89309805 0.793884053 -#> 54 S08 I06 0.39902196 0 -0.059806157 0.41655671 0.042271403 -#> 68 S08 I07 2.03180820 0 -0.059806157 0.21130684 1.880307518 -#> 78 S08 I08 0.95222401 0 -0.059806157 0.01882627 0.993203894 -#> 83 S08 I09 0.33756329 0 -0.059806157 0.89066536 -0.493295910 -#> 97 S08 I10 -2.65417971 0 -0.059806157 -1.30699432 -1.287379227 -#> 3 S09 I01 0.30722379 0 1.501903884 -0.52749074 -0.667189357 -#> 13 S09 I02 2.62403210 0 1.501903884 1.31276628 -0.190638062 -#> 26 S09 I03 0.46762070 0 1.501903884 -0.17919260 -0.855090584 -#> 32 S09 I04 -0.48025629 0 1.501903884 0.08841686 -2.070577042 -#> 42 S09 I05 0.13182078 0 1.501903884 -0.89309805 -0.476985050 -#> 55 S09 I06 2.15578084 0 1.501903884 0.41655671 0.237320245 -#> 65 S09 I07 0.76725645 0 1.501903884 0.21130684 -0.945954269 -#> 71 S09 I08 1.79184922 0 1.501903884 0.01882627 0.271119065 -#> 84 S09 I09 2.55216550 0 1.501903884 0.89066536 0.159596260 -#> 94 S09 I10 1.09434151 0 1.501903884 -1.30699432 0.899431949 -#> 10 S10 I01 0.60173217 0 0.830053002 -0.52749074 0.299169903 -#> 14 S10 I02 1.70552946 0 0.830053002 1.31276628 -0.437289821 -#> 28 S10 I03 -1.07579437 0 0.830053002 -0.17919260 -1.726654769 -#> 40 S10 I04 0.43708661 0 0.830053002 0.08841686 -0.481383257 -#> 43 S10 I05 -0.13807019 0 0.830053002 -0.89309805 -0.075025139 -#> 57 S10 I06 1.69410135 0 0.830053002 0.41655671 0.447491634 -#> 70 S10 I07 2.23529582 0 0.830053002 0.21130684 1.193935978 -#> 72 S10 I08 0.68539020 0 0.830053002 0.01882627 -0.163489074 -#> 86 S10 I09 1.65446208 0 0.830053002 0.89066536 -0.066256281 -#> 100 S10 I10 -0.68229054 0 0.830053002 -1.30699432 -0.205349219
    +
    #> sub_id item_id y grand_i sub_i item_i err +#> 1 S01 I01 -3.251555640 0 -1.0933128 -2.2805280 0.12228514 +#> 15 S01 I02 -1.851005204 0 -1.0933128 -1.0255685 0.26787615 +#> 29 S01 I03 -1.390906708 0 -1.0933128 -0.5102049 0.21261102 +#> 31 S01 I04 -1.617827203 0 -1.0933128 -0.3906218 -0.13389262 +#> 44 S01 I05 -0.306424397 0 -1.0933128 0.2110268 0.57586158 +#> 58 S01 I06 -1.192460606 0 -1.0933128 -0.1854311 0.08628335 +#> 61 S01 I07 -4.025276824 0 -1.0933128 -2.1994373 -0.73252676 +#> 73 S01 I08 -0.343640393 0 -1.0933128 -0.1822684 0.93194080 +#> 87 S01 I09 -2.429076596 0 -1.0933128 0.1812328 -1.51699658 +#> 91 S01 I10 0.944345854 0 -1.0933128 1.2116043 0.82605439 +#> 7 S02 I01 -0.773433000 0 1.2269399 -2.2805280 0.28015505 +#> 17 S02 I02 1.532269630 0 1.2269399 -1.0255685 1.33089825 +#> 30 S02 I03 1.631832238 0 1.2269399 -0.5102049 0.91509724 +#> 36 S02 I04 1.944916820 0 1.2269399 -0.3906218 1.10859867 +#> 46 S02 I05 3.134732788 0 1.2269399 0.2110268 1.69676604 +#> 59 S02 I06 -1.486422043 0 1.2269399 -0.1854311 -2.52793082 +#> 69 S02 I07 0.163382637 0 1.2269399 -2.1994373 1.13587997 +#> 75 S02 I08 2.060254032 0 1.2269399 -0.1822684 1.01558250 +#> 88 S02 I09 1.215851593 0 1.2269399 0.1812328 -0.19232112 +#> 98 S02 I10 2.324614560 0 1.2269399 1.2116043 -0.11392964 +#> 4 S03 I01 -0.721495163 0 -0.1957095 -2.2805280 1.75474230 +#> 18 S03 I02 -2.151125422 0 -0.1957095 -1.0255685 -0.92984739 +#> 23 S03 I03 -1.336808367 0 -0.1957095 -0.5102049 -0.63089395 +#> 33 S03 I04 -0.003187314 0 -0.1957095 -0.3906218 0.58314395 +#> 47 S03 I05 0.859461960 0 -0.1957095 0.2110268 0.84414462 +#> 60 S03 I06 -0.662850779 0 -0.1957095 -0.1854311 -0.28171014 +#> 62 S03 I07 -0.642091135 0 -0.1957095 -2.1994373 1.75305561 +#> 76 S03 I08 -0.771932591 0 -0.1957095 -0.1822684 -0.39395471 +#> 89 S03 I09 -1.053161622 0 -0.1957095 0.1812328 -1.03868492 +#> 95 S03 I10 2.074628263 0 -0.1957095 1.2116043 1.05873348 +#> 5 S04 I01 -0.230073329 0 1.4196822 -2.2805280 0.63077248 +#> 19 S04 I02 1.271973590 0 1.4196822 -1.0255685 0.87785997 +#> 21 S04 I03 0.893478213 0 1.4196822 -0.5102049 -0.01599903 +#> 34 S04 I04 0.521050191 0 1.4196822 -0.3906218 -0.50801020 +#> 48 S04 I05 2.728176842 0 1.4196822 0.2110268 1.09746785 +#> 51 S04 I06 0.252287855 0 1.4196822 -0.1854311 -0.98196316 +#> 63 S04 I07 -1.702166936 0 1.4196822 -2.1994373 -0.92241184 +#> 77 S04 I08 1.210144474 0 1.4196822 -0.1822684 -0.02726930 +#> 90 S04 I09 1.863358807 0 1.4196822 0.1812328 0.26244385 +#> 92 S04 I10 1.398374433 0 1.4196822 1.2116043 -1.23291200 +#> 2 S05 I01 -3.068392143 0 -0.9949279 -2.2805280 0.20706376 +#> 16 S05 I02 -2.736549670 0 -0.9949279 -1.0255685 -0.71605320 +#> 22 S05 I03 -2.069097882 0 -0.9949279 -0.5102049 -0.56396503 +#> 35 S05 I04 0.015326650 0 -0.9949279 -0.3906218 1.40087635 +#> 45 S05 I05 -1.735127692 0 -0.9949279 0.2110268 -0.95122659 +#> 52 S05 I06 -2.490137013 0 -0.9949279 -0.1854311 -1.30977793 +#> 64 S05 I07 -2.763086707 0 -0.9949279 -2.1994373 0.43127848 +#> 74 S05 I08 -1.353850058 0 -0.9949279 -0.1822684 -0.17665374 +#> 81 S05 I09 -0.171143537 0 -0.9949279 0.1812328 0.64255160 +#> 93 S05 I10 0.381921817 0 -0.9949279 1.2116043 0.16524548 +#> 8 S06 I01 -2.661141564 0 -0.5320612 -2.2805280 0.15144762 +#> 20 S06 I02 -0.910032228 0 -0.5320612 -1.0255685 0.64759753 +#> 27 S06 I03 -1.762424505 0 -0.5320612 -0.5102049 -0.72015837 +#> 37 S06 I04 0.003285302 0 -0.5320612 -0.3906218 0.92596829 +#> 49 S06 I05 -0.164212061 0 -0.5320612 0.2110268 0.15682232 +#> 56 S06 I06 0.335041751 0 -0.5320612 -0.1854311 1.05253411 +#> 66 S06 I07 -2.510777609 0 -0.5320612 -2.1994373 0.22072086 +#> 79 S06 I08 -3.403794678 0 -0.5320612 -0.1822684 -2.68946508 +#> 85 S06 I09 -0.754394318 0 -0.5320612 0.1812328 -0.40356590 +#> 99 S06 I10 1.029510980 0 -0.5320612 1.2116043 0.34996792 +#> 9 S07 I01 -2.593790416 0 -0.4006895 -2.2805280 0.08742706 +#> 11 S07 I02 -0.304845036 0 -0.4006895 -1.0255685 1.12141301 +#> 24 S07 I03 0.619818589 0 -0.4006895 -0.5102049 1.53071301 +#> 38 S07 I04 -2.480214929 0 -0.4006895 -0.3906218 -1.68890365 +#> 50 S07 I05 -1.479370173 0 -0.4006895 0.2110268 -1.28970750 +#> 53 S07 I06 0.515777993 0 -0.4006895 -0.1854311 1.10189864 +#> 67 S07 I07 -3.143974999 0 -0.4006895 -2.1994373 -0.54384824 +#> 80 S07 I08 -0.407739052 0 -0.4006895 -0.1822684 0.17521884 +#> 82 S07 I09 -0.155472015 0 -0.4006895 0.1812328 0.06398470 +#> 96 S07 I10 0.485831518 0 -0.4006895 1.2116043 -0.32508325 +#> 6 S08 I01 -0.935827145 0 0.4811886 -2.2805280 0.86351220 +#> 12 S08 I02 -0.649548158 0 0.4811886 -1.0255685 -0.10516825 +#> 25 S08 I03 -0.086549245 0 0.4811886 -0.5102049 -0.05753295 +#> 39 S08 I04 1.453692551 0 0.4811886 -0.3906218 1.36312569 +#> 41 S08 I05 2.225776944 0 0.4811886 0.2110268 1.53356148 +#> 54 S08 I06 0.019908610 0 0.4811886 -0.1854311 -0.27584887 +#> 68 S08 I07 -1.520430713 0 0.4811886 -2.1994373 0.19781791 +#> 78 S08 I08 0.855809028 0 0.4811886 -0.1822684 0.55688879 +#> 83 S08 I09 0.841050376 0 0.4811886 0.1812328 0.17862895 +#> 97 S08 I10 0.853546501 0 0.4811886 1.2116043 -0.83924640 +#> 3 S09 I01 -1.036473841 0 1.3491860 -2.2805280 -0.10513183 +#> 13 S09 I02 0.552036698 0 1.3491860 -1.0255685 0.22841928 +#> 26 S09 I03 0.790027261 0 1.3491860 -0.5102049 -0.04895378 +#> 32 S09 I04 1.264072873 0 1.3491860 -0.3906218 0.30550868 +#> 42 S09 I05 0.547848354 0 1.3491860 0.2110268 -1.01236444 +#> 55 S09 I06 1.399430774 0 1.3491860 -0.1854311 0.23567596 +#> 65 S09 I07 0.305820358 0 1.3491860 -2.1994373 1.15607166 +#> 71 S09 I08 0.619861481 0 1.3491860 -0.1822684 -0.54705609 +#> 84 S09 I09 1.983678167 0 1.3491860 0.1812328 0.45325941 +#> 94 S09 I10 4.128354187 0 1.3491860 1.2116043 1.56756395 +#> 10 S10 I01 -2.163925260 0 0.3304327 -2.2805280 -0.21382994 +#> 14 S10 I02 -0.521211412 0 0.3304327 -1.0255685 0.17392447 +#> 28 S10 I03 -0.675178314 0 0.3304327 -0.5102049 -0.49540605 +#> 40 S10 I04 -0.180856589 0 0.3304327 -0.3906218 -0.12066747 +#> 43 S10 I05 0.097784937 0 0.3304327 0.2110268 -0.44367455 +#> 57 S10 I06 1.341901847 0 0.3304327 -0.1854311 1.19690034 +#> 70 S10 I07 -1.388569829 0 0.3304327 -2.1994373 0.48043477 +#> 72 S10 I08 -2.191840031 0 0.3304327 -0.1822684 -2.34000430 +#> 86 S10 I09 0.913213917 0 0.3304327 0.1812328 0.40154847 +#> 100 S10 I10 2.065417563 0 0.3304327 1.2116043 0.52338063
    @@ -125,12 +127,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -211,107 +219,107 @@

    Value

    Examples

    sim_mixed_df(faceratings, 10, 10, "rating", "rater_id", "face_id") -
    #> sub_id item_id y grand_i sub_i item_i err -#> 1 S01 I01 6.3646902 3.018906 1.48120549 1.19133200 0.67324705 -#> 15 S01 I02 4.8794404 3.018906 1.48120549 0.14091305 0.23841620 -#> 29 S01 I03 2.8839789 3.018906 1.48120549 0.06485664 -1.68098887 -#> 31 S01 I04 2.1128697 3.018906 1.48120549 -0.42635348 -1.96088794 -#> 44 S01 I05 6.7938000 3.018906 1.48120549 1.12736729 1.16632159 -#> 58 S01 I06 5.6298822 3.018906 1.48120549 1.10087374 0.02889740 -#> 61 S01 I07 5.0537244 3.018906 1.48120549 -0.29432480 0.84793813 -#> 73 S01 I08 4.9907879 3.018906 1.48120549 0.66207708 -0.17140028 -#> 87 S01 I09 5.1491113 3.018906 1.48120549 -0.06026755 0.70926774 -#> 91 S01 I10 5.0168336 3.018906 1.48120549 0.35539173 0.16133080 -#> 7 S02 I01 2.8445029 3.018906 0.14436494 1.19133200 -1.51009968 -#> 17 S02 I02 2.8657735 3.018906 0.14436494 0.14091305 -0.43841007 -#> 30 S02 I03 1.1268162 3.018906 0.14436494 0.06485664 -2.10131101 -#> 36 S02 I04 3.6991602 3.018906 0.14436494 -0.42635348 0.96224313 -#> 46 S02 I05 4.7060601 3.018906 0.14436494 1.12736729 0.41542222 -#> 59 S02 I06 4.7605146 3.018906 0.14436494 1.10087374 0.49637031 -#> 69 S02 I07 3.1690952 3.018906 0.14436494 -0.29432480 0.30014947 -#> 75 S02 I08 5.0680639 3.018906 0.14436494 0.66207708 1.24271622 -#> 88 S02 I09 3.2088190 3.018906 0.14436494 -0.06026755 0.10581605 -#> 98 S02 I10 3.8651679 3.018906 0.14436494 0.35539173 0.34650563 -#> 4 S03 I01 2.9498962 3.018906 0.10403004 1.19133200 -1.36437142 -#> 18 S03 I02 3.6717427 3.018906 0.10403004 0.14091305 0.40789402 -#> 23 S03 I03 5.2679292 3.018906 0.10403004 0.06485664 2.08013692 -#> 33 S03 I04 2.4907094 3.018906 0.10403004 -0.42635348 -0.20587274 -#> 47 S03 I05 4.0098255 3.018906 0.10403004 1.12736729 -0.24047743 -#> 60 S03 I06 5.7845975 3.018906 0.10403004 1.10087374 1.56078814 -#> 62 S03 I07 4.2883106 3.018906 0.10403004 -0.29432480 1.45969972 -#> 76 S03 I08 2.3639133 3.018906 0.10403004 0.66207708 -1.42109948 -#> 89 S03 I09 2.4388567 3.018906 0.10403004 -0.06026755 -0.62381139 -#> 95 S03 I10 3.5708095 3.018906 0.10403004 0.35539173 0.09248213 -#> 5 S04 I01 3.3127892 3.018906 -0.72126824 1.19133200 -0.17618017 -#> 19 S04 I02 2.1062678 3.018906 -0.72126824 0.14091305 -0.33228260 -#> 21 S04 I03 2.6418236 3.018906 -0.72126824 0.06485664 0.27932960 -#> 34 S04 I04 0.5971781 3.018906 -0.72126824 -0.42635348 -1.27410579 -#> 48 S04 I05 2.2582697 3.018906 -0.72126824 1.12736729 -1.16673493 -#> 51 S04 I06 4.7742557 3.018906 -0.72126824 1.10087374 1.37574462 -#> 63 S04 I07 1.7274217 3.018906 -0.72126824 -0.29432480 -0.27589082 -#> 77 S04 I08 3.0309383 3.018906 -0.72126824 0.66207708 0.07122382 -#> 90 S04 I09 1.7091782 3.018906 -0.72126824 -0.06026755 -0.52819164 -#> 92 S04 I10 1.0661287 3.018906 -0.72126824 0.35539173 -1.58690035 -#> 2 S05 I01 4.7306599 3.018906 -0.09666313 1.19133200 0.61708542 -#> 16 S05 I02 1.8091947 3.018906 -0.09666313 0.14091305 -1.25396080 -#> 22 S05 I03 2.3451278 3.018906 -0.09666313 0.06485664 -0.64197132 -#> 35 S05 I04 2.3940620 3.018906 -0.09666313 -0.42635348 -0.10182698 -#> 45 S05 I05 4.5573163 3.018906 -0.09666313 1.12736729 0.50770650 -#> 52 S05 I06 3.9619034 3.018906 -0.09666313 1.10087374 -0.06121280 -#> 64 S05 I07 3.0178613 3.018906 -0.09666313 -0.29432480 0.38994363 -#> 74 S05 I08 4.9287422 3.018906 -0.09666313 0.66207708 1.34442260 -#> 81 S05 I09 2.0351907 3.018906 -0.09666313 -0.06026755 -0.82678427 -#> 93 S05 I10 4.0721195 3.018906 -0.09666313 0.35539173 0.79448526 -#> 8 S06 I01 8.5191887 3.018906 0.27574486 1.19133200 4.03320622 -#> 20 S06 I02 4.5425418 3.018906 0.27574486 0.14091305 1.10697827 -#> 27 S06 I03 5.3935785 3.018906 0.27574486 0.06485664 2.03407141 -#> 37 S06 I04 2.5990446 3.018906 0.27574486 -0.42635348 -0.26925242 -#> 49 S06 I05 6.1673410 3.018906 0.27574486 1.12736729 1.74532329 -#> 56 S06 I06 2.9396400 3.018906 0.27574486 1.10087374 -1.45588420 -#> 66 S06 I07 3.5754168 3.018906 0.27574486 -0.29432480 0.57509110 -#> 79 S06 I08 5.9921398 3.018906 0.27574486 0.66207708 2.03541222 -#> 85 S06 I09 3.4217117 3.018906 0.27574486 -0.06026755 0.18732875 -#> 99 S06 I10 3.7023838 3.018906 0.27574486 0.35539173 0.05234157 -#> 9 S07 I01 4.8096390 3.018906 1.66441057 1.19133200 -1.06500917 -#> 11 S07 I02 5.0047442 3.018906 1.66441057 0.14091305 0.18051494 -#> 24 S07 I03 5.2533366 3.018906 1.66441057 0.06485664 0.50516381 -#> 38 S07 I04 5.8410663 3.018906 1.66441057 -0.42635348 1.58410357 -#> 50 S07 I05 6.3028370 3.018906 1.66441057 1.12736729 0.49215349 -#> 53 S07 I06 4.3370986 3.018906 1.66441057 1.10087374 -1.44709132 -#> 67 S07 I07 5.3543573 3.018906 1.66441057 -0.29432480 0.96536587 -#> 80 S07 I08 6.7314783 3.018906 1.66441057 0.66207708 1.38608500 -#> 82 S07 I09 4.1947866 3.018906 1.66441057 -0.06026755 -0.42826206 -#> 96 S07 I10 4.0377783 3.018906 1.66441057 0.35539173 -1.00092957 -#> 6 S08 I01 3.1992472 3.018906 -0.64871111 1.19133200 -0.36227934 -#> 12 S08 I02 2.3541248 3.018906 -0.64871111 0.14091305 -0.15698273 -#> 25 S08 I03 3.5737760 3.018906 -0.64871111 0.06485664 1.13872487 -#> 39 S08 I04 2.4713875 3.018906 -0.64871111 -0.42635348 0.52754647 -#> 41 S08 I05 3.8748313 3.018906 -0.64871111 1.12736729 0.37726954 -#> 54 S08 I06 3.2499115 3.018906 -0.64871111 1.10087374 -0.22115670 -#> 68 S08 I07 1.7740479 3.018906 -0.64871111 -0.29432480 -0.30182180 -#> 78 S08 I08 4.5566479 3.018906 -0.64871111 0.66207708 1.52437635 -#> 83 S08 I09 1.0542787 3.018906 -0.64871111 -0.06026755 -1.25564825 -#> 97 S08 I10 3.2486453 3.018906 -0.64871111 0.35539173 0.52305908 -#> 3 S09 I01 7.0228290 3.018906 0.76380851 1.19133200 2.04878290 -#> 13 S09 I02 3.9522030 3.018906 0.76380851 0.14091305 0.02857582 -#> 26 S09 I03 1.7458393 3.018906 0.76380851 0.06485664 -2.10173145 -#> 32 S09 I04 4.7553102 3.018906 0.76380851 -0.42635348 1.39894955 -#> 42 S09 I05 6.6840208 3.018906 0.76380851 1.12736729 1.77393934 -#> 55 S09 I06 6.3029382 3.018906 0.76380851 1.10087374 1.41935035 -#> 65 S09 I07 3.0003536 3.018906 0.76380851 -0.29432480 -0.48803575 -#> 71 S09 I08 5.5210688 3.018906 0.76380851 0.66207708 1.07627757 -#> 84 S09 I09 3.3168697 3.018906 0.76380851 -0.06026755 -0.40557691 -#> 94 S09 I10 3.9206237 3.018906 0.76380851 0.35539173 -0.21748212 -#> 10 S10 I01 5.3804615 3.018906 0.39888947 1.19133200 0.77133444 -#> 14 S10 I02 2.5611011 3.018906 0.39888947 0.14091305 -0.99760699 -#> 28 S10 I03 3.1531022 3.018906 0.39888947 0.06485664 -0.32954948 -#> 40 S10 I04 2.8808465 3.018906 0.39888947 -0.42635348 -0.11059510 -#> 43 S10 I05 2.8139884 3.018906 0.39888947 1.12736729 -1.73117400 -#> 57 S10 I06 4.3653339 3.018906 0.39888947 1.10087374 -0.15333491 -#> 70 S10 I07 3.7041212 3.018906 0.39888947 -0.29432480 0.58065095 -#> 72 S10 I08 5.8502180 3.018906 0.39888947 0.66207708 1.77034588 -#> 86 S10 I09 3.7997745 3.018906 0.39888947 -0.06026755 0.44224694 -#> 100 S10 I10 4.6078044 3.018906 0.39888947 0.35539173 0.83461757
    +
    #> sub_id item_id y grand_i sub_i item_i err +#> 1 S01 I01 4.1152324 3.018906 0.56998287 0.06372689 0.4626170223 +#> 15 S01 I02 4.4224176 3.018906 0.56998287 -0.61913239 1.4526614811 +#> 29 S01 I03 3.8339794 3.018906 0.56998287 -0.47084975 0.7159406247 +#> 31 S01 I04 3.6693181 3.018906 0.56998287 -0.79426537 0.8746950317 +#> 44 S01 I05 4.1682274 3.018906 0.56998287 0.04751609 0.5318228254 +#> 58 S01 I06 4.5589567 3.018906 0.56998287 -0.03988620 1.0099544077 +#> 61 S01 I07 3.3139561 3.018906 0.56998287 -0.15429743 -0.1206349769 +#> 73 S01 I08 3.4466844 3.018906 0.56998287 -0.10140898 -0.0407951098 +#> 87 S01 I09 4.1150472 3.018906 0.56998287 -0.44323124 0.9693899904 +#> 91 S01 I10 3.7546416 3.018906 0.56998287 -0.41773369 0.5834868363 +#> 7 S02 I01 4.4331212 3.018906 0.15562574 0.06372689 1.1948629436 +#> 17 S02 I02 2.6376456 3.018906 0.15562574 -0.61913239 0.0822465999 +#> 30 S02 I03 1.7765036 3.018906 0.15562574 -0.47084975 -0.9271780136 +#> 36 S02 I04 2.0848855 3.018906 0.15562574 -0.79426537 -0.2953805179 +#> 46 S02 I05 2.7319999 3.018906 0.15562574 0.04751609 -0.4900475211 +#> 59 S02 I06 2.6284272 3.018906 0.15562574 -0.03988620 -0.5062179545 +#> 69 S02 I07 2.3668419 3.018906 0.15562574 -0.15429743 -0.6533920233 +#> 75 S02 I08 3.4096195 3.018906 0.15562574 -0.10140898 0.3364971592 +#> 88 S02 I09 2.0566689 3.018906 0.15562574 -0.44323124 -0.6746311797 +#> 98 S02 I10 2.3720810 3.018906 0.15562574 -0.41773369 -0.3847166733 +#> 4 S03 I01 4.7030774 3.018906 0.03692411 0.06372689 1.5835208395 +#> 18 S03 I02 0.8793870 3.018906 0.03692411 -0.61913239 -1.5573102959 +#> 23 S03 I03 2.0037907 3.018906 0.03692411 -0.47084975 -0.5811892504 +#> 33 S03 I04 1.0014127 3.018906 0.03692411 -0.79426537 -1.2601516722 +#> 47 S03 I05 3.2211549 3.018906 0.03692411 0.04751609 0.1178091041 +#> 60 S03 I06 1.3304699 3.018906 0.03692411 -0.03988620 -1.6854735746 +#> 62 S03 I07 3.1215507 3.018906 0.03692411 -0.15429743 0.2200184260 +#> 76 S03 I08 5.3608647 3.018906 0.03692411 -0.10140898 2.4064439566 +#> 89 S03 I09 2.5733421 3.018906 0.03692411 -0.44323124 -0.0392563757 +#> 95 S03 I10 3.3314952 3.018906 0.03692411 -0.41773369 0.6933991949 +#> 5 S04 I01 2.6792280 3.018906 0.19476739 0.06372689 -0.5981719043 +#> 19 S04 I02 1.8084207 3.018906 0.19476739 -0.61913239 -0.7861199053 +#> 21 S04 I03 3.9052572 3.018906 0.19476739 -0.47084975 1.1624339153 +#> 34 S04 I04 0.2667572 3.018906 0.19476739 -0.79426537 -2.1526504501 +#> 48 S04 I05 2.0248756 3.018906 0.19476739 0.04751609 -1.2363135229 +#> 51 S04 I06 1.6265464 3.018906 0.19476739 -0.03988620 -1.5472403653 +#> 63 S04 I07 1.7877199 3.018906 0.19476739 -0.15429743 -1.2716556202 +#> 77 S04 I08 2.5907081 3.018906 0.19476739 -0.10140898 -0.5215558932 +#> 90 S04 I09 2.0019422 3.018906 0.19476739 -0.44323124 -0.7684995082 +#> 92 S04 I10 3.9799185 3.018906 0.19476739 -0.41773369 1.1839792246 +#> 2 S05 I01 3.5292700 3.018906 -0.75807487 0.06372689 1.2047123566 +#> 16 S05 I02 1.3561640 3.018906 -0.75807487 -0.61913239 -0.2855343293 +#> 22 S05 I03 3.2562826 3.018906 -0.75807487 -0.47084975 1.4663015969 +#> 35 S05 I04 2.2140772 3.018906 -0.75807487 -0.79426537 0.7475118666 +#> 45 S05 I05 3.8999286 3.018906 -0.75807487 0.04751609 1.5915817696 +#> 52 S05 I06 4.4560178 3.018906 -0.75807487 -0.03988620 2.2350733124 +#> 64 S05 I07 3.5746937 3.018906 -0.75807487 -0.15429743 1.4681603850 +#> 74 S05 I08 0.3091243 3.018906 -0.75807487 -0.10140898 -1.8502974398 +#> 81 S05 I09 2.2126284 3.018906 -0.75807487 -0.44323124 0.3950288774 +#> 93 S05 I10 0.5045372 3.018906 -0.75807487 -0.41773369 -1.3385598100 +#> 8 S06 I01 3.0560640 3.018906 0.48363404 0.06372689 -0.5102025526 +#> 20 S06 I02 3.8891499 3.018906 0.48363404 -0.61913239 1.0057426556 +#> 27 S06 I03 4.8701173 3.018906 0.48363404 -0.47084975 1.8384274413 +#> 37 S06 I04 1.4001795 3.018906 0.48363404 -0.79426537 -1.3080948287 +#> 49 S06 I05 2.0216018 3.018906 0.48363404 0.04751609 -1.5284539771 +#> 56 S06 I06 3.7873565 3.018906 0.48363404 -0.03988620 0.3247030803 +#> 66 S06 I07 3.2805782 3.018906 0.48363404 -0.15429743 -0.0676640293 +#> 79 S06 I08 4.7155581 3.018906 0.48363404 -0.10140898 1.3144273905 +#> 85 S06 I09 3.2717270 3.018906 0.48363404 -0.44323124 0.2124186328 +#> 99 S06 I10 3.2642692 3.018906 0.48363404 -0.41773369 0.1794631937 +#> 9 S07 I01 3.6939536 3.018906 0.54553255 0.06372689 0.0657885048 +#> 11 S07 I02 1.2170700 3.018906 0.54553255 -0.61913239 -1.7282357430 +#> 24 S07 I03 4.2110089 3.018906 0.54553255 -0.47084975 1.1174204576 +#> 38 S07 I04 2.1033565 3.018906 0.54553255 -0.79426537 -0.6668162783 +#> 50 S07 I05 3.7363105 3.018906 0.54553255 0.04751609 0.1243562894 +#> 53 S07 I06 3.6785335 3.018906 0.54553255 -0.03988620 0.1539815503 +#> 67 S07 I07 4.7664235 3.018906 0.54553255 -0.15429743 1.3562827924 +#> 80 S07 I08 3.0045458 3.018906 0.54553255 -0.10140898 -0.4584834292 +#> 82 S07 I09 3.8416183 3.018906 0.54553255 -0.44323124 0.7204114222 +#> 96 S07 I10 2.8716905 3.018906 0.54553255 -0.41773369 -0.2750140285 +#> 6 S08 I01 2.2301931 3.018906 -0.40144258 0.06372689 -0.4509967811 +#> 12 S08 I02 2.3133628 3.018906 -0.40144258 -0.61913239 0.3150321147 +#> 25 S08 I03 2.0169064 3.018906 -0.40144258 -0.47084975 -0.1297068522 +#> 39 S08 I04 2.0436948 3.018906 -0.40144258 -0.79426537 0.2204971325 +#> 41 S08 I05 0.9715504 3.018906 -0.40144258 0.04751609 -1.6934287350 +#> 54 S08 I06 1.8520727 3.018906 -0.40144258 -0.03988620 -0.7255041591 +#> 68 S08 I07 2.4390171 3.018906 -0.40144258 -0.15429743 -0.0241485454 +#> 78 S08 I08 1.0305279 3.018906 -0.40144258 -0.10140898 -1.4855261434 +#> 83 S08 I09 1.9171300 3.018906 -0.40144258 -0.44323124 -0.2571018196 +#> 97 S08 I10 1.6690544 3.018906 -0.40144258 -0.41773369 -0.5306749508 +#> 3 S09 I01 2.9555480 3.018906 0.57304625 0.06372689 -0.7001307111 +#> 13 S09 I02 2.2941068 3.018906 0.57304625 -0.61913239 -0.6787127129 +#> 26 S09 I03 0.7553089 3.018906 0.57304625 -0.47084975 -2.3657931602 +#> 32 S09 I04 3.7013706 3.018906 0.57304625 -0.79426537 0.9036840992 +#> 42 S09 I05 4.5290509 3.018906 0.57304625 0.04751609 0.8895829209 +#> 55 S09 I06 3.7888207 3.018906 0.57304625 -0.03988620 0.2367550325 +#> 65 S09 I07 3.4651418 3.018906 0.57304625 -0.15429743 0.0274874126 +#> 71 S09 I08 4.5560139 3.018906 0.57304625 -0.10140898 1.0654710594 +#> 84 S09 I09 2.9545448 3.018906 0.57304625 -0.44323124 -0.1941758110 +#> 94 S09 I10 2.7663826 3.018906 0.57304625 -0.41773369 -0.4078355519 +#> 10 S10 I01 4.9049963 3.018906 0.42651506 0.06372689 1.3958487131 +#> 14 S10 I02 2.2826745 3.018906 0.42651506 -0.61913239 -0.5436137684 +#> 28 S10 I03 3.0489810 3.018906 0.42651506 -0.47084975 0.0744100611 +#> 40 S10 I04 2.2858762 3.018906 0.42651506 -0.79426537 -0.3652791241 +#> 43 S10 I05 2.1215325 3.018906 0.42651506 0.04751609 -1.3714042494 +#> 57 S10 I06 4.4669262 3.018906 0.42651506 -0.03988620 1.0613917740 +#> 70 S10 I07 3.0090947 3.018906 0.42651506 -0.15429743 -0.2820285529 +#> 72 S10 I08 4.0185082 3.018906 0.42651506 -0.10140898 0.6744965044 +#> 86 S10 I09 1.0367855 3.018906 0.42651506 -0.44323124 -1.9654039006 +#> 100 S10 I10 3.0267011 3.018906 0.42651506 -0.41773369 -0.0009858907
    @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/trunc2norm-1.png b/docs/reference/trunc2norm-1.png index ef4e139d..3f9376e6 100644 Binary files a/docs/reference/trunc2norm-1.png and b/docs/reference/trunc2norm-1.png differ diff --git a/docs/reference/trunc2norm.html b/docs/reference/trunc2norm.html index 2bbc9d84..4fc7c065 100644 --- a/docs/reference/trunc2norm.html +++ b/docs/reference/trunc2norm.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/unif2norm-1.png b/docs/reference/unif2norm-1.png index d17a49fa..0a66a3f7 100644 Binary files a/docs/reference/unif2norm-1.png and b/docs/reference/unif2norm-1.png differ diff --git a/docs/reference/unif2norm.html b/docs/reference/unif2norm.html index 486544d7..eeca34a7 100644 --- a/docs/reference/unif2norm.html +++ b/docs/reference/unif2norm.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -200,10 +208,10 @@

    Examp
    x <- runif(10000) y <- unif2norm(x) -
    #> min was set to -9.99357387423515e-05
    #> max was set to 0.999908634631336
    g <- ggplot2::ggplot() + ggplot2::geom_point(ggplot2::aes(x, y)) +
    #> min was set to -7.23436776548624e-05
    #> max was set to 1.00006860069223
    g <- ggplot2::ggplot() + ggplot2::geom_point(ggplot2::aes(x, y)) ggExtra::ggMarginal(g, type = "histogram")
    -
    + @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • diff --git a/docs/reference/wide2long.html b/docs/reference/wide2long.html index bf7440d7..dc75798b 100644 --- a/docs/reference/wide2long.html +++ b/docs/reference/wide2long.html @@ -45,10 +45,12 @@ + + - + @@ -84,7 +86,7 @@ faux - 1.0.0 + 1.1.0 @@ -124,12 +126,18 @@
  • Mixed Design Simulation
  • +
  • + Randomised Reports +
  • Distribution Conversions
  • Codebook Demo
  • +
  • + Contrasts +
  • @@ -209,607 +217,607 @@

    Value

    Examples

    wide2long(iris, c("Feature", "Measure"), 1:4, sep = "\\.") -
    #> id Species Feature Measure y -#> S001.1 S001 setosa Sepal Length 5.1 -#> S002.1 S002 setosa Sepal Length 4.9 -#> S003.1 S003 setosa Sepal Length 4.7 -#> S004.1 S004 setosa Sepal Length 4.6 -#> S005.1 S005 setosa Sepal Length 5.0 -#> S006.1 S006 setosa Sepal Length 5.4 -#> S007.1 S007 setosa Sepal Length 4.6 -#> S008.1 S008 setosa Sepal Length 5.0 -#> S009.1 S009 setosa Sepal Length 4.4 -#> S010.1 S010 setosa Sepal Length 4.9 -#> S011.1 S011 setosa Sepal Length 5.4 -#> S012.1 S012 setosa Sepal Length 4.8 -#> S013.1 S013 setosa Sepal Length 4.8 -#> S014.1 S014 setosa Sepal Length 4.3 -#> S015.1 S015 setosa Sepal Length 5.8 -#> S016.1 S016 setosa Sepal Length 5.7 -#> S017.1 S017 setosa Sepal Length 5.4 -#> S018.1 S018 setosa Sepal Length 5.1 -#> S019.1 S019 setosa Sepal Length 5.7 -#> S020.1 S020 setosa Sepal Length 5.1 -#> S021.1 S021 setosa Sepal Length 5.4 -#> S022.1 S022 setosa Sepal Length 5.1 -#> S023.1 S023 setosa Sepal Length 4.6 -#> S024.1 S024 setosa Sepal Length 5.1 -#> S025.1 S025 setosa Sepal Length 4.8 -#> S026.1 S026 setosa Sepal Length 5.0 -#> S027.1 S027 setosa Sepal Length 5.0 -#> S028.1 S028 setosa Sepal Length 5.2 -#> S029.1 S029 setosa Sepal Length 5.2 -#> S030.1 S030 setosa Sepal Length 4.7 -#> S031.1 S031 setosa Sepal Length 4.8 -#> S032.1 S032 setosa Sepal Length 5.4 -#> S033.1 S033 setosa Sepal Length 5.2 -#> S034.1 S034 setosa Sepal Length 5.5 -#> S035.1 S035 setosa Sepal Length 4.9 -#> S036.1 S036 setosa Sepal Length 5.0 -#> S037.1 S037 setosa Sepal Length 5.5 -#> S038.1 S038 setosa Sepal Length 4.9 -#> S039.1 S039 setosa Sepal Length 4.4 -#> S040.1 S040 setosa Sepal Length 5.1 -#> S041.1 S041 setosa Sepal Length 5.0 -#> S042.1 S042 setosa Sepal Length 4.5 -#> S043.1 S043 setosa Sepal Length 4.4 -#> S044.1 S044 setosa Sepal Length 5.0 -#> S045.1 S045 setosa Sepal Length 5.1 -#> S046.1 S046 setosa Sepal Length 4.8 -#> S047.1 S047 setosa Sepal Length 5.1 -#> S048.1 S048 setosa Sepal Length 4.6 -#> S049.1 S049 setosa Sepal Length 5.3 -#> S050.1 S050 setosa Sepal Length 5.0 -#> S051.1 S051 versicolor Sepal Length 7.0 -#> S052.1 S052 versicolor Sepal Length 6.4 -#> S053.1 S053 versicolor Sepal Length 6.9 -#> S054.1 S054 versicolor Sepal Length 5.5 -#> S055.1 S055 versicolor Sepal Length 6.5 -#> S056.1 S056 versicolor Sepal Length 5.7 -#> S057.1 S057 versicolor Sepal Length 6.3 -#> S058.1 S058 versicolor Sepal Length 4.9 -#> S059.1 S059 versicolor Sepal Length 6.6 -#> S060.1 S060 versicolor Sepal Length 5.2 -#> S061.1 S061 versicolor Sepal Length 5.0 -#> S062.1 S062 versicolor Sepal Length 5.9 -#> S063.1 S063 versicolor Sepal Length 6.0 -#> S064.1 S064 versicolor Sepal Length 6.1 -#> S065.1 S065 versicolor Sepal Length 5.6 -#> S066.1 S066 versicolor Sepal Length 6.7 -#> S067.1 S067 versicolor Sepal Length 5.6 -#> S068.1 S068 versicolor Sepal Length 5.8 -#> S069.1 S069 versicolor Sepal Length 6.2 -#> S070.1 S070 versicolor Sepal Length 5.6 -#> S071.1 S071 versicolor Sepal Length 5.9 -#> S072.1 S072 versicolor Sepal Length 6.1 -#> S073.1 S073 versicolor Sepal Length 6.3 -#> S074.1 S074 versicolor Sepal Length 6.1 -#> S075.1 S075 versicolor Sepal Length 6.4 -#> S076.1 S076 versicolor Sepal Length 6.6 -#> S077.1 S077 versicolor Sepal Length 6.8 -#> S078.1 S078 versicolor Sepal Length 6.7 -#> S079.1 S079 versicolor Sepal Length 6.0 -#> S080.1 S080 versicolor Sepal Length 5.7 -#> S081.1 S081 versicolor Sepal Length 5.5 -#> S082.1 S082 versicolor Sepal Length 5.5 -#> S083.1 S083 versicolor Sepal Length 5.8 -#> S084.1 S084 versicolor Sepal Length 6.0 -#> S085.1 S085 versicolor Sepal Length 5.4 -#> S086.1 S086 versicolor Sepal Length 6.0 -#> S087.1 S087 versicolor Sepal Length 6.7 -#> S088.1 S088 versicolor Sepal Length 6.3 -#> S089.1 S089 versicolor Sepal Length 5.6 -#> S090.1 S090 versicolor Sepal Length 5.5 -#> S091.1 S091 versicolor Sepal Length 5.5 -#> S092.1 S092 versicolor Sepal Length 6.1 -#> S093.1 S093 versicolor Sepal Length 5.8 -#> S094.1 S094 versicolor Sepal Length 5.0 -#> S095.1 S095 versicolor Sepal Length 5.6 -#> S096.1 S096 versicolor Sepal Length 5.7 -#> S097.1 S097 versicolor Sepal Length 5.7 -#> S098.1 S098 versicolor Sepal Length 6.2 -#> S099.1 S099 versicolor Sepal Length 5.1 -#> S100.1 S100 versicolor Sepal Length 5.7 -#> S101.1 S101 virginica Sepal Length 6.3 -#> S102.1 S102 virginica Sepal Length 5.8 -#> S103.1 S103 virginica Sepal Length 7.1 -#> S104.1 S104 virginica Sepal Length 6.3 -#> S105.1 S105 virginica Sepal Length 6.5 -#> S106.1 S106 virginica Sepal Length 7.6 -#> S107.1 S107 virginica Sepal Length 4.9 -#> S108.1 S108 virginica Sepal Length 7.3 -#> S109.1 S109 virginica Sepal Length 6.7 -#> S110.1 S110 virginica Sepal Length 7.2 -#> S111.1 S111 virginica Sepal Length 6.5 -#> S112.1 S112 virginica Sepal Length 6.4 -#> S113.1 S113 virginica Sepal Length 6.8 -#> S114.1 S114 virginica Sepal Length 5.7 -#> S115.1 S115 virginica Sepal Length 5.8 -#> S116.1 S116 virginica Sepal Length 6.4 -#> S117.1 S117 virginica Sepal Length 6.5 -#> S118.1 S118 virginica Sepal Length 7.7 -#> S119.1 S119 virginica Sepal Length 7.7 -#> S120.1 S120 virginica Sepal Length 6.0 -#> S121.1 S121 virginica Sepal Length 6.9 -#> S122.1 S122 virginica Sepal Length 5.6 -#> S123.1 S123 virginica Sepal Length 7.7 -#> S124.1 S124 virginica Sepal Length 6.3 -#> S125.1 S125 virginica Sepal Length 6.7 -#> S126.1 S126 virginica Sepal Length 7.2 -#> S127.1 S127 virginica Sepal Length 6.2 -#> S128.1 S128 virginica Sepal Length 6.1 -#> S129.1 S129 virginica Sepal Length 6.4 -#> S130.1 S130 virginica Sepal Length 7.2 -#> S131.1 S131 virginica Sepal Length 7.4 -#> S132.1 S132 virginica Sepal Length 7.9 -#> S133.1 S133 virginica Sepal Length 6.4 -#> S134.1 S134 virginica Sepal Length 6.3 -#> S135.1 S135 virginica Sepal Length 6.1 -#> S136.1 S136 virginica Sepal Length 7.7 -#> S137.1 S137 virginica Sepal Length 6.3 -#> S138.1 S138 virginica Sepal Length 6.4 -#> S139.1 S139 virginica Sepal Length 6.0 -#> S140.1 S140 virginica Sepal Length 6.9 -#> S141.1 S141 virginica Sepal Length 6.7 -#> S142.1 S142 virginica Sepal Length 6.9 -#> S143.1 S143 virginica Sepal Length 5.8 -#> S144.1 S144 virginica Sepal Length 6.8 -#> S145.1 S145 virginica Sepal Length 6.7 -#> S146.1 S146 virginica Sepal Length 6.7 -#> S147.1 S147 virginica Sepal Length 6.3 -#> S148.1 S148 virginica Sepal Length 6.5 -#> S149.1 S149 virginica Sepal Length 6.2 -#> S150.1 S150 virginica Sepal Length 5.9 -#> S001.2 S001 setosa Sepal Width 3.5 -#> S002.2 S002 setosa Sepal Width 3.0 -#> S003.2 S003 setosa Sepal Width 3.2 -#> S004.2 S004 setosa Sepal Width 3.1 -#> S005.2 S005 setosa Sepal Width 3.6 -#> S006.2 S006 setosa Sepal Width 3.9 -#> S007.2 S007 setosa Sepal Width 3.4 -#> S008.2 S008 setosa Sepal Width 3.4 -#> S009.2 S009 setosa Sepal Width 2.9 -#> S010.2 S010 setosa Sepal Width 3.1 -#> S011.2 S011 setosa Sepal Width 3.7 -#> S012.2 S012 setosa Sepal Width 3.4 -#> S013.2 S013 setosa Sepal Width 3.0 -#> S014.2 S014 setosa Sepal Width 3.0 -#> S015.2 S015 setosa Sepal Width 4.0 -#> S016.2 S016 setosa Sepal Width 4.4 -#> S017.2 S017 setosa Sepal Width 3.9 -#> S018.2 S018 setosa Sepal Width 3.5 -#> S019.2 S019 setosa Sepal Width 3.8 -#> S020.2 S020 setosa Sepal Width 3.8 -#> S021.2 S021 setosa Sepal Width 3.4 -#> S022.2 S022 setosa Sepal Width 3.7 -#> S023.2 S023 setosa Sepal Width 3.6 -#> S024.2 S024 setosa Sepal Width 3.3 -#> S025.2 S025 setosa Sepal Width 3.4 -#> S026.2 S026 setosa Sepal Width 3.0 -#> S027.2 S027 setosa Sepal Width 3.4 -#> S028.2 S028 setosa Sepal Width 3.5 -#> S029.2 S029 setosa Sepal Width 3.4 -#> S030.2 S030 setosa Sepal Width 3.2 -#> S031.2 S031 setosa Sepal Width 3.1 -#> S032.2 S032 setosa Sepal Width 3.4 -#> S033.2 S033 setosa Sepal Width 4.1 -#> S034.2 S034 setosa Sepal Width 4.2 -#> S035.2 S035 setosa Sepal Width 3.1 -#> S036.2 S036 setosa Sepal Width 3.2 -#> S037.2 S037 setosa Sepal Width 3.5 -#> S038.2 S038 setosa Sepal Width 3.6 -#> S039.2 S039 setosa Sepal Width 3.0 -#> S040.2 S040 setosa Sepal Width 3.4 -#> S041.2 S041 setosa Sepal Width 3.5 -#> S042.2 S042 setosa Sepal Width 2.3 -#> S043.2 S043 setosa Sepal Width 3.2 -#> S044.2 S044 setosa Sepal Width 3.5 -#> S045.2 S045 setosa Sepal Width 3.8 -#> S046.2 S046 setosa Sepal Width 3.0 -#> S047.2 S047 setosa Sepal Width 3.8 -#> S048.2 S048 setosa Sepal Width 3.2 -#> S049.2 S049 setosa Sepal Width 3.7 -#> S050.2 S050 setosa Sepal Width 3.3 -#> S051.2 S051 versicolor Sepal Width 3.2 -#> S052.2 S052 versicolor Sepal Width 3.2 -#> S053.2 S053 versicolor Sepal Width 3.1 -#> S054.2 S054 versicolor Sepal Width 2.3 -#> S055.2 S055 versicolor Sepal Width 2.8 -#> S056.2 S056 versicolor Sepal Width 2.8 -#> S057.2 S057 versicolor Sepal Width 3.3 -#> S058.2 S058 versicolor Sepal Width 2.4 -#> S059.2 S059 versicolor Sepal Width 2.9 -#> S060.2 S060 versicolor Sepal Width 2.7 -#> S061.2 S061 versicolor Sepal Width 2.0 -#> S062.2 S062 versicolor Sepal Width 3.0 -#> S063.2 S063 versicolor Sepal Width 2.2 -#> S064.2 S064 versicolor Sepal Width 2.9 -#> S065.2 S065 versicolor Sepal Width 2.9 -#> S066.2 S066 versicolor Sepal Width 3.1 -#> S067.2 S067 versicolor Sepal Width 3.0 -#> S068.2 S068 versicolor Sepal Width 2.7 -#> S069.2 S069 versicolor Sepal Width 2.2 -#> S070.2 S070 versicolor Sepal Width 2.5 -#> S071.2 S071 versicolor Sepal Width 3.2 -#> S072.2 S072 versicolor Sepal Width 2.8 -#> S073.2 S073 versicolor Sepal Width 2.5 -#> S074.2 S074 versicolor Sepal Width 2.8 -#> S075.2 S075 versicolor Sepal Width 2.9 -#> S076.2 S076 versicolor Sepal Width 3.0 -#> S077.2 S077 versicolor Sepal Width 2.8 -#> S078.2 S078 versicolor Sepal Width 3.0 -#> S079.2 S079 versicolor Sepal Width 2.9 -#> S080.2 S080 versicolor Sepal Width 2.6 -#> S081.2 S081 versicolor Sepal Width 2.4 -#> S082.2 S082 versicolor Sepal Width 2.4 -#> S083.2 S083 versicolor Sepal Width 2.7 -#> S084.2 S084 versicolor Sepal Width 2.7 -#> S085.2 S085 versicolor Sepal Width 3.0 -#> S086.2 S086 versicolor Sepal Width 3.4 -#> S087.2 S087 versicolor Sepal Width 3.1 -#> S088.2 S088 versicolor Sepal Width 2.3 -#> S089.2 S089 versicolor Sepal Width 3.0 -#> S090.2 S090 versicolor Sepal Width 2.5 -#> S091.2 S091 versicolor Sepal Width 2.6 -#> S092.2 S092 versicolor Sepal Width 3.0 -#> S093.2 S093 versicolor Sepal Width 2.6 -#> S094.2 S094 versicolor Sepal Width 2.3 -#> S095.2 S095 versicolor Sepal Width 2.7 -#> S096.2 S096 versicolor Sepal Width 3.0 -#> S097.2 S097 versicolor Sepal Width 2.9 -#> S098.2 S098 versicolor Sepal Width 2.9 -#> S099.2 S099 versicolor Sepal Width 2.5 -#> S100.2 S100 versicolor Sepal Width 2.8 -#> S101.2 S101 virginica Sepal Width 3.3 -#> S102.2 S102 virginica Sepal Width 2.7 -#> S103.2 S103 virginica Sepal Width 3.0 -#> S104.2 S104 virginica Sepal Width 2.9 -#> S105.2 S105 virginica Sepal Width 3.0 -#> S106.2 S106 virginica Sepal Width 3.0 -#> S107.2 S107 virginica Sepal Width 2.5 -#> S108.2 S108 virginica Sepal Width 2.9 -#> S109.2 S109 virginica Sepal Width 2.5 -#> S110.2 S110 virginica Sepal Width 3.6 -#> S111.2 S111 virginica Sepal Width 3.2 -#> S112.2 S112 virginica Sepal Width 2.7 -#> S113.2 S113 virginica Sepal Width 3.0 -#> S114.2 S114 virginica Sepal Width 2.5 -#> S115.2 S115 virginica Sepal Width 2.8 -#> S116.2 S116 virginica Sepal Width 3.2 -#> S117.2 S117 virginica Sepal Width 3.0 -#> S118.2 S118 virginica Sepal Width 3.8 -#> S119.2 S119 virginica Sepal Width 2.6 -#> S120.2 S120 virginica Sepal Width 2.2 -#> S121.2 S121 virginica Sepal Width 3.2 -#> S122.2 S122 virginica Sepal Width 2.8 -#> S123.2 S123 virginica Sepal Width 2.8 -#> S124.2 S124 virginica Sepal Width 2.7 -#> S125.2 S125 virginica Sepal Width 3.3 -#> S126.2 S126 virginica Sepal Width 3.2 -#> S127.2 S127 virginica Sepal Width 2.8 -#> S128.2 S128 virginica Sepal Width 3.0 -#> S129.2 S129 virginica Sepal Width 2.8 -#> S130.2 S130 virginica Sepal Width 3.0 -#> S131.2 S131 virginica Sepal Width 2.8 -#> S132.2 S132 virginica Sepal Width 3.8 -#> S133.2 S133 virginica Sepal Width 2.8 -#> S134.2 S134 virginica Sepal Width 2.8 -#> S135.2 S135 virginica Sepal Width 2.6 -#> S136.2 S136 virginica Sepal Width 3.0 -#> S137.2 S137 virginica Sepal Width 3.4 -#> S138.2 S138 virginica Sepal Width 3.1 -#> S139.2 S139 virginica Sepal Width 3.0 -#> S140.2 S140 virginica Sepal Width 3.1 -#> S141.2 S141 virginica Sepal Width 3.1 -#> S142.2 S142 virginica Sepal Width 3.1 -#> S143.2 S143 virginica Sepal Width 2.7 -#> S144.2 S144 virginica Sepal Width 3.2 -#> S145.2 S145 virginica Sepal Width 3.3 -#> S146.2 S146 virginica Sepal Width 3.0 -#> S147.2 S147 virginica Sepal Width 2.5 -#> S148.2 S148 virginica Sepal Width 3.0 -#> S149.2 S149 virginica Sepal Width 3.4 -#> S150.2 S150 virginica Sepal Width 3.0 -#> S001.3 S001 setosa Petal Length 1.4 -#> S002.3 S002 setosa Petal Length 1.4 -#> S003.3 S003 setosa Petal Length 1.3 -#> S004.3 S004 setosa Petal Length 1.5 -#> S005.3 S005 setosa Petal Length 1.4 -#> S006.3 S006 setosa Petal Length 1.7 -#> S007.3 S007 setosa Petal Length 1.4 -#> S008.3 S008 setosa Petal Length 1.5 -#> S009.3 S009 setosa Petal Length 1.4 -#> S010.3 S010 setosa Petal Length 1.5 -#> S011.3 S011 setosa Petal Length 1.5 -#> S012.3 S012 setosa Petal Length 1.6 -#> S013.3 S013 setosa Petal Length 1.4 -#> S014.3 S014 setosa Petal Length 1.1 -#> S015.3 S015 setosa Petal Length 1.2 -#> S016.3 S016 setosa Petal Length 1.5 -#> S017.3 S017 setosa Petal Length 1.3 -#> S018.3 S018 setosa Petal Length 1.4 -#> S019.3 S019 setosa Petal Length 1.7 -#> S020.3 S020 setosa Petal Length 1.5 -#> S021.3 S021 setosa Petal Length 1.7 -#> S022.3 S022 setosa Petal Length 1.5 -#> S023.3 S023 setosa Petal Length 1.0 -#> S024.3 S024 setosa Petal Length 1.7 -#> S025.3 S025 setosa Petal Length 1.9 -#> S026.3 S026 setosa Petal Length 1.6 -#> S027.3 S027 setosa Petal Length 1.6 -#> S028.3 S028 setosa Petal Length 1.5 -#> S029.3 S029 setosa Petal Length 1.4 -#> S030.3 S030 setosa Petal Length 1.6 -#> S031.3 S031 setosa Petal Length 1.6 -#> S032.3 S032 setosa Petal Length 1.5 -#> S033.3 S033 setosa Petal Length 1.5 -#> S034.3 S034 setosa Petal Length 1.4 -#> S035.3 S035 setosa Petal Length 1.5 -#> S036.3 S036 setosa Petal Length 1.2 -#> S037.3 S037 setosa Petal Length 1.3 -#> S038.3 S038 setosa Petal Length 1.4 -#> S039.3 S039 setosa Petal Length 1.3 -#> S040.3 S040 setosa Petal Length 1.5 -#> S041.3 S041 setosa Petal Length 1.3 -#> S042.3 S042 setosa Petal Length 1.3 -#> S043.3 S043 setosa Petal Length 1.3 -#> S044.3 S044 setosa Petal Length 1.6 -#> S045.3 S045 setosa Petal Length 1.9 -#> S046.3 S046 setosa Petal Length 1.4 -#> S047.3 S047 setosa Petal Length 1.6 -#> S048.3 S048 setosa Petal Length 1.4 -#> S049.3 S049 setosa Petal Length 1.5 -#> S050.3 S050 setosa Petal Length 1.4 -#> S051.3 S051 versicolor Petal Length 4.7 -#> S052.3 S052 versicolor Petal Length 4.5 -#> S053.3 S053 versicolor Petal Length 4.9 -#> S054.3 S054 versicolor Petal Length 4.0 -#> S055.3 S055 versicolor Petal Length 4.6 -#> S056.3 S056 versicolor Petal Length 4.5 -#> S057.3 S057 versicolor Petal Length 4.7 -#> S058.3 S058 versicolor Petal Length 3.3 -#> S059.3 S059 versicolor Petal Length 4.6 -#> S060.3 S060 versicolor Petal Length 3.9 -#> S061.3 S061 versicolor Petal Length 3.5 -#> S062.3 S062 versicolor Petal Length 4.2 -#> S063.3 S063 versicolor Petal Length 4.0 -#> S064.3 S064 versicolor Petal Length 4.7 -#> S065.3 S065 versicolor Petal Length 3.6 -#> S066.3 S066 versicolor Petal Length 4.4 -#> S067.3 S067 versicolor Petal Length 4.5 -#> S068.3 S068 versicolor Petal Length 4.1 -#> S069.3 S069 versicolor Petal Length 4.5 -#> S070.3 S070 versicolor Petal Length 3.9 -#> S071.3 S071 versicolor Petal Length 4.8 -#> S072.3 S072 versicolor Petal Length 4.0 -#> S073.3 S073 versicolor Petal Length 4.9 -#> S074.3 S074 versicolor Petal Length 4.7 -#> S075.3 S075 versicolor Petal Length 4.3 -#> S076.3 S076 versicolor Petal Length 4.4 -#> S077.3 S077 versicolor Petal Length 4.8 -#> S078.3 S078 versicolor Petal Length 5.0 -#> S079.3 S079 versicolor Petal Length 4.5 -#> S080.3 S080 versicolor Petal Length 3.5 -#> S081.3 S081 versicolor Petal Length 3.8 -#> S082.3 S082 versicolor Petal Length 3.7 -#> S083.3 S083 versicolor Petal Length 3.9 -#> S084.3 S084 versicolor Petal Length 5.1 -#> S085.3 S085 versicolor Petal Length 4.5 -#> S086.3 S086 versicolor Petal Length 4.5 -#> S087.3 S087 versicolor Petal Length 4.7 -#> S088.3 S088 versicolor Petal Length 4.4 -#> S089.3 S089 versicolor Petal Length 4.1 -#> S090.3 S090 versicolor Petal Length 4.0 -#> S091.3 S091 versicolor Petal Length 4.4 -#> S092.3 S092 versicolor Petal Length 4.6 -#> S093.3 S093 versicolor Petal Length 4.0 -#> S094.3 S094 versicolor Petal Length 3.3 -#> S095.3 S095 versicolor Petal Length 4.2 -#> S096.3 S096 versicolor Petal Length 4.2 -#> S097.3 S097 versicolor Petal Length 4.2 -#> S098.3 S098 versicolor Petal Length 4.3 -#> S099.3 S099 versicolor Petal Length 3.0 -#> S100.3 S100 versicolor Petal Length 4.1 -#> S101.3 S101 virginica Petal Length 6.0 -#> S102.3 S102 virginica Petal Length 5.1 -#> S103.3 S103 virginica Petal Length 5.9 -#> S104.3 S104 virginica Petal Length 5.6 -#> S105.3 S105 virginica Petal Length 5.8 -#> S106.3 S106 virginica Petal Length 6.6 -#> S107.3 S107 virginica Petal Length 4.5 -#> S108.3 S108 virginica Petal Length 6.3 -#> S109.3 S109 virginica Petal Length 5.8 -#> S110.3 S110 virginica Petal Length 6.1 -#> S111.3 S111 virginica Petal Length 5.1 -#> S112.3 S112 virginica Petal Length 5.3 -#> S113.3 S113 virginica Petal Length 5.5 -#> S114.3 S114 virginica Petal Length 5.0 -#> S115.3 S115 virginica Petal Length 5.1 -#> S116.3 S116 virginica Petal Length 5.3 -#> S117.3 S117 virginica Petal Length 5.5 -#> S118.3 S118 virginica Petal Length 6.7 -#> S119.3 S119 virginica Petal Length 6.9 -#> S120.3 S120 virginica Petal Length 5.0 -#> S121.3 S121 virginica Petal Length 5.7 -#> S122.3 S122 virginica Petal Length 4.9 -#> S123.3 S123 virginica Petal Length 6.7 -#> S124.3 S124 virginica Petal Length 4.9 -#> S125.3 S125 virginica Petal Length 5.7 -#> S126.3 S126 virginica Petal Length 6.0 -#> S127.3 S127 virginica Petal Length 4.8 -#> S128.3 S128 virginica Petal Length 4.9 -#> S129.3 S129 virginica Petal Length 5.6 -#> S130.3 S130 virginica Petal Length 5.8 -#> S131.3 S131 virginica Petal Length 6.1 -#> S132.3 S132 virginica Petal Length 6.4 -#> S133.3 S133 virginica Petal Length 5.6 -#> S134.3 S134 virginica Petal Length 5.1 -#> S135.3 S135 virginica Petal Length 5.6 -#> S136.3 S136 virginica Petal Length 6.1 -#> S137.3 S137 virginica Petal Length 5.6 -#> S138.3 S138 virginica Petal Length 5.5 -#> S139.3 S139 virginica Petal Length 4.8 -#> S140.3 S140 virginica Petal Length 5.4 -#> S141.3 S141 virginica Petal Length 5.6 -#> S142.3 S142 virginica Petal Length 5.1 -#> S143.3 S143 virginica Petal Length 5.1 -#> S144.3 S144 virginica Petal Length 5.9 -#> S145.3 S145 virginica Petal Length 5.7 -#> S146.3 S146 virginica Petal Length 5.2 -#> S147.3 S147 virginica Petal Length 5.0 -#> S148.3 S148 virginica Petal Length 5.2 -#> S149.3 S149 virginica Petal Length 5.4 -#> S150.3 S150 virginica Petal Length 5.1 -#> S001.4 S001 setosa Petal Width 0.2 -#> S002.4 S002 setosa Petal Width 0.2 -#> S003.4 S003 setosa Petal Width 0.2 -#> S004.4 S004 setosa Petal Width 0.2 -#> S005.4 S005 setosa Petal Width 0.2 -#> S006.4 S006 setosa Petal Width 0.4 -#> S007.4 S007 setosa Petal Width 0.3 -#> S008.4 S008 setosa Petal Width 0.2 -#> S009.4 S009 setosa Petal Width 0.2 -#> S010.4 S010 setosa Petal Width 0.1 -#> S011.4 S011 setosa Petal Width 0.2 -#> S012.4 S012 setosa Petal Width 0.2 -#> S013.4 S013 setosa Petal Width 0.1 -#> S014.4 S014 setosa Petal Width 0.1 -#> S015.4 S015 setosa Petal Width 0.2 -#> S016.4 S016 setosa Petal Width 0.4 -#> S017.4 S017 setosa Petal Width 0.4 -#> S018.4 S018 setosa Petal Width 0.3 -#> S019.4 S019 setosa Petal Width 0.3 -#> S020.4 S020 setosa Petal Width 0.3 -#> S021.4 S021 setosa Petal Width 0.2 -#> S022.4 S022 setosa Petal Width 0.4 -#> S023.4 S023 setosa Petal Width 0.2 -#> S024.4 S024 setosa Petal Width 0.5 -#> S025.4 S025 setosa Petal Width 0.2 -#> S026.4 S026 setosa Petal Width 0.2 -#> S027.4 S027 setosa Petal Width 0.4 -#> S028.4 S028 setosa Petal Width 0.2 -#> S029.4 S029 setosa Petal Width 0.2 -#> S030.4 S030 setosa Petal Width 0.2 -#> S031.4 S031 setosa Petal Width 0.2 -#> S032.4 S032 setosa Petal Width 0.4 -#> S033.4 S033 setosa Petal Width 0.1 -#> S034.4 S034 setosa Petal Width 0.2 -#> S035.4 S035 setosa Petal Width 0.2 -#> S036.4 S036 setosa Petal Width 0.2 -#> S037.4 S037 setosa Petal Width 0.2 -#> S038.4 S038 setosa Petal Width 0.1 -#> S039.4 S039 setosa Petal Width 0.2 -#> S040.4 S040 setosa Petal Width 0.2 -#> S041.4 S041 setosa Petal Width 0.3 -#> S042.4 S042 setosa Petal Width 0.3 -#> S043.4 S043 setosa Petal Width 0.2 -#> S044.4 S044 setosa Petal Width 0.6 -#> S045.4 S045 setosa Petal Width 0.4 -#> S046.4 S046 setosa Petal Width 0.3 -#> S047.4 S047 setosa Petal Width 0.2 -#> S048.4 S048 setosa Petal Width 0.2 -#> S049.4 S049 setosa Petal Width 0.2 -#> S050.4 S050 setosa Petal Width 0.2 -#> S051.4 S051 versicolor Petal Width 1.4 -#> S052.4 S052 versicolor Petal Width 1.5 -#> S053.4 S053 versicolor Petal Width 1.5 -#> S054.4 S054 versicolor Petal Width 1.3 -#> S055.4 S055 versicolor Petal Width 1.5 -#> S056.4 S056 versicolor Petal Width 1.3 -#> S057.4 S057 versicolor Petal Width 1.6 -#> S058.4 S058 versicolor Petal Width 1.0 -#> S059.4 S059 versicolor Petal Width 1.3 -#> S060.4 S060 versicolor Petal Width 1.4 -#> S061.4 S061 versicolor Petal Width 1.0 -#> S062.4 S062 versicolor Petal Width 1.5 -#> S063.4 S063 versicolor Petal Width 1.0 -#> S064.4 S064 versicolor Petal Width 1.4 -#> S065.4 S065 versicolor Petal Width 1.3 -#> S066.4 S066 versicolor Petal Width 1.4 -#> S067.4 S067 versicolor Petal Width 1.5 -#> S068.4 S068 versicolor Petal Width 1.0 -#> S069.4 S069 versicolor Petal Width 1.5 -#> S070.4 S070 versicolor Petal Width 1.1 -#> S071.4 S071 versicolor Petal Width 1.8 -#> S072.4 S072 versicolor Petal Width 1.3 -#> S073.4 S073 versicolor Petal Width 1.5 -#> S074.4 S074 versicolor Petal Width 1.2 -#> S075.4 S075 versicolor Petal Width 1.3 -#> S076.4 S076 versicolor Petal Width 1.4 -#> S077.4 S077 versicolor Petal Width 1.4 -#> S078.4 S078 versicolor Petal Width 1.7 -#> S079.4 S079 versicolor Petal Width 1.5 -#> S080.4 S080 versicolor Petal Width 1.0 -#> S081.4 S081 versicolor Petal Width 1.1 -#> S082.4 S082 versicolor Petal Width 1.0 -#> S083.4 S083 versicolor Petal Width 1.2 -#> S084.4 S084 versicolor Petal Width 1.6 -#> S085.4 S085 versicolor Petal Width 1.5 -#> S086.4 S086 versicolor Petal Width 1.6 -#> S087.4 S087 versicolor Petal Width 1.5 -#> S088.4 S088 versicolor Petal Width 1.3 -#> S089.4 S089 versicolor Petal Width 1.3 -#> S090.4 S090 versicolor Petal Width 1.3 -#> S091.4 S091 versicolor Petal Width 1.2 -#> S092.4 S092 versicolor Petal Width 1.4 -#> S093.4 S093 versicolor Petal Width 1.2 -#> S094.4 S094 versicolor Petal Width 1.0 -#> S095.4 S095 versicolor Petal Width 1.3 -#> S096.4 S096 versicolor Petal Width 1.2 -#> S097.4 S097 versicolor Petal Width 1.3 -#> S098.4 S098 versicolor Petal Width 1.3 -#> S099.4 S099 versicolor Petal Width 1.1 -#> S100.4 S100 versicolor Petal Width 1.3 -#> S101.4 S101 virginica Petal Width 2.5 -#> S102.4 S102 virginica Petal Width 1.9 -#> S103.4 S103 virginica Petal Width 2.1 -#> S104.4 S104 virginica Petal Width 1.8 -#> S105.4 S105 virginica Petal Width 2.2 -#> S106.4 S106 virginica Petal Width 2.1 -#> S107.4 S107 virginica Petal Width 1.7 -#> S108.4 S108 virginica Petal Width 1.8 -#> S109.4 S109 virginica Petal Width 1.8 -#> S110.4 S110 virginica Petal Width 2.5 -#> S111.4 S111 virginica Petal Width 2.0 -#> S112.4 S112 virginica Petal Width 1.9 -#> S113.4 S113 virginica Petal Width 2.1 -#> S114.4 S114 virginica Petal Width 2.0 -#> S115.4 S115 virginica Petal Width 2.4 -#> S116.4 S116 virginica Petal Width 2.3 -#> S117.4 S117 virginica Petal Width 1.8 -#> S118.4 S118 virginica Petal Width 2.2 -#> S119.4 S119 virginica Petal Width 2.3 -#> S120.4 S120 virginica Petal Width 1.5 -#> S121.4 S121 virginica Petal Width 2.3 -#> S122.4 S122 virginica Petal Width 2.0 -#> S123.4 S123 virginica Petal Width 2.0 -#> S124.4 S124 virginica Petal Width 1.8 -#> S125.4 S125 virginica Petal Width 2.1 -#> S126.4 S126 virginica Petal Width 1.8 -#> S127.4 S127 virginica Petal Width 1.8 -#> S128.4 S128 virginica Petal Width 1.8 -#> S129.4 S129 virginica Petal Width 2.1 -#> S130.4 S130 virginica Petal Width 1.6 -#> S131.4 S131 virginica Petal Width 1.9 -#> S132.4 S132 virginica Petal Width 2.0 -#> S133.4 S133 virginica Petal Width 2.2 -#> S134.4 S134 virginica Petal Width 1.5 -#> S135.4 S135 virginica Petal Width 1.4 -#> S136.4 S136 virginica Petal Width 2.3 -#> S137.4 S137 virginica Petal Width 2.4 -#> S138.4 S138 virginica Petal Width 1.8 -#> S139.4 S139 virginica Petal Width 1.8 -#> S140.4 S140 virginica Petal Width 2.1 -#> S141.4 S141 virginica Petal Width 2.4 -#> S142.4 S142 virginica Petal Width 2.3 -#> S143.4 S143 virginica Petal Width 1.9 -#> S144.4 S144 virginica Petal Width 2.3 -#> S145.4 S145 virginica Petal Width 2.5 -#> S146.4 S146 virginica Petal Width 2.3 -#> S147.4 S147 virginica Petal Width 1.9 -#> S148.4 S148 virginica Petal Width 2.0 -#> S149.4 S149 virginica Petal Width 2.3 -#> S150.4 S150 virginica Petal Width 1.8
    +
    #> id Species Feature Measure y +#> 1 S001 setosa Sepal Length 5.1 +#> 2 S002 setosa Sepal Length 4.9 +#> 3 S003 setosa Sepal Length 4.7 +#> 4 S004 setosa Sepal Length 4.6 +#> 5 S005 setosa Sepal Length 5.0 +#> 6 S006 setosa Sepal Length 5.4 +#> 7 S007 setosa Sepal Length 4.6 +#> 8 S008 setosa Sepal Length 5.0 +#> 9 S009 setosa Sepal Length 4.4 +#> 10 S010 setosa Sepal Length 4.9 +#> 11 S011 setosa Sepal Length 5.4 +#> 12 S012 setosa Sepal Length 4.8 +#> 13 S013 setosa Sepal Length 4.8 +#> 14 S014 setosa Sepal Length 4.3 +#> 15 S015 setosa Sepal Length 5.8 +#> 16 S016 setosa Sepal Length 5.7 +#> 17 S017 setosa Sepal Length 5.4 +#> 18 S018 setosa Sepal Length 5.1 +#> 19 S019 setosa Sepal Length 5.7 +#> 20 S020 setosa Sepal Length 5.1 +#> 21 S021 setosa Sepal Length 5.4 +#> 22 S022 setosa Sepal Length 5.1 +#> 23 S023 setosa Sepal Length 4.6 +#> 24 S024 setosa Sepal Length 5.1 +#> 25 S025 setosa Sepal Length 4.8 +#> 26 S026 setosa Sepal Length 5.0 +#> 27 S027 setosa Sepal Length 5.0 +#> 28 S028 setosa Sepal Length 5.2 +#> 29 S029 setosa Sepal Length 5.2 +#> 30 S030 setosa Sepal Length 4.7 +#> 31 S031 setosa Sepal Length 4.8 +#> 32 S032 setosa Sepal Length 5.4 +#> 33 S033 setosa Sepal Length 5.2 +#> 34 S034 setosa Sepal Length 5.5 +#> 35 S035 setosa Sepal Length 4.9 +#> 36 S036 setosa Sepal Length 5.0 +#> 37 S037 setosa Sepal Length 5.5 +#> 38 S038 setosa Sepal Length 4.9 +#> 39 S039 setosa Sepal Length 4.4 +#> 40 S040 setosa Sepal Length 5.1 +#> 41 S041 setosa Sepal Length 5.0 +#> 42 S042 setosa Sepal Length 4.5 +#> 43 S043 setosa Sepal Length 4.4 +#> 44 S044 setosa Sepal Length 5.0 +#> 45 S045 setosa Sepal Length 5.1 +#> 46 S046 setosa Sepal Length 4.8 +#> 47 S047 setosa Sepal Length 5.1 +#> 48 S048 setosa Sepal Length 4.6 +#> 49 S049 setosa Sepal Length 5.3 +#> 50 S050 setosa Sepal Length 5.0 +#> 51 S051 versicolor Sepal Length 7.0 +#> 52 S052 versicolor Sepal Length 6.4 +#> 53 S053 versicolor Sepal Length 6.9 +#> 54 S054 versicolor Sepal Length 5.5 +#> 55 S055 versicolor Sepal Length 6.5 +#> 56 S056 versicolor Sepal Length 5.7 +#> 57 S057 versicolor Sepal Length 6.3 +#> 58 S058 versicolor Sepal Length 4.9 +#> 59 S059 versicolor Sepal Length 6.6 +#> 60 S060 versicolor Sepal Length 5.2 +#> 61 S061 versicolor Sepal Length 5.0 +#> 62 S062 versicolor Sepal Length 5.9 +#> 63 S063 versicolor Sepal Length 6.0 +#> 64 S064 versicolor Sepal Length 6.1 +#> 65 S065 versicolor Sepal Length 5.6 +#> 66 S066 versicolor Sepal Length 6.7 +#> 67 S067 versicolor Sepal Length 5.6 +#> 68 S068 versicolor Sepal Length 5.8 +#> 69 S069 versicolor Sepal Length 6.2 +#> 70 S070 versicolor Sepal Length 5.6 +#> 71 S071 versicolor Sepal Length 5.9 +#> 72 S072 versicolor Sepal Length 6.1 +#> 73 S073 versicolor Sepal Length 6.3 +#> 74 S074 versicolor Sepal Length 6.1 +#> 75 S075 versicolor Sepal Length 6.4 +#> 76 S076 versicolor Sepal Length 6.6 +#> 77 S077 versicolor Sepal Length 6.8 +#> 78 S078 versicolor Sepal Length 6.7 +#> 79 S079 versicolor Sepal Length 6.0 +#> 80 S080 versicolor Sepal Length 5.7 +#> 81 S081 versicolor Sepal Length 5.5 +#> 82 S082 versicolor Sepal Length 5.5 +#> 83 S083 versicolor Sepal Length 5.8 +#> 84 S084 versicolor Sepal Length 6.0 +#> 85 S085 versicolor Sepal Length 5.4 +#> 86 S086 versicolor Sepal Length 6.0 +#> 87 S087 versicolor Sepal Length 6.7 +#> 88 S088 versicolor Sepal Length 6.3 +#> 89 S089 versicolor Sepal Length 5.6 +#> 90 S090 versicolor Sepal Length 5.5 +#> 91 S091 versicolor Sepal Length 5.5 +#> 92 S092 versicolor Sepal Length 6.1 +#> 93 S093 versicolor Sepal Length 5.8 +#> 94 S094 versicolor Sepal Length 5.0 +#> 95 S095 versicolor Sepal Length 5.6 +#> 96 S096 versicolor Sepal Length 5.7 +#> 97 S097 versicolor Sepal Length 5.7 +#> 98 S098 versicolor Sepal Length 6.2 +#> 99 S099 versicolor Sepal Length 5.1 +#> 100 S100 versicolor Sepal Length 5.7 +#> 101 S101 virginica Sepal Length 6.3 +#> 102 S102 virginica Sepal Length 5.8 +#> 103 S103 virginica Sepal Length 7.1 +#> 104 S104 virginica Sepal Length 6.3 +#> 105 S105 virginica Sepal Length 6.5 +#> 106 S106 virginica Sepal Length 7.6 +#> 107 S107 virginica Sepal Length 4.9 +#> 108 S108 virginica Sepal Length 7.3 +#> 109 S109 virginica Sepal Length 6.7 +#> 110 S110 virginica Sepal Length 7.2 +#> 111 S111 virginica Sepal Length 6.5 +#> 112 S112 virginica Sepal Length 6.4 +#> 113 S113 virginica Sepal Length 6.8 +#> 114 S114 virginica Sepal Length 5.7 +#> 115 S115 virginica Sepal Length 5.8 +#> 116 S116 virginica Sepal Length 6.4 +#> 117 S117 virginica Sepal Length 6.5 +#> 118 S118 virginica Sepal Length 7.7 +#> 119 S119 virginica Sepal Length 7.7 +#> 120 S120 virginica Sepal Length 6.0 +#> 121 S121 virginica Sepal Length 6.9 +#> 122 S122 virginica Sepal Length 5.6 +#> 123 S123 virginica Sepal Length 7.7 +#> 124 S124 virginica Sepal Length 6.3 +#> 125 S125 virginica Sepal Length 6.7 +#> 126 S126 virginica Sepal Length 7.2 +#> 127 S127 virginica Sepal Length 6.2 +#> 128 S128 virginica Sepal Length 6.1 +#> 129 S129 virginica Sepal Length 6.4 +#> 130 S130 virginica Sepal Length 7.2 +#> 131 S131 virginica Sepal Length 7.4 +#> 132 S132 virginica Sepal Length 7.9 +#> 133 S133 virginica Sepal Length 6.4 +#> 134 S134 virginica Sepal Length 6.3 +#> 135 S135 virginica Sepal Length 6.1 +#> 136 S136 virginica Sepal Length 7.7 +#> 137 S137 virginica Sepal Length 6.3 +#> 138 S138 virginica Sepal Length 6.4 +#> 139 S139 virginica Sepal Length 6.0 +#> 140 S140 virginica Sepal Length 6.9 +#> 141 S141 virginica Sepal Length 6.7 +#> 142 S142 virginica Sepal Length 6.9 +#> 143 S143 virginica Sepal Length 5.8 +#> 144 S144 virginica Sepal Length 6.8 +#> 145 S145 virginica Sepal Length 6.7 +#> 146 S146 virginica Sepal Length 6.7 +#> 147 S147 virginica Sepal Length 6.3 +#> 148 S148 virginica Sepal Length 6.5 +#> 149 S149 virginica Sepal Length 6.2 +#> 150 S150 virginica Sepal Length 5.9 +#> 151 S001 setosa Sepal Width 3.5 +#> 152 S002 setosa Sepal Width 3.0 +#> 153 S003 setosa Sepal Width 3.2 +#> 154 S004 setosa Sepal Width 3.1 +#> 155 S005 setosa Sepal Width 3.6 +#> 156 S006 setosa Sepal Width 3.9 +#> 157 S007 setosa Sepal Width 3.4 +#> 158 S008 setosa Sepal Width 3.4 +#> 159 S009 setosa Sepal Width 2.9 +#> 160 S010 setosa Sepal Width 3.1 +#> 161 S011 setosa Sepal Width 3.7 +#> 162 S012 setosa Sepal Width 3.4 +#> 163 S013 setosa Sepal Width 3.0 +#> 164 S014 setosa Sepal Width 3.0 +#> 165 S015 setosa Sepal Width 4.0 +#> 166 S016 setosa Sepal Width 4.4 +#> 167 S017 setosa Sepal Width 3.9 +#> 168 S018 setosa Sepal Width 3.5 +#> 169 S019 setosa Sepal Width 3.8 +#> 170 S020 setosa Sepal Width 3.8 +#> 171 S021 setosa Sepal Width 3.4 +#> 172 S022 setosa Sepal Width 3.7 +#> 173 S023 setosa Sepal Width 3.6 +#> 174 S024 setosa Sepal Width 3.3 +#> 175 S025 setosa Sepal Width 3.4 +#> 176 S026 setosa Sepal Width 3.0 +#> 177 S027 setosa Sepal Width 3.4 +#> 178 S028 setosa Sepal Width 3.5 +#> 179 S029 setosa Sepal Width 3.4 +#> 180 S030 setosa Sepal Width 3.2 +#> 181 S031 setosa Sepal Width 3.1 +#> 182 S032 setosa Sepal Width 3.4 +#> 183 S033 setosa Sepal Width 4.1 +#> 184 S034 setosa Sepal Width 4.2 +#> 185 S035 setosa Sepal Width 3.1 +#> 186 S036 setosa Sepal Width 3.2 +#> 187 S037 setosa Sepal Width 3.5 +#> 188 S038 setosa Sepal Width 3.6 +#> 189 S039 setosa Sepal Width 3.0 +#> 190 S040 setosa Sepal Width 3.4 +#> 191 S041 setosa Sepal Width 3.5 +#> 192 S042 setosa Sepal Width 2.3 +#> 193 S043 setosa Sepal Width 3.2 +#> 194 S044 setosa Sepal Width 3.5 +#> 195 S045 setosa Sepal Width 3.8 +#> 196 S046 setosa Sepal Width 3.0 +#> 197 S047 setosa Sepal Width 3.8 +#> 198 S048 setosa Sepal Width 3.2 +#> 199 S049 setosa Sepal Width 3.7 +#> 200 S050 setosa Sepal Width 3.3 +#> 201 S051 versicolor Sepal Width 3.2 +#> 202 S052 versicolor Sepal Width 3.2 +#> 203 S053 versicolor Sepal Width 3.1 +#> 204 S054 versicolor Sepal Width 2.3 +#> 205 S055 versicolor Sepal Width 2.8 +#> 206 S056 versicolor Sepal Width 2.8 +#> 207 S057 versicolor Sepal Width 3.3 +#> 208 S058 versicolor Sepal Width 2.4 +#> 209 S059 versicolor Sepal Width 2.9 +#> 210 S060 versicolor Sepal Width 2.7 +#> 211 S061 versicolor Sepal Width 2.0 +#> 212 S062 versicolor Sepal Width 3.0 +#> 213 S063 versicolor Sepal Width 2.2 +#> 214 S064 versicolor Sepal Width 2.9 +#> 215 S065 versicolor Sepal Width 2.9 +#> 216 S066 versicolor Sepal Width 3.1 +#> 217 S067 versicolor Sepal Width 3.0 +#> 218 S068 versicolor Sepal Width 2.7 +#> 219 S069 versicolor Sepal Width 2.2 +#> 220 S070 versicolor Sepal Width 2.5 +#> 221 S071 versicolor Sepal Width 3.2 +#> 222 S072 versicolor Sepal Width 2.8 +#> 223 S073 versicolor Sepal Width 2.5 +#> 224 S074 versicolor Sepal Width 2.8 +#> 225 S075 versicolor Sepal Width 2.9 +#> 226 S076 versicolor Sepal Width 3.0 +#> 227 S077 versicolor Sepal Width 2.8 +#> 228 S078 versicolor Sepal Width 3.0 +#> 229 S079 versicolor Sepal Width 2.9 +#> 230 S080 versicolor Sepal Width 2.6 +#> 231 S081 versicolor Sepal Width 2.4 +#> 232 S082 versicolor Sepal Width 2.4 +#> 233 S083 versicolor Sepal Width 2.7 +#> 234 S084 versicolor Sepal Width 2.7 +#> 235 S085 versicolor Sepal Width 3.0 +#> 236 S086 versicolor Sepal Width 3.4 +#> 237 S087 versicolor Sepal Width 3.1 +#> 238 S088 versicolor Sepal Width 2.3 +#> 239 S089 versicolor Sepal Width 3.0 +#> 240 S090 versicolor Sepal Width 2.5 +#> 241 S091 versicolor Sepal Width 2.6 +#> 242 S092 versicolor Sepal Width 3.0 +#> 243 S093 versicolor Sepal Width 2.6 +#> 244 S094 versicolor Sepal Width 2.3 +#> 245 S095 versicolor Sepal Width 2.7 +#> 246 S096 versicolor Sepal Width 3.0 +#> 247 S097 versicolor Sepal Width 2.9 +#> 248 S098 versicolor Sepal Width 2.9 +#> 249 S099 versicolor Sepal Width 2.5 +#> 250 S100 versicolor Sepal Width 2.8 +#> 251 S101 virginica Sepal Width 3.3 +#> 252 S102 virginica Sepal Width 2.7 +#> 253 S103 virginica Sepal Width 3.0 +#> 254 S104 virginica Sepal Width 2.9 +#> 255 S105 virginica Sepal Width 3.0 +#> 256 S106 virginica Sepal Width 3.0 +#> 257 S107 virginica Sepal Width 2.5 +#> 258 S108 virginica Sepal Width 2.9 +#> 259 S109 virginica Sepal Width 2.5 +#> 260 S110 virginica Sepal Width 3.6 +#> 261 S111 virginica Sepal Width 3.2 +#> 262 S112 virginica Sepal Width 2.7 +#> 263 S113 virginica Sepal Width 3.0 +#> 264 S114 virginica Sepal Width 2.5 +#> 265 S115 virginica Sepal Width 2.8 +#> 266 S116 virginica Sepal Width 3.2 +#> 267 S117 virginica Sepal Width 3.0 +#> 268 S118 virginica Sepal Width 3.8 +#> 269 S119 virginica Sepal Width 2.6 +#> 270 S120 virginica Sepal Width 2.2 +#> 271 S121 virginica Sepal Width 3.2 +#> 272 S122 virginica Sepal Width 2.8 +#> 273 S123 virginica Sepal Width 2.8 +#> 274 S124 virginica Sepal Width 2.7 +#> 275 S125 virginica Sepal Width 3.3 +#> 276 S126 virginica Sepal Width 3.2 +#> 277 S127 virginica Sepal Width 2.8 +#> 278 S128 virginica Sepal Width 3.0 +#> 279 S129 virginica Sepal Width 2.8 +#> 280 S130 virginica Sepal Width 3.0 +#> 281 S131 virginica Sepal Width 2.8 +#> 282 S132 virginica Sepal Width 3.8 +#> 283 S133 virginica Sepal Width 2.8 +#> 284 S134 virginica Sepal Width 2.8 +#> 285 S135 virginica Sepal Width 2.6 +#> 286 S136 virginica Sepal Width 3.0 +#> 287 S137 virginica Sepal Width 3.4 +#> 288 S138 virginica Sepal Width 3.1 +#> 289 S139 virginica Sepal Width 3.0 +#> 290 S140 virginica Sepal Width 3.1 +#> 291 S141 virginica Sepal Width 3.1 +#> 292 S142 virginica Sepal Width 3.1 +#> 293 S143 virginica Sepal Width 2.7 +#> 294 S144 virginica Sepal Width 3.2 +#> 295 S145 virginica Sepal Width 3.3 +#> 296 S146 virginica Sepal Width 3.0 +#> 297 S147 virginica Sepal Width 2.5 +#> 298 S148 virginica Sepal Width 3.0 +#> 299 S149 virginica Sepal Width 3.4 +#> 300 S150 virginica Sepal Width 3.0 +#> 301 S001 setosa Petal Length 1.4 +#> 302 S002 setosa Petal Length 1.4 +#> 303 S003 setosa Petal Length 1.3 +#> 304 S004 setosa Petal Length 1.5 +#> 305 S005 setosa Petal Length 1.4 +#> 306 S006 setosa Petal Length 1.7 +#> 307 S007 setosa Petal Length 1.4 +#> 308 S008 setosa Petal Length 1.5 +#> 309 S009 setosa Petal Length 1.4 +#> 310 S010 setosa Petal Length 1.5 +#> 311 S011 setosa Petal Length 1.5 +#> 312 S012 setosa Petal Length 1.6 +#> 313 S013 setosa Petal Length 1.4 +#> 314 S014 setosa Petal Length 1.1 +#> 315 S015 setosa Petal Length 1.2 +#> 316 S016 setosa Petal Length 1.5 +#> 317 S017 setosa Petal Length 1.3 +#> 318 S018 setosa Petal Length 1.4 +#> 319 S019 setosa Petal Length 1.7 +#> 320 S020 setosa Petal Length 1.5 +#> 321 S021 setosa Petal Length 1.7 +#> 322 S022 setosa Petal Length 1.5 +#> 323 S023 setosa Petal Length 1.0 +#> 324 S024 setosa Petal Length 1.7 +#> 325 S025 setosa Petal Length 1.9 +#> 326 S026 setosa Petal Length 1.6 +#> 327 S027 setosa Petal Length 1.6 +#> 328 S028 setosa Petal Length 1.5 +#> 329 S029 setosa Petal Length 1.4 +#> 330 S030 setosa Petal Length 1.6 +#> 331 S031 setosa Petal Length 1.6 +#> 332 S032 setosa Petal Length 1.5 +#> 333 S033 setosa Petal Length 1.5 +#> 334 S034 setosa Petal Length 1.4 +#> 335 S035 setosa Petal Length 1.5 +#> 336 S036 setosa Petal Length 1.2 +#> 337 S037 setosa Petal Length 1.3 +#> 338 S038 setosa Petal Length 1.4 +#> 339 S039 setosa Petal Length 1.3 +#> 340 S040 setosa Petal Length 1.5 +#> 341 S041 setosa Petal Length 1.3 +#> 342 S042 setosa Petal Length 1.3 +#> 343 S043 setosa Petal Length 1.3 +#> 344 S044 setosa Petal Length 1.6 +#> 345 S045 setosa Petal Length 1.9 +#> 346 S046 setosa Petal Length 1.4 +#> 347 S047 setosa Petal Length 1.6 +#> 348 S048 setosa Petal Length 1.4 +#> 349 S049 setosa Petal Length 1.5 +#> 350 S050 setosa Petal Length 1.4 +#> 351 S051 versicolor Petal Length 4.7 +#> 352 S052 versicolor Petal Length 4.5 +#> 353 S053 versicolor Petal Length 4.9 +#> 354 S054 versicolor Petal Length 4.0 +#> 355 S055 versicolor Petal Length 4.6 +#> 356 S056 versicolor Petal Length 4.5 +#> 357 S057 versicolor Petal Length 4.7 +#> 358 S058 versicolor Petal Length 3.3 +#> 359 S059 versicolor Petal Length 4.6 +#> 360 S060 versicolor Petal Length 3.9 +#> 361 S061 versicolor Petal Length 3.5 +#> 362 S062 versicolor Petal Length 4.2 +#> 363 S063 versicolor Petal Length 4.0 +#> 364 S064 versicolor Petal Length 4.7 +#> 365 S065 versicolor Petal Length 3.6 +#> 366 S066 versicolor Petal Length 4.4 +#> 367 S067 versicolor Petal Length 4.5 +#> 368 S068 versicolor Petal Length 4.1 +#> 369 S069 versicolor Petal Length 4.5 +#> 370 S070 versicolor Petal Length 3.9 +#> 371 S071 versicolor Petal Length 4.8 +#> 372 S072 versicolor Petal Length 4.0 +#> 373 S073 versicolor Petal Length 4.9 +#> 374 S074 versicolor Petal Length 4.7 +#> 375 S075 versicolor Petal Length 4.3 +#> 376 S076 versicolor Petal Length 4.4 +#> 377 S077 versicolor Petal Length 4.8 +#> 378 S078 versicolor Petal Length 5.0 +#> 379 S079 versicolor Petal Length 4.5 +#> 380 S080 versicolor Petal Length 3.5 +#> 381 S081 versicolor Petal Length 3.8 +#> 382 S082 versicolor Petal Length 3.7 +#> 383 S083 versicolor Petal Length 3.9 +#> 384 S084 versicolor Petal Length 5.1 +#> 385 S085 versicolor Petal Length 4.5 +#> 386 S086 versicolor Petal Length 4.5 +#> 387 S087 versicolor Petal Length 4.7 +#> 388 S088 versicolor Petal Length 4.4 +#> 389 S089 versicolor Petal Length 4.1 +#> 390 S090 versicolor Petal Length 4.0 +#> 391 S091 versicolor Petal Length 4.4 +#> 392 S092 versicolor Petal Length 4.6 +#> 393 S093 versicolor Petal Length 4.0 +#> 394 S094 versicolor Petal Length 3.3 +#> 395 S095 versicolor Petal Length 4.2 +#> 396 S096 versicolor Petal Length 4.2 +#> 397 S097 versicolor Petal Length 4.2 +#> 398 S098 versicolor Petal Length 4.3 +#> 399 S099 versicolor Petal Length 3.0 +#> 400 S100 versicolor Petal Length 4.1 +#> 401 S101 virginica Petal Length 6.0 +#> 402 S102 virginica Petal Length 5.1 +#> 403 S103 virginica Petal Length 5.9 +#> 404 S104 virginica Petal Length 5.6 +#> 405 S105 virginica Petal Length 5.8 +#> 406 S106 virginica Petal Length 6.6 +#> 407 S107 virginica Petal Length 4.5 +#> 408 S108 virginica Petal Length 6.3 +#> 409 S109 virginica Petal Length 5.8 +#> 410 S110 virginica Petal Length 6.1 +#> 411 S111 virginica Petal Length 5.1 +#> 412 S112 virginica Petal Length 5.3 +#> 413 S113 virginica Petal Length 5.5 +#> 414 S114 virginica Petal Length 5.0 +#> 415 S115 virginica Petal Length 5.1 +#> 416 S116 virginica Petal Length 5.3 +#> 417 S117 virginica Petal Length 5.5 +#> 418 S118 virginica Petal Length 6.7 +#> 419 S119 virginica Petal Length 6.9 +#> 420 S120 virginica Petal Length 5.0 +#> 421 S121 virginica Petal Length 5.7 +#> 422 S122 virginica Petal Length 4.9 +#> 423 S123 virginica Petal Length 6.7 +#> 424 S124 virginica Petal Length 4.9 +#> 425 S125 virginica Petal Length 5.7 +#> 426 S126 virginica Petal Length 6.0 +#> 427 S127 virginica Petal Length 4.8 +#> 428 S128 virginica Petal Length 4.9 +#> 429 S129 virginica Petal Length 5.6 +#> 430 S130 virginica Petal Length 5.8 +#> 431 S131 virginica Petal Length 6.1 +#> 432 S132 virginica Petal Length 6.4 +#> 433 S133 virginica Petal Length 5.6 +#> 434 S134 virginica Petal Length 5.1 +#> 435 S135 virginica Petal Length 5.6 +#> 436 S136 virginica Petal Length 6.1 +#> 437 S137 virginica Petal Length 5.6 +#> 438 S138 virginica Petal Length 5.5 +#> 439 S139 virginica Petal Length 4.8 +#> 440 S140 virginica Petal Length 5.4 +#> 441 S141 virginica Petal Length 5.6 +#> 442 S142 virginica Petal Length 5.1 +#> 443 S143 virginica Petal Length 5.1 +#> 444 S144 virginica Petal Length 5.9 +#> 445 S145 virginica Petal Length 5.7 +#> 446 S146 virginica Petal Length 5.2 +#> 447 S147 virginica Petal Length 5.0 +#> 448 S148 virginica Petal Length 5.2 +#> 449 S149 virginica Petal Length 5.4 +#> 450 S150 virginica Petal Length 5.1 +#> 451 S001 setosa Petal Width 0.2 +#> 452 S002 setosa Petal Width 0.2 +#> 453 S003 setosa Petal Width 0.2 +#> 454 S004 setosa Petal Width 0.2 +#> 455 S005 setosa Petal Width 0.2 +#> 456 S006 setosa Petal Width 0.4 +#> 457 S007 setosa Petal Width 0.3 +#> 458 S008 setosa Petal Width 0.2 +#> 459 S009 setosa Petal Width 0.2 +#> 460 S010 setosa Petal Width 0.1 +#> 461 S011 setosa Petal Width 0.2 +#> 462 S012 setosa Petal Width 0.2 +#> 463 S013 setosa Petal Width 0.1 +#> 464 S014 setosa Petal Width 0.1 +#> 465 S015 setosa Petal Width 0.2 +#> 466 S016 setosa Petal Width 0.4 +#> 467 S017 setosa Petal Width 0.4 +#> 468 S018 setosa Petal Width 0.3 +#> 469 S019 setosa Petal Width 0.3 +#> 470 S020 setosa Petal Width 0.3 +#> 471 S021 setosa Petal Width 0.2 +#> 472 S022 setosa Petal Width 0.4 +#> 473 S023 setosa Petal Width 0.2 +#> 474 S024 setosa Petal Width 0.5 +#> 475 S025 setosa Petal Width 0.2 +#> 476 S026 setosa Petal Width 0.2 +#> 477 S027 setosa Petal Width 0.4 +#> 478 S028 setosa Petal Width 0.2 +#> 479 S029 setosa Petal Width 0.2 +#> 480 S030 setosa Petal Width 0.2 +#> 481 S031 setosa Petal Width 0.2 +#> 482 S032 setosa Petal Width 0.4 +#> 483 S033 setosa Petal Width 0.1 +#> 484 S034 setosa Petal Width 0.2 +#> 485 S035 setosa Petal Width 0.2 +#> 486 S036 setosa Petal Width 0.2 +#> 487 S037 setosa Petal Width 0.2 +#> 488 S038 setosa Petal Width 0.1 +#> 489 S039 setosa Petal Width 0.2 +#> 490 S040 setosa Petal Width 0.2 +#> 491 S041 setosa Petal Width 0.3 +#> 492 S042 setosa Petal Width 0.3 +#> 493 S043 setosa Petal Width 0.2 +#> 494 S044 setosa Petal Width 0.6 +#> 495 S045 setosa Petal Width 0.4 +#> 496 S046 setosa Petal Width 0.3 +#> 497 S047 setosa Petal Width 0.2 +#> 498 S048 setosa Petal Width 0.2 +#> 499 S049 setosa Petal Width 0.2 +#> 500 S050 setosa Petal Width 0.2 +#> 501 S051 versicolor Petal Width 1.4 +#> 502 S052 versicolor Petal Width 1.5 +#> 503 S053 versicolor Petal Width 1.5 +#> 504 S054 versicolor Petal Width 1.3 +#> 505 S055 versicolor Petal Width 1.5 +#> 506 S056 versicolor Petal Width 1.3 +#> 507 S057 versicolor Petal Width 1.6 +#> 508 S058 versicolor Petal Width 1.0 +#> 509 S059 versicolor Petal Width 1.3 +#> 510 S060 versicolor Petal Width 1.4 +#> 511 S061 versicolor Petal Width 1.0 +#> 512 S062 versicolor Petal Width 1.5 +#> 513 S063 versicolor Petal Width 1.0 +#> 514 S064 versicolor Petal Width 1.4 +#> 515 S065 versicolor Petal Width 1.3 +#> 516 S066 versicolor Petal Width 1.4 +#> 517 S067 versicolor Petal Width 1.5 +#> 518 S068 versicolor Petal Width 1.0 +#> 519 S069 versicolor Petal Width 1.5 +#> 520 S070 versicolor Petal Width 1.1 +#> 521 S071 versicolor Petal Width 1.8 +#> 522 S072 versicolor Petal Width 1.3 +#> 523 S073 versicolor Petal Width 1.5 +#> 524 S074 versicolor Petal Width 1.2 +#> 525 S075 versicolor Petal Width 1.3 +#> 526 S076 versicolor Petal Width 1.4 +#> 527 S077 versicolor Petal Width 1.4 +#> 528 S078 versicolor Petal Width 1.7 +#> 529 S079 versicolor Petal Width 1.5 +#> 530 S080 versicolor Petal Width 1.0 +#> 531 S081 versicolor Petal Width 1.1 +#> 532 S082 versicolor Petal Width 1.0 +#> 533 S083 versicolor Petal Width 1.2 +#> 534 S084 versicolor Petal Width 1.6 +#> 535 S085 versicolor Petal Width 1.5 +#> 536 S086 versicolor Petal Width 1.6 +#> 537 S087 versicolor Petal Width 1.5 +#> 538 S088 versicolor Petal Width 1.3 +#> 539 S089 versicolor Petal Width 1.3 +#> 540 S090 versicolor Petal Width 1.3 +#> 541 S091 versicolor Petal Width 1.2 +#> 542 S092 versicolor Petal Width 1.4 +#> 543 S093 versicolor Petal Width 1.2 +#> 544 S094 versicolor Petal Width 1.0 +#> 545 S095 versicolor Petal Width 1.3 +#> 546 S096 versicolor Petal Width 1.2 +#> 547 S097 versicolor Petal Width 1.3 +#> 548 S098 versicolor Petal Width 1.3 +#> 549 S099 versicolor Petal Width 1.1 +#> 550 S100 versicolor Petal Width 1.3 +#> 551 S101 virginica Petal Width 2.5 +#> 552 S102 virginica Petal Width 1.9 +#> 553 S103 virginica Petal Width 2.1 +#> 554 S104 virginica Petal Width 1.8 +#> 555 S105 virginica Petal Width 2.2 +#> 556 S106 virginica Petal Width 2.1 +#> 557 S107 virginica Petal Width 1.7 +#> 558 S108 virginica Petal Width 1.8 +#> 559 S109 virginica Petal Width 1.8 +#> 560 S110 virginica Petal Width 2.5 +#> 561 S111 virginica Petal Width 2.0 +#> 562 S112 virginica Petal Width 1.9 +#> 563 S113 virginica Petal Width 2.1 +#> 564 S114 virginica Petal Width 2.0 +#> 565 S115 virginica Petal Width 2.4 +#> 566 S116 virginica Petal Width 2.3 +#> 567 S117 virginica Petal Width 1.8 +#> 568 S118 virginica Petal Width 2.2 +#> 569 S119 virginica Petal Width 2.3 +#> 570 S120 virginica Petal Width 1.5 +#> 571 S121 virginica Petal Width 2.3 +#> 572 S122 virginica Petal Width 2.0 +#> 573 S123 virginica Petal Width 2.0 +#> 574 S124 virginica Petal Width 1.8 +#> 575 S125 virginica Petal Width 2.1 +#> 576 S126 virginica Petal Width 1.8 +#> 577 S127 virginica Petal Width 1.8 +#> 578 S128 virginica Petal Width 1.8 +#> 579 S129 virginica Petal Width 2.1 +#> 580 S130 virginica Petal Width 1.6 +#> 581 S131 virginica Petal Width 1.9 +#> 582 S132 virginica Petal Width 2.0 +#> 583 S133 virginica Petal Width 2.2 +#> 584 S134 virginica Petal Width 1.5 +#> 585 S135 virginica Petal Width 1.4 +#> 586 S136 virginica Petal Width 2.3 +#> 587 S137 virginica Petal Width 2.4 +#> 588 S138 virginica Petal Width 1.8 +#> 589 S139 virginica Petal Width 1.8 +#> 590 S140 virginica Petal Width 2.1 +#> 591 S141 virginica Petal Width 2.4 +#> 592 S142 virginica Petal Width 2.3 +#> 593 S143 virginica Petal Width 1.9 +#> 594 S144 virginica Petal Width 2.3 +#> 595 S145 virginica Petal Width 2.5 +#> 596 S146 virginica Petal Width 2.3 +#> 597 S147 virginica Petal Width 1.9 +#> 598 S148 virginica Petal Width 2.0 +#> 599 S149 virginica Petal Width 2.3 +#> 600 S150 virginica Petal Width 1.8
  • - + - + @@ -294,17 +292,17 @@

    Simulate data for a mixed design

    - + - + - +
    rep

    the number of data frames to return (default 1); if greater than 1, the returned data frame is nested by rep

    nested

    Whether to nest data frames by rep if rep > 1

    seed

    DEPRECATED use set.seed() instead before running this function

    r

    the correlations among the variables (can be a single number, full correlation matrix as a matric or vector, or a vector of the upper right triangle of the correlation matrix

    the correlations among the variables (can be a single number, full correlation matrix as a matrix or vector, or a vector of the upper right triangle of the correlation matrix

    empiricalid

    the name of the id column (defaults to id)

    vardesc

    a list of variable descriptions having the names of the within- and between-subject factors

    plot

    whether to show a plot of the design

    design

    a design list including within, between, n, mu, sd, r, dv, id

    a design list including within, between, n, mu, sd, r, dv, id, and vardesc

    rep

    the number of data frames to return (default 1); if greater than 1, the returned data frame is nested by rep

    the number of data frames to return (default 1); if greater than 1, the returned data frame is nested by rep (if nested = TRUE)

    nested

    Whether to nest data frames by rep if rep > 1

    seed
    private M6566
    private F6554
    private
    public M171186
    public F174187
    public NB48
    diff --git a/pkgdown/index.md b/pkgdown/index.md index 0737ba8b..dce47abc 100644 --- a/pkgdown/index.md +++ b/pkgdown/index.md @@ -19,21 +19,19 @@ It is useful to be able to simulate data with a specified structure. The `faux` ## Installation -You can install the released version of faux (1.0.0) from [CRAN](https://CRAN.R-project.org) with: +You can install the released version of faux from [CRAN](https://CRAN.R-project.org) with: ``` r install.packages("faux") ``` -And the development version (1.0.0.9006) from [GitHub](https://github.com/debruine/faux) with: +And the development version from [GitHub](https://github.com/debruine/faux) with: ``` r # install.packages("devtools") devtools::install_github("debruine/faux") ``` -See the [development version manual](https://debruine.github.io/faux/dev/). - ## Quick overview ### Simulate data for a factorial design @@ -103,12 +101,12 @@ data <- add_random(class = 20) %>% |school_type |gender | n| |:-----------|:------|---:| -|private |M | 65| -|private |F | 65| +|private |M | 66| +|private |F | 54| |private |NB | 1| -|public |M | 171| -|public |F | 174| -|public |NB | 4| +|public |M | 186| +|public |F | 187| +|public |NB | 8| diff --git a/pkgdown/man/figures/plot-design-1.png b/pkgdown/man/figures/plot-design-1.png index c467d03b..2ed69780 100644 Binary files a/pkgdown/man/figures/plot-design-1.png and b/pkgdown/man/figures/plot-design-1.png differ diff --git a/pkgdown/man/figures/plot-iris-sim-1.png b/pkgdown/man/figures/plot-iris-sim-1.png index 1c06395b..cc3930ff 100644 Binary files a/pkgdown/man/figures/plot-iris-sim-1.png and b/pkgdown/man/figures/plot-iris-sim-1.png differ diff --git a/vignettes/random_reports.Rmd b/vignettes/random_reports.Rmd index 561b4edf..039f73c9 100644 --- a/vignettes/random_reports.Rmd +++ b/vignettes/random_reports.Rmd @@ -17,13 +17,13 @@ knitr::opts_chunk$set( library(kableExtra) ``` -Have you ever wanted to create unique versions of datasets for each student in a class? This vignette walks through the proess of setting up a simple study with a subject table and a questionnaire table. +Have you ever wanted to create unique versions of datasets for each student in a class? This vignette walks through the process of setting up a simple study with a subject table and a questionnaire table. The subjects have varying demographic attributes and are assigned to a counterbalanced condition and version of the study. Some of the demographic data is missing. The questionnaire has a variable number of questions, answered on a 7-point Likert scale. Some of the questions are reverse-coded, indicated by the column names. There are some missing observations. -The data is set up with fixed effects for condition, version, and subject language that you can vary between students. The DV is created using a mixed effects model formula to simulate realistic random interpects and slopes, so these data would be suitable for analysis with mixed effects models, or you can instruct students to aggregate the questionnaire data to analyse with t-tests, correlations, and ANOVAs. +The data is set up with fixed effects for condition, version, and subject language that you can vary between students. The DV is created using a mixed effects model formula to simulate realistic random intercepts and slopes, so these data would be suitable for analysis with mixed effects models, or you can instruct students to aggregate the questionnaire data to analyse with single-level models. A custom assignment is created for each student, where they are told the questionnaire contains scores on one of three topics, and are asked to determine if there is an effect of one factor for a subgroup of another factor. The categories chosen here are pretty arbitrary, but you can change this to make sense for your subject area. @@ -32,10 +32,10 @@ Finally, the subject table, questionnaire table, and instructions are saved to a ## Setup -Some of the functions below currently require the development version of faux (`add_random()`, `add_between()`, `add_ranef()` and `add_contrast()`). I am working on submitting the new version to CRAN, so any feedback would be welcome. +Some of the functions below require version 1.1.0 of faux (`add_random()`, `add_between()`, `add_ranef()` and `add_contrast()`). This version has been submitted to CRAN, and is available on github. Any feedback would be welcome. ```{r setup, message=FALSE} -# devtools::install_github("debruine/faux", ref = "dev") +# devtools::install_github("debruine/faux") library(faux) library(dplyr) library(tidyr) @@ -46,17 +46,22 @@ library(glue) theme_set(theme_minimal()) ``` -Start your script by setting a seed that is unique to each student. Below is a useful pattern to generate a seed from a student ID, even if it contains letters. +Start your script by setting a seed that is unique to each student. Below is a useful function you can use to generate a seed from a student ID, even if it contains letters. ```{r} -student_id <- "8675309J" +seed_from_string <- function(seed) { + if (is.numeric(seed)) return(set.seed(seed)) + + # otherwise set from characters + seed %>% + openssl::md5() %>% # turn into something with lots of numbers + gsub("[a-z]", "", .) %>% # get rid of letters + substr(1, 8) %>% # select the first 8 numbers + set.seed() +} -student_id %>% - as.character() %>% # has to be a character string to start - openssl::md5() %>% # turn into something with lots of numbers - gsub("[a-z]", "", .) %>% # get rid of letters - substr(1, 8) %>% # select the first 8 numbers - set.seed() +student_id <- "8675309J" +seed_from_string(student_id) ``` @@ -419,9 +424,10 @@ I sample a topic from "stress", "extroversion", and "disgust". You can choose re I also sample an alpha level and power for the power calculation aspect of the assessment. This reinforces a lesson I want to teach about alpha = 0.5 and target power = 0.8 being mindless defaults that we should question. [Justify everything](https://osf.io/j4s3c/). ```{r} -factors <- sample(c("language", "condition", "version"), 2) -iv <- factors[[1]] -subset <- factors[[2]] +factors <- c("language", "condition", "version") +two_factors <- sample(factors, 2) +iv <- two_factors[[1]] +subset <- two_factors[[2]] level <- subjects[[subset]] %>% unique() %>% sample(1) topic <- sample(c("stress", "extroversion", "disgust"), 1) alpha <- sample(c(.005, .01, .05), 1) @@ -431,18 +437,40 @@ power <- sample(c(80, 85, 90), 1) This will produce the following text. ```{r} -research_question <- readLines("template_instructions.txt") %>% +instructions <- readLines("template_instructions.txt") %>% paste(collapse = "\n") %>% glue::glue() ```
    -`r research_question` +`r instructions`
    +### Instructions function + +As before, wrap this code in a function. + +```{r} +make_instructions <- function(template, + factors = c("language", "condition", "version")) { + two_factors <- sample(factors, 2) + iv <- two_factors[[1]] + subset <- two_factors[[2]] + level <- subjects[[subset]] %>% unique() %>% sample(1) + topic <- sample(c("stress", "extroversion", "disgust"), 1) + alpha <- sample(c(.005, .01, .05), 1) + power <- sample(c(80, 85, 90), 1) + + readLines(template) %>% + paste(collapse = "\n") %>% + glue::glue() +} +``` + + ## Save files Now you need to create a directory for the student's files and save the subject table, question table, and instructions. I'm saving the files in a directory that contains the student ID so I can upload them to Moodle easily. @@ -452,7 +480,7 @@ dir <- paste0("exam_", student_id) dir.create(dir, showWarnings = FALSE) readr::write_csv(subjects, file.path(dir, "subjects.csv")) readr::write_csv(questions, file.path(dir, "questions.csv")) -write(research_question, file.path(dir, "instructions.txt")) +write(instructions, file.path(dir, "instructions.txt")) ``` @@ -463,12 +491,7 @@ Once you've debugged your code above, put each step inside a function with the a ```{r function} random_project <- function(student_id) { # set seed using student ID - student_id %>% - as.character() %>% - openssl::md5() %>% - gsub("[a-z]", "", .) %>% - substr(1, 8) %>% - set.seed() + seed_from_string(student_id) # simulate subjects subjects <- make_subjects() @@ -476,26 +499,15 @@ random_project <- function(student_id) { # simulate questionnaire questions <- make_quest(subjects) - # sample research question variables - factors <- sample(c("language", "condition", "version"), 2) - iv <- factors[[1]] - subset <- factors[[2]] - level <- subjects[[subset]] %>% unique() %>% sample(1) - topic <- sample(c("stress", "extroversion", "disgust"), 1) - alpha <- sample(c(.005, .01, .05), 1) - power <- sample(c(80, 85, 90), 1) - - # create random research question text - research_question <- readLines("template_instructions.txt") %>% - paste(collapse = "\n") %>% - glue::glue() + # customise instructions + instructions <- make_instructions("template_instructions.txt") - # write files + # write files to a new directory dir <- paste0("exam_", student_id) dir.create(dir, showWarnings = FALSE) readr::write_csv(subjects, file.path(dir, "subjects.csv")) readr::write_csv(questions, file.path(dir, "questions.csv")) - write(research_question, file.path(dir, "instructions.txt")) + write(instructions, file.path(dir, "instructions.txt")) return(dir) }