splmm (version 1.1.2)

splmm: Function to fit linear mixed-effects model with double penalty for fixed effects and random effects

Description

All the details of the algorithm can be found in the manuscript.

Usage

splmm(x, y, z, grp, lam1, lam2, nonpen.b=1,nonpen.L=1,penalty.b=c("lasso","scad"),
      penalty.L=c("lasso","scad"),CovOpt=c("nlminb","optimize"),
      standardize=TRUE,control=splmmControl())

# S3 method for default splmm(x, y, z, grp, lam1, lam2, nonpen.b=1,nonpen.L=1,penalty.b=c("lasso","scad"), penalty.L=c("lasso","scad"),CovOpt=c("nlminb","optimize"), standardize=TRUE,control=splmmControl())

Arguments

x

matrix of dimension N x p including the fixed-effects covariables. An intercept has to be included in the first column as (1,...,1).

y

response variable of length N.

z

random effects matrix of dimension N x q. It has to be a matrix, even if q=1.

grp

grouping variable of length N

lam1

regularization parameter for fixed effects penalization.

lam2

regularization parameter for random effects penalization.

nonpen.b

Index of indices of fixed effects not penalized. The default value is 1, which means the fixed intercept is not penalized

nonpen.L

Index of indices of random effects not penalized. The default value is 1, which means the random intercept is not penalized

penalty.b

The penalty method for fixed effects penalization. Currently available options include LASSO penalty and SCAD penalty.

penalty.L

The penalty method for fixed effects penalization. Currently available options include LASSO penalty and SCAD penalty.

CovOpt

which optimization routine should be used for updating the variance parameter. The available options include optimize and nlminb. nlminb uses the estimate of the last iteration as a starting value. nlminb is faster if there are many Gauss-Seidel iterations.

standardize

A logical parameter specifying whether the fixed effects matrix x and random effects matrix z should be standardized such that each column has mean 0 and standard deviation 1. The default value is TRUE

control

control parameters for the algorithm and the Armijo Rule, see 'splmmControl' for the details

Value

A 'splmm' object is returned, for which coef,resid, fitted, print, summary methods exist.

data

data set used for fitting the model, as a list with four components: x, y, z, grp (see above)

coefInit

list of the starting values for beta, random effects covariance structure, and variance structure

penalty.b

The penalty method for fixed effects penalization.

penalty.L

The penalty method for random effects penalization.

nonpen.b

Index of indices of fixed effects not penalized.

nonpen.L

Index of indices of random effects not penalized.

lambda1

regularization parameter for fixed effects penalization scaled by the number of subjects.

lambda2

regularization parameter for random effects penalization the number of subjects.

sigma

standard deviation \(\hat{\sigma}\) of the errors

D

The estimates of the random effects covariance matrix \(\hat{D}\).

Lvec

Vectorized \(\hat{L}\), the lower triangular matrix of \(\hat{D}\) from Cholesky Decomposition.

coefficients

estimated fixed-effects coefficients \(\hat{\beta}\)

random

vector with random effects, sorted by groups

ranef

vector with random effects, sorted by effect

u

vector with the standardized random effects, sorted by effect

fixef

estimated fixed-effects coeffidients \(\hat{\beta}\)

fitted.values

The fitted values \(\hat{y} = \hat{X} \beta + Z \hat{b}_i\)

residuals

raw residuals \(y-\hat{y}\)

corD

Correlation matrix of the random effects

logLik

value of the log-likelihood function

deviance

deviance=-2*logLik

npar

Number of parameters. Corresponds to the cardinality of the set of nonzero coefficients plus the number of nonzero variance in D

aic

AIC

bic

BIC

bbic

Modified BIC defined by Wang et al (2009)

ebic

Extended BIC defined by Chen and Chen (2008)

converged

Does the algorithm converge? 0: correct convergence ; an odd number means that maxIter was reached ; an even number means that the Armijo step was not succesful. For each unsuccessfull Armijo step, 2 is added to converged. If converged is large compared to the number of iterations counter, you may increase maxArmijo.

counter

The number of iterations used.

stopped

logical indicating whether the algorithm stopped due to too many parameters, if yes need to increase lam1 or lam2

CovOpt

optimization routine

control

see splmmControl

objective

Value of the objective function at the final estimates

call

call

Examples

Run this code
# NOT RUN {
## Use splmm on the Kenya school cognitive data set


data(cognitive)

x <- model.matrix(ravens ~schoolid+treatment+year+sex+age_at_time0
                  +height+weight+head_circ+ses+mom_read+mom_write
                  +mom_edu, cognitive)
z <- x

fit <- splmm(x=x,y=cognitive$ravens,z=z,grp=cognitive$id,lam1=0.1,
lam2=0.1,penalty.b="lasso", penalty.L="lasso")
summary(fit)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab