Learn R Programming

MESS (version 0.5.12)

plr: Fast computation of several simple linear regressions

Description

Fast computation of several simple linear regression, where the outcome is analyzed with several marginal analyses, or where several outcome are analyzed separately, or a combination of both.

Usage

plr(y, x, addintercept = TRUE)

# S3 method for numeric plr(y, x, addintercept = TRUE)

# S3 method for matrix plr(y, x, addintercept = TRUE)

Value

a data frame (if Y is a vector) or list of data frames (if Y is a matrix)

Arguments

y

either a vector (of length N) or a matrix (with N rows)

x

a matrix with N rows

addintercept

boolean. Should the intercept be included in the model by default (TRUE)

Author

Claus Ekstrom ekstrom@sund.ku.dk

See Also

mfastLmCpp

Examples

Run this code

N <- 1000  # Number of observations
Nx <- 20   # Number of independent variables
Ny <- 80   # Number of dependent variables

# Simulate outcomes that are all standard Gaussians
Y <- matrix(rnorm(N*Ny), ncol=Ny)  
X <- matrix(rnorm(N*Nx), ncol=Nx)

plr(Y, X)

Run the code above in your browser using DataLab