Git Product home page Git Product logo

Comments (6)

ewenharrison avatar ewenharrison commented on July 29, 2024 1

Thanks Jan.
Yes I see that.
An alternative workaround is this:

colon_s %>% 
  glmmulti("mort_5yr", "age.factor") %>% 
  fit2df(condense = FALSE) %>% 
  dplyr::select(-p) %>% 
  condense_fit()

Interested in your thoughts.

from finalfit.

epi-stats avatar epi-stats commented on July 29, 2024 1

Nice!
Wouldn't call it a workaround but rather a solution.
But not easy to find out. Maybe an example in the help file would be good.

from finalfit.

epi-stats avatar epi-stats commented on July 29, 2024 1

You are my hero, Thanks.

from finalfit.

ewenharrison avatar ewenharrison commented on July 29, 2024

I’ve never done it before which is why it isn’t documented 😬
I’ll add it.
There’s lots of variations here. Had you found that?
https://finalfit.org/articles/all_tables_examples.html
Thanks again.

from finalfit.

epi-stats avatar epi-stats commented on July 29, 2024

Of course I had a look at https://finalfit.org/articles/all_tables_examples.html
But if I am not mistaken, there is also no example with condense = FALSE

There is one other point which could be improved:
In epidemiology we are interested in row percentages not in column percentages.
If you look at your example: 2.01 Default Logistic regression first.
You are interested how different risk factors/exposures influence disease outcomes.
E.g. is case fatality higher in age < 40 compared to 45-60
The row percentages are also closer to the odds ratio which is on fact:
(Alive[risk]/Dead[risk]) / (Alive[no-risk]/Dead[no-risk])

I applied your trick mentioned above:
df <- data.frame(out=factor(rbinom(200,1,.5)), a=factor(rbinom(200,3,.5)), b=factor(rbinom(200,4,.5)))

ff <- df %>% summary_factorlist("out", c("a","b"), fit_id=TRUE) %>%
finalfit_merge(
fit2df(glmmulti(df, "out", c("a","b"), family = binomial), condense = FALSE) %>%
dplyr::select(-p) %>%
condense_fit()
)

But I think an argument column in funtion finalfit or finalfit.glm would be easy to implement.
Maybe something like:

finalfit.glm = function(.data, dependent, explanatory, [...]
keep_fit_id=FALSE, column = TRUE, ...){

summary.out = summary_factorlist(.data, dependent, explanatory, [...] , column=column,

from finalfit.

ewenharrison avatar ewenharrison commented on July 29, 2024

Hi,
If you pull from github you can now choose row proportions column = FALSE in finalfit() which is the new default.
devtools::install_github('ewenharrison/finalfit')

You can also use the helper function ff_remove_p() which will do as it says for any Finalfit condensed output. Let me know if there are issues. Thank you again.

from finalfit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.