Comments (3)
I dig it! If folks would find this pedagogically useful, I think this is surely within scope and would have a low maintenance burden. :)
from infer.
I think I can see the value, but I'm having a rough time picturing what procedures would look like based on @andrewpbray's description.
@andrewpbray -- Could you write up a couple of examples as though rep_shuffle_col()
existed? Also, I think the name would need to be something else -- shuffle
is to sample
and slice
is to col
here (though obviously row
would have been better.
rep_slice_sample()
vs.rep_col_shuffle()
rep_slice_sample()
vs.rep_mutate_shuffle()
-- I don't love this at all, but seems more of a parity
from infer.
Here's an example of a permutation test using a difference in means, starting with the existing implementation from full pipeline examples docs.
library(infer)
# existing implementation
null_dist <- gss %>%
specify(age ~ college) %>%
hypothesize(null = "independence") %>%
generate(reps = 1000, type = "permute") %>%
calculate(stat = "diff in means", order = c("degree", "no degree"))
# new approach (to get through the generate step)
gss %>%
rep_col_shuffle(age, reps = 1000)
where the output of the second pipeline would be a data frame with nrow(gss) * reps
rows and ncol(gss) + 1
columns, the new column being replicate
. In that data frame, age
will now be sample(age)
.
The syntax would be the same for a permutation test for a difference in proportions, the coefficient of a linear model, etc.
If we did a close port of rep_slice_sample()
, then that output data frame wouldn't have any of the metadata normally appended by specify()
and hypothesize()
that is used by calculate()
, so the user would have to use dplyr
to group_by(replicate)
and calculate their statistics. I think that's ok.
from infer.
Related Issues (20)
- Residuals and expected cell counts for chi-square tests HOT 7
- issues with p-value shading HOT 1
- Variance/SD hypotesis test HOT 2
- deprecated use of `...` in `dplyr::across()` HOT 1
- hyperlink help-files in error messages HOT 1
- Tidy Chi-Squared Tests: support data that is already a contingency table HOT 3
- Grab other model attributes from `fit()` HOT 1
- `t_test` errors with variables with spaces in them HOT 2
- Upkeep for infer HOT 4
- `usethis::use_testthat(3)` and upgrade to 3e, testthat 3e vignette HOT 1
- ggplot 3.4.0 `size` aesthetic deprecation HOT 1
- vdiffr 1.0.0 `path` argument deprecation HOT 1
- `rep_slice_sample()` doesn't work with integer sampling weights HOT 6
- transition `*_glue()` machinery to cli HOT 1
- Permutation test for paired data HOT 12
- `specify()` not capable of tidyverse programming HOT 7
- prop_test() wrapper incorrectly computing the confidence interval for differences in percents. HOT 5
- Can I get expected values from contingency tables HOT 3
- Contrast matrices are not preserved HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from infer.