wplmm: Weighted Partially Linear Mixed Effects Model

Description Usage Arguments Details Value See Also Examples

View source: R/wplmm.R

Description

Estimate the regression error variance function nonparametrically from a partially linear mixed effects model fitted using the model fitting function plmm, and refit the model applying the weighted least squares procedure. wplmm returns an object of the ‘wplmm’ class.

Usage

1
2
3
wplmm(object, heteroX, data, nonpar.bws = "h.select", poly.index = 1, 
var.fun.bws = "ROT", var.fun.poly.index = 0, scale.h = 1, trim = 0.01, 
lim.binning = 100, ...)

Arguments

object

a model fitted with plmm.

heteroX

at most two variables conditioning the heteroskedasticity of the regression error variance. If there are two variables, they can be passed either as a 2-element list or a 2-column matrix.

data

an optional data frame containing the variables in the model. If relevant variables are not found in data, they are taken from the environment from which wplmm was called.

nonpar.bws

the bandwidth selection method for the kernel regression of the nonparametric component. The default method “h.select” (cross validation (CV) using binning technique), “hcv” (ordinary CV), “GCV” (generalized CV) and “GCV.c” (generalized CV for correlated data) are available.

poly.index

the degrees of polynomial for the kernel regression of the nonparametric component: either 0 for local constant or 1 (default) for local linear.

var.fun.bws

the bandwidth selection method for kernel regression of the variance function. A rule-of-thumb type method “ROT” (default), “h.select” (cross validation using binning technique) and “hcv” (ordinary cross validation) are available.

var.fun.poly.index

the degree of polynomial of the kernel regression to estimate the nonparametric variance function: either 0 (default) for local constant or 1 for local linear.

scale.h

a scalar or 2-dimensional vector to scale the bandwidths selected for kernel regression of the nonparametric component. The default is 1. When a scalar is given for a nonparametric component of two covariates, it scales the bandwidths in both directions by the same factor.

trim

if estimated variance function values are below the value of trim, they are set to this value. The default is 0.01.

lim.binning

the smallest sample size below which binning techniques are not used to calculate the degrees of freedom of the estimated nonparametric component. Then, the ordinary cross-validation is used instead. This option doesn't apply if “GCV.c” is used for nonpar.bws.

...

optional arguments relevant to h.select or hcv, which include nbins, hstart and hend. See sm.options and hcv.

Details

There are three methods to select bandwidths for kernel regression of the nonparametric variance function: “h.select” and “hcv” call h.select and hcv, respectively, which are functions of the sm package; “ROT” selects the bandwidths for heteroskedasticity conditioning variable w by sd(w)N^{-1/(4+q)} where q is the number of the conditioning variables (1 or 2) and N is the sample size.

Value

coefficients

estimated regression coefficients.

fitted.values

conditional predictions of the response, defined as the sum of the estimated fixed components and the predicted random intercepts.

residuals

residuals of the fitted model, defined as the response values minus the conditional predictions of the response.

var.comp

variance component estimates.

nonpar.values

estimated function values of the nonparametric component at the data points.

h.nonpar

the bandwidths used to estimate the nonparametric component.

var.fun.values

estimated variance function values. Original computations less than the value of trim have been set to the value of trim.

h.var.fun

the bandwidths used to estimate the nonparametric variance function.

rank

the degrees of freedom of the parametric component, which doesn't include the intercept term.

df.residual

the residual degrees of freedom defined as N-p-tr(2S-S^T) where N is the sample size, p is the rank of the parametric component, and S is the smoother matrix for the nonparametric component. If “GCV.c” is used for nonpar.bws, alternative definition N-p-tr(2SR-SRS^T) is applied with R being the estimated correlation matrix of the data.

nbins

the number of bins (which would have been) used for binning for CV and the calculation of the degrees of freedom.

formula

formula passed to wplmm.

call

the matched call to wplmm.

h0.call

the matched call to select.h0 underlying the plmm that yielded the object.

plmm.call

the matched call to the plmm that yielded the object.

xlevels

if there are factors among the covariates in the parametric component, the levels of those factors.

heteroX

the names of the heteroskedasticity conditioning variables.

See Also

plmm, h.select, hcv, sm.options.

Examples

1
2
3
4
data(plmm.data)
model <- plmm(y1~x1+x2+x3|t1, random=cluster, data=plmm.data)
model2 <- wplmm(model, heteroX=x3, data=plmm.data)
summary(model2)

plmm documentation built on May 2, 2019, 7:29 a.m.