


Generally I trust the package authors in this regard, which means if the values are calculated this way elsewhere (e.g. They are uncontroversial: no one would argue that they should be calculated differently or that they're unhelpful.I know rms tidiers have been a long wait- the truth is that I don't understand the package and statistical methods nearly well enough to get the tidiers right Generally I support adding measures if they fit roughly these conditions: Thank you both for this really interesting discussion. # Stop here for separate **rows** for coefficient and ratio effects Separate( term, into = c( "term ", "type ")) Sprintf( "%s, ratio ", dplyr ::lag( term)),ĭplyr ::select( - type, - low, - high) % >% # "term" will temporarily be "variable, " term = ifelse( term %in% c( "Hazard Ratio ", "Odds Ratio "), Lowc = ifelse(is.na( lowc), dplyr ::lag( lowc), lowc), Highc = ifelse(is.na( highc), dplyr ::lag( highc), highc), Ifelse( term %in% paste(c( "Hazard ", "Odds "), "Ratio "), NA, Mutate( highc = ifelse( !is.na( highc), highc, # Create character versions of all low/high values for each row Separate( term, into = c( "term ", "highc ", "lowc "), sep = " * * ") % >% # Separate variable names from adjust-to values I'm sure it could be more elegant, and I'll apologize in advance if a PR would be better - I'm very new at using Github for collaborating! I have a function that I've been working on that does some similar things, but it's not production-ready and definitely not in the tidy/broom format.
HIGH A VS HIGHC CODE
I've included some code I wrote for your that does the above. Separate rows with an indicator for type, much like Frank already has (type 1 or 2), but with variable names instead of "Hazard Ratio," for example.Great for preserving all information and quickly selecting the ratio-related values, but doesn't lend itself to consistency with methods for ols. Separate columns for the original and ratio quantities.(I usually don't need the values on the original scale, so end up subsetting the data to just the ratio rows after some preliminary work.) That could mean a couple of things (at least), and I'm not sure what would be best. Somehow get the data in a format where I can quickly and easily get the HR/ORs.Separate the variable names completely from the adjust-to values, and replace the numeric versions of character versions with their character counterparts (naturally that does force the low and high columns to be formatted as character as well).But I do have lots of experience doing my own version of "tidying" these results for (hopefully) clear and concise presentation! Usually I do the following: I'm just now exploring broom, so definitely don't know what would be most consistent with the typical package mentality.
