- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Percent
Hi,
I have a col with values "yes" and "no". Also I have a col of unquie LotNames. How can I find the total percentage of yes for a lotname.
I know the logic, just dont know how to do it in JMP.
Logic:
Percent of yes = Number of "yes" groupby LotName/ Total Rows grouped by LotName
Thank you,
Rami
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Percent
Attached is a simple Example data table that uses the below formula to create the Percent values you want
New Table( "example",
Add Rows( 100 ),
New Column( "Lot",
Character( 6 ),
"Nominal",
Set Values(
{"Lot 1", "Lot 1", "Lot 1", "Lot 1", "Lot 1", "Lot 1", "Lot 1", "Lot 1",
"Lot 1", "Lot 1", "Lot 2", "Lot 2", "Lot 2", "Lot 2", "Lot 2", "Lot 2",
"Lot 2", "Lot 2", "Lot 2", "Lot 2", "Lot 3", "Lot 3", "Lot 3", "Lot 3",
"Lot 3", "Lot 3", "Lot 3", "Lot 3", "Lot 3", "Lot 3", "Lot 4", "Lot 4",
"Lot 4", "Lot 4", "Lot 4", "Lot 4", "Lot 4", "Lot 4", "Lot 4", "Lot 4",
"Lot 5", "Lot 5", "Lot 5", "Lot 5", "Lot 5", "Lot 5", "Lot 5", "Lot 5",
"Lot 5", "Lot 5", "Lot 6", "Lot 6", "Lot 6", "Lot 6", "Lot 6", "Lot 6",
"Lot 6", "Lot 6", "Lot 6", "Lot 6", "Lot 7", "Lot 7", "Lot 7", "Lot 7",
"Lot 7", "Lot 7", "Lot 7", "Lot 7", "Lot 7", "Lot 7", "Lot 8", "Lot 8",
"Lot 8", "Lot 8", "Lot 8", "Lot 8", "Lot 8", "Lot 8", "Lot 8", "Lot 8",
"Lot 9", "Lot 9", "Lot 9", "Lot 9", "Lot 9", "Lot 9", "Lot 9", "Lot 9",
"Lot 9", "Lot 9", "Lot 10", "Lot 10", "Lot 10", "Lot 10", "Lot 10",
"Lot 10", "Lot 10", "Lot 10", "Lot 10", "Lot 10"}
),
Set Display Width( 48 )
),
New Column( "Yes_No",
Character( 3 ),
"Nominal",
Set Values(
{"No", "Yes", "No", "No", "No", "Yes", "No", "No", "No", "Yes", "Yes",
"Yes", "No", "No", "No", "No", "No", "No", "Yes", "Yes", "No", "No",
"No", "No", "No", "No", "Yes", "No", "No", "Yes", "No", "No", "No",
"Yes", "No", "Yes", "No", "Yes", "Yes", "No", "No", "No", "Yes", "Yes",
"No", "No", "Yes", "Yes", "No", "No", "No", "Yes", "Yes", "No", "Yes",
"No", "Yes", "No", "No", "No", "Yes", "No", "No", "No", "No", "Yes",
"No", "Yes", "No", "No", "No", "Yes", "No", "No", "No", "No", "No", "No",
"No", "Yes", "No", "No", "Yes", "Yes", "No", "Yes", "Yes", "Yes", "Yes",
"No", "No", "Yes", "No", "No", "Yes", "No", "Yes", "No", "No", "No"}
),
Set Display Width( 50 )
),
New Column( "Percent",
Numeric,
"Continuous",
Format( "Percent", 12, 2 ),
Formula(
Col Number( If( :Yes_No == "Yes", 1, . ), :Lot ) /
Col Number( :Yes_No, :Lot )
),
Set Display Width( 186 )
)
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Percent
This is easy to do interactively using Tabulate.
Drag your LotName column to the rows area, your Y/N to the columns area and then the Row % statistic to the columns area.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Percent
Attached is a simple Example data table that uses the below formula to create the Percent values you want
New Table( "example",
Add Rows( 100 ),
New Column( "Lot",
Character( 6 ),
"Nominal",
Set Values(
{"Lot 1", "Lot 1", "Lot 1", "Lot 1", "Lot 1", "Lot 1", "Lot 1", "Lot 1",
"Lot 1", "Lot 1", "Lot 2", "Lot 2", "Lot 2", "Lot 2", "Lot 2", "Lot 2",
"Lot 2", "Lot 2", "Lot 2", "Lot 2", "Lot 3", "Lot 3", "Lot 3", "Lot 3",
"Lot 3", "Lot 3", "Lot 3", "Lot 3", "Lot 3", "Lot 3", "Lot 4", "Lot 4",
"Lot 4", "Lot 4", "Lot 4", "Lot 4", "Lot 4", "Lot 4", "Lot 4", "Lot 4",
"Lot 5", "Lot 5", "Lot 5", "Lot 5", "Lot 5", "Lot 5", "Lot 5", "Lot 5",
"Lot 5", "Lot 5", "Lot 6", "Lot 6", "Lot 6", "Lot 6", "Lot 6", "Lot 6",
"Lot 6", "Lot 6", "Lot 6", "Lot 6", "Lot 7", "Lot 7", "Lot 7", "Lot 7",
"Lot 7", "Lot 7", "Lot 7", "Lot 7", "Lot 7", "Lot 7", "Lot 8", "Lot 8",
"Lot 8", "Lot 8", "Lot 8", "Lot 8", "Lot 8", "Lot 8", "Lot 8", "Lot 8",
"Lot 9", "Lot 9", "Lot 9", "Lot 9", "Lot 9", "Lot 9", "Lot 9", "Lot 9",
"Lot 9", "Lot 9", "Lot 10", "Lot 10", "Lot 10", "Lot 10", "Lot 10",
"Lot 10", "Lot 10", "Lot 10", "Lot 10", "Lot 10"}
),
Set Display Width( 48 )
),
New Column( "Yes_No",
Character( 3 ),
"Nominal",
Set Values(
{"No", "Yes", "No", "No", "No", "Yes", "No", "No", "No", "Yes", "Yes",
"Yes", "No", "No", "No", "No", "No", "No", "Yes", "Yes", "No", "No",
"No", "No", "No", "No", "Yes", "No", "No", "Yes", "No", "No", "No",
"Yes", "No", "Yes", "No", "Yes", "Yes", "No", "No", "No", "Yes", "Yes",
"No", "No", "Yes", "Yes", "No", "No", "No", "Yes", "Yes", "No", "Yes",
"No", "Yes", "No", "No", "No", "Yes", "No", "No", "No", "No", "Yes",
"No", "Yes", "No", "No", "No", "Yes", "No", "No", "No", "No", "No", "No",
"No", "Yes", "No", "No", "Yes", "Yes", "No", "Yes", "Yes", "Yes", "Yes",
"No", "No", "Yes", "No", "No", "Yes", "No", "Yes", "No", "No", "No"}
),
Set Display Width( 50 )
),
New Column( "Percent",
Numeric,
"Continuous",
Format( "Percent", 12, 2 ),
Formula(
Col Number( If( :Yes_No == "Yes", 1, . ), :Lot ) /
Col Number( :Yes_No, :Lot )
),
Set Display Width( 186 )
)
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Percent
This is easy to do interactively using Tabulate.
Drag your LotName column to the rows area, your Y/N to the columns area and then the Row % statistic to the columns area.