plotreg: Returns scatter plot with regression results

Description Usage Arguments Value Examples

View source: R/plotreg.r

Description

Returns scatter plot with regression results

Usage

1
2
plotreg(x, y, dat, titl, xlab, ylab, scx, scy, w, names, sepa, ini, font,
  logs, cv, nx, ny, stepx, stepy)

Arguments

x

string with name of variable on x axis

y

string with name of variable on y axis

dat

data frame with data

titl

string with tittle

xlab

string with lable x axis, x by default

ylab

string with lable y axisa, y by default

scx

scale x variable. E.g 10s,100s, 1000s,... scx=1 by default

scy

scale y variable. E.g 10s,100s, 1000s,... scy=1 by default

w

string with name of regression weights variable. Equal weight by default

names

string with name of data points labels. E.g. City, State, Country

sepa

parameter used to calibrate the frequency tick marks, large values imply lower frequency. sepa=0 produces one label per data point

ini

number beyond which the frequency of names is reduced

font

plot font, serif by default

logs

use of logs in the regression, logs=0 y~x, logs=1: log(y)~log(x), logs=2: log(y)~x, logs=3: y~log(x)

cv

name of covariates

nx

horizontal adjustment for data points labels

ny

vertical adjustment for data points labels

Value

weighted scater plot with weighted linear regression

Examples

1
2
3
 
exmp<-plotreg(x='Distance_from_Largest_City_to_NYC_miles',y='Total_Trade_Amount_2015_Thousand_USD',dat=trade,titl='trade',xlab = 'distance',ylab='trade',w='GDP_2015_USD',names='Name_country',nx=100,ny=0)
exmp

marangoisa/RegressionVisuals documentation built on Nov. 4, 2019, 5:21 p.m.