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
- :
- Random Normal Mixture vector input

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

Aug 10, 2016 5:12 AM
(794 views)

Hi

I have been trying to write a formula for a column, using **Random Normal Mixture(meanvec, sdvec, probvec)**. I would like to use Table variables as the input. How do I go about this? Do I define the table variables as vectors or can i make a vector of single table variables in the formula editor?

Thank you for any clues or help

1 ACCEPTED SOLUTION

Accepted Solutions

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

Solution

I think Jim was just using the script above as a convenient way to generate the table with the required properties and formula. But the script is not required. Please see the attached.

4 REPLIES

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

Aug 10, 2016 6:44 AM
(652 views)

Here is an example script that uses table variables as input to a Random Normal Mixture formula:

Names Default To Here**(** **1** **)**;

dt = New Table**(** "Example" **)**;

mv = **[**-**3**, **3]**;

sv = **[****1**, **1]**;

pv = **[****.3**, **.7]**;

// All table variables are actually character strings

// so the matrices need to be saved as literals

dt << **New Table Variable(** "meanvec", Char**(** mv **)** **)**;

dt << **New Table Variable(** "sdvec", Char**(** sv **)** **)**;

dt << **New Table Variable(** "probvec", Char**(** pv **)** **)**;

dt << **New Column(** "Rand NM",

set formula**(** Random Normal Mixture**(**

Parse**(** dt:meanvec **)**,

Parse**(** dt:sdvec **)**,

Parse**(** dt:probvec **)** **)** **)**

**)**;

dt << **add rows(** **1000** **)**;

Jim

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

Aug 11, 2016 10:56 PM
(652 views)

Hi Jim

Thank you very much for the answer. I was actually looking for a solution for how to do it in the formula editor in a table, ie. without scripting. Do you know how that can be done?

Best regards

Jeppe

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

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

Aug 12, 2016 1:45 AM
(652 views)

Thank you Ian... I was missing the *Parse()* function in there... Now I got it to work