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
Ted
Ted
Level IV

How to set format for Distribution platform output?

Analyze=>Distribution
gives (by default) the following format:

Level Count Prob
1    4    0,03846
2   32   0,30769
3   57   0,54808
4   11   0,10577
Total  104  1,00000

but I need so:

Level Count Prob
1    4     3,8%
2   32   30,8%
3   57   54,8%
4   11   10,6%
Total  104  100,0%

It's easy to obtain if call (by double-clicking on it):
"Column Numeric Format".

OK! But it works for ONE variable! But I have MANY variables! How to set this format for all (in JMP v10)?

 

Files => Preferences=> ???

(or in some other way...?)

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: How to set format for Distribution platform output?

The column in the table displayed is a Probability, therefore it is displayed properly.  If you change it to a percent, then you should also change the column header from "Prob" to "Percent".

There is not an option in the platform to change the format, however, in JSL 

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
dis = dt << Distribution( Nominal Distribution( Column( :sex ) ) );
Report( dis )["Frequencies"][Table Box( 1 )][Number Col Box( 2 )] <<
set format( "Percent", 7, 2 ) << set heading( "Percent" );
Jim

View solution in original post

txnelson
Super User

Re: How to set format for Distribution platform output?

Ed,

I am replying to your direct email to me, because your question to me was something that I believe others may find useful.  The direct emails are not available for searching by the general user community.

 

Here is my response to your direct email to me, which said:

 

Jim, sorry, I have 100 columns name(original) in my data file (names go in a row), I bring some of them: 
1.1	1.2	1.3	1.4.1	1.5.1	1.5.2	1.5.3	1.5.4	1.5.5	1.5.6	1.5.7	1.5.8
I try list them using comma as separator in your script (but it does not work)... Ed
 
Names Default To Here( 1 );
dt = Open( "F:/R/data/donor.jmp" );
dis = dt << Distribution( Nominal Distribution( Column( : 1.1, 1.2, 1.3, etc. ) ) );
Report( dis )["Frequencies"][Table Box( 1 )][Number Col Box( 2 )] <<
set format( "Percent", 7, 1 ) << set heading( "Percent" );

The code you specified to create the distributions is incorrect, and additionally, the code required to handle multiple distributions forces a change in the code required to pass through all of the outputs to change the Frequencies tables

Names Default To Here( 1 );
dt = New Table( "All Nominal",
	Add Rows( 40 ),
	New Column("1.1",
	Character,
		"Nominal",
		Set Values(
			{"KATIE", "LOUISE", "JANE", "JACLYN", "LILLIE", "TIM", "JAMES", "ROBERT",
			"BARBARA", "ALICE", "SUSAN", "JOHN", "JOE", "MICHAEL", "DAVID", "JUDY",
			"ELIZABETH", "LESLIE", "CAROL", "PATTY", "FREDERICK", "ALFRED", "HENRY",
			"LEWIS", "EDWARD", "CHRIS", "JEFFREY", "MARY", "1.1", "ROBERT",
			"WILLIAM", "CLAY", "MARK", "DANNY", "MARTHA", "MARION", "PHILLIP",
			"LINDA", "KIRK", "LAWRENCE"}
		)
	),
	New Column("1.2",
	Character,
		"Nominal",
		Set Values(
			{"12", "12", "12", "12", "12", "12", "12", "12", "13", "13", "13", "13",
			"13", "13", "13", "14", "14", "14", "14", "14", "14", "14", "14", "14",
			"14", "14", "14", "15", "15", "15", "15", "15", "15", "15", "16", "16",
			"16", "17", "17", "17"}
		)
	),
	New Column("1.3",
	Character( 1 ),
		"Nominal",
		Set Values(
			{"F", "F", "F", "F", "F", "M", "M", "M", "F", "F", "F", "M", "M", "M",
			"M", "F", "F", "F", "F", "F", "M", "M", "M", "M", "M", "M", "M", "F",
			"F", "M", "M", "M", "M", "M", "F", "F", "M", "F", "M", "M"}
		)
	),
	New Column("1.4",
		Character,
		"Nominal",
		Set Values(
			{"59", "61", "55", "66", "52", "60", "61", "51", "60", "61", "56", "65",
			"63", "58", "59", "61", "62", "65", "63", "62", "63", "64", "65", "64",
			"68", "64", "69", "62", "64", "67", "65", "66", "62", "66", "65", "60",
			"68", "62", "68", "70"}
		)
	),
	New Column("1.5",
	Character,
		"Nominal",
		Set Values(
			{"95", "123", "74", "145", "64", "84", "128", "79", "112", "107", "67",
			"98", "105", "95", "79", "81", "91", "142", "84", "85", "93", "99",
			"119", "92", "112", "99", "113", "92", "112", "128", "111", "105", "104",
			"106", "112", "115", "128", "116", "134", "172"}
		)
	)
);

