Lm

case class Lm(y: DenseVector[Double], Xmat: DenseMatrix[Double], colNames: Seq[String], addIntercept: Boolean) extends Model

Linear regression modelling

Value Params
Xmat

Covariate matrix

addIntercept

Add an intercept term to the covariate matrix?

colNames

List of covariate names

y

Vector of responses

Returns

An object of type Lm with many useful attributes providing information about the regression fit

Companion
object
trait Serializable
trait Product
trait Equals
trait Model
class Object
trait Matchable
class Any

Value members

Concrete methods

def plots: Figure
def predict(newX: DenseMatrix[Double]): PredictLm

Predictions for a new matrix of covariates

Predictions for a new matrix of covariates

Value Params
newX

New matrix of covariates

Returns

Prediction object

def summary: Unit

Prints a human-readable regression summary to the console

Prints a human-readable regression summary to the console

Inherited methods

def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product

Concrete fields

val QR: QR[DenseMatrix[Double]]

Breeze QR object for the design matrix

Breeze QR object for the design matrix

val X: DenseMatrix[Double]

Design matrix (including intercept, if required)

Design matrix (including intercept, if required)

lazy val adjRs: Double

The adjusted R^2 value for the regression

The adjusted R^2 value for the regression

val coefficients: DenseVector[Double]

Fitted regression coefficients

Fitted regression coefficients

lazy val df: Int

Degrees of freedom

Degrees of freedom

lazy val f: Double

The f-statistic for the regression analysis

The f-statistic for the regression analysis

lazy val fitted: DenseVector[Double]

Fitted values

Fitted values

lazy val h: Vector[Double]

Vector containing the leverages (diagonal of the hat matrix)

Vector containing the leverages (diagonal of the hat matrix)

lazy val k: Int

Degrees of freedom for the F-statistic

Degrees of freedom for the F-statistic

lazy val n: Int

Number of observations

Number of observations

val names: Seq[String]

Column names (including intercept)

Column names (including intercept)

lazy val p: DenseVector[Double]

p-values for the regression coefficients

p-values for the regression coefficients

lazy val pf: Double

The p-value associated with the f-statistic

The p-value associated with the f-statistic

lazy val pp: Int

Number of variables (including any intercept)

Number of variables (including any intercept)

val q: DenseMatrix[Double]

n x p Q-matrix

n x p Q-matrix

val qty: DenseVector[Double]

Q'y

Q'y

val r: DenseMatrix[Double]

p x p upper-triangular R-matrix

p x p upper-triangular R-matrix

lazy val rSquared: Double
The R^2 value for the regression analysis
lazy val residuals: DenseVector[Double]

Residuals

Residuals

lazy val ri: DenseMatrix[Double]

The inverse of the R-matrix

The inverse of the R-matrix

lazy val rse: Double

Residual squared error

Residual squared error

lazy val rss: Double

Residual sum of squares

Residual sum of squares

lazy val se: DenseVector[Double]

Standard errors for the regression coefficients

Standard errors for the regression coefficients

lazy val sh: DenseVector[Double]

Square root of the leverage vector

Square root of the leverage vector

lazy val ssy: Double
The sum-of-squares of the centred observations
lazy val studentised: DenseVector[Double]
lazy val t: DenseVector[Double]

t-statistics for the regression coefficients

t-statistics for the regression coefficients

lazy val ybar: Double

The mean of the observations

The mean of the observations

lazy val ymyb: DenseVector[Double]
The centred observations