anm.ls.reg: Animated plot of the least squares function.
Description
Depicts the process of least squares estimation of simple linear regression parameters by plotting the least squares function with respect to estimate possibilities for the intercept or slope.
Usage
anm.ls.reg(X, Y, parameter="slope", nmax=50, interval = 0.1, col = "red",...)
anm.ls.reg.tck()
Value
An animated plot of the plot possible regression lines is created along with an animated plot of the residual sum of squares. The function anm.ls.reg.tck provides a GUI to run the function.
Arguments
X
A numeric vector containing explanatory data.
Y
A numeric vector containing response data.
parameter
Parameter to be estimated. Either "slope" or "intercept".
nmax
The number of parameter estimates to be depicted. The true LS estimate will always be in the center of this sequence.
interval
Speed of animation (in frames per second). A smaller interval decreases speed. May not work in all systems; see Sys.sleep.