Message Boards Message Boards

0
|
1852 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Formatting Table function output using an AssociationThread function

Posted 1 year ago

Hi;

Please see the attached notebook which includes embedded text comments. My question actually has more to do with the Wolfram language than Mathematics, and specifically the Table and AssociationThread functions.

My goal is to end up with a 4-column table which consists of: Confidence Interval - column 1, Percentage (from table i value) - column 2, and the calculated low and high values - columns 3 & 4 again calculated from the Table function. Since the Confidence Interval data is not a part of the Table function, I tried to it by using the AssociationThread function, which only created 2 columns with the Table function data being treated as a single column list which is not what I want. Hopefully this, my attached notebook will clarify any questions.

Thanks,
Mitch Sandlin

POSTED BY: Mitchell Sandlin

I asked chatGPT how to add a column to a matrix. It gave me two answers. The first method was wrong (it adds a row, not a column). The second answer was good: using Join with a level 2 specification:

tbl0 = {{0.9`, 0.0584241190299567`, 0.11844662926936303`},
   {0.925`, 0.054724560329369586`, 0.12214618796995014`},
   {0.95`, 0.04991634521614036`, 0.12695440308317937`},
   {0.975`, 0.042537120230813234`, 0.1343336280685065`},
   {0.99`, 0.03395717645392384`, 0.14291357184539588`},
   {0.995`, 0.02811484358968761`, 0.14875590470963213`}};
ci = {".80", ".85", ".90", ".95", ".98", ".99"};
Join[Map[List, ci], tbl0, 2] // TableForm
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract