powered by
Given regression model and clustering, this function calculates the OLS residuals under the linear null hypothesis, and assigns them to the specified clusters.
model
clustering
get_clustered_eps(model, clustering)
A regression model. See example_model for details.
A List that specifies a clustering of indexes 1...n (#datapoints). See example_clustering for details.
List
A List of the restricted residuals clustered according to clustering.
# NOT RUN { 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) # }
Run the code above in your browser using DataLab