// Run the distributions
dis = dt << Distribution(
	Nominal Distribution( Column( :Name( "1.1" ) ) ),
	Nominal Distribution( Column( :Name( "1.2" ) ) ),
	Nominal Distribution( Column( :Name( "1.3" ) ) ),
	Nominal Distribution( Column( :Name( "1.4" ) ) ),
	Nominal Distribution( Column( :Name( "1.5" ) ) )
);

// Change the tables
// Because of Your column names(this is a JMP bug I believe), we have
// to use a direct reference to the Outline Box number.  See below where
// if the column names were not of the form 1.1, 1.2, 1.3 etc. a better
// reference could be made 
For( i = 2, i <= N Col( dt ) * 2, i++,
	Report( dis )[Outline Box( i )]["Frequencies"][Table Box( 1 )][Number Col Box( 2 )] <<
	set format( "Percent", 7, 2 ) << set heading( "Percent" )
);


/*For( i = 1, i <= N Col( dt ), i++,
	Report( dis )[column(dt,i)<<get name]["Frequencies"][Table Box( 1 )][Number Col Box( 2 )] <<
	set format( "Percent", 7, 2 ) << set heading( "Percent" )
);*/
Jim

View solution in original post

6 REPLIES 6
txnelson
Super User

Re: How to set format for Distribution platform output?

The column in the table displayed is a Probability, therefore it is displayed properly.  If you change it to a percent, then you should also change the column header from "Prob" to "Percent".

There is not an option in the platform to change the format, however, in JSL 

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
dis = dt << Distribution( Nominal Distribution( Column( :sex ) ) );
Report( dis )["Frequencies"][Table Box( 1 )][Number Col Box( 2 )] <<
set format( "Percent", 7, 2 ) << set heading( "Percent" );
Jim
Ted
Ted
Level IV

Re: How to set format for Distribution platform output?

Oh, Many Thanks! I will try...
P.S. It's strange, why I can't put "kudos" (stopped working)?!

txnelson
Super User

Re: How to set format for Distribution platform output?

Concerning the Kudos, I would try changing your browser to Chrome

Jim
Ted
Ted
Level IV

Re: How to set format for Distribution platform output?

I always use Chrome

txnelson
Super User

Re: How to set format for Distribution platform output?

Ed,

I am replying to your direct email to me, because your question to me was something that I believe others may find useful.  The direct emails are not available for searching by the general user community.

 

Here is my response to your direct email to me, which said:

 

Jim, sorry, I have 100 columns name(original) in my data file (names go in a row), I bring some of them: 
1.1	1.2	1.3	1.4.1	1.5.1	1.5.2	1.5.3	1.5.4	1.5.5	1.5.6	1.5.7	1.5.8
I try list them using comma as separator in your script (but it does not work)... Ed
 
Names Default To Here( 1 );
dt = Open( "F:/R/data/donor.jmp" );
dis = dt << Distribution( Nominal Distribution( Column( : 1.1, 1.2, 1.3, etc. ) ) );
Report( dis )["Frequencies"][Table Box( 1 )][Number Col Box( 2 )] <<
set format( "Percent", 7, 1 ) << set heading( "Percent" );

