Skip to content

Commit

Permalink
update and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
philchalmers committed Aug 12, 2021
1 parent e1efb4d commit d01b222
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: SimDesign
Title: Structure for Organizing Monte Carlo Simulation Designs
Version: 2.6.5
Version: 2.7
Authors@R: c(person("Phil", "Chalmers", email = "[email protected]", role = c("aut", "cre"),
comment = c(ORCID="0000-0001-5332-2810")),
person("Matthew", "Sigal", role = c("ctb")),
Expand Down
30 changes: 29 additions & 1 deletion vignettes/MultipleAnalyses.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The above template should of course be modified to replace the less useful names
Finally, note that all the rules about objects and object naming from the typical single Analyse function still apply and are properly checked internally for suitable names and consistency. The independently defined Analyse functions are also *interchangable* and *removable*/*replaceable*, which makes the structure of the Generate-Analyse-Summarise setup more modular with respect to the analysis components.


# An example
## An example

The following code is [adopted from the Wiki](http://philchalmers.github.io/SimDesign/html/03-Parameter_recovery_simulation.html), and so details about the simulation should be obtained from that source.

Expand Down Expand Up @@ -578,3 +578,31 @@ Analyse.FIML <- function(condition, dat, fixed_objects = NULL) {

Using this definition the final object returned by `runSimulation()` will provide suitable `NA` placeholders (where appropriate). For continuous indicators the results will be presented as though `mirt` was never used for the continuous indicator conditions controlled by the `Design` object.

## Applying one analyse function per-condition

Interestingly, `AnalyseIf()` could also be used to select only one analysis function at a time given the components in the `Design` object. For instance, if the `Design` definition were constructed using

```{r}
Design <- createDesign(sample_size = sample_sizes,
nitems = nitems,
method = c('FIML', 'DWLS'))
Design
```

and the analysis functions above were supplied defined as

```{r}
Analyse.FIML <- function(condition, dat, fixed_objects = NULL) {
AnalyseIf(method == 'FIML', condition)
#...
}
Analyse.DWLS <- function(condition, dat, fixed_objects = NULL) {
AnalyseIf(method == 'DWLS', condition)
# ...
}
```

then only one analysis function will be applied at a time in the simulation experiment. Users may find this a more natural setup than having to merge all analysis information into a single `Analyse()` definition. The downside, however, is that the analysis function will be applied to different generated datasets, which while theoretically unbiased could have ramifications should the analysis functions throw errors at different rates (even when explicitly supplying a `seed` vector input to `runSimulation()`).


0 comments on commit d01b222

Please sign in to comment.