Learn R Programming

BetterReg (version 0.3.0)

indbcomp: Comparing Independent Coefficients in Multiple Regression

Description

Comparing Independent Coefficients in Multiple Regression

Usage

indbcomp(model1 = NULL, model2 = NULL, comps = "abs", pred = NULL)

Value

Comparing Independent Coefficients in Multiple Regression

Arguments

model1

Summary of first model (see example for how to summarize)

model2

Summary of second model (see example for how to summarize)

comps

Type of comparison. "abs" - absolute value of coefficient

pred

Number of predictors

Examples

Run this code
y_1<-rnorm(200); x1_1<-rnorm(200); x2_1<-rnorm(200)
y_2<-rnorm(200); x1_2<-rnorm(200);x2_2<-rnorm(200)
df1<-as.data.frame(cbind(y_1, x1_1,x2_1))
df2<-as.data.frame(cbind(y_2, x1_2,x2_2))
model1_2<-summary(lm(y_1~x1_1+x2_1, data=df1))
model2_2<-summary(lm(y_2~x1_2+x2_2, data=df2))
indbcomp(model1 = model1_2, model2 = model2_2, comps="abs", pred=2)

Run the code above in your browser using DataLab