CAPDM Tutorial Applets

Correlation

Functionality:

This applet allows you to view the correlation and distribution of samples taken from two related and known populations. The applet displays the correlation values calculated from the samples taken. Sample size can be changed to see how accuracy is affected as number of samples increases. The base populations can also be modified to give them a closer correlation, etc.

Remote Control using JavaScript

There is no applet-specific control available outwith the applet. See the 'Runtime Applet API Calls' section below for details.

Examples

Show 'About' dialog

How to Invoke the Applet

The applet can be invoked by embedding an APPLET tag into your HTML document (if you look at the source of this document you will see a working example you can copy). The table below details the basic parameters used and additional startup parameters that are specific to this applet.

<APPLET
   CODEBASE="../../../../classes"
   CODE="applet.capdm.qm.correlation.CorrelationApp" 
NAME="Correlation" ALT="Correlation" WIDTH="360" HEIGHT="425"> </APPLET>
Basic Parameters Use
CODEBASE="../../../../classes" The CODEBASE of the applet must point at the top-level classes directory in order for the applet to be found.
CODE="applet.capdm.qm.correlation.
CorrelationApp"
This required attribute gives the name of the file that contains the applet's compiled Applet subclass. This file is relative to the base URI of the applet.
ALT="Correlation" This optional attribute specifies any text that should be displayed if the browser understands the APPLET tag but can't run Java applets.
NAME="Correlation" This optional attribute specifies a name for the applet instance, which makes it possible for applets on the same page to find (and communicate with) each other. If you intend to use JavaScript/Applet scripting then the applet must be named a shown.
WIDTH="360" HEIGHT="425" These required attributes give the initial width and height (in pixels) of the applet display area, not counting any windows or dialogs that the applet brings up.
Applet Startup Parameters Use
MinXVal Sets the minimum X value of population and samples. eg <PARAM NAME="MinXVal" VALUE="-2.0">
MaxXVal Sets the maximum X value of population and samples. eg <PARAM NAME="MaxXVal" VALUE="2.0">
MinYVal Sets the minimum Y value of population and samples. eg <PARAM NAME="MinYVal" VALUE="-2.0">
MaxYVal Sets the maximum Y value of population and samples. eg <PARAM NAME="MaxYVal" VALUE="2.0">
XStep Sets the X-axis marks eg <PARAM NAME="XStep" VALUE="2">
YStep Sets the Y-axis marks eg <PARAM NAME="YStep" VALUE="2">
XMean Sets the starting mean of the the 'X' population eg <PARAM NAME="XMean" VALUE="0.0">
XVariance Sets the start variance of the 'X' population eg <PARAM NAME="XVariance" VALUE="1.00">
YMean Sets the starting mean of the the 'Y' population eg <PARAM NAME="YMean" VALUE="0.0">
YVariance Sets the start variance of the 'Y' population eg <PARAM NAME="YVariance" VALUE="1.00">
Correlation Sets up a starting correlation between X and Y eg <PARAM NAME="Correlation" VALUE="0.5">
SampleSize A starting size for the sample eg <PARAM NAME="SampleSize" VALUE="20">

For more information on the use of the APPLET tag and other attributes you can use but which are not listed above, visit the W3.org specification page at: APPLET tag in HTML 4.

Runtime Applet API Calls

This applet can be called into using Javascript 1.1 while running. Although JavaScript can call the Applet directly, some convenient JavaScript functions have been created which deal with the details of the communication. The following table lists the call Names which can be made, and gives examples of their use and results.

API Call Name Parameters Use and Result
showAbout none javascript:showAbout(); Shows the version dialog box of this applet.