## Psych 285: Computational Statistics

and Statistical Visualization## Professor Forrest Young

## Object-Oriented Programming

Tierney's Object SystemWrite

NORM-PROTO, a prototype object that normalizes a matrixX(i.e., makes the mean of each columnMEANand the standard deviationSTDEV). The object's constructor-function should be calledNORM. It should take a matrixXas its only required argument, with keyword argumentsMEAN(default 0.0) andSTDEV(default 1.0). The constructor-function should return the object identification information of the instantiated object.The object should have two slots for the mean and standard deviation specified by the user, and 4 slots for the raw data, normalized data, means and standard-deviations. The object should store the desired mean and standard deviation, the matrices of original and normalized variables, and should store lists or vectors of the means and standard-deviations of the original variables.

In addition to the six slot-accessor methods, there should be object-specific methods which compute values for each slot.

Test out your code by creating instances of the object using the tutorial data. Send the instances appropriate messages to show that it works right. Compare results to ViSta's

TRANSFORMmenu'sNORMALIZE-DATAitem.Send your code, and your test of the code, to me by e-mail before class on the due date.

## To get in touch:

email: forrest@unc.edu WWW: http://forrest.psych.unc.edu