bbolker / broom.mixed

tidy methods for mixed models in R
227 stars 23 forks source link

feature request: partially linear mixed effects model (`plmm`) models #52

Open IndrajeetPatil opened 5 years ago

IndrajeetPatil commented 5 years ago
# setup
set.seed(123)
library(plmm)
#> Loading required package: sm
#> Package 'sm', version 2.2-5.6: type help(sm) for summary information
#> Loading required package: Formula
#> Loading required package: nlme
data(plmm.data)

# model
mod <-
  plmm::plmm(formula = y0 ~ x1 + x2 + x3 |
               t1,
             random = cluster,
             data = plmm.data)

# class
class(mod)
#> [1] "plmm"

# summary
summary(mod)
#> Partially Linear Mixed Effects Model 
#> Call:
#> plmm::plmm(formula = y0 ~ x1 + x2 + x3 | t1, random = cluster,      data = plmm.data) 
#> Convergence after 3 iterations 
#> 
#> Variance components (FC) :
#>       cluster idiosyncratic 
#>      2.141472      1.090061 
#> 
#> Fixed coefficients:
#>      Estimate
#> x1  0.9479039
#> x2  0.5057765
#> x3 -1.0128097
#> 
#> Nonparametric component: t1 
#> Method: Local Linear 
#> Bandwidth selection: h.select 
#> Bandwidth: 0.5225235

Created on 2018-12-26 by the reprex package (v0.2.1)