rpr: Cluster and Subcluster effects

Description Usage Arguments Value Author(s) References See Also Examples

Description

Partitions model residuals into cluster and subcluster effects using RPP algorithm.

Usage

1
rpr(f, resd, data, rprpair = "hl-disp")

Arguments

f

A model formula which specifices the random effects (see example)

resd

The residuals from the fitted model

data

The data the model was fitted on

rprpair

Character string indicating the location and scale parameters to use. Default to "hl-disp", but may also be "med-mad". See Bilgic (2012).

Value

siga2

Variance from cluster

sigw2

Variance from subcluster

sigmae2

Remaining variance not accounted for by variance of cluster and subcluster

Author(s)

J. W. McKean and Y. K. Bilgic

References

Y. K. Bilgic. Rank-based estimation and prediction for mixed effects models in nested designs. 2012. URL http://scholarworks.wmich.edu/dissertations/40. Dissertation.

See Also

rprmeddis, dispvar

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Load school data
data(schools)

# Fit fixed effects model with lmr
lmr.fit = lmr(y ~ age + sex, data=schools)

# Three level design
# Partition residuals into school and region effects with rpp algorithm
rpr(y ~ age + sex + (1 | school) + (1 | school:region), lmr.fit$ehat, schools)

# Two level design
# Estimate variance in residuals from school
rpr(y ~ age + sex + (1 | school), lmr.fit$ehat, schools)

rlme documentation built on May 2, 2019, 3:47 p.m.