View source: R/circulation_lm.R
circulation_lm | R Documentation |
Using circulation to fit linear models between one dependent variable and series of independent variable
circulation_lm(y, xframe, margin)
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 |
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.
Data frame contains lm statistics of all Independent Variable
Other arguments used in function lm were set as default. See in lm
.
Wang Ningqi2434066068@qq.com
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.