Comments (6)
Dear Karl,
in the current version, you can add groups of control variables (and their combination) as follows:
library(specr)
results <- run_specs(
df = dplyr::mutate(example_data, c3 = runif(dplyr::n())),
y = c("y1", "y2"),
x = c("x1", "x2"),
model = c("lm"),
controls = c("c1 + c2", "c1 + c3") # note the different notation here
)
dplyr::distinct(results, controls)
#> # A tibble: 4 x 1
#> controls
#> <chr>
#> 1 c1 + c2 + c1 + c3
#> 2 c1 + c2
#> 3 c1 + c3
#> 4 no covariates
As you can see, the function produces also the combination of the "combinations". You would need to remove this specification afterwards, if it doesn't make sense to you.
We have considered including all combinations of controls, but as you said that increases the amount of specifications considerably (and for a standard routine potentially unnecessarily). I'll have to think about this more and might add some more standardized procedures in the next version.
Hope this helps!
from specr.
Hi @masurp,
Ah, that's very helpful, thank you!
Another tool that might be useful is purrr::cross_df
and its .filter
argument, which could be used in place of expand.grid
in setup_specs
to drop specifications before they're run.
(If that change sounds useful, I would be happy to submit a PR in a few weeks.)
from specr.
results <- run_specs(
df = dplyr::mutate(example_data, c3 = runif(dplyr::n())),
y = c("y1", "y2"),
x = c("x1", "x2"),
model = c("lm"),
controls = c("c1 + c2", "c1 + c3") # note the different notation here
)
plot_specs(results)
One problem with this approach is that the graph doesn't recognize "c1+c2" or "c1+c3" as separate groups in the 'controls' section. Instead, they get lumped together as 'all covariates':
from specr.
Hi,
run_specs() no longer puts them together in the newest development version. Please install the latest version, and it should print them all separately. Will push to CRAN soon.
Best,
Philipp
from specr.
Great, that works!
from specr.
I just found out on my own that I can include "groups" using this notation and it's very useful. Can this be added to the guides on the website?
from specr.
Related Issues (20)
- Problem treating xยดs as pairs HOT 1
- Request: allow weighting and clustering HOT 2
- Request: order by specification HOT 3
- Singleton control set produces duplicates HOT 1
- Calculate models for all combinations of covariates HOT 2
- Error in run_spec with input res HOT 4
- Run a list of predefined specifications HOT 3
- Request: Perform joint test across specification curves HOT 3
- run_specs following setup_specs HOT 4
- specs using weighted survey data HOT 1
- Bug: `plot_specs()` plot is uninterpretable if there are many covariates. HOT 5
- Models are not found when they are elements of a list. HOT 5
- Don't get "no covariates" in fixed effects regression HOT 1
- How does specr handle dummy coded categorical variables HOT 2
- Categorical independet variable HOT 2
- Testing the effect of an interaction term HOT 4
- Interactions question HOT 2
- How to customise the colours in specr plots HOT 1
- np Package errors HOT 2
- Show choices together with options on the left? HOT 2
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 specr.