Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

357 stat methods vignette #365

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jtalboys
Copy link
Collaborator

What changes are proposed in this pull request?

#357 Add an article detailing how a user can implement their own statistical methods

I'll open this as a draft for now as it would be good just to get a review on the content initially if you have time @ddsjoberg?

Also a couple of points/questions:

  • Currently I've left in the {cardx} example, which would mean adding {cardx} to Suggests. I'm happy to remove, just couldn't remember exactly what we agreed on in the last meeting.
  • I haven't been able render due to as_cards_fn being new and installation restrictions on our SCE - if this is important then I should be able to work around it to render the article
  • Added as an article rather than a vignette
  • Are there any other parts of the process which change for adding documentation like this. (If there are then I can also add to the CONTRIBUTING guidelines)

closes #357


Pre-review Checklist (if item does not apply, mark is as complete)

  • All GitHub Action workflows pass with a ✅
  • PR branch has pulled the most recent updates from master branch: usethis::pr_merge_main()
  • If a bug was fixed, a unit test was added.
  • Code coverage is suitable for any new functions/features (generally, 100% coverage for new code): devtools::test_coverage()
  • Request a reviewer

Reviewer Checklist (if item does not apply, mark is as complete)

  • If a bug was fixed, a unit test was added.
  • Run pkgdown::build_site(). Check the R console for errors, and review the rendered website.
  • Code coverage is suitable for any new functions/features: devtools::test_coverage()

When the branch is ready to be merged:

  • Update NEWS.md with the changes from this pull request under the heading "# cards (development version)". If there is an issue associated with the pull request, reference it in parentheses at the end update (see NEWS.md for examples).
  • All GitHub Action workflows pass with a ✅
  • Approve Pull Request
  • Merge the PR. Please use "Squash and merge" or "Rebase and merge".

@jtalboys
Copy link
Collaborator Author

Even just creating this PR I can see there's some grammar/spellings that need fixing - I'll do another pass to fix all that but please let me know if the content is what we're after @ddsjoberg @bzkrouse

Copy link
Collaborator

@ddsjoberg ddsjoberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great!

Just a few initial comments

)
```

The basic functions offered by {cards} can create a wide variety of ARDs. However, sometimes we may need to include the outputs from more complicated statistical methods in our ARDs. In this article we'll look at a few different ways to implement the output from these statistical methods.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put each sentence on a new line? It makes it easier to track changes to the article in the future.

dplyr::mutate(context = "t_test_one_sample")
```

Over 100 different statistical methods implemented in R are able to be 'tidied' using `broom::tidy`. However, the method you aim to use might not be, or the current `broom::tidy` implementation might not contain the information that you need to be in your ARD. In that case we'll have to format the output ourselves.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make the distinction that only broom::tidy() methods that return a single row of results work here?


As an example, let's write a function which carries out a Wilcoxon signed rank test over one variable using the function `wilcox.test`. As an output we just want to record the method and the p-value.

```{r wilcox-function}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be easier to read as wilcox_one_var <- \(x) wilcox.test(x)[c("method", "p.value")]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vignette on creating ARDs for stat methods not implemented
2 participants