Skip to content

Commit

Permalink
review before bump to 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mightymetrika committed Apr 28, 2024
1 parent 9ea48ad commit 31d24b4
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 25 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
^LICENSE\.md$
^data-raw$
^README\.Rmd$
^cran-comments\.md$
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: scdtb
Title: Tools for Analyzing Data from Single Case Designs
Title: Single Case Design Tools
Version: 0.0.0.9000
Authors@R: c(
person("Mackson", "Ncube", , "[email protected]", role = c("aut", "cre")),
Expand All @@ -15,7 +15,9 @@ Description: In some situations where researchers would like to demonstrate
Works Clearinghouse (2022) <https://ies.ed.gov/ncee/wwc/Handbooks>. The
package also offers the mixed_model_analysis() and cross_lagged() functions
which implement mixed effects models and cross lagged analyses as described
in Maric & van der Werff <2020, ISBN:9780429273872>. The scdtb() 'shiny'
in Maric & van der Werff (2020) <doi:10.4324/9780429273872-9>. The
randomization_test() function implements randomization tests based on methods
presented in Onghena (2020) <doi:10.4324/9780429273872-8>. The scdtb() 'shiny'
application can be used to upload single case design data and access various
'scdtb' tools for plotting and analysis.
License: MIT + file LICENSE
Expand Down
3 changes: 0 additions & 3 deletions NEWS.md

This file was deleted.

2 changes: 1 addition & 1 deletion R/cross_lagged.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#' @examples
#' # Creating a sample dataset
#' reversal_withdrawal <- data.frame(
#' phase = c(rep("baseline1", 6), rep("teratment1", 5), rep("baseline2", 5), rep("teratment2", 5)),
#' phase = c(rep("baseline1", 6), rep("treatment1", 5), rep("baseline2", 5), rep("treatment2", 5)),
#' time = 1:21,
#' extbehavs = c(15, 10, 14, 17, 13, 12, 2, 1, 1, 0, 0, 9, 9, 11, 15, 20, 1, 0, 4, 0, 1)
#' )
Expand Down
8 changes: 4 additions & 4 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#' Designs in Clinical Intervention Research. In R. van de Schoot & M. Miocevic
#' (Eds.), Small Sample Size Solutions: A Guide for Applied Researchers and
#' Practitioners (1st ed., pp. 10). Routledge.
#' https://doi.org/10.4324/9780429273872
#' <doi:10.4324/9780429273872-9>
#'
#' @format ## `efficacy_of_CBT`
#' A data frame with 10 rows and 4 columns:
Expand All @@ -51,7 +51,7 @@
#' \item{Anxious}{Outcome measure}
#' \item{CATS_N}{Outcome measure}
#' }
#' @source <https://doi.org/10.4324/9780429273872>
#' @source <doi:10.4324/9780429273872-9>
"efficacy_of_CBT"

#' Sleeping Pills and Dizziness Example
Expand All @@ -61,7 +61,7 @@
#' @references Onghena, P. (2020). One by one: The design and analysis of
#' replicated randomized single-case experiments. In R. van de Schoot & M. Miocevic
#' (Eds.), Small sample size solutions: A guide for applied researchers and
#' practitioners (1st ed., pp. 15). Routledge. https://doi.org/10.4324/9780429273872
#' practitioners (1st ed., pp. 15). Routledge. <doi:10.4324/9780429273872-8>
#'
#' @format ## `sleeping_pills`
#' A data frame with 14 rows and 3 columns:
Expand All @@ -70,7 +70,7 @@
#' \item{treatment}{E, Experimental; C, Control}
#' \item{sever_compl}{Severity of complaints}
#' }
#' @source <https://doi.org/10.4324/9780429273872>
#' @source <doi:10.4324/9780429273872-8>
"sleeping_pills"


5 changes: 2 additions & 3 deletions R/mixed_model_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#' Designs in Clinical Intervention Research. In R. van de Schoot & M. Miocevic
#' (Eds.), Small Sample Size Solutions: A Guide for Applied Researchers and
#' Practitioners (1st ed., pp. 10). Routledge.
#' https://doi.org/10.4324/9780429273872
#' <doi:10.4324/9780429273872-9>
#'
#' @examples
#' res <- mixed_model_analysis(efficacy_of_CBT, .dv = "Anxious", .time = "time",
Expand Down Expand Up @@ -119,7 +119,7 @@ mixed_model_analysis <- function(.df, .dv, .time, .phase, .participant = NULL,
mod <- nlme::gls(model = mod_form,
data = .df,
method = "REML",
correlation = nlme::corAR1(, form=re_form),
correlation = nlme::corAR1(form=re_form),
...)

# Get predicted values
Expand Down Expand Up @@ -176,4 +176,3 @@ mixed_model_analysis <- function(.df, .dv, .time, .phase, .participant = NULL,
plot = ggp))

}

2 changes: 1 addition & 1 deletion R/randomization_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#' Onghena, P. (2020). One by One: The design and analysis of replicated randomized
#' single-case experiments.In R. van de Schoot & M. Mioecvic (Eds.), Small Sample
#' Size Solutions: A Guide for Applied Researchers and Practitioners (1st ed., pp.
#' 15). Routledge. https://doi.org/10.4324/9780429273872
#' 15). Routledge. <doi:10.4324/9780429273872-8>
#'
#' @export
randomization_test <- function(.df, .out, .cond, .time, num_permutations = NULL,
Expand Down
4 changes: 2 additions & 2 deletions R/scdtb.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' Maric, M., & van der Werff, V. (2020). Single-Case ExperimentalDesigns in
#' Clinical Intervention Research. In R. van de Schoot & M. Miocevic (Eds.),
#' Small Sample Size Solutions: A Guide for Applied Researchers and Practitioners
#' (1st ed., pp. 10). Routledge. https://doi.org/10.4324/9780429273872
#' (1st ed., pp. 10). Routledge. <doi:10.4324/9780429273872-9>
#'
#' What Works Clearinghouse. (2022). What Works Clearinghouse procedures and
#' standards handbook, version 5.0. U.S. Department of Education, Institute of
Expand All @@ -28,7 +28,7 @@
#' Onghena, P. (2020). One by One: The design and analysis of replicated randomized
#' single-case experiments.In R. van de Schoot & M. Mioecvic (Eds.), Small Sample
#' Size Solutions: A Guide for Applied Researchers and Practitioners (1st ed., pp.
#' 15). Routledge. https://doi.org/10.4324/9780429273872
#' 15). Routledge. <doi:10.4324/9780429273872-8>
#'
#' @export
scdtb <- function(){
Expand Down
6 changes: 6 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ The goal of 'scdtb' is to provide tools for the analysis of single case design d

## Installation

You can install the released version of 'scdtb' from [CRAN](https://CRAN.R-project.org):

```{r eval=FALSE}
install.packages("scdtb")
```

To install the development version of 'scdtb' from GitHub, use the [devtools](https://devtools.r-lib.org/) package:

```{r, eval=FALSE}
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ design data.

## Installation

You can install the released version of ‘scdtb’ from
[CRAN](https://CRAN.R-project.org):

``` r
install.packages("scdtb")
```

To install the development version of ‘scdtb’ from GitHub, use the
[devtools](https://devtools.r-lib.org/) package:

Expand Down
5 changes: 5 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## R CMD check results

0 errors | 0 warnings | 1 note

* This is a new release.
2 changes: 1 addition & 1 deletion man/cross_lagged.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/efficacy_of_CBT.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/mixed_model_analysis.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/randomization_test.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/scdtb.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/sleeping_pills.Rd

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

0 comments on commit 31d24b4

Please sign in to comment.