plot_reg: Plot points with the corresponding linear regression line

Description Usage Arguments Value Author(s) Examples

Description

Plots points with the corresponding linear regression line

Usage

1
plot_reg(x, y, pch = 19, xlab = NULL, ylab = NULL, ...)

Arguments

x

numeric vector

y

numeric vector

pch

type of points

xlab

character string, label of the x axis, NULL by default

ylab

character string, label of the y axis, NULL by default

...

other arguments to be passed in plot

Value

None

Author(s)

Hugo Varet

Examples

1
plot_reg(cgd$age,cgd$height,xlab="Age (years)",ylab="Height")

Example output

Loading required package: survival

Call:
lm(formula = y ~ x)

Residuals:
    Min      1Q  Median      3Q     Max 
-91.267 -10.327   1.669  13.556  36.954 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  99.7174     2.1763   45.82   <2e-16 ***
x             2.8019     0.1313   21.33   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 17.43 on 201 degrees of freedom
Multiple R-squared:  0.6936,	Adjusted R-squared:  0.6921 
F-statistic: 455.1 on 1 and 201 DF,  p-value: < 2.2e-16

packHV documentation built on May 2, 2019, 5:40 a.m.