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
- :
- Discussions
- :
- create a formula that takes means over different variables

Topic Options

- Start Article
- 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

Mar 3, 2015 11:14 AM
(5175 views)

I have a bunch of categorical factors (like gender, age group, etc.) and a continuous response. I'd like to take the means of the response but grouped for the categorical factors. So any woman between the ages of 15 and 20, say, would be averaged separately from men 60-65. And I would like these means saved to a column. Is there a way to do that? Sorry, if this is an easy answer...I'm very new to jmp.

1 ACCEPTED SOLUTION

Accepted Solutions

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

If you want the means in your original table a column formula may be a better option, especially if your data will change.

Add a new column with a formula like

Col Mean(:height, :sex, :age)

where :*height* is the continuos response and :*sex *and* :age* represent optional grouping columns.

8 REPLIES 8

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

Re: create a formula that takes means over different variables

start with Tables->Summary, which will produce a new table. If you like what you get, there is a Source script (red triangle) you can use in JSL.

Craige

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

Re: create a formula that takes means over different variables

I can use that to get my means but I don't know how to take that information and put it back into my original data table as a column. I have over 4k rows so manually entering the means is not possible.

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

Re: create a formula that takes means over different variables

Hi, Lauren. Everyone was new to JMP at one time...

Go to Table -> Join and join the new table with the original by matching the AGE column.

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

Re: create a formula that takes means over different variables

Tables->Join does the job of matching up the rows from the short and long tables, using a column you specify to match them. Again, there will be a script in the joined table if you need it for JSL.

Craige

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

Re: create a formula that takes means over different variables

Here's a neat, hidden trick in JMP – you can drag a column from a summary table back to the source table to auto-join it. Just remember to pause for a beat after clicking at the top of the summary column.

-Jeff

-Jeff

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

If you want the means in your original table a column formula may be a better option, especially if your data will change.

Add a new column with a formula like

Col Mean(:height, :sex, :age)

where :*height* is the continuos response and :*sex *and* :age* represent optional grouping columns.

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

Re: create a formula that takes means over different variables

way better

Craige

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

Re: create a formula that takes means over different variables

Thank you! That was very easy.