<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Wrong rounding when transferring from crosstab table to new table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Wrong-rounding-when-transferring-from-crosstab-table-to-new/m-p/880149#M104380</link>
    <description>&lt;P&gt;Did you check the values it really has? Those values you see in the JMP report are most likely already rounded values. This is done in JMP18&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Drug.jmp");
obj = Fit Model(
	Y(:y),
	Effects(:Drug, :x),
	Personality(Standard Least Squares),
	Emphasis(Effect Leverage),
	&amp;lt;&amp;lt; Run(:Drug &amp;lt;&amp;lt; {LSMeans Student's t(.05, Ordered Differences Report(1))})
);

m = Report(obj)["Response y","Drug","LSMeans Differences Student's t",CrosstabBox(1)] &amp;lt;&amp;lt; get as matrix;
show(m);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1750151934553.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76998i8CEA67611BF24FFC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1750151934553.png" alt="jthi_0-1750151934553.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Jun 2025 09:19:11 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2025-06-17T09:19:11Z</dc:date>
    <item>
      <title>Wrong rounding when transferring from crosstab table to new table</title>
      <link>https://community.jmp.com/t5/Discussions/Wrong-rounding-when-transferring-from-crosstab-table-to-new/m-p/879736#M104311</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using JMP version 16.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am transferring data from a CrossTab table. I have asked it to round to 3 decimals. It then saves the data into a string, which will be used to print the results into a table. See code below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Get data from CrossTab table
	crossTab = reportFitmod[Outline Box( "LSMeans Differences Student's t" )][CrosstabBox( 1 )] &amp;lt;&amp;lt; get as matrix;
	meandiff = Round( crossTab[1, 2] , 3 );
	lowerCL = Round( crossTab[3, 2] , 3 );
	upperCL = Round( crossTab[4, 2] , 3 );&lt;BR /&gt;&lt;BR /&gt; // Create the Difference in mean and CL string&lt;BR /&gt;Insert Into( dif, Char( meandiff ) || " [" || Char( lowerCL ) || " ; " || Char( upperCL ) || "]" );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have two questions about the reporting:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Why does it report e.g., 0.019 as 0.02 instead of 0.020 when it is specified to report 3 decimals?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. This used to work, but now it does not - it takes the value 0.0015 and rounds it to 0.001 instead of 0.002. Do you know why it does this and how to fix it? I want it to keep the normal rounding rules (4 or less rounds down and 5 or higher rounds up).&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jun 2025 12:35:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Wrong-rounding-when-transferring-from-crosstab-table-to-new/m-p/879736#M104311</guid>
      <dc:creator>Juli</dc:creator>
      <dc:date>2025-06-13T12:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong rounding when transferring from crosstab table to new table</title>
      <link>https://community.jmp.com/t5/Discussions/Wrong-rounding-when-transferring-from-crosstab-table-to-new/m-p/879810#M104319</link>
      <description>&lt;P&gt;1. I think if you wish to have those extra zeros in JMP, you have to specify the format and convert to string&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Format(1.100, "Fixed Dec", 10, 3)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2. Are you sure you are rounding 0.0015 and not something else? What is the real value in the matrix you have? Even if the platform is showing you 0.0015 the value is most likely more accurate in reality, such as 0.00149 which would then get rounded to 0.0015&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jun 2025 16:21:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Wrong-rounding-when-transferring-from-crosstab-table-to-new/m-p/879810#M104319</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-06-13T16:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong rounding when transferring from crosstab table to new table</title>
      <link>https://community.jmp.com/t5/Discussions/Wrong-rounding-when-transferring-from-crosstab-table-to-new/m-p/880147#M104379</link>
      <description>&lt;P&gt;Hi Jarmo,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for the reply!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. I will try this, thanks.&lt;/P&gt;
&lt;P&gt;2. It should go to the crosstab and take from the second column, row 1, row 3 and row 4 (Mean[i]-Mean[j], Lower CL Dif and Upper CL Dif).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please see picture below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Juli_0-1750146899254.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76996i5264DE74799E5C5B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Juli_0-1750146899254.png" alt="Juli_0-1750146899254.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The mean difference is printed with this line&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;meandiff = Round( crossTab[1, 2] , 3 );&lt;/PRE&gt;
&lt;P&gt;It should be rounded to three decimals and it should be rounded according to normal rounding rules. It just did not round correctly and I cannot figure out what goes wrong.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jun 2025 08:39:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Wrong-rounding-when-transferring-from-crosstab-table-to-new/m-p/880147#M104379</guid>
      <dc:creator>Juli</dc:creator>
      <dc:date>2025-06-17T08:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong rounding when transferring from crosstab table to new table</title>
      <link>https://community.jmp.com/t5/Discussions/Wrong-rounding-when-transferring-from-crosstab-table-to-new/m-p/880149#M104380</link>
      <description>&lt;P&gt;Did you check the values it really has? Those values you see in the JMP report are most likely already rounded values. This is done in JMP18&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Drug.jmp");
obj = Fit Model(
	Y(:y),
	Effects(:Drug, :x),
	Personality(Standard Least Squares),
	Emphasis(Effect Leverage),
	&amp;lt;&amp;lt; Run(:Drug &amp;lt;&amp;lt; {LSMeans Student's t(.05, Ordered Differences Report(1))})
);

m = Report(obj)["Response y","Drug","LSMeans Differences Student's t",CrosstabBox(1)] &amp;lt;&amp;lt; get as matrix;
show(m);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1750151934553.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76998i8CEA67611BF24FFC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1750151934553.png" alt="jthi_0-1750151934553.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jun 2025 09:19:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Wrong-rounding-when-transferring-from-crosstab-table-to-new/m-p/880149#M104380</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-06-17T09:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong rounding when transferring from crosstab table to new table</title>
      <link>https://community.jmp.com/t5/Discussions/Wrong-rounding-when-transferring-from-crosstab-table-to-new/m-p/880212#M104386</link>
      <description>&lt;P&gt;I could not get it to run the following line&lt;/P&gt;
&lt;PRE&gt;m = Report(obj)[ :Result , :Person , "LSMeans Differences Student's t" , CrosstabBox(1)] &amp;lt;&amp;lt; get as matrix;
&lt;/PRE&gt;
&lt;P&gt;So instead I opened the ordered differences report. Here I can see, that the full difference is 0.0015000, hence, it is not double rounded.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Juli_1-1750168401191.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/77008iA5318AA6F40C1454/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Juli_1-1750168401191.png" alt="Juli_1-1750168401191.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jun 2025 13:55:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Wrong-rounding-when-transferring-from-crosstab-table-to-new/m-p/880212#M104386</guid>
      <dc:creator>Juli</dc:creator>
      <dc:date>2025-06-17T13:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong rounding when transferring from crosstab table to new table</title>
      <link>https://community.jmp.com/t5/Discussions/Wrong-rounding-when-transferring-from-crosstab-table-to-new/m-p/880215#M104389</link>
      <description>&lt;P&gt;You already had the script for your case to extract the matrix&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;crossTab = reportFitmod[Outline Box( "LSMeans Differences Student's t" )][CrosstabBox( 1 )] &amp;lt;&amp;lt; get as matrix;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Just verify the values by printing the crossTab&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jun 2025 14:14:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Wrong-rounding-when-transferring-from-crosstab-table-to-new/m-p/880215#M104389</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-06-17T14:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong rounding when transferring from crosstab table to new table</title>
      <link>https://community.jmp.com/t5/Discussions/Wrong-rounding-when-transferring-from-crosstab-table-to-new/m-p/880219#M104390</link>
      <description>&lt;P&gt;Ahh, thank you! I got the results out and can see it is because when it rounds to 2 decimals instead of 3, then it rounds differently.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;crossTab = [0 0.00149999999999987, 0 0.000298142396959379, 0 0.000835697341910363, 0 0.00216430265808938, -0.00149999999999987 0, 0.000298142396959379 0, -0.00216430265808938 0, -0.000835697341910363 0];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you a lot for your help :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jun 2025 14:30:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Wrong-rounding-when-transferring-from-crosstab-table-to-new/m-p/880219#M104390</guid>
      <dc:creator>Juli</dc:creator>
      <dc:date>2025-06-17T14:30:03Z</dc:date>
    </item>
  </channel>
</rss>

