-
Notifications
You must be signed in to change notification settings - Fork 3
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
Updated package functions #25
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aso_odds_ratio_function aso_odds_ratio_funciton_repeated
When using data masking and tidy selection no global variable with that name is avalible - it only exisits in the context of the current data frame. Therefore, the CRAN check will complain that there is "no global variable definition for" the variable. In a tidy select context we just use the quoted column name. In a data masking context we must explicitly refere to the current context data fram by writing `.data$variable` when using `variable`.
Note that it was necissary to make a summary method for `svy_vglm` objects, as the summary method for these is not exported from the svyVGAM package.
Add CovariateBalance function
Updated braid_rows function. Updated causal forest examples to run faster. General improvements.
- Option to output eCDF plots - Option to output a table of balance statistics Fixed in RateTest: - Correctly pass formals to grf::rank_average_treatment_effect
… observed outcome for treated minus observed outcome for non-treated.
Use convex optimization to find confidence set of functions of model parameters unless problem is not convex or user specifies otherwise. This solver is expected to be much faster than the previous solver, where a grid of points was projected to the boundary, and is also more accurate, as we are guarantied to get the correct boudaries. Add cli, snow, and doSNOW to suggests. Add improved checks of input to fct_confint.
Added check if package cli is installed when required and asks to install. Improved handling of required data for different choices of matching method and tau_hat_method. Move to complete dplyr data flow. Add a formatted tibble with c-for-benefit results to output.
multi_join implements the functionality in many_merge with additional name and error handling.
- Add check for by_vars - Update check for include_NA to check for boolean instead of logical. - Add check for weightvar - match output to list of possible arguments.
Remove instances were a character is first quoted then deparsed back to a character. Remove substitute from freq_function were symbol func_var is not substituted. Move rename to account for this. Remove unnecessary paste + gsub from deparse substitute pattern in charlson_score. Add check to ensure Person_ID is length 1.
When model_object=TRUE the function returns the output of the modelling function that was used without standardising the output. Early returns are used so unnecessary standardisation is not performed before returning.
Update some names of intermediate tables to make them consistent regardless if using `svyglm` or `svy_vglm`.
Update `odds_ratio_functions' to remove .data pronouns used in situations where a symbol is supposed to refer to an environment object and not a column in the data mask.
Pipe data into add_row to improve readability.
-Place spaces before left parentheses. -Place spaces before curly brackets. -No new line for else in control flow. - Use long form logical operators in control flow. - Check spelling. - Check indentation.
- Use `ifelse` instead of `dplyr::case_when` when there is only one condition. - Combine records using dplyr::across instead of copy-pasting the same function across all health conditions. - Remove lines where columns in func_table are multiplied with 1 (when assigning points for the Charlson specification).
- Add warning about non-positive weights in weightvar. - Check use of embrace. - Check tidyselect syntax (primarily using `dplyr::all_of` instead of embrace). - Check data mask syntax. - Use name injection instead of renaming var1 and var2 columns at the start and restoring names at the end. - Move away from saving separate intermediate objects (func_tablex). Instead keep intermediate steps assigned to func_table. Only keep an intermediate object which are important for other calculations (such as chi-square statistics). Otherwise use pipes to keep track of steps. - Move chi-square calculations to their logical locations in the stream of operations. - Remove conditions in control flow where no changes are made.
- Use requireNamespace to check if suggested package is installed. - Fix punctuation in error messages. - Add missing .data pronouns. - Add missing embrace.
- Remove unecessary control flow when selecting covariates based on the existence of colnames for cf$.orig (both cases are covered by dplyr::all_of. - Add missing embrace operators. - Add missing .data pronouns. - Quote names used in selection.
- Check if suggested packages are installed using requireNamespace. - Add foreach, parallel, doParallel, and CVXR to suggested packages. - Ask user for permission to install a required package if not already installed. - Carry all needed objects into ci_fct and ci_fct_error_handler.
- Update order of formal arguments in fct_confint. - Add documentation of ci_fct_error_handler. - Add documentation of ci_fct. - Update order of formal arguments in CforBenefit. Update default value of n_bootstraps to 999L (only used if CI = "bootstrap". Update default CI value to simple (has low computational cost). Add explicitely arguments match_method and match_distance passed to matchit (... arguments are still passed to matchit).
Add links between odds_ratio_function/freq_function and the repeated variants.
Update the default value of the output argument in freq_function to include "col" in the list of possible inputs, and correct "totalW" to "totalw".
Update the checks of weightvar. When checking the content of the weightvar column of normaldata, a check for NAs are added to the existing check of negative weights. The warning if negative weights or NAs are present is updated to print the index of consecutive rows in the format "a:b".
Fix bug when output=totalw where the columns starting with "Freqw_total_" are removed instead of those starting with "Freq_row_".
Fix check that n_fold is coercible to a positive integer. Replace references to the tibble package with references to the dplyr package. Replace explicit function() with \() when function is volatile. Add more expressive naming. Improve inline comments.
Remove note from documentation that only makes sense for binary outcomes. Add a type component to the output, containing information on the input that was provided to the function.
Remove note from documentation that only makes sense for binary outcomes. Add a type component to the output, containing information on the input that was provided to the function.
Update the default value of the output argument in freq_function to include "col" in the list of possible inputs, and correct "totalW" to "totalw". This fix is replicates the fix from 5872b16 for freq_function_repeated.
Laksafoss
reviewed
Feb 7, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we get rid of rlang and tibble entirely?
Laksafoss
approved these changes
Feb 7, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll make it into issues :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
try_catch_warnings()
.braid_rows()
andflatten_date_intervals()
.freq_function()
,freq_function_repeated()
,odds_ratio_function()
,odds_ratio_function_repeated()
, andmany_merge()
.charlson_score()
.CovariateBalance()
for generalized random forest analysis.CForBenefit()
,CATESurface()
,CausalForestDynamicSubgroups()
,DiscreteCovariatesToOneHot()
,RATEOmnibusTest()
, andRATETest()
for generalized random forest analysis.fct_confint()
,lms()
, andmulti_join()
.