Skip to content
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

feature request: supporting buildmer class objects #79

Open
IndrajeetPatil opened this issue Sep 29, 2019 · 0 comments
Open

feature request: supporting buildmer class objects #79

IndrajeetPatil opened this issue Sep 29, 2019 · 0 comments

Comments

@IndrajeetPatil
Copy link

buildmer makes it easy to perform stepwise elimination of mixed-effects models fit and it would be nice if this is supported in broom.mixed-

library(buildmer)

m <- buildlme(Reaction ~ Days + (Days | Subject), data = lme4::sleepstudy)
#> Determining predictor order
#> Fitting via lm: Reaction ~ 1
#> Currently evaluating LRT for: Days
#> Fitting via lm: Reaction ~ 1 + Days
#> Updating formula: Reaction ~ 1 + Days
#> Fitting via gls (because REML was requested): Reaction ~ 1 + Days
#> Currently evaluating LRT for: 1 | Subject
#> Fitting via lme, with REML: Reaction ~ 1 + Days, random=~1 | Subject
#> Updating formula: Reaction ~ 1 + Days + (1 | Subject)
#> Currently evaluating LRT for: Days | Subject
#> Fitting via lme, with REML: Reaction ~ 1 + Days, random=~1 + Days | Subject
#> Updating formula: Reaction ~ 1 + Days + (1 + Days | Subject)
#> Fitting ML and REML reference models
#> Fitting via lme, with REML: Reaction ~ 1 + Days, random=~1 + Days | Subject
#> Fitting via lme, with ML: Reaction ~ 1 + Days, random=~1 + Days | Subject
#> Testing terms
#> Fitting via lme, with REML: Reaction ~ 1 + Days, random=~1 | Subject
#>   grouping term           block     score          LRT Iteration
#> 1     <NA>    1         NA NA 1        NA           NA         1
#> 2     <NA> Days      NA NA Days -32.67300           NA         1
#> 3  Subject    1    NA Subject 1 -56.86469           NA         1
#> 4  Subject Days NA Subject Days -22.11155 2.495021e-10         1
#> All terms are significant

summary(m)
#> Linear mixed-effects model fit by REML
#>  Data: lme4::sleepstudy 
#>        AIC      BIC    logLik
#>   1755.628 1774.719 -871.8141
#> 
#> Random effects:
#>  Formula: ~1 + Days | Subject
#>  Structure: General positive-definite, Log-Cholesky parametrization
#>             StdDev    Corr  
#> (Intercept) 24.740241 (Intr)
#> Days         5.922103 0.066 
#> Residual    25.591843       
#> 
#> Fixed effects: Reaction ~ 1 + Days 
#>                 Value Std.Error  DF  t-value p-value
#> (Intercept) 251.40510  6.824516 161 36.83853       0
#> Days         10.46729  1.545783 161  6.77151       0
#>  Correlation: 
#>      (Intr)
#> Days -0.138
#> 
#> Standardized Within-Group Residuals:
#>         Min          Q1         Med          Q3         Max 
#> -3.95355735 -0.46339976  0.02311783  0.46339621  5.17925089 
#> 
#> Number of Observations: 180
#> Number of Groups: 18

