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

Suggestion for new package covering missing stat functions #12

Closed
msberends opened this issue Jun 3, 2021 · 12 comments
Closed

Suggestion for new package covering missing stat functions #12

msberends opened this issue Jun 3, 2021 · 12 comments

Comments

@msberends
Copy link

Would it be an idea to add another package with stat functions you would expect to be in stats but they are not?

Harmonic mean, geometric mean, mode, correlation of variance, standard errors, these kind of things? I could think of tens of obvious functions.

@bwiernik
Copy link
Contributor

bwiernik commented Jun 3, 2021

I'm not sure exactly what you mean by correlation of variance or standard errors. Could you elaborate?

@msberends
Copy link
Author

As far as I know, there is no cv() function such as:

# coefficient of variation
cv <- function(..., na.rm = FALSE) {
  sd(c(...), na.rm = na.rm) / mean(..., na.rm = na.rm)
}

Another example, the coefficient of quartile variation (CQV, example in other package):

cqv <- function(x, na.rm = FALSE) {
  q1 <- quantile(x, 0.25)
  q3 <- quantile(x, 0.75)
  (q3 - q1) / (q3 + q1)
}

Wouldn’t the easystats be a great place for missing, obvious stat functions?

@msberends
Copy link
Author

Ah, sorry, I now see I wrote ‘correlation’, where I meant ‘coefficient’. Excuse me!

@DominiqueMakowski
Copy link
Member

I don't think there's enough of these for now to warrant their own separate package, but they could probably be incorporated within others, such as for instance bayestestR or parameters that have some functions to describe vectors

@bwiernik
Copy link
Contributor

bwiernik commented Jun 4, 2021

I think these could go in either parameters or datawizard

@IndrajeetPatil
Copy link
Member

Yes, this would be a nice addition. I would vote for including them in datawizard.

@strengejacke
Copy link
Member

CV (currently also in sjstats) is something that would fit into performance, since it somewhat close to r2() or rmse().

@strengejacke
Copy link
Member

Maybe also some of the summary statistics from sjstats can be implemented in datawizard?

@msberends
Copy link
Author

I don't think there's enough of these for now to warrant their own separate package

This could use some investigation. I’d like to think the opposite, but I’ll look around for blogs and question of people missing such functions in base R or ‘stats’.

@IndrajeetPatil
Copy link
Member

Maybe also some of the summary statistics from sjstats can be implemented in datawizard?

Yes, a few of them can definitely be implemented.

Also, the weighted functions you have might also be helpful to be included in datawizard.

@bwiernik
Copy link
Contributor

bwiernik commented Jun 5, 2021

The describe distribution functions in general could be moved from parameters to datawizard (and re-exported).

@IndrajeetPatil
Copy link
Member

Some of these functions have already been added in this repo, while there are open issues for the rest (#232, easystats/performance#433, etc.).

So I am going to close the current issue.

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

No branches or pull requests

5 participants