Choose Language Hide Translation Bar
Level I

Assigning values to a JMP.bivarFitTransformConstants

I am automating JMP using C#. I am trying to get a Bivariate Fit Y by X Analysis with a Log Fit. ( The curve I want to use as a fit is:  y = a + b*ln(x) )

I have:

JMP.Application myJMP;

JMP.Bivariate biv;

JMP.Document doc;

JMP.bivarFitTransformConstants Xtransform;

JMP.bivarFitTransformConstants Ytransform;

doc = myJMP.OpenDocument(excelFilePath);

And I think the correct function to call would be:

biv.FitTransformed(Xtransform, Ytransform, 1);

The only problem I have is I am not able to assign values for the  bivarFitTransformConstants 'Xtransform' and 'Ytransform'. I can see in the JMP Automation Reference for the  Bivariate Platform Constants that the possible Values are:  None, Log, Sqrt, Square, Reciprocal and  Exp.

I have tried:

Xtransform = Log;

Xtransform = "Log";

Xtransform = (JMP.bivarFitTransformConstants) "Log";

Xtransform = myJMP.   (Here, I could not find the appropriate function to use to assign the value 'Log' to Xtransform.



None of these options work, and the Common message is that "I cannot convert 'string' to 'JMP.bivarFitTransformConstants' ".

What is the correct way to assign values to the JMP.bivarFitTransformConstants ?

Help is appreciated!


Re: Assigning values to a JMP.bivarFitTransformConstants

​​I found this syntax for FitTransformed in the Automation reference for C#:

FitTransformed(Xtransform As Integer, Ytransform as Integer, PolynomialDegree as Integer)

​This shows it as accepting integer types for all three parameters. However, the X and Y Transform are indeed in the JMP.bivarFitTransformConstants object type. However, when you try to cast your Xtransform with the value "Log," it is throwing you an error. This is because it is looking for the integer value of the constant.

You can assign the value of Xtransform and YTransform in the following way:

Xtransform = (JMP.bivarFitTransformConstants) 1;

Ytransform = (JMP.bivarFitTransformConstants) 1;

Here is a list of what these constants are mapped to:

0 = None;

1 = Log

2 = Sqrt

3 = Square

4 = Reciprocal

5 = Exp

I have attached a text file of a full code example of a bivariate analysis with FitTransformConstants.

Article Labels

    There are no labels assigned to this post.