Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ When segue gains a new exported function, add its `.qmd` file to a section under

## Test coverage

`coverage.qmd` shows segue's test coverage, overall and per file, with a [covr](https://covr.r-lib.org/) report for each line. The numbers are computed here, not read from Codecov. You need covr 4.0.0 or later.
`testing.qmd` shows segue's test coverage, overall and per file, with a [covr](https://covr.r-lib.org/) report for each line. The numbers are computed here, not read from Codecov. You need covr 4.0.0 or later.

Then, from this folder, pass a branch, tag, or commit SHA of `posit-dev/segue` (the default is `main`):

Expand All @@ -94,7 +94,7 @@ The script exports that commit from `_packages/segue` into a temporary folder (s
| `assets/coverage-badge.svg` | Badge for the whole package |
| `assets/coverage/<file>.svg` | One badge per file in segue's `R/` folder, e.g. `assets/coverage/sas_round.svg` |

Then render `coverage.qmd` again. A badge can be used on any page, e.g. `![](../assets/coverage/sas_round.svg)` on a comparison page.
Then render `testing.qmd` again. A badge can be used on any page, e.g. `![](../assets/coverage/sas_round.svg)` on a comparison page.

## Links to function documentation

Expand Down
2 changes: 1 addition & 1 deletion _coverage/build.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Computes the test coverage of segue and saves it for coverage.qmd.
# Computes the test coverage of segue and saves it for testing.qmd.
#
# Run from the root of this project:
#
Expand Down
10 changes: 4 additions & 6 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,10 @@ website:
href: reference/index.qmd
- text: "Comparisons"
href: comparisons/index.qmd
- text: "Methodology"
href: methodology.qmd
- text: "Design"
href: design.qmd
- text: "Test Coverage"
href: coverage.qmd
href: design.qmd
- text: "Software Validity Testing"
href: testing.qmd
right:
- text: "segue on GitHub"
href: https://github.com/posit-dev/segue
Expand Down Expand Up @@ -134,4 +132,4 @@ format:
fig-dpi: 160

bibliography: segue.bib
csl: chicago-author-date-inline.csl
csl: chicago-author-date-inline.csl
13 changes: 8 additions & 5 deletions comparisons/bin-prop-test.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ format: html

`bin_prop_test()` is an interface to a set of statistial methods to test that $H_0: \pi = \pi_0$ where $\pi_0$ is the null value. There is a section below that descibes the results for each `method`.

## Resources:

- [Help Page Details Section](../reference/bin_prop_test.qmd#details)
- Code coverage:
- <img src="../assets/coverage/bin_prop_test.svg" alt="100%">
- <img src="../assets/coverage/exact_binom_test_sas.svg" alt="100%">

## Experimental Setup

```{r}
Expand All @@ -27,10 +34,6 @@ Since this function takes qualitative data as the input, we can look at the resu

To measure the difference, we consider the absolute difference in the resulting p-values.

Resources:

- [Help Page Details Section](../reference/bin_prop_test.qmd#details)
- link to file code coverage

## Exact Test (R-based): `method = "exact"`

Expand Down Expand Up @@ -230,4 +233,4 @@ score_complete |>
labs(x = "Abs Difference (segue - SAS)", title = "Score Test") +
scale_x_continuous(labels = label_scientific(digits = 2))+
theme(axis.text.x = element_text(size = 10, angle = 45, hjust = 1, vjust = 1))
```
```
12 changes: 7 additions & 5 deletions comparisons/numeric-rank-test.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ One method estimates a stratified statistic, so a thrid qualitative variable is

These comparisons are specific to asymptotic test statistics since that is the method common to segue and SAS.


## Resources:

- [Help Page Details Section](../reference/numeric_rank_test.qmd#details)
- Code coverage:
- <img src="../assets/coverage/numeric_rank_test.svg" alt="100%">

## Experimental Setup

```{r}
Expand Down Expand Up @@ -54,11 +61,6 @@ The simulation and rounding were computed in R.

To measure the difference, we consider the absolute difference in the resulting p-values.

Resources:

- [Help Page Details Section](../reference/numeric_rank_test.qmd#details)
- link to file code coverage

## Wilcoxon Rank Sum Test

`method = "wilcoxon"`
Expand Down
91 changes: 0 additions & 91 deletions coverage.qmd

This file was deleted.

87 changes: 6 additions & 81 deletions index.qmd
Original file line number Diff line number Diff line change
@@ -1,90 +1,15 @@
---
title: "segue"
pagetitle: "segue: SAS analyses, written in R"
toc: false
body-classes: home
page-layout: full
listing:
id: home-comparisons
contents:
- "comparisons/*.qmd"
- "!comparisons/index.qmd"
template: comparisons/_rows.ejs
sort: "order"
fields: [title, description, sas, r, agreement, agreement-label]
filter-ui: false
sort-ui: false
---

::: {.hero}
# Your SAS analyses, written in R.
segue is an R package that is intended to help new R users coming to SAS, especially those in clinical statistics groups within the pharmaceutical industry.

[Each page here takes a SAS step you already know, shows the R code that does the same job with the segue package, and reports how closely the results agree. Every comparison is checked by running both programs on thousands of inputs.]{.lede}
The idea is to give users a set of well-named, extensively documented functions that serve as SAS analogs. They are neither SAS-like nor base R-like; they generally follow conventions developed by the [tidyverse](https://tidyverse.org/) and [tidymodels](https://www.tmwr.org/) groups that focus on how humans interact with software. See the [**Design**](design.qmd) page for more information on our philosophy.

::: {.actions}
[Browse the comparisons](comparisons/index.qmd){.btn-go}
[Methodology](methodology.qmd){.btn-quiet}
:::
These functions can help SAS users become acclimated to R in the short term, but they can be used as longer-term tools for a validated clinical pipeline.

::: {.hero-translation}
::: {.translation}
::: {.pane .sas what="PROC FREQ" result-label="XP2_BIN" result="0.56971121420377"}
```sas
proc freq data=trial;
tables response
/ binomial(p=0.25 level="yes");
exact binomial;
weight count;
run;
```
:::
The [**Reference**](reference/index.qmd) section echoes each function's help file in HTML format. The function documentation there describes any _methodological_ differences between segue/R and SAS.

::: {.pane .r what="segue" result-label="p.value" result="0.56971121420377"}
```r
library(segue)
If you are interested in how the _results_ of segue's function compare to those of SAS, the [**Comparisons**](comparisons/index.qmd) page shows fairly extensive numerical analysis and comparisons between the software platforms. In many cases, repeated simulations of clinical data are used to characterize how your results (e.g., p-values) might differ.

bin_prop_test(
response,
method = "exact_sas",
null_value = 0.25
)
```
:::
:::
:::
:::

::: {.section-head}
## Comparisons

[See all](comparisons/index.qmd)
:::

::: {#home-comparisons}
:::

::: {.section-head}
## Comparison methodology

[Read the details](methodology.qmd)
:::

::: {.steps}
::: {.step}
### Run SAS on many inputs

A SAS program runs the analysis on a grid of inputs and edge cases, and saves the results as `.sas7bdat` files.
:::

::: {.step}
### Run R on the same values

R reads those files bit for bit with haven, so both programs start from identical numbers.
:::

::: {.step}
### Compare every result

Each page reports how many results are identical, the largest difference, and the reason for any gap.
:::
:::
Finally, the [**Software Validity Testing**](testing.qmd) page gives an overview of how this package is tested and specific details for each line of code in the package sources.
37 changes: 0 additions & 37 deletions methodology.qmd

This file was deleted.

Loading
Loading