14.03.2014 Views

Automation Reference - JMP

Automation Reference - JMP

Automation Reference - JMP

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Application Object <strong>Reference</strong> for Automating <strong>JMP</strong><br />

Automating <strong>JMP</strong> through Visual Basic<br />

Oneway.Quantiles (True)<br />

'Create the initial analysis output<br />

Oneway.Launch<br />

Oneway.MeansAnovaT (True)<br />

Oneway.MeansStdDev (True)<br />

Oneway.UnequalVariances (True)<br />

Oneway.NormalQuantilePlot (True)<br />

Oneway.SetAlpha (0.05)<br />

Oneway.Save (oscCentered)<br />

Oneway.Save (oscStandardized)<br />

Oneway.CompareMeans occAllPairs, True<br />

Oneway.CompareMeans occEachPair, True<br />

The first step is to create the analysis object, which is done by calling the CreateOneway method of the document<br />

class. Next, X and Y columns are selected, and then Launch is called to create the actual One-way analysis. Each<br />

analysis platform has a distinct creation method, which you can view under the Document object in the object<br />

browser. In many cases, it is possible to specify options before the Launch of the object, so the analysis output uses<br />

the options that are already set. In this example, most option processing is done after the launch of the analysis, which<br />

shows the options popup in the display. As you can see, most methods are a simple setting of options, like you might<br />

do from a menu. SetAlpha takes a parameter, since you do not want to open a window for interaction during<br />

automation. CompareMeans takes two parameters, one for the type of comparison and one for the toggle to indicate<br />

on or off. The Save method takes a predefined constant (viewable in the object browser) that tells the Oneway<br />

analysis what to save.<br />

Most analysis methods work this way, although some like Bivariate produce additional objects when methods are<br />

called. An example is:<br />

Set Fit = Bivar.FitLine<br />

Fit.ConfidenceFit (True)<br />

Fit.ConfidenceIndividual (True)<br />

Here, the FitLine method produces an object of type Fit. This object has methods and properties of its own, which<br />

can be manipulated. Remember, the new object created by FitLine can be manipulated only while its variable is in<br />

scope.<br />

If a method produces an object that can also be automated, the object browser indicates this. For FitLine, the object<br />

browser specifies that the return type is As Fit.<br />

Since this is not a predefined type like short or BSTR, you can probably guess that this is an object. If you look<br />

farther down the object browser, you see Fit as an object type. This confirms that an object is produced, and also<br />

gives you the methods that Fit supports.<br />

Creating and populating a data table<br />

New data tables can be created with the (appropriately named) NewDataTable method of the Application object.<br />

A filename is assigned at creation time. This method returns a column object, which must be retained as long as you<br />

want to add rows. By default, 20 rows are created. The SetCellVal method can be used to populate individual cells,<br />

and AddRows can be used to add rows as needed. Here is an example:<br />

Dim Col As Object<br />

Set DT = <strong>JMP</strong>.NewDataTable("C:\test.jmp")<br />

Set Col = DT.NewColumn("Col1", dtTypeNumeric, 0, 8)<br />

DT.Visible = True<br />

Page 3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!