Learn R Programming

CVcalibration (version 1.0-1)

calfun: Estimating the Calibration Equation

Description

Estimating the calibration equation ``y=a+b*x'' with error-in observations assuming that the coefficients of the variation of the measurements are constants.

Usage

calfun(x, y, CVx, CVy, lambda0)

Arguments

x
The observed $x$ values
y
The observed $y$ values
CVx
The underlying coefficient of variation of measurement $x$
CVy
The underlying coefficient of variation of measurement $y$
lambda0
The ratio, $CV_y^2/CV_x^2$

Value

result
The estimated regression coefficients, standard error and confidence intervals based on (1) CVx only; (2) CVy only; (3) both CVx and CVy; and (4) the ratio of CVy^2/CVx^2.

Examples

Run this code
n=100
sigma0=10

beta0=5
beta1=1.2
CVx=0.15
CVy=0.07

lambda0=CVy^2/CVx^2

x0=runif(n, 20, 200)
y0=beta0+beta1*x0+rnorm(n)*sigma0
x=x0+x0*CVx*rnorm(n)
y=y0+y0*CVy*rnorm(n)

fit=calfun(x, y, CVx, CVy, lambda0)
fit

Run the code above in your browser using DataLab