turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- How do I create a summary table with mean ± SD in ...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 19, 2016 11:28 AM
(4095 views)

I generate tables by hand that express mean ± SD in the same column. This is very time consuming. Is there a way to generate in a table in JMP that looks like the table below?

Thanks,

A~

Time | Group 1 | Group 2 | Group 3 |

(hr) | | | |

1 | mean ± SD | mean ± SD | mean ± SD |

2 | mean ± SD | mean ± SD | mean ± SD |

3 | mean ± SD | mean ± SD | mean ± SD |

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 22, 2016 1:27 PM
(6866 views)

Solution

The non-scripting solution:

First you need to build a summary table which is really easy to do. There are two options, use the tabulate and when your table looks like what you want then use save to table option. Or alternately from the Tables menu select Summary. Put your grouping variables into the group (so in your case Group and Time) then select the data column and then in the "Statistics" drop down menu in the summary dialog box select mean and then again select std dev. Before you hit the OK button check the little "keep dialog open" button so that if your table is not what you want it is easy to go back to the dialog and try again (and don't worry, we all do this multiple times to get exactly what we want).

Now you have a table with a Group Column, a Time Column, a mean, and a std dev. Now you can add another column (double click to the right of your last column) and now right click on that empty column and select formula. You want to build a formula that concatenates the mean, the ± symbol, and the standard deviation. The only trick is that the mean and std dev are numbers so I have a 3 part concatenate (look that up in the formula functions) with a char function to convert numbers to characters. I also use the ^ option on the character function to get a space for the "7" to control the length of the character. Maybe someone has a better solution to get a constant 2 digits when converting a number to a character.

Char**(** :Name**(** "Mean(Data)" **)**, **7** **)** || "±" || Char**(** :Name**(** "Std Dev(Data)" **)**, **7** **)**

Finally to get the layout you were looking for you would Split your table. Table menu, Split option, dialog box: split by = group, split columns = new column, and group = time, again utilize that "keep dialog open" to go back and redo when you put the columns in the wrong places.

8 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 19, 2016 6:27 PM
(3809 views)

I have attached a script that illustrates how to do the 3 different solutions for your request. I think the 3rd one is the closest to what you want.

Jim

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 22, 2016 10:46 AM
(3809 views)

Thank you, Jim. The third option is exactly what I am looking for. How do I arrive at this format? I have very little experience creating data tables using JMP.

Thanks,

A~

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 22, 2016 10:49 AM
(3809 views)

The script that I encluded in the response has the jsl code to create the table. If you need more explanation after you look at the attached file, get back to me and we can walk through it.

Jim

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 22, 2016 12:05 PM
(3809 views)

Hi Jim,

Unfortuantely, I can't follow the jsl code so I'll need step by step instrcution. I am happy to share my desktop for a virtual session.

Thanks.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 22, 2016 1:27 PM
(6867 views)

The non-scripting solution:

First you need to build a summary table which is really easy to do. There are two options, use the tabulate and when your table looks like what you want then use save to table option. Or alternately from the Tables menu select Summary. Put your grouping variables into the group (so in your case Group and Time) then select the data column and then in the "Statistics" drop down menu in the summary dialog box select mean and then again select std dev. Before you hit the OK button check the little "keep dialog open" button so that if your table is not what you want it is easy to go back to the dialog and try again (and don't worry, we all do this multiple times to get exactly what we want).

Now you have a table with a Group Column, a Time Column, a mean, and a std dev. Now you can add another column (double click to the right of your last column) and now right click on that empty column and select formula. You want to build a formula that concatenates the mean, the ± symbol, and the standard deviation. The only trick is that the mean and std dev are numbers so I have a 3 part concatenate (look that up in the formula functions) with a char function to convert numbers to characters. I also use the ^ option on the character function to get a space for the "7" to control the length of the character. Maybe someone has a better solution to get a constant 2 digits when converting a number to a character.

Char**(** :Name**(** "Mean(Data)" **)**, **7** **)** || "±" || Char**(** :Name**(** "Std Dev(Data)" **)**, **7** **)**

Finally to get the layout you were looking for you would Split your table. Table menu, Split option, dialog box: split by = group, split columns = new column, and group = time, again utilize that "keep dialog open" to go back and redo when you put the columns in the wrong places.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 22, 2016 2:39 PM
(3809 views)

Hi Karen,

Your instructions were very easy to follow and I have a table to work with. However, I am stuck at that point. I am struggling with the '3 part concatenate' and what I am understanding as the conversion of numbers to characters. It also looks like there is some place I am supossed to put a code, correct? Any further details would be much appreciated.

Thanks!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 22, 2016 3:07 PM
(3809 views)

If you add a new column to the summary table, then from the column properties (or right click on the column and select formula) and you will get something that looks like this:

[Missing image]

If you cut and paste the line of code from my previous post and paste it here you should get what you are looking for. The two formulas are "Concatenate" and "Character". Here is the link to the start of the formula editor help info. The formula editor takes a bit of "playing with" to get the hang of but once you do...watch out.

http://www.jmp.com/support/help/Formula_Editor.shtml#96570

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 22, 2016 1:44 PM
(3809 views)

Attached is a cut down version of the script that previously sent you. I have eliminated the sections that produced the output that you didn't want, and have annotated the sections of the code with how these could have been done interactively rather than with the JSL. Please take a look at it. I think it will walk you though the process to get what you need.

Jim