| errorsINx | R Documentation | 
Simulates $y-$ and $x-$values for the straight line regression model, but with $x-$values subject to random measurement error, following the classical “errors in x” model. Optionally, the x-values can be split into two groups, with one group shifted relative to the other
errorsINx(mu = 12.5, n = 200, a = 15, b = 1.5, SDx=2, SDyerr = 1.5,
           timesSDx=(1:5)/2.5, gpfactor=if(missing(gpdiff))FALSE else TRUE,
           gpdiff=if(gpfactor) 1.5 else 0, layout=NULL,
           parset = simpleTheme(alpha = 0.75, col = c("black","gray45"),
             col.line = c("black","gray45"), lwd=c(1,1.5), pch=c(1,2),
           lty=c(1,2)), print.summary=TRUE, plotit=TRUE, xrelation="same")
| mu | Mean of $z$ | 
| n | Number of points | 
| a | Intercept in model where $z$ is measured without error | 
| b | Slope in model where $z$ is measured without error | 
| SDx | SD of $z$-values, measured without error | 
| SDyerr | SD of error term in  | 
| timesSDx | SD of measurement error is  | 
| gpfactor | Should x-values be split into two groups, with one shifted relative to the other? | 
| gpdiff | Amount of shift of one group of z-values relative to the other | 
| layout | Layout for lattice graph, if requested | 
| parset | Parameters to be supplied to the lattice plot, if any | 
| print.summary | Print summary information on fits? | 
| plotit | logical: plot the data? | 
| xrelation | character: sets the x-axis  | 
The argument timesSDx can be a numeric vector.
One set of $x$-values that are contaminated with measurement error
is simulated for each element of timesSDx.
| gph | the trellis graphics object | 
| mat | A matrix, with  | 
John Maindonald
Data Analysis and Graphics Using R, 3rd edn, Section 6.7
library(lattice)
errorsINx()
errorsINx(gpdiff=2, timesSDx=1.25, SDyerr=2.5, n=80)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.