The code you specified to create the distributions is incorrect, and additionally, the code required to handle multiple distributions forces a change in the code required to pass through all of the outputs to change the Frequencies tables

Names Default To Here( 1 );
dt = New Table( "All Nominal",
	Add Rows( 40 ),
	New Column("1.1",
	Character,
		"Nominal",
		Set Values(
			{"KATIE", "LOUISE", "JANE", "JACLYN", "LILLIE", "TIM", "JAMES", "ROBERT",
			"BARBARA", "ALICE", "SUSAN", "JOHN", "JOE", "MICHAEL", "DAVID", "JUDY",
			"ELIZABETH", "LESLIE", "CAROL", "PATTY", "FREDERICK", "ALFRED", "HENRY",
			"LEWIS", "EDWARD", "CHRIS", "JEFFREY", "MARY", "1.1", "ROBERT",
			"WILLIAM", "CLAY", "MARK", "DANNY", "MARTHA", "MARION", "PHILLIP",
			"LINDA", "KIRK", "LAWRENCE"}
		)
	),
	New Column("1.2",
	Character,
		"Nominal",
		Set Values(
			{"12", "12", "12", "12", "12", "12", "12", "12", "13", "13", "13", "13",
			"13", "13", "13", "14", "14", "14", "14", "14", "14", "14", "14", "14",
			"14", "14", "14", "15", "15", "15", "15", "15", "15", "15", "16", "16",
			"16", "17", "17", "17"}
		)
	),
	New Column("1.3",
	Character( 1 ),
		"Nominal",
		Set Values(
			{"F", "F", "F", "F", "F", "M", "M", "M", "F", "F", "F", "M", "M", "M",
			"M", "F", "F", "F", "F", "F", "M", "M", "M", "M", "M", "M", "M", "F",
			"F", "M", "M", "M", "M", "M", "F", "F", "M", "F", "M", "M"}
		)
	),
	New Column("1.4",
		Character,
		"Nominal",
		Set Values(
			{"59", "61", "55", "66", "52", "60", "61", "51", "60", "61", "56", "65",
			"63", "58", "59", "61", "62", "65", "63", "62", "63", "64", "65", "64",
			"68", "64", "69", "62", "64", "67", "65", "66", "62", "66", "65", "60",
			"68", "62", "68", "70"}
		)
	),
	New Column("1.5",
	Character,
		"Nominal",
		Set Values(
			{"95", "123", "74", "145", "64", "84", "128", "79", "112", "107", "67",
			"98", "105", "95", "79", "81", "91", "142", "84", "85", "93", "99",
			"119", "92", "112", "99", "113", "92", "112", "128", "111", "105", "104",
			"106", "112", "115", "128", "116", "134", "172"}
		)
	)
);

// Run the distributions
dis = dt << Distribution(
	Nominal Distribution( Column( :Name( "1.1" ) ) ),
	Nominal Distribution( Column( :Name( "1.2" ) ) ),
	Nominal Distribution( Column( :Name( "1.3" ) ) ),
	Nominal Distribution( Column( :Name( "1.4" ) ) ),
	Nominal Distribution( Column( :Name( "1.5" ) ) )
);

// Change the tables
// Because of Your column names(this is a JMP bug I believe), we have
// to use a direct reference to the Outline Box number.  See below where
// if the column names were not of the form 1.1, 1.2, 1.3 etc. a better
// reference could be made 
For( i = 2, i <= N Col( dt ) * 2, i++,
	Report( dis )[Outline Box( i )]["Frequencies"][Table Box( 1 )][Number Col Box( 2 )] <<
	set format( "Percent", 7, 2 ) << set heading( "Percent" )
);


/*For( i = 1, i <= N Col( dt ), i++,
	Report( dis )[column(dt,i)<<get name]["Frequencies"][Table Box( 1 )][Number Col Box( 2 )] <<
	set format( "Percent", 7, 2 ) << set heading( "Percent" )
);*/
Jim
Ted
Ted
Level IV

Re: How to set format for Distribution platform output?

Grandiose! Thank you very much for your help!