diff --git a/DESCRIPTION b/DESCRIPTION index 9cf5623..99df558 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,7 +29,7 @@ Suggests: tidyverse, car VignetteBuilder: knitr -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Encoding: UTF-8 Config/testthat/edition: 3 LazyData: true diff --git a/R/data.R b/R/data.R index cfb39e5..824d888 100644 --- a/R/data.R +++ b/R/data.R @@ -4,7 +4,7 @@ #' (especially heart attacks and congestive heart failure) and cerebrovascular disease #' (especially strokes) in the U.S. elderly. More information, including a coding key, #' is available at -#' \url{http://www.emersonstatistics.com/datasets/mri.doc}. +#' \url{https://rct-design.com/TeachingMaterials/Datasets/mri.txt}. #' #' #' @format A data frame with 735 rows and 30 variables: @@ -116,7 +116,7 @@ #' to their death. If 0, the number of days in \code{obstime} is the number of #' days between that participant's MRI and September 16, 1997.} } #' -#' @source \url{http://www.emersonstatistics.com/datasets/mri.txt} +#' @source \url{https://rct-design.com/TeachingMaterials/Datasets/mri.txt} "mri" #' Salary dataset @@ -125,7 +125,7 @@ #' monthly salary each year from 1976 through 1995, as well as sex, highest degree attained, #' year of highest degree, field, year hired, rank, and administrative duties. #' More information, including a coding key, is available at -#' \url{http://www.emersonstatistics.com/datasets/salary.doc}. +#' \url{https://rct-design.com/TeachingMaterials/Datasets/salary.txt}. #' #' #' @format A data frame with 19792 rows and 11 variables: @@ -155,7 +155,7 @@ #' #' } #' -#' @source \url{http://www.emersonstatistics.com/datasets/salary.txt} +#' @source \url{https://rct-design.com/TeachingMaterials/Datasets/salary.txt} "salary" #' PSA dataset @@ -163,7 +163,7 @@ #' Data from a study of 50 men having hormonally treated prostate cancer. Includes information on #' PSA levels, tumor characteristics, remission status, age, and disease state. #' More information, including a coding key, is available at -#' \url{http://www.emersonstatistics.com/datasets/PSA.doc}. +#' \url{https://rct-design.com/TeachingMaterials/Datasets/psa.txt}. #' #' #' @format A data frame with 50 rows and 9 variables: @@ -189,7 +189,7 @@ #' #' } #' -#' @source \url{http://www.emersonstatistics.com/datasets/psa.txt} +#' @source \url{https://rct-design.com/TeachingMaterials/Datasets/psa.txt} "psa" #' FEV dataset @@ -198,7 +198,7 @@ #' lung function (measured by FEV). Each row corresponds to a single clinic visit and contains #' information on age, height, sex, FEV, and smoking status. #' More information, including a coding key, is available at -#' \url{http://www.emersonstatistics.com/datasets/fev.doc}. +#' \url{https://rct-design.com/TeachingMaterials/Datasets/fev.txt}. #' #' #' @format A data frame with 654 rows and 7 variables: @@ -219,5 +219,5 @@ #' \item{smoke}{smoking habits ("yes" or "no")} #' } #' -#' @source \url{http://www.emersonstatistics.com/datasets/fev.txt} +#' @source \url{https://rct-design.com/TeachingMaterials/Datasets/fev.txt} "fev" \ No newline at end of file diff --git a/R/descrip.R b/R/descrip.R index ec17a1c..25ac9e2 100644 --- a/R/descrip.R +++ b/R/descrip.R @@ -98,34 +98,34 @@ #' corresponding to variables and strata and columns corresponding to the #' descriptive statistics. Descriptive statistics include #' \itemize{ -#' \item{N:} { the number of observations.} -#' \item{Msng:} { the number of observations with missing values.} -#' \item{Mean:} { the mean of the nonmissing observations (this is potentially -#' a restricted mean for right-censored time-to-event data).} -#' \item{Std Dev:} { the standard deviation of the nonmissing observations +#' \item N: the number of observations. +#' \item Msng: the number of observations with missing values. +#' \item Mean: the mean of the nonmissing observations (this is potentially +#' a restricted mean for right-censored time-to-event data). +#' \item Std Dev: the standard deviation of the nonmissing observations #' (this is potentially a restricted standard deviation for -#' right-censored time to event data).} -#' \item{Geom Mn:} { the geometric mean of the nonmissing observations +#' right-censored time to event data). +#' \item Geom Mn: the geometric mean of the nonmissing observations #' (this is potentially a restricted geometric mean for #' right-censored time to event data). Nonpositive values in #' the variable will generate \code{NA}, unless \code{replaceZeroes} -#' was specified.} -#' \item{Min:} { the minimum value of the nonmissing observations (this is -#' potentially restricted for right-censored time-to-event data).} -#' \item{Quantiles:} { columns corresponding to the quantiles specified by \code{probs} +#' was specified. +#' \item Min: the minimum value of the nonmissing observations (this is +#' potentially restricted for right-censored time-to-event data). +#' \item Quantiles: columns corresponding to the quantiles specified by \code{probs} #' (these are potentially restricted for right-censored -#' time-to-event data).} -#' \item{Max:} { the maximum value of the nonmissing observations (this is -#' potentially restricted for right-censored time-to-event data).} -#' \item{Proportions:} { columns corresponding to the proportions as specified by +#' time-to-event data). +#' \item Max: the maximum value of the nonmissing observations (this is +#' potentially restricted for right-censored time-to-event data). +#' \item Proportions: columns corresponding to the proportions as specified by #' \code{above}, \code{below}, \code{labove}, \code{rbelow}, #' \code{lbetween}, \code{rbetween}, \code{interval}, -#' \code{linterval}, \code{rinterval}, and \code{lrinterval}.} -#' \item{restriction:} { the threshold for restricted means, standard deviations, -#' and geometric means.} -#' \item{firstEvent:} { the time of the first event for censored time-to-event variables.} -#' \item{lastEvent:} { the time of the last event for censored time-to-event variables.} -#' \item{isDate:} { an indicator that the variable is a \code{Date} object.} +#' \code{linterval}, \code{rinterval}, and \code{lrinterval}. +#' \item restriction: the threshold for restricted means, standard deviations, +#' and geometric means. +#' \item firstEvent: the time of the first event for censored time-to-event variables. +#' \item lastEvent: the time of the last event for censored time-to-event variables. +#' \item isDate: an indicator that the variable is a \code{Date} object. #' } #' #' @examples diff --git a/README.Rmd b/README.Rmd index 5d43005..97888fc 100644 --- a/README.Rmd +++ b/README.Rmd @@ -46,7 +46,7 @@ You can install the development version of `rigr` from GitHub using the code bel If this produces an error, please run `install.packages("remotes")` first then try the above line again. -`rigr` is maintained by the [StatDivLab](http://statisticaldiversitylab.com/), but relies on community support to log issues and implement new features. Is there a method you would like to have implemented? Please submit a pull request or start a [discussion](https://github.com/statdivlab/rigr/discussions/)! +`rigr` is maintained by the [StatDivLab](https://statdivlab.github.io/), but relies on community support to log issues and implement new features. Is there a method you would like to have implemented? Please submit a pull request or start a [discussion](https://github.com/statdivlab/rigr/discussions/)! ## Documentation @@ -54,9 +54,9 @@ Examples of how to use the main functions in `rigr` are provided in three vignet ## Humans -Maintainer: [Amy Willis](http://statisticaldiversitylab.com/) +Maintainer: [Amy Willis](https://statdivlab.github.io/) -Authors: [Scott S Emerson](http://www.emersonstatistics.com/), [Brian D Williamson](https://bdwilliamson.github.io/), [Charles Wolock](https://cwolock.github.io/), [Taylor Okonek](https://taylorokonek.github.io/), [Yiqun T Chen](https://yiqunchen.github.io/), [Jim Hughes](https://www.biostat.washington.edu/people/james-hughes), [Amy Willis](http://statisticaldiversitylab.com/), [Andrew J Spieker](https://www.vumc.org/biostatistics/person/andrew-spieker) and Travis Y Hee Wai. +Authors: [Scott S Emerson](http://www.emersonstatistics.com/), [Brian D Williamson](https://bdwilliamson.github.io/), [Charles Wolock](https://cwolock.github.io/), [Taylor Okonek](https://taylorokonek.github.io/), [Yiqun T Chen](https://yiqunchen.github.io/), [Jim Hughes](https://www.biostat.washington.edu/people/james-hughes), [Amy Willis](https://statdivlab.github.io/), [Andrew J Spieker](https://www.vumc.org/biostatistics/person/andrew-spieker) and Travis Y Hee Wai. ## Issues @@ -66,4 +66,4 @@ Do you have a **question**? Please first check out the vignettes, then please po ## Code of Conduct -Please note that the rigr project is released with a [Contributor Code of Conduct]( By contributing to this project, you agree to abide by its terms. +Please note that the rigr project is released with a [Contributor Code of Conduct](https://statdivlab.github.io/rigr/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. diff --git a/README.md b/README.md index 2dd7f7b..e5f3546 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ - + -[![CRAN status](https://www.r-pkg.org/badges/version/rigr)](https://CRAN.R-project.org/package=rigr) [![R-CMD-check](https://github.com/statdivlab/rigr/workflows/R-CMD-check/badge.svg)](https://github.com/statdivlab/rigr/actions) [![codecov](https://codecov.io/gh/statdivlab/rigr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/statdivlab/rigr) +[![CRAN +status](https://www.r-pkg.org/badges/version/rigr)](https://CRAN.R-project.org/package=rigr) +[![R-CMD-check](https://github.com/statdivlab/rigr/workflows/R-CMD-check/badge.svg)](https://github.com/statdivlab/rigr/actions) +[![codecov](https://codecov.io/gh/statdivlab/rigr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/statdivlab/rigr) @@ -10,9 +13,22 @@ ## Introduction -`rigr` is an `R` package to streamline data analysis in `R`. Learning both `R` and introductory statistics at the same time can be challenging, and so we created `rigr` to facilitate common data analysis tasks and enable learners to focus on statistical concepts. - -`rigr`, formerly known as [`uwIntroStats`](https://CRAN.R-project.org/package=uwIntroStats), provides easy-to-use interfaces for descriptive statistics, one- and two-sample inference, and regression analyses. `rigr` output includes key information while omitting unnecessary details that can be confusing to beginners. Heteroskedasticity-robust (“sandwich”) standard errors are returned by default, and multiple partial F-tests and tests for contrasts are easy to specify. A single regression function (`regress()`) can fit both linear models, generalized linear models, and proportional hazards models, allowing students to more easily make connections between different classes of models. +`rigr` is an `R` package to streamline data analysis in `R`. Learning +both `R` and introductory statistics at the same time can be +challenging, and so we created `rigr` to facilitate common data analysis +tasks and enable learners to focus on statistical concepts. + +`rigr`, formerly known as +[`uwIntroStats`](https://CRAN.R-project.org/package=uwIntroStats), +provides easy-to-use interfaces for descriptive statistics, one- and +two-sample inference, and regression analyses. `rigr` output includes +key information while omitting unnecessary details that can be confusing +to beginners. Heteroskedasticity-robust (“sandwich”) standard errors are +returned by default, and multiple partial F-tests and tests for +contrasts are easy to specify. A single regression function +(`regress()`) can fit both linear models, generalized linear models, and +proportional hazards models, allowing students to more easily make +connections between different classes of models. ## Installation @@ -20,33 +36,56 @@ You can install the stable release of `rigr` from CRAN as follows: install.packages("rigr") -You can install the development version of `rigr` from GitHub using the code below. The installment is through the `R` package `remotes`. +You can install the development version of `rigr` from GitHub using the +code below. The installment is through the `R` package `remotes`. + + #> Using GitHub PAT from the git credential store. + #> Skipping install of 'rigr' from a github remote, the SHA1 (8b901ee9) has not changed since last install. + #> Use `force = TRUE` to force installation - # run the following code to make sure that the remote package it installed - if (!requireNamespace("remotes", quietly = TRUE)) { - install.packages("remotes") - } - # install the package - remotes::install_github("statdivlab/rigr") +If this produces an error, please run `install.packages("remotes")` +first then try the above line again. -`rigr` is maintained by the [StatDivLab](http://statisticaldiversitylab.com/), but relies on community support to log issues and implement new features. Is there a method you would like to have implemented? Please submit a pull request or start a [discussion](https://github.com/statdivlab/rigr/discussions/)! +`rigr` is maintained by the [StatDivLab](https://statdivlab.github.io/), +but relies on community support to log issues and implement new +features. Is there a method you would like to have implemented? Please +submit a pull request or start a +[discussion](https://github.com/statdivlab/rigr/discussions/)! ## Documentation -Examples of how to use the main functions in `rigr` are provided in three vignettes, available [here](https://statdivlab.github.io/rigr/). One details the `regress` function and its utilities, one details the `descrip` function for descriptive statistics, and the third details functions used for one- and two-sample inference, including `ttest`, `wilcoxon`, and `proptest`. +Examples of how to use the main functions in `rigr` are provided in +three vignettes. One details the `regress` function and its utilities, +one details the `descrip` function for descriptive statistics, and the +third details functions used for one- and two-sample inference, +including `ttest`, `wilcoxon`, and `proptest`. ## Humans -Maintainer: [Amy Willis](http://statisticaldiversitylab.com/) +Maintainer: [Amy Willis](https://statdivlab.github.io/) -Authors: [Scott S Emerson](http://www.emersonstatistics.com/), [Brian D Williamson](https://bdwilliamson.github.io/), [Charles Wolock](https://cwolock.github.io/), [Taylor Okonek](https://taylorokonek.github.io/), [Yiqun T Chen](https://yiqunchen.github.io/), [Jim Hughes](https://www.biostat.washington.edu/people/james-hughes), [Amy Willis](http://statisticaldiversitylab.com/), [Andrew J Spieker](https://www.vumc.org/biostatistics/person/andrew-spieker) and Travis Y Hee Wai. +Authors: [Scott S Emerson](http://www.emersonstatistics.com/), [Brian D +Williamson](https://bdwilliamson.github.io/), [Charles +Wolock](https://cwolock.github.io/), [Taylor +Okonek](https://taylorokonek.github.io/), [Yiqun T +Chen](https://yiqunchen.github.io/), [Jim +Hughes](https://www.biostat.washington.edu/people/james-hughes), [Amy +Willis](https://statdivlab.github.io/), [Andrew J +Spieker](https://www.vumc.org/biostatistics/person/andrew-spieker) and +Travis Y Hee Wai. ## Issues -If you encounter any **bugs**, please [file an issue](https://github.com/statdivlab/rigr/issues/). Better yet, [submit a pull request](https://github.com/statdivlab/rigr/pulls/)! +If you encounter any **bugs**, please [file an +issue](https://github.com/statdivlab/rigr/issues/). Better yet, [submit +a pull request](https://github.com/statdivlab/rigr/pulls/)! -Do you have a **question**? Please first check out the vignettes, then please post on the [Discussions](https://github.com/statdivlab/rigr/discussions/). +Do you have a **question**? Please first check out the vignettes, then +please post on the +[Discussions](https://github.com/statdivlab/rigr/discussions/). ## Code of Conduct -Please note that the rigr project is released with a [Contributor Code of Conduct]( By contributing to this project, you agree to abide by its terms. +Please note that the rigr project is released with a [Contributor Code +of Conduct](https://statdivlab.github.io/rigr/CODE_OF_CONDUCT.html). By +contributing to this project, you agree to abide by its terms. diff --git a/man/descrip.Rd b/man/descrip.Rd index c815747..a7f686e 100644 --- a/man/descrip.Rd +++ b/man/descrip.Rd @@ -119,34 +119,34 @@ An object of class \code{uDescriptives} is returned. Descriptive corresponding to variables and strata and columns corresponding to the descriptive statistics. Descriptive statistics include \itemize{ - \item{N:} { the number of observations.} - \item{Msng:} { the number of observations with missing values.} - \item{Mean:} { the mean of the nonmissing observations (this is potentially - a restricted mean for right-censored time-to-event data).} - \item{Std Dev:} { the standard deviation of the nonmissing observations + \item N: the number of observations. + \item Msng: the number of observations with missing values. + \item Mean: the mean of the nonmissing observations (this is potentially + a restricted mean for right-censored time-to-event data). + \item Std Dev: the standard deviation of the nonmissing observations (this is potentially a restricted standard deviation for - right-censored time to event data).} - \item{Geom Mn:} { the geometric mean of the nonmissing observations + right-censored time to event data). + \item Geom Mn: the geometric mean of the nonmissing observations (this is potentially a restricted geometric mean for right-censored time to event data). Nonpositive values in the variable will generate \code{NA}, unless \code{replaceZeroes} - was specified.} - \item{Min:} { the minimum value of the nonmissing observations (this is - potentially restricted for right-censored time-to-event data).} - \item{Quantiles:} { columns corresponding to the quantiles specified by \code{probs} + was specified. + \item Min: the minimum value of the nonmissing observations (this is + potentially restricted for right-censored time-to-event data). + \item Quantiles: columns corresponding to the quantiles specified by \code{probs} (these are potentially restricted for right-censored - time-to-event data).} - \item{Max:} { the maximum value of the nonmissing observations (this is - potentially restricted for right-censored time-to-event data).} - \item{Proportions:} { columns corresponding to the proportions as specified by + time-to-event data). + \item Max: the maximum value of the nonmissing observations (this is + potentially restricted for right-censored time-to-event data). + \item Proportions: columns corresponding to the proportions as specified by \code{above}, \code{below}, \code{labove}, \code{rbelow}, \code{lbetween}, \code{rbetween}, \code{interval}, - \code{linterval}, \code{rinterval}, and \code{lrinterval}.} - \item{restriction:} { the threshold for restricted means, standard deviations, - and geometric means.} - \item{firstEvent:} { the time of the first event for censored time-to-event variables.} - \item{lastEvent:} { the time of the last event for censored time-to-event variables.} - \item{isDate:} { an indicator that the variable is a \code{Date} object.} + \code{linterval}, \code{rinterval}, and \code{lrinterval}. + \item restriction: the threshold for restricted means, standard deviations, + and geometric means. + \item firstEvent: the time of the first event for censored time-to-event variables. + \item lastEvent: the time of the last event for censored time-to-event variables. + \item isDate: an indicator that the variable is a \code{Date} object. } } \description{ diff --git a/man/fev.Rd b/man/fev.Rd index 904d33f..5869591 100644 --- a/man/fev.Rd +++ b/man/fev.Rd @@ -24,7 +24,7 @@ A data frame with 654 rows and 7 variables: } } \source{ -\url{http://www.emersonstatistics.com/datasets/fev.txt} +\url{https://rct-design.com/TeachingMaterials/Datasets/fev.txt} } \usage{ fev @@ -34,6 +34,6 @@ Data from a study of 654 children on the relationship between smoking status and lung function (measured by FEV). Each row corresponds to a single clinic visit and contains information on age, height, sex, FEV, and smoking status. More information, including a coding key, is available at -\url{http://www.emersonstatistics.com/datasets/fev.doc}. +\url{https://rct-design.com/TeachingMaterials/Datasets/fev.txt}. } \keyword{datasets} diff --git a/man/mri.Rd b/man/mri.Rd index b4cda00..a5986dc 100644 --- a/man/mri.Rd +++ b/man/mri.Rd @@ -115,7 +115,7 @@ to their death. If 0, the number of days in \code{obstime} is the number of days between that participant's MRI and September 16, 1997.} } } \source{ -\url{http://www.emersonstatistics.com/datasets/mri.txt} +\url{https://rct-design.com/TeachingMaterials/Datasets/mri.txt} } \usage{ mri @@ -125,6 +125,6 @@ Data from an observational study of the incidence of cardiovascular disease (especially heart attacks and congestive heart failure) and cerebrovascular disease (especially strokes) in the U.S. elderly. More information, including a coding key, is available at -\url{http://www.emersonstatistics.com/datasets/mri.doc}. +\url{https://rct-design.com/TeachingMaterials/Datasets/mri.txt}. } \keyword{datasets} diff --git a/man/psa.Rd b/man/psa.Rd index ba14482..02fcd0d 100644 --- a/man/psa.Rd +++ b/man/psa.Rd @@ -29,7 +29,7 @@ A data frame with 50 rows and 9 variables: } } \source{ -\url{http://www.emersonstatistics.com/datasets/psa.txt} +\url{https://rct-design.com/TeachingMaterials/Datasets/psa.txt} } \usage{ psa @@ -38,6 +38,6 @@ psa Data from a study of 50 men having hormonally treated prostate cancer. Includes information on PSA levels, tumor characteristics, remission status, age, and disease state. More information, including a coding key, is available at -\url{http://www.emersonstatistics.com/datasets/PSA.doc}. +\url{https://rct-design.com/TeachingMaterials/Datasets/psa.txt}. } \keyword{datasets} diff --git a/man/salary.Rd b/man/salary.Rd index 0578241..af06f27 100644 --- a/man/salary.Rd +++ b/man/salary.Rd @@ -33,7 +33,7 @@ A data frame with 19792 rows and 11 variables: } } \source{ -\url{http://www.emersonstatistics.com/datasets/salary.txt} +\url{https://rct-design.com/TeachingMaterials/Datasets/salary.txt} } \usage{ salary @@ -43,6 +43,6 @@ Data from a study of 1,597 faculty members at a single US university. Includes i monthly salary each year from 1976 through 1995, as well as sex, highest degree attained, year of highest degree, field, year hired, rank, and administrative duties. More information, including a coding key, is available at -\url{http://www.emersonstatistics.com/datasets/salary.doc}. +\url{https://rct-design.com/TeachingMaterials/Datasets/salary.txt}. } \keyword{datasets}