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

Log-transform yi estimates prior to fitting MA mod #118

Closed
egouldo opened this issue Aug 15, 2024 · 2 comments · Fixed by #121
Closed

Log-transform yi estimates prior to fitting MA mod #118

egouldo opened this issue Aug 15, 2024 · 2 comments · Fixed by #121
Assignees
Labels
bug an unexpected problem or unintended behavior feature a feature request or enhancement

Comments

@egouldo
Copy link
Owner

egouldo commented Aug 15, 2024

  • update downstream processing to log-transform out-of-sample euc estimates

Originally posted by @egouldo in #88

See also: egouldo/ManyAnalysts#63

@egouldo egouldo added bug an unexpected problem or unintended behavior feature a feature request or enhancement labels Aug 15, 2024
@egouldo egouldo added this to the Respond Reviewer Comments milestone Aug 15, 2024
@egouldo egouldo self-assigned this Aug 15, 2024
egouldo added a commit that referenced this issue Aug 15, 2024
- #102 add import tags for `log_transform()` and link to equivalent functions, apply default argument values / checks
- #97 rename out argument
egouldo added a commit that referenced this issue Aug 15, 2024
- equivalent to `pred_to_z()`
- #102 write documentation
egouldo added a commit that referenced this issue Aug 15, 2024
- #118 adapt response variable preparation to accept additional argument `dataset_log_transform` apply argument checks #116, add roxygen param #102
- #118 adapt response variable processing to accept either/or/none for dataset standardisation/log-transformation.
egouldo added a commit that referenced this issue Aug 15, 2024
- #102 add import, return, and see also roxygen doc tags, replace note with details tag, rename fn doc title
- #116 update argument checks conditional expression
- #118 match output to `log_transform_yi()` (now returns additional cols `lower` and `upper`, not only `c("Z","VZ")`)
- #118 match process to `log_transform_yi()` and #97 generalise processing to both euc/bt datasets without hard-coding dataset names in fns, and remove associated dataset-specific argument checking #116
egouldo added a commit that referenced this issue Aug 15, 2024
…dardisation updates

- #118 extract `lower` and `upper` transformed vals in line with addition of `log_transform_response()` / changes to `standardise_response()`
egouldo added a commit that referenced this issue Aug 15, 2024
- #118 add log-transformation equivalent to `standardise_response()` and `process_resonse()`
- #102 add function documentation, including examples
egouldo added a commit that referenced this issue Aug 15, 2024
…pipeline

- #118 call new arg `dataset_log_transform` in fn to log-transform outcomes for euc yi analysis
egouldo added a commit that referenced this issue Aug 15, 2024
egouldo added a commit that referenced this issue Aug 15, 2024
- #118 ensure application of Z_VZ_preds takes the generalised colnames yi, yi_se instead of using hard-coded dataset application #97
egouldo added a commit that referenced this issue Aug 15, 2024
egouldo added a commit that referenced this issue Aug 15, 2024
…lied for standardising / transformation

- accidentally deleted when upgrading for #118, have added creation of transform_datasets tibbles for all cases now, and then these will apply the appropriate functions in final code chunk at end
egouldo added a commit that referenced this issue Aug 23, 2024
- `dat` to `data` to help with auto-matching in pmap within prepare_response_variables() wrapper #118
- ensure all family fns have ... arg for pmap application in prepare_response_variables() since all fns have different argument lengths and names
egouldo added a commit that referenced this issue Aug 23, 2024
…ample code for `log_transform_response()`
egouldo added a commit that referenced this issue Aug 23, 2024
egouldo added a commit that referenced this issue Aug 23, 2024
egouldo added a commit that referenced this issue Aug 23, 2024
… of transformation / standardisation in `standardise_response()`

- #118 delete old pmap helper function
egouldo added a commit that referenced this issue Aug 23, 2024
egouldo added a commit that referenced this issue Aug 23, 2024
egouldo added a commit that referenced this issue Aug 23, 2024
egouldo added a commit that referenced this issue Aug 23, 2024
---

