Questions tagged [broom]

broom is an R package for converting statistical analysis objects into "tidy" data frames

Thebroom package provides functions for converting statistical analysis objects into "tidy" tibbles in the R programming language.

The three main verbs of broom are:

  • tidy() summarizes information about model components;
  • glance() reports information about the entire model;
  • augment() adds informations about observations to a dataset.

For more information:

339 questions
0
votes
0 answers

R dplyr passing and returning dataframe from an object

I'm an R beginner and am using dplyr and trying to incorporate a custom function into my R script. I have a data frame called ss, I want to apply filters to it, but I want to separate out the filters into a separate function so it can be shared with…
user791793
  • 413
  • 1
  • 6
  • 19
0
votes
1 answer

Any way to use rma() outputs with broom package?

I am doing meta-analysis research and really fond of the metafor package in R. However, to be able to leverage all the great things you can do with R, for example managing many different models in a nested data.frame (Thanks to Hadley Wickham and…
0
votes
1 answer

Fit series of linear models to separate dependent variables for a different grouping variable

Hi: I have six continuous dependent variables and one independent variable for three countires. I would like to see what the coefficient is for y1 to y6 ~ x1 for each country. Is there a way to do this neatly with dplyr and broom? I know dplyr…
spindoctor
  • 1,719
  • 1
  • 18
  • 42
0
votes
1 answer

Wrangling clusters/centers of kmeans back into original data frame

Here's some data. df <- data.frame(groupvar=rep(c('a','b'),100),v1=rnorm(200),v2=rnorm(200)) Now I do k means within each group: require(dplyr) kobjs = df %>% group_by(groupvar) %>% do(kclust = kmeans(cbind(.$v1,.$v2),centers=5)) "kobjs" looks…
Nicholas Root
  • 535
  • 3
  • 15
0
votes
0 answers

Conditional nls fitting with dplyr+broom

I am using the dplyr and broom combination and try to fitting regression models depending on the condition inside of the data groups. Finally I want to extract the regression coefficients by each group. So far I'm getting the same fitting results…
Alexander
  • 4,527
  • 5
  • 51
  • 98
-1
votes
1 answer

Improving survival curves

Could someone help me improve my below coding as I don't think that I am quite getting the answer to this question? It is based on an R database VA. "using the td data frame below and ggplot, produce a single graphic that allows comparison of…
Dearbhla
  • 1
  • 1
-1
votes
1 answer

Pooled estimates - regression model with broom and tidyverse

I'm working with a team and some people are using SPSS to replace missing case (multiple imputation) and, then, analyze the data. When SPSS impute new values, it reports every dataset result and a pooled result, that is different than the mean of…
Luis
  • 1,388
  • 10
  • 30
-1
votes
1 answer

How to Graph regression coefficients (or other estimates for model parameters) from (nested) regression models by condition?

I'm trying to plot regression coefficients from a (nested) dataframe (by condition) for which i ran four regression models for the four condtitions (with multiple predictors) on the nested data within each condition. Plotting the R-Squared values…
Benjamin Telkamp
  • 1,451
  • 2
  • 17
  • 31
-2
votes
1 answer

How do I add select function to select colmuns that I wanted in the glance function?

How do I add "select()" after "glance()" to select values "r.squared" ?
1 2 3
22
23