modelsummary | Beautiful and customizable model summaries in R | Grid library

 by   vincentarelbundock R Version: 1.4.0 License: GPL-3.0

kandi X-RAY | modelsummary Summary

kandi X-RAY | modelsummary Summary

modelsummary is a R library typically used in User Interface, Grid applications. modelsummary has no bugs, it has no vulnerabilities, it has a Strong Copyleft License and it has low support. You can download it from GitHub.

modelsummary creates tables and plots to summarize statistical models and data in R. The tables and plots produced by modelsummary are beautiful and highly customizable. They can be echoed to the R console or displayed in the RStudio Viewer. They can be saved to a wide variety of formats, including HTML, PDF, Text/Markdown, LaTeX, MS Word, RTF, JPG, and PNG. Tables can easily be embedded in dynamic documents with Rmarkdown, knitr, or Sweave. modelsummary supports hundreds of model types out-of-the-box. The look of your tables is infinitely customizable using external package such as kableExtra, gt, flextable, or huxtable.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              modelsummary has a low active ecosystem.
              It has 723 star(s) with 62 fork(s). There are 9 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 11 open issues and 519 have been closed. On average issues are closed in 16 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of modelsummary is 1.4.0

            kandi-Quality Quality

              modelsummary has 0 bugs and 0 code smells.

            kandi-Security Security

              modelsummary has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              modelsummary code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              modelsummary is licensed under the GPL-3.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              modelsummary releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 1845 lines of code, 0 functions and 15 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of modelsummary
            Get all kandi verified functions for this library.

            modelsummary Key Features

            No Key Features are available at this moment for modelsummary.

            modelsummary Examples and Code Snippets

            No Code Snippets are available at this moment for modelsummary.

            Community Discussions

            QUESTION

            Show count of unique values in datasummary and combine two different tables of descriptive statistics using data
            Asked 2022-Apr-04 at 14:15

            I really like the modelsummary package and i'm trying to produce a single table that mixes descriptive statistics of different types. The first part is easy: I can make basic descriptives of var2 and var3 before. I can't get the second part right, though.

            1. I'd like to get a count of the unique entries of the variable var1, i.e. 26.
            2. I'd like to be able to combine the two into one table.
            ...

            ANSWER

            Answered 2022-Apr-04 at 14:11

            Mixing factor and numeric variables in datasummary() is kind of tricky. Here are two options.

            The first approach is to create a first table with output="data.frame", and to feed it to the add_rows argument of a second table, inserting “empty” columns as necessary to align the two tables:

            Source https://stackoverflow.com/questions/71737847

            QUESTION

            How can I use a for loop to run regression?
            Asked 2022-Mar-31 at 16:20

            My current dataset looks like:

            ...

            ANSWER

            Answered 2022-Mar-29 at 13:04

            I can't replicate your example with the provided code. Neverthless, you can use a loop like this:

            Source https://stackoverflow.com/questions/71661565

            QUESTION

            Creating loop over columns to calculate regression and then compare best combination of variables
            Asked 2022-Mar-24 at 19:14

            I am trying to run a loop which takes different columns of a dataset as the dependent variable and remaining variables as the independent variables and run the lm command. Here's my code

            ...

            ANSWER

            Answered 2022-Mar-24 at 17:53

            We could change the line of fit with

            Source https://stackoverflow.com/questions/71605227

            QUESTION

            Modelsummary: Different formats for estimates and extra rows from add_rows
            Asked 2022-Mar-24 at 12:18

            This question is similar in spirit to Modelsummary: Different formats for estimates and statistics, but concerns the formatting for "additional rows" created with the add_rows function of the (excellent) modelsummary package. As far as I can tell, these cannot be formatted in a similar manner (though hopefully I'm not missing something basic!). Here's a simple reproducible example.

            ...

            ANSWER

            Answered 2022-Mar-24 at 12:18

            Currently, the fmt argument only works for estimates and statistics, and the gof_map argument only works for goodness-of-fit statistics that are extracted automatically by modelsummary.

            Your idea is interesting, and I tried to think about what kind of user-interface could be used to achieve this. However, all the ideas I came up with were way less elegant than the ultra simple base R code I paste below.

            If you have a better idea for a user-interface, feel free to propose it on Github.

            Source https://stackoverflow.com/questions/71579714

            QUESTION

            Adding a LaTeX reference label to a table in modelsummary
            Asked 2022-Mar-24 at 12:03

            I'm trying to produce tables in R (not RMarkdown, as this question helps answer) with modelsummary and I'm having a tough time adding reference labels (e.g., tab:hello). As Vincent points out in this answer, extra arguments to modelsummary should be pushed forward automatically, but it seems this does not work with LaTeX labels. Here's an example:

            ...

            ANSWER

            Answered 2022-Mar-24 at 12:03

            I believe this is a limitation in LaTeX itself, which requires a caption for proper table numbering and referencing. See this answer for a discussion and an alternative mechanism:

            https://tex.stackexchange.com/a/438267/16188

            Beyond that, I think it is useful to note that this is not a modelsummary-specific issue. As you may know, modelsummary supports several table-making packages that produce different output formats: kableExtra, gt, flextable, or huxtable. The default table-maker for LaTeX is kableExtra.

            Here’s a minimal example in kableExtra that reproduces the same problem:

            Source https://stackoverflow.com/questions/71580556

            QUESTION

            Augmenting/Mutating of Model objects in R
            Asked 2022-Mar-22 at 21:38

            So I am running multiple cochrane orcutt regressions, which is no problem. I then display the output of these regressions using modelsummary(). Still no problems up to this point.

            However, when I then try to compare the models using modelplot(), there are no confidence intervals computed in the cochrane orcutt model (class "orcutt") and I thus get the following error:

            Error in eval(parse(text = text, keep.source = FALSE), envir) : object 'conf.low' not found

            I know what the problem here is - there are just no confidence interval "parts" computed by the cochrane.orcutt() command. A partial solution is also obvious - I can just calculate the confidence intervals using the point estimates/coefficients and the standard errors (which are of course included in the model by default).

            However my problem arises when I want to use these confidence interval values in modelplot(), because they are not "in" the model object. In my ignorance, I attempted the following to try and create the lower bound of a confidence interval, using mutate():

            ...

            ANSWER

            Answered 2022-Mar-22 at 21:38

            As noted in the comments, mutate is a function from the dplyr package which is intended to work on data frames, and not on model objects or on modelsummary tables.

            Also, please note that I can’t diagnose your problem properly because you did not supply a MINIMAL REPRODUCIBLE EXAMPLE and you don’t event tell us which function you used to estimate the model.

            One way to do the Cochrane-Orcutt in R is to use the orcutt package:

            Source https://stackoverflow.com/questions/71576891

            QUESTION

            How can I use Newey-West Standard Errors in modelplot(), in R?
            Asked 2022-Mar-21 at 12:53

            apologies if I write anything wrong - this is my first post. I am doing some time series regressions on the different determinants of house prices for different countries, and would like to use modelplot() to showcase the different coefficients for one variable across all the countries. This is the easy part, and I have it done. However, when I try to run this code to try and include Newey-West std. errors:

            ...

            ANSWER

            Answered 2022-Mar-21 at 12:49

            The modelplot documentation notes that the vcov argument can be either a list of functions, or a list of matrices, or a vector of strings. This means that both of these commands should work:

            Source https://stackoverflow.com/questions/71550549

            QUESTION

            Display statistics for the whole sample as well as subgroups with modelsummary or similar packages
            Asked 2022-Mar-11 at 20:00

            I am trying to create a table with descriptive statistics for the whole sample as well as subgroups. My goal is to use the wonderful modelsummary R package to return one table with mean, sd, min, median, max, and graphs for the variables calculated for the entire sample as well as mean and sd for every group. I was able to achieve this with two separate tables. However, I would like to have all this information in a single table with the statistics about the entire sample first (see Fig. 1) and the subgroups second (see Fig. 2). If possible, I would also like to add the first-level heading for the whole sample and name it "All" or "Entire sample." Lastly, given that journals in my field require the use of the APA style, I wonder if the table can be turned into this format (e.g., with all the required borders, text in black instead of grey, etc.) (see Fig. 3). If modelsummary does not handle this, I am also open to trying other packages. Thanks so much to anyone who will help!

            ...

            ANSWER

            Answered 2022-Mar-11 at 20:00

            There are two questions here:

            1. How to change the appearance of the table?
            2. How to create a table with a given shape (yet to be specifically defined)?
            Question 1

            The appearance is extremely configurable using the kableExtra package (modelsummary also supports gt, huxtable, and flextable through the output argument). An easy way to change the look is to use the kable_classic() function from kableExtra, as illustrated below. If you have more specific needs, please refer to the kableExtra documentation:

            Question 2

            As noted in the documentation for datasummary(), you can use a 1 to indicate the "full sample". Here is a minimal example:

            Source https://stackoverflow.com/questions/71433724

            QUESTION

            Removing certain parts of modelsummary in R at specific statistics
            Asked 2022-Mar-09 at 13:28

            I am using gamm4:gamm4 to model longitudinal change.

            I am trying to use the modelsummary::modelsummary function to create an output table of the following results:

            I would like to add t-values and std.error to the output of the fixed effects, and remove the empty tags values from the random effects

            ...

            ANSWER

            Answered 2022-Mar-09 at 13:28

            This is kind of tricky, actually. The issue is that modelsummary() automatically drops empty rows when they are filled with NA or an empty string "". However, since glue strings can include arbitrary text, it is hard to think of a general way to figure out if the row is empty or not, because modelsummary() cannot know ex ante what constitutes an empty string.

            If you have an idea on how this check could be implemented, please report it on Github:

            https://github.com/vincentarelbundock/modelsummary

            In the meantime, you could use the powerful tidy_custom.CLASSNAME mechanism to customize the statistic and p.value statistics directly instead of through a glue string:

            Source https://stackoverflow.com/questions/71405838

            QUESTION

            How to transpose a regression output with modelsummary package?
            Asked 2022-Jan-21 at 11:55

            I JUST found out about this amazing R package, modelsummary.

            It doesn't seem like it offers an ability to transpose regression outputs.

            I know that you cannot do a tranposition within kable-extra, which is my go-to for ordinary table outputs in R. Since modelsummary relies on kable-extra for post-processing, I'm wondering if this is possible. Has anyone else figured it out?

            Ideally I'd like to preserve the stars of my regression output. This is available in STATA (below):

            Thanks in advance!

            ...

            ANSWER

            Answered 2022-Jan-18 at 21:35

            You can flip the order of the terms in the group argument formula. See documentation here and also here for many examples.

            Source https://stackoverflow.com/questions/70762148

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install modelsummary

            You can install modelsummary from CRAN:.
            There are a million ways to customize the tables and plots produced by modelsummary. In this Getting Started section we will only scratch the surface. For details, see the vignettes:.
            modelsummary: https://vincentarelbundock.github.io/modelsummary/articles/modelsummary.html
            modelplot: https://vincentarelbundock.github.io/modelsummary/articles/modelplot.html
            datasummary: https://vincentarelbundock.github.io/modelsummary/articles/datasummary.html
            Appearance: https://vincentarelbundock.github.io/modelsummary/articles/appearance.html

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/vincentarelbundock/modelsummary.git

          • CLI

            gh repo clone vincentarelbundock/modelsummary

          • sshUrl

            git@github.com:vincentarelbundock/modelsummary.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link