get_clustered_eps: Calculate residuals restricted under H0

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Given regression model and clustering, this function calculates the OLS residuals under the linear null hypothesis, and assigns them to the specified clusters.

Usage

1
get_clustered_eps(model, clustering)

Arguments

model

A regression model. See example_model for details.

clustering

A List that specifies a clustering of indexes 1...n (#datapoints). See example_clustering for details.

Value

A List of the restricted residuals clustered according to clustering.

Examples

1
2
3
4
5
m = example_model(n=100)
cl = list(1:50, 51:100)
er = get_clustered_eps(m, cl)
stopifnot(length(er) == length(cl))
stopifnot(length(er[[1]]) == 50)

RRI documentation built on Dec. 19, 2019, 9:06 a.m.

Related to get_clustered_eps in RRI...