KNex {Matrix}R Documentation

Koenker-Ng Example Sparse Model Matrix and Response Vector

Description

A model matrix mm and corresponding response vector y used in an example by Koenker and Ng. The matrix mm is a sparse matrix with 1850 rows and 712 columns but only 8758 non-zero entries. It is a "dgCMatrix" object. The vector y is just numeric of length 1850.

Usage

data(KNex)

References

Roger Koenker and Pin Ng (2003). SparseM: A sparse matrix package for R; J. of Statistical Software, 8 (6), http://www.jstatsoft.org/

Examples

data(KNex)
class(KNex$mm)
  dim(KNex$mm)
str(KNex)

sparse.sol <- with(KNex, solve(crossprod(mm), crossprod(mm, y)))
str(sparse.sol)

[Package Matrix version 0.995-11 Index]