For `ManyEcoEvo_yi` currently which does not have an `estimate_type` col
egouldo added a commit that referenced this issue Aug 23, 2024
…ype` is missing in `ManyEcoEvo` dataframe

- #118 build: devtools::document()
egouldo added a commit that referenced this issue Aug 23, 2024
----

Was returning only the first column as a vector rather than entire output of log_transform_yi() because `ifelse()` returns vectors dummy!
egouldo added a commit that referenced this issue Aug 23, 2024
…ponse_variables() that now create estiamte_type col

---

unnest() was throwing an error after splitting based on scenario numbers because colum estimate_type was duplicated
egouldo added a commit that referenced this issue Aug 24, 2024
…erenc `VZ` colnames (i.e. from `log_transform_response()`) #118

- refactor!: `apply_VZ_exclusions()` to handle different out-of-sample colnames for each dataset #118
egouldo added a commit that referenced this issue Aug 24, 2024
egouldo added a commit that referenced this issue Aug 27, 2024
- expose filtering of subsets to user argument: ignore outlier generation for some subsets
- Expose `n_min` and `n_max` args to user
- Add argument checks #116, inc. checking filter expressions for existance of col names in `data`
- Conditionally slice depending on whether `n_*` args supplied in call
- Define internal helper fns to reduce duplicate code
- Permit multiple logical expressions in argument ignore_subsets
- Allow different values of `n_min` and `n_max` for different `dataset`s

bug!: properly evaluate whether arg `ignore_subsets` is null and parse to `filter_vars`, see `dplyr::dplyr_data_masking`

docs!: Update docs #118

- include functional updates in roxygen docs #102
- rm targets pipeline family tag

style: tidy lint #97

- linespacing / whitespace
- rm TODO comments
- Add section header comments
egouldo added a commit that referenced this issue Aug 27, 2024
bug!: #118 ensure `estimate_type` column is added back in using argument value if existing col is replaced and stop grouping on returned data frame
@egouldo
Copy link
Owner Author

egouldo commented Aug 27, 2024

Almost there. Remaining downstream functions to fix:

  • meta_analyse_datasets() use same approach as n_max/n_min/VZ_cutoff argument matching strategies to deal with different outcome variables
    • calculate_deviation_score()
    • box_cox_transform()
    • fit_sorensen_glm()
  • Check make_viz works as expected after updates on branch

@egouldo egouldo removed this from the Respond Reviewer Comments milestone Aug 28, 2024
egouldo added a commit that referenced this issue Aug 28, 2024
- rm commented out `poss_fit_*()` (now exported internally in 7dabe6d) #97
- replace name of data arg to `data` #97
- switch to rlang::is_null for arg checking #116 / conditional behaviour
- Add arg checking for `filter_vars`, `data`, and checking wither required columns, incl. those in `filter_vars` exist in `data` #116
- expose user-supplied arguments `outcom_variable` / `outcome_SE` and match values to arg conditions in new columns
- update supply of colnames arg to meta-analysis functions

docs!: update corresponding docs #102

- switch to `@importFrom` for `cli::`, add missing `@importFrom` calls
- Add `@details` on user-specified exclusion of outcome variable / outcome variable SE

style: spacing indentation, rm inline TODO comments #97
egouldo added a commit that referenced this issue Aug 28, 2024
…118

- `fit_MA_mv()` switch from `Z_colname` to `outcome_colname` and `VZ_colname` to `outcome_SE_colname` #118
- `calculate_deviation_score()` #118:  expose colname selection column to user , return meta-analytic mean in column, add `outcome_colname` to specify relevant outcome column name, add argument checking #116
- `apply_slice_conditionally()` create column `exclusion_set` if does not exist and switch to `se_log` as `VZ_colname` in example for eucalyptus` #188
- `box_cox_transform()` expose `outcome_SE_colname` arg, add relevant arg checks, update cli output, parse outcome_SE_columns` to `folded_params()` function call #188
- replace `std.error_log` arg with `se_log` for any logged `yi` data #188
- and update wrapper function calls in `meta_analyse_datasets()`, provide NULL default for new arg `outcome_SE` #188
- `fit_box_cox_ratings_cat()`: add arg checks #116, replace arg name `.data` with `data`, switch to `inject` approach as per `fit_box_cox_ratings_cont()` #97
- fit_box_cox_ratings_cont()` switch to `data` arg from `.data`, add arg checks #116
- add arg checks to `standardise_response()`, `fit_sorensen_glm()`, `fit_multivar_MA()` , `fit_uni_mixed_effects()` #116

docs!: update corresponding docs

- delete obsolete `@examples` code #102
- add #TODO comments #97
- add missing `@import` calls
- switch to `@importFrom` from `@import` for `purrr::` `rlang::` and `tidyr::` et al
- don't import `rlang::` in package.R

bug!: minor bug fixes

- unquote bare colname in pointblank check for `exclude_extreme_VZ()`
- `fit_metafor_mv_reduced()` replace obs_id with study_id as random effect
egouldo added a commit that referenced this issue Aug 28, 2024
- add import tag for `purrr::transpose()` in `fit_multivar_MA()` #102
- defuse argument `outcome` in `cli()` call in `fit_boxcox_ratings_cont()`

- `meta_analyse_datasets()`:
  - use correct argument in calls to `fit_boxcox_ratings_*()` (`data` from `.data`)
  - apply coalesce on list-cols only and `@import` `tidyselect::where()` (previously non-list-cols were ignored because character columns were explicitly grouped, however current approach in pipeline is ungrouped in order to allow for generalisability / scalability #87. Can't caoalesce a character vector and list, must be of same type).

build!: update calls in targets `yi` pipeline
@egouldo
Copy link
Owner Author

egouldo commented Aug 28, 2024

huge push! make_viz() fns to check:

  • get_MA_fit_stats()
  • gg_forest()
  • poss_viz_funnel()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant