CCRls.coord {cluscov} | R Documentation |
Linear regression via coordinate descent with covariate clustering
Description
This function is a wrapper for linrclus
. It requires less input.
Usage
CCRls.coord(Y, X, k, nC = 1, ...)
Arguments
Y |
vector of outcome variable |
X |
matrix of covariates. Should not include 1's for the intercept |
k |
number of clusters |
nC |
first nC-1 covariates in X not to cluster. Must be at least 1 for the intercept |
... |
additional parameters to be passed to lm |
Value
mobj
the low dimension lm regression object
clus
cluster assignments of covariates (excluding the first nC
covariates - including the intercept 1)
Examples
set.seed(14) #Generate data
N = 1000; (bets = rep(-2:2,4)); p = length(bets); X = matrix(rnorm(N*p),N,p)
Y = cbind(1,X)%*%matrix(c(0.5,bets),ncol = 1)
CCRls.coord(Y,X,k=5,nC=1)
[Package cluscov version 1.1.0 Index]