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
- :
- Compute Column Mean while restricting observations...

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

Dec 12, 2014 5:16 AM
(2341 views)

Hello,

I want to get a column mean into a new column but I want to be able to restrict the date range that I use. I want to be able to say get column mean from day x to day y in my formula. This is the current formula that i have:

New Column ("X",

Numeric,

Continuous,

Format ("Best", 12),

Formula (Col Mean (:WeeklyPercent, :Week, :Source)), Set Selected);

It pull the average weekly percent by week and source of the data which is perfect, however, even when I put a data filter on the dataset it still pulls the mean for the entire data set by those two by variables. I want to be able to change the date range that those column means are from. Can anyone help me with that?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

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

Dec 19, 2014 11:45 AM
(3640 views)

Solution

The column functions operate on the whole table, ignoring selection and exclusions. However, you can make a formula column that's dependent on the row state and use that column as a BY variable.

New Column( "mysel", Formula( Selected( Row State() ) ) );

New Column( "meany", Formula( Col Mean( :y, :mysel) ) );

If you're using the global data filter with selection turned on, the Column Means will be recomputed whenever the selection changes.

1 REPLY

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

Dec 19, 2014 11:45 AM
(3641 views)

The column functions operate on the whole table, ignoring selection and exclusions. However, you can make a formula column that's dependent on the row state and use that column as a BY variable.

New Column( "mysel", Formula( Selected( Row State() ) ) );

New Column( "meany", Formula( Col Mean( :y, :mysel) ) );

If you're using the global data filter with selection turned on, the Column Means will be recomputed whenever the selection changes.