cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
wgardnerQS
Level III

Parsing << Get Estimates list elements

The below script is from one of the scripting index entries for the "Get Estimates" message. The object returned is a list. Are the individual elements of the list easily parsed? Type(estimate[n]), "Name". estimate[2], for example, appears to contain a consistent data structure. How does one return, for example, the matrix denoted "Time End"?

 

I know that all of the information output by "<< Get Estimates" is ultimately accessible via "<< Get Report" and deciphering the display box hierarchy. However, the concise and easily interpreted structure of "Get Estimates" looks like it could be easier to use and result in simpler code.

 

//scripting index script
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Reliability/Fan.jmp" );
obj = dt <<
Life Distribution(
	Y( :Time ),
	Censor( :Censor ),
	Fit Exponential,
	Set Scale( Exponential )
);
estimate = obj << Get Estimates;
Show( estimate );

//=======================
//content of estimate[2]

nonparametric estimate(
	{Time Start(
		[450, 1150, 1150, 1600, 2070, 2070, 2080, 3100, 3450, 4600, 6100, 8750]
	), Time End(
		[1150, 1150, 1600, 2070, 2070, 2080, 3100, 3450, 4600, 6100, 8750, 11500]
	), Estimate(
		[0.0142857142857142, 0.0287815126050419, 0.0432773109243697,
		0.0579961215255332, 0.0751234647705236, 0.0922508080155139,
		0.109378151260504, 0.128327552297515, 0.147698051135348, 0.17276575551372,
		0.204582457224731, 0.292962184199761]
	), Standard Error(
		[0.0141833064113421, 0.0200581923902226, 0.024441823837429,
		0.0281508958436217, 0.0324334709625386, 0.0360727593407561,
		0.0392481174087784, 0.0427434474191106, 0.0459737153753552,
		0.0509999042262761, 0.0581216781767556, 0.098041976927893]
	)}
)
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Parsing << Get Estimates list elements

How do you wish to parse it? Is this information enough that you can use lists like this in JMP

estimate["nonparametric estimate"]["Time End"]
-Jarmo

View solution in original post

5 REPLIES 5
jthi
Super User

Re: Parsing << Get Estimates list elements

How do you wish to parse it? Is this information enough that you can use lists like this in JMP

estimate["nonparametric estimate"]["Time End"]
-Jarmo
wgardnerQS
Level III

Re: Parsing << Get Estimates list elements

Works perfect.  Thank you!  Is that type of data structure documented?  I did not find it.

jthi
Super User

Re: Parsing << Get Estimates list elements

Lists do have quite a bit of documentation in Scripting Guide Scripting Guide > Data Structures > Lists in JSL Scripts . I think that behavior is also documented somewhere BUT it might not be under the lists section... I might have just gotten it by pure luck and trying out all sorts of things or I might have read about it (I will try to find it from documentation and will edit if I find it). @EvanMcCorkle 

 

Edit: Found it mentioned at least here (I didn't find it from here first time I got it for sure, but it is mentioned) Scripting Guide > Data Structures > Lists in JSL Scripts > Subscripts in Lists 

jthi_0-1731683360231.png

 

-Jarmo
mmarchandFSLR
Level IV

Re: Parsing << Get Estimates list elements

In this case, you could use this lovely script.

 

End = Arg( Arg( Arg( estimate[2], 1 ), 2 ), 1 );
mmarchandFSLR
Level IV

Re: Parsing << Get Estimates list elements

Or use @jthi's much better one.