Created on 2019-09-29 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> - Session info ----------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.6.1 (2019-07-05)
#>  os       Windows 10 x64              
#>  system   x86_64, mingw32             
#>  ui       RTerm                       
#>  language (EN)                        
#>  collate  English_United States.1252  
#>  ctype    English_United States.1252  
#>  tz       Europe/London               
#>  date     2019-09-29                  
#> 
#> - Packages --------------------------------------------------------------
#>  package     * version    date       lib source                        
#>  assertthat    0.2.1      2019-03-21 [1] CRAN (R 3.6.0)                
#>  backports     1.1.4      2019-04-10 [1] CRAN (R 3.6.0)                
#>  boot          1.3-23     2019-07-05 [1] CRAN (R 3.6.1)                
#>  buildmer    * 1.3        2019-09-28 [1] CRAN (R 3.6.1)                
#>  callr         3.3.2      2019-09-22 [1] CRAN (R 3.6.1)                
#>  cli           1.1.0      2019-03-19 [1] CRAN (R 3.6.0)                
#>  crayon        1.3.4      2017-09-16 [1] CRAN (R 3.5.1)                
#>  desc          1.2.0      2019-04-03 [1] Github (r-lib/desc@c860e7b)   
#>  devtools      2.2.1      2019-09-24 [1] CRAN (R 3.6.1)                
#>  digest        0.6.21     2019-09-20 [1] CRAN (R 3.6.1)                
#>  ellipsis      0.3.0      2019-09-20 [1] CRAN (R 3.6.1)                
#>  evaluate      0.14       2019-05-28 [1] CRAN (R 3.6.0)                
#>  fs            1.3.1      2019-05-06 [1] CRAN (R 3.6.0)                
#>  glue          1.3.1      2019-03-12 [1] CRAN (R 3.6.0)                
#>  highr         0.8        2019-03-20 [1] CRAN (R 3.6.0)                
#>  htmltools     0.3.6      2017-04-28 [1] CRAN (R 3.5.1)                
#>  knitr         1.25       2019-09-18 [1] CRAN (R 3.6.1)                
#>  lattice       0.20-38    2018-11-04 [2] CRAN (R 3.6.1)                
#>  lme4          1.1-21     2019-03-05 [1] CRAN (R 3.6.0)                
#>  magrittr      1.5        2014-11-22 [1] CRAN (R 3.5.1)                
#>  MASS          7.3-51.4   2019-03-31 [1] CRAN (R 3.6.0)                
#>  Matrix        1.2-17     2019-03-22 [1] CRAN (R 3.6.0)                
#>  memoise       1.1.0      2017-04-21 [1] CRAN (R 3.6.0)                
#>  mgcv          1.8-29     2019-09-20 [1] CRAN (R 3.6.1)                
#>  minqa         1.2.4      2014-10-09 [1] CRAN (R 3.5.1)                
#>  nlme          3.1-140    2019-05-12 [2] CRAN (R 3.6.1)                
#>  nloptr        1.2.1      2018-10-03 [1] CRAN (R 3.5.1)                
#>  pkgbuild      1.0.5      2019-08-26 [1] CRAN (R 3.6.1)                
#>  pkgload       1.0.2      2018-10-29 [1] CRAN (R 3.6.0)                
#>  plyr          1.8.4      2016-06-08 [1] CRAN (R 3.5.1)                
#>  prettyunits   1.0.2      2015-07-13 [1] CRAN (R 3.5.1)                
#>  processx      3.4.1      2019-07-18 [1] CRAN (R 3.6.1)                
#>  ps            1.3.0      2018-12-21 [1] CRAN (R 3.6.0)                
#>  R6            2.4.0      2019-02-14 [1] CRAN (R 3.6.0)                
#>  Rcpp          1.0.2      2019-07-25 [1] CRAN (R 3.6.1)                
#>  remotes       2.1.0      2019-06-24 [1] CRAN (R 3.6.0)                
#>  rlang         0.4.0      2019-06-25 [1] CRAN (R 3.6.0)                
#>  rmarkdown     1.15       2019-08-21 [1] CRAN (R 3.6.1)                
#>  rprojroot     1.3-2      2018-01-03 [1] CRAN (R 3.5.1)                
#>  sessioninfo   1.1.1      2018-11-05 [1] CRAN (R 3.6.0)                
#>  stringi       1.4.3      2019-03-12 [1] CRAN (R 3.6.0)                
#>  stringr       1.4.0      2019-02-10 [1] CRAN (R 3.6.0)                
#>  testthat      2.2.1      2019-07-25 [1] CRAN (R 3.6.1)                
#>  usethis       1.5.1.9000 2019-09-12 [1] Github (r-lib/usethis@a2342b8)
#>  withr         2.1.2      2018-03-15 [1] CRAN (R 3.5.1)                
#>  xfun          0.9        2019-08-21 [1] CRAN (R 3.6.1)                
#>  yaml          2.2.0      2018-07-25 [1] CRAN (R 3.5.1)                
#> 
#> [1] C:/Users/inp099/Documents/R/win-library/3.6
#> [2] C:/Program Files/R/R-3.6.1/library
@IndrajeetPatil IndrajeetPatil changed the title supporting buildmer class objects feature request: supporting buildmer class objects Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant