plot.york: Plot an york object

Description Usage Arguments Details Examples

View source: R/method_plot.R

Description

Plots for york model fit are obtained. The plot function returns 6 different plots. A plot for the fitted line, diagnostic plots and a trace plot (if the slope coefficient was determined approximately, no trace plot will be shown).

Usage

1
2
## S3 method for class 'york'
plot(x, ...)

Arguments

x

an object of class "york"

...

arguments to be passed to methods.

Details

Given an object of class "york" this function gives several york plots. The first plot shows York's best-fit straight line only. The second plot shows York's best fit straight line compared to OLS and orthogonal regression. Additionally, the different "center of gravity" are shown. The third plot is a "y-residuals vs. x-residuals plot". The fourth is a "x-residuals vs. fitted-y plot". The fith plot is a "y-residuals vs. fitted y" plot and the last plot is a "trace plot" which shows the slope after each interation, i.e. how the slope coefficient converges.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 # Example: York's regression with weight data taken from Pearson (1901):
 x <- c(0.0, 0.9, 1.8, 2.6, 3.3, 4.4, 5.2, 6.1, 6.5, 7.4)
 y <- c(5.9, 5.4, 4.4, 4.6, 3.5, 3.7, 2.8, 2.8, 2.4, 1.5)
 weights_x <- c(1e+3, 1e+3, 5e+2, 8e+2, 2e+2, 8e+1, 6e+1, 2e+1, 1.8, 1)
 weights_y <- c(1, 1.8, 4, 8, 20, 20, 70, 70, 1e+2, 5e+2)
 r_xy_errors <- 0

 # fit york model
 york_fit <- york(x, y, weights_x, weights_y, r_xy_errors = 0)

 # Obtain plots
 plot(york_fit)

JENScoding/York documentation built on Oct. 30, 2019, 7:29 p.m.