cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
lisa2442
Level I

Using JSL to Save results from an Expression to a Journal

I have the following code that I got A LOT of help on from my JMP JSL SAS professors when I took the course (so I don't totally understand how it works). It allows me to put a bunch of (variable, to be selected by the user) distributions in one window. How do I script the resultant window to the Journal that is created earlier in my code? All my other graphs are straightforward - created an outline box in the Journal and then appended the outline box with the line up box that had my created graphs in it. However, this is so different than those that I don't understand how I "save" the resultant single window with multiple (variable) distributions in it to the Journal under a differently titled outline box. Thanks! 

 

// Make Distribution of all Controlled Conditions in its own window
n = N Items( cont_cond );
If( N Items( cont_cond ),
	yExpr = Expr( Y() );
	For( iItem = 1, iItem <= n, iItem++,
		Insert Into( yExpr, Column( cont_cond[iItem] ) )
	);
	Eval(
		Substitute(
				Expr(
					dt << Distribution(
						yyy,
						quantiles( 0 ),
						show percents( 1 ),
						show counts( 1 ),
						outlier box plot( 0 ),
						customize summary statistics( 
							//Skewness(1),
							//Kurtosis(1),
							set alpha level( 0.2 )
						)
					)
				),
			Expr( yyy ), Name Expr( yExpr )
		)
	);
);
4 REPLIES 4
txnelson
Super User

Re: Using JSL to Save results from an Expression to a Journal

If you add the following code to your original script, and you create the cont_cond list, the below code should add the distributions to the bottom of your journal.

// Make Distribution of all Controlled Conditions in its own window
n = N Items( cont_cond );
If( N Items( cont_cond ),
	yExpr = Expr( Y() );
	For( iItem = 1, iItem <= n, iItem++,
		Insert Into( yExpr, Column( cont_cond[iItem] ) )
	);
	
	Eval(
		Substitute(
				Expr(
					dis = dt << Distribution(invisible,
						yyy,
						quantiles( 0 ),
						show percents( 1 ),
						show counts( 1 ),
						outlier box plot( 0 ),
						customize summary statistics( 
							//Skewness(1),
							//Kurtosis(1),
							set alpha level( 0.2 )
						)
					)
				),
			Expr( yyy ), Name Expr( yExpr )
		)
	);
	
	nwjrn << append(report(dis));
);	
	
Jim
lisa2442
Level I

Re: Using JSL to Save results from an Expression to a Journal

Thank you!!
lisa2442
Level I

Re: Using JSL to Save results from an Expression to a Journal

One follow on question; I am trying to set the title of the resultant Report Window as:

Set Report Title( "Distribution of Controlled Conditions" );

For code later on down the line I need the window of distributions to have a common name that I can call on regardless of the data table name or columns selected for the distribution. Where in this expression code would I do that?? Thanks! 

 

txnelson
Super User

Re: Using JSL to Save results from an Expression to a Journal

Run the distribution platform interactively. Then go to the Report Window title you want changed and click on it and change it. Then go to the red triangle and save the script. The script will have the jsl required to change the report title.
Jim