Skip to content

Commit

Permalink
Fixed typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
masurp committed Mar 25, 2020
1 parent a27454e commit 1916538
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions R/icc_specs.r
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
#' This function extracts intraclass correlation coefficients (ICC) from a multilevel model. It can be used to decompose the variance in the outcome variable of a specification curve analysis (e.g., the regression coefficients). This approach summarises the relative importance of analytical choices by estimating the share of variance in the outcome (e.g., the regression coefficient) that different analytical choices or combinations therefor account for. To use this approach, one needs to estimate a multilevel model that includes all analytical choices as grouping variables (see examples).
#'
#' @param model a multilevel (i.e., mixed effects) model that captures the variances of the specification curve.
#' @param percent a logical value indicating whether the icc should also be printed as percentage. Defaults to TRUE.
#' @param percent a logical value indicating whether the ICC should also be printed as percentage. Defaults to TRUE.
#'
#' @return a [tibble][tibble::tibble-package] including the grouping variable, the random effect variances, the raw intraclass correlation coefficient (ICC), and the ICC in percent.
#'
#' @references \itemize{
#' \item Hox, J. J. (2010). Multilevel analysis: techniques and applications (2nd ed). New York: Routledge.
#' \item Hox, J. J. (2010). Multilevel analysis: techniques and applications. New York: Routledge.
#' }
#' @export
#'
Expand Down
4 changes: 2 additions & 2 deletions R/plot_variance.r
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Plot variance decomposition
#'
#' This functions creates a simple barplot that visually displays how much variance in the outcome (e.g., the regression coeficient) different analytical choices or combinations therefor account for. To use this approach, one needs to estimate a multilevel model that includes all analytical choices as grouping variables (see examples and vignettes). This function uses [icc_specs()] to compute the intraclass correlation coefficients (ICCs), which provides the data basis for the plot (see examples).
#' This functions creates a simple barplot that visually displays how much variance in the outcome (e.g., the regression coefficient) different analytical choices or combinations therefor account for. To use this approach, one needs to estimate a multilevel model that includes all analytical choices as grouping variables (see examples and vignettes). This function uses [icc_specs()] to compute the intraclass correlation coefficients (ICCs), which provides the data basis for the plot (see examples).
#'
#' @param model a multilevel model that captures the variances of the specification curve (based on the data frame resulting from \code{run_specs}).
#'
Expand All @@ -22,7 +22,7 @@
#' # Step 3: Plot model
#' plot_variance(model)
#'
#' @seealso [icc_specs()] to produce a tibble that details the variance decomposion.
#' @seealso [icc_specs()] to produce a tibble that details the variance decomposition.
plot_variance <- function(model) {

icc_specs(model) %>%
Expand Down
2 changes: 1 addition & 1 deletion R/run_specs.r
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' @return a [tibble][tibble::tibble-package] that includes all specifications and a tidy summary of model components.
#'
#' @references \itemize{
#' \item Simonsohn, U., Simmons, J. P., & Nelson, L. D. (2019). Specification Curve: Descriptive and Inferential Statistics for all Plausible Specifications. Available at: http://dx.doi.org/10.2139/ssrn.2694998
#' \item Simonsohn, U., Simmons, J. P., & Nelson, L. D. (2019). Specification Curve: Descriptive and Inferential Statistics for all Plausible Specifications. Available at: https://doi.org/10.2139/ssrn.2694998
#' \item Steegen, S., Tuerlinckx, F., Gelman, A., & Vanpaemel, W. (2016). Increasing Transparency Through a Multiverse Analysis. Perspectives on Psychological Science, 11(5), 702-712. https://doi.org/10.1177/1745691616658637
#' }
#' @export
Expand Down
6 changes: 3 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ There are also some vignettes that exemplify and explain specific aspects and fu
- [Getting started](https://masurp.github.io/specr/articles/specr.html): A comprehensive example. This vignette illustrates the major functions of the package.
- [Customizing specification curve plots](https://masurp.github.io/specr/articles/custom-plot.html): This vignette exemplifies various ways to plot the specification curve.
- [Decomposing the variance of the specification curve](https://masurp.github.io/specr/articles/decompose_var.html): An example of how to investigate variance components of the specification curve.
- [Visualizing progress during estimation](https://masurp.github.io/specr/articles/progress.html): This vignette explains how to create a customizable progress bar for longer computations.
- [Visualizing progress during estimation](https://masurp.github.io/specr/articles/progress.html): This vignette explains how to create a progress bar for longer computations.

## Disclaimer

We do see a lot of value in investigating how analytical choices affect a statistical outcome of interest. However, we strongly caution against using `specr` as a tool to somehow arrive at a better estimate. Running a specification curve analysis does not make your findings any more reliable, valid or generalizable than a single analyis. The method is only meant to inform about the effects of analytical choices on results, and not a better way to estimate a correlation or effect.
We do see a lot of value in investigating how analytical choices affect a statistical outcome of interest. However, we strongly caution against using `specr` as a tool to somehow arrive at a better estimate. Running a specification curve analysis does not make your findings any more reliable, valid or generalizable than a single analysis. The method is only meant to inform about the effects of analytical choices on results, and not a better way to estimate a correlation or effect.

## Installation

Expand Down Expand Up @@ -83,6 +83,6 @@ citation("specr")

## References

Simonsohn, U., Simmons, J. P., & Nelson, L. D. (2019). *Specification Curve: Descriptive and Inferential Statistics for all Plausible Specifications.* Available at: http://dx.doi.org/10.2139/ssrn.2694998
Simonsohn, U., Simmons, J. P., & Nelson, L. D. (2019). *Specification Curve: Descriptive and Inferential Statistics for all Plausible Specifications.* Available at: https://doi.org/10.2139/ssrn.2694998

Steegen, S., Tuerlinckx, F., Gelman, A., & Vanpaemel, W. (2016). Increasing Transparency Through a Multiverse Analysis. *Perspectives on Psychological Science*, 11(5), 702-712. https://doi.org/10.1177/1745691616658637
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ aspects and functions of the package:
specification curve.
- [Visualizing progress during
estimation](https://masurp.github.io/specr/articles/progress.html):
This vignette explains how to create a customizable progress bar for
longer computations.
This vignette explains how to create a progress bar for longer
computations.

## Disclaimer

We do see a lot of value in investigating how analytical choices affect
a statistical outcome of interest. However, we strongly caution against
using `specr` as a tool to somehow arrive at a better estimate. Running
a specification curve analysis does not make your findings any more
reliable, valid or generalizable than a single analyis. The method is
reliable, valid or generalizable than a single analysis. The method is
only meant to inform about the effects of analytical choices on results,
and not a better way to estimate a correlation or effect.

Expand Down Expand Up @@ -120,7 +120,7 @@ citation("specr")
#> A BibTeX entry for LaTeX users is
#>
#> @Misc{,
#> title = {specr: Statistical functions for conducting specification curve analyses (Version 0.1.1)},
#> title = {specr: Statistical functions for conducting specification curve analyses (Version 0.2.0)},
#> author = {Philipp K. Masur and Michael Scharkow},
#> year = {2019},
#> url = {https://github.com/masurp/specr},
Expand All @@ -131,7 +131,7 @@ citation("specr")

Simonsohn, U., Simmons, J. P., & Nelson, L. D. (2019). *Specification
Curve: Descriptive and Inferential Statistics for all Plausible
Specifications.* Available at: <http://dx.doi.org/10.2139/ssrn.2694998>
Specifications.* Available at: <https://doi.org/10.2139/ssrn.2694998>

Steegen, S., Tuerlinckx, F., Gelman, A., & Vanpaemel, W. (2016).
Increasing Transparency Through a Multiverse Analysis. *Perspectives on
Expand Down
4 changes: 2 additions & 2 deletions man/icc_specs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/plot_variance.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/run_specs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vignettes/custom-plot.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ vignette: >
%\VignetteEncoding{UTF-8}
---

This vignette exemplifies different ways to plot the specification curve. For most casces, the function `plot_specs()` takes care of the overall process. However, more specific customizations are possible if we use the more specific functions `plot_curve()` and `plot_choices`. Furthermore, we can extend the overall plot with the additional function `plot_samplesizes()`. All of these functions produce objects of the class [ggplot](https://ggplot2.tidyverse.org/index.html) that can be customized further using the grammar of graphics provided by the package [ggplot2](https://ggplot2.tidyverse.org/index.html).
This vignette exemplifies different ways to plot the specification curve. For most cases, the function `plot_specs()` takes care of the overall process. However, more specific customization is possible if we use the more specific functions `plot_curve()` and `plot_choices`. Furthermore, we can extend the overall plot with the additional function `plot_samplesizes()`. All of these functions produce objects of the class [ggplot](https://ggplot2.tidyverse.org/index.html) that can be customized further using the grammar of graphics provided by the package [ggplot2](https://ggplot2.tidyverse.org/index.html).


## 1. Run the specification curve analysis
Expand Down
2 changes: 1 addition & 1 deletion vignettes/decompose_var.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ We can see that `r icc_specs(m1)[3,4] %>% round(1)`\% of the variance in the obt

## 4. Plot variance components

Second, we can alternatively use the function `plot_variance()` to obtain a visualization. The function calls `icc_specs()` automatically. We can hence pass the multilevel results object directly. Further customizations via the ggplot2 is possible.
Second, we can alternatively use the function `plot_variance()` to obtain a visualization. The function calls `icc_specs()` automatically. We can hence pass the multilevel results object directly. Further customization via ggplot2 is possible.

```{r, message = F, warnings = F}
plot_variance(m1) +
Expand Down
2 changes: 1 addition & 1 deletion vignettes/progress.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ results <- run_specs(example_data,
```

The console will show a progress bar during estimation. For more information and additional customizations of the progress bar, see the [documentation](https://github.com/r-lib/progress) of the package `progress`.
The console will show a progress bar during estimation. For more information, see the [documentation](https://github.com/r-lib/progress) of the package `progress`.

```{r, eval=F}
[==========================================================-------------] 81% (156/192) Finished in 1s
Expand Down
4 changes: 2 additions & 2 deletions vignettes/specr.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ head(example_data)
summary(example_data)
```

There are several numeric variables. In this exampkle, we assume that `x` represents independent variables, `y` represents dependent variables, `c` represents control variables, and `group` denotes potential grouping variables that can be used for subsetting the data.
There are several numeric variables. In this example, we assume that `x` represents independent variables, `y` represents dependent variables, `c` represents control variables, and `group` denotes potential grouping variables that can be used for subsetting the data.

## 2. Define analytical choices

Expand Down Expand Up @@ -113,7 +113,7 @@ summarise_specs(results,

The output contains summary statistics such as the median, the median absolute deviation, ... as well as the number of observations that were used for each model. Bear in mind that due to subsetting or missing data, sample sizes can vary considerably which, in turn, affects the results (e.g., the p-value).

However, in order to grasp how the different analytical choices affect the outcome of interest (in this case, the estimate refers to the unstandarized regression coefficient *b*), it is reasonable to plot a specification curve. The function `plot_specs()` to produces the typical visualization of the specification curve and how the analytical choices affected the obtained results.
However, in order to grasp how the different analytical choices affect the outcome of interest (in this case, the estimate refers to the unstandardized regression coefficient *b*), it is reasonable to plot a specification curve. The function `plot_specs()` to produces the typical visualization of the specification curve and how the analytical choices affected the obtained results.

```{r, fig.height=10, fig.width=10, message=F, warning = F}
# Plot specification curve analysis
Expand Down

0 comments on commit 1916538

Please sign in to comment.