Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: tware
See also: twrandomsample twpvalue twnormalize tw1d twpearson twclt

Macro: twlinreg
Description: teachware quantlet twlinreg gives visual insight into how least squares simple linear regression works, and the relationship between the regression of Y on X, X on Y, and total regression. The data are bivariate Gaussian, and a menu allows control of the number of data points, and the correlation.Intuitive understanding of least squares fitting is conveyed through interactive manipulation of a candidate fit line. A menu gives control over this process, through incremental adjustments that are selected by check boxes, followed by a push of the "OK" button. The main graphics window shows the data scatterplot, together with the least squares fit line. A text component shows the equation of the current line (which changes as the line is manipulated), together with the Residual Sum of Squares which gives a numerical summary of the goodness of fit. Very effective visual indication of what RSS means comes from the lower graphics part of this window, which represents the residuals as vertical lines. When the fit is poor (and hence the RSS is large), the residual plot shows why, and give a clear indication of how the line should be moved to improve the quality of the fit to the data.

Reference(s):

Usage: twlinreg({x})
Input:
x matrix (n x 2) with user defined data

Note:

Example:
; load teachware library
library("tware")
; predefine matrix 
x = normal(100,2) 
; call twlinreg teachware quantlet
twlinreg(x)
Result:
a three window port display with the scatterplot of the matrix x 
in the upper port and the values of the RSS and the regression
equation in the middle (text) port. The lower port is reserved for
display of the current residuals. 

Library: tware
See also: twrandomsample twpvalue twnormalize tw1d twpearson twclt

Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Author: SK, WH, 990103
(C) MD*TECH Method and Data Technologies, 28.6.1999