Learn R Programming

LorMe (version 1.2.1)

circulation_lm: Circulation of fitting Linear Models

Description

Using circulation to fit linear models between one dependent variable and series of independent variable

Usage

circulation_lm(y, xframe, margin)

Value

Data frame contains lm statistics of all Independent Variable

Arguments

y

Dependent variable

xframe

Matrix or data frame of independent variable

margin

A vector of 1 or 2 indicates arrangement of xframe. 1:by rows 2:by columns

Author

Wang Ningqi2434066068@qq.com

Details

if row names(for margin 1) and column names(for margin 2) are not given, ID column of return data frame will be row/column numbers.

Examples

Run this code
data(testotu)

###using margin 1, arrange by rows##
dep=testotu[1,2:21]
in_dep=testotu[-1,2:21]
lm_stat<-circulation_lm(y = dep,xframe = in_dep,margin = 1)
lm_stat

###using margin 2, arrange by column##
dep=testotu[,2]
in_dep=testotu[,3:21]
lm_stat<-circulation_lm(y = dep,xframe = in_dep,margin = 2)
lm_stat

Run the code above in your browser using DataLab