Choose Language Hide Translation Bar
Highlighted
AT
AT
Level V

How to save standardized columns in a script?

I like to save the standardized columns using JSL. Here are is what I had in mine and I get an error when I run the script.

 

 

dt = Current Data Table();
cc = dt << Get Column Names( Continuous ); '
ncols = N Items( cc );
For( i = 1, i <= ncols, i++,
cc << Set Selected( 0 ),
col = Column(dt,cc), Distribution( Continuous Distribution(col,Save(Standardized))) );

 

I appreciate your help. Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: How to save standardized columns in a script?

Not only does the code make the display invisible but it also closes the display, thus freeing up memory

Names Default to Here( 1 );
dt = Current Data Table();
cc = dt << Get Column Names( Continuous );
ncols = N Items( cc );
For( i = 1, i <= ncols, i++,
	dis = Distribution( Invisible, Continuous Distribution( Column(  cc[i] ) ) );
	dis << Save( Standardized );
	dis << close window;
);

Jim

View solution in original post

4 REPLIES 4
Highlighted
txnelson
Super User

Re: How to save standardized columns in a script?

Here is a modification of your code that works as you want.  You need to become familiar with the Scripting Index, for it will give you the syntax and examples of how to accomplish what you want

Names Default to Here( 1 );
dt = Current Data Table();
cc = dt << Get Column Names( Continuous );
ncols = N Items( cc );
For( i = 1, i <= ncols, i++,
	dis = Distribution( Continuous Distribution( Column(  cc[i] ) ) );
	dis << Save( Standardized );
);
Jim
Highlighted
AT
AT
Level V

Re: How to save standardized columns in a script?

Thanks Jim. How do you make the distribtions invisibile. I have quite many variables and don't want to see the histograms. 

Highlighted
txnelson
Super User

Re: How to save standardized columns in a script?

Not only does the code make the display invisible but it also closes the display, thus freeing up memory

Names Default to Here( 1 );
dt = Current Data Table();
cc = dt << Get Column Names( Continuous );
ncols = N Items( cc );
For( i = 1, i <= ncols, i++,
	dis = Distribution( Invisible, Continuous Distribution( Column(  cc[i] ) ) );
	dis << Save( Standardized );
	dis << close window;
);

Jim

View solution in original post

Highlighted
AT
AT
Level V

Re: How to save standardized columns in a script?

Thanks so much Jim.
Article Labels

    There are no labels assigned to this post.