multreg.plot: A regression function created to allow for easy regression...

Description Usage Arguments Value Examples

View source: R/multreg.plot.r

Description

A regression function created to allow for easy regression related functional performance

Usage

1
2
3
4
5
6
7
8
9
multreg.plot(data, yvar = "MBISQ", xvar, j = j, xvar2 = NULL,
  jneg = TRUE, xlim = NULL, x2lim = NULL, binom = TRUE, addcor = F,
  addpred = F, addref = TRUE, ylim = NULL, xlab = names(data[xvar]),
  x2lab = names(data[xvar2]), ln.col = "red",
  ylab = "Probability of Meeting Biological Criterion", cex.lab = 1,
  cex = 1, cex.axis = 1, las = 1, pch = 21, col = 1, bg = 8,
  main = "", type = "p", cex.main = 1, varlist = NULL, varpred,
  cont = TRUE, cont2 = FALSE, xlog = TRUE, x2log = TRUE, add = F,
  rounder = 2, nbin = 41, LC50.plot = FALSE, model.sel = NULL, ...)

Arguments

data

A input data frame, default to be NULL,

yvar

for column index of x, y values in data data frame, or column names; y could be binary

xvar

x variable, either column name or index value

j

threshold for logistic regression

binom

if binomial function will be used

xlog

if xvar should be log transformed

rounder

if x should be round to a value

model.sel

= 0 (single var) 1 (2 var), 2 (2 var interaction),3(quadratic)

x.add

1 to convert percent x value = 0 to 1+ x value , or 100, then *100+1,

x2var

x variable, either column name or index value

xlog2

if xvar2 should be log transformed

add:

add multiple regression lines in single graphs espeically for logistic, regression single x variable

addcor:

add principal component line between two explanatory variables and the predicted line for xvar

addref:

add reference value for one variable to predict the other, e.g, add reference value for habitat(160) to predict cond

nbin:

logistic regression number of bins.

LC50.plot:

to add the biological response variable plot

varlist:

additional variables to include in the multiple regression plot, all these variables should be normal distributed

varpred:

additional variable values for making predictions

jneg:

xvar and yvar are negatively correlated, default is true

cont:

if true plot contour, if not plot scatterplot

cont2:

if true plot contour, if not plot scatterplot

Value

Returns

Examples

1
2
3
4
5
6
7
8
set.seed(1)
x <- rlnorm(n) + 1:n
x <- (x - min(x))/max(x)
y <- n + 1:n + (rnorm(n))*0.2*n
par(mfrow=c(1,2))
plot(y~x)
scatter.plot(data = data.frame(x,y), xvar= "x", yvar = "y", add.fit = "linear", xlim = c(0,n), 
    ylim = range(y), log.flag = "x", x.add =100)

kevinlzheng/RegR documentation built on May 18, 2017, 7:31 p.m.