cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
helalmob
Level II

How to calculate row percentage for dimension subtotal?

I have the following data with 20+ measures. Raw data shown here is a sample with only one measure. With Tabulate I can get subtotal for each site for all levels of Var2 (0,1,2,3) and level of Var1 (A, B). For example, the subtotal for Site1=461 (438+19+2+2). I am comparing the percentage of measure for each level of Var2 between the level of Var1 for each Site. Table1 presents subtotal for each site for each level of Var2 and Var1. Table 2 shows the percentage of the total for each level of Var2 and Var1. This is the desired percentage that I like to compare and contrast. In this example (Table 2), there is not much variability between A & B (Var1 level) across each level of Var2 (0,1,2,3) for each site. However, I need to perform similar comparisons across 20+ measures. I appreciate any guidance/help to calculate the percentages.

 

Raw Data

Site

Var1

Var2

Measure

Site1

A

0

438

Site1

A

1

19

Site1

A

2

2

Site1

A

3

2

Site2

A

0

321

Site2

A

1

0

Site2

A

2

0

Site2

A

3

0

Site1

B

0

57

Site1

B

1

4

Site1

B

2

0

Site1

B

3

0

Site2

B

0

37

Site2

B

1

1

Site2

B

2

0

Site2

B

3

0

 

Table 1

 

Site1

 

 

 

 

Site2

 

 

 

 

 

Var2

 

 

 

 

Var2

 

 

 

 

 

0

1

2

3

 

0

1

2

3

 

Var1

N

N

N

N

Total

N

N

N

N

Total

A

438

19

2

2

461

321

0

0

0

321

B

57

4

0

0

61

37

1

0

0

38

All

495

23

2

2

522

358

1

0

0

359

 

 

Site1

 

 

 

 

Site2

 

 

 

 

 

Var2

 

 

 

 

Var2

 

 

 

 

 

0

1

2

3

 

0

1

2

3

 

Var1

%

%

%

%

Total

%

%

%

%

Total

A

95%

4%

0%

0%

100%

100%

0%

0%

0%

100%

B

93%

7%

0%

0%

100%

97%

3%

0%

0%

100%

All

95%

4%

0%

0%

100%

100%

0%

0%

0%

100%

 

Thank you,

 

Helal

2 REPLIES 2
Phil_Kay
Staff

Re: How to calculate row percentage for dimension subtotal?

Hi,

I think this is what you want?

Phil_Kay_0-1647341679052.png

I have attached your example data with the Tabulate script. Hopefully you can see how I used Tabulate from this.

By the way, it is good to attach your example data as a .jmp file to your JMP Community post - it makes it easier for the community to help you.

I hope this helps,

Phil 

Phil_Kay
Staff

Re: How to calculate row percentage for dimension subtotal?

Personally, I prefer a graphical analysis. You could use Graph Builder for this kind of comparison:

 

Phil_Kay_2-1647342191213.png