Assigning values to a JMP.bivarFitTransformConstants
Nov 19, 2015 9:51 AM(1838 views)
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) )
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 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.