<?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: need error bars in arithmetic space for for a linear regression conducted in in log space in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/617851#M81733</link>
    <description>&lt;P&gt;I agree with your approach: use the transformed variables for estimating the best linear regression model, predict the mean, then back-transform the prediction to the original scale. Do the same for the confidence limits. You cannot use the JMP formula for the confidence interval, though. You need a surrogate computation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example of what I propose:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

// example of linear regression
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

// transform varibles
dt	&amp;lt;&amp;lt; New Column( "Log weight", "Numeric", "Continuous", Formula( Log( :weight ) ) )
	&amp;lt;&amp;lt; New Column( "Log height", "Numeric", "Continuous", Formula( Log( :height ) ) );

// fit linear regression model on transformed variables
fls = dt &amp;lt;&amp;lt; Fit Model(
	Y( :Log weight ),
	Effects( :Log height ),
	Personality( "Standard Least Squares" ),
	Emphasis( "Minimal Report" ),
	Run(
		:Log weight &amp;lt;&amp;lt; {Summary of Fit( 1 ), Analysis of Variance( 1 ),
		Parameter Estimates( 1 ), Scaled Estimates( 0 ),
		Plot Actual by Predicted( 0 ), Plot Residual by Predicted( 0 ),
		Plot Studentized Residuals( 0 ), Plot Effect Leverage( 0 ),
		Plot Residual by Normal Quantiles( 0 ), Box Cox Y Transformation( 0 )}
	)
);

// save mean prediction formula
fls &amp;lt;&amp;lt; Conditional Pred Formula;

// save mean confidence interval formula
mci = fls &amp;lt;&amp;lt; Mean Confidence Limit Formula( .05 );

// save individual confidence interval formula
ici = fls &amp;lt;&amp;lt; Indiv Confidence Limit Formula( .05 );

// proof of concept - fit polynomial function to upper mean Ci to regressor X
dt &amp;lt;&amp;lt; Bivariate( Y( mci[2] ), X( :Log height ), Fit Polynomial( 2 ) );

// use back transformed value of polynomial for upper mean limit, and so on...&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 29 Mar 2023 14:55:03 GMT</pubDate>
    <dc:creator>Mark_Bailey</dc:creator>
    <dc:date>2023-03-29T14:55:03Z</dc:date>
    <item>
      <title>need error bars in arithmetic space for for a linear regression conducted in in log space</title>
      <link>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/616295#M81589</link>
      <description>&lt;P&gt;Hi - I did a linear regression on log_turbidity (explanatory variable) vs log_ecoli (response variable) and am now trying to compute, and more importantly, understand intuitively, what my 95% confidence interval is in arithmetic space.&amp;nbsp; Specifically, I need error bars in arithmetic space to go along with my back transformed predicted ecoli values, but I'm not sure how to do and interpret this step. &amp;nbsp; (Note that my log-residuals are normally distributed.)&amp;nbsp; Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 00:59:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/616295#M81589</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2023-06-09T00:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: need error bars in arithmetic space for for a linear regression conducted in in log space</title>
      <link>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/616427#M81609</link>
      <description>&lt;P&gt;You can back-transform the values (e.g., Exp( value ) ). They will not be symmetric anymore, but they should be realistic.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 18:02:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/616427#M81609</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2023-03-24T18:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: need error bars in arithmetic space for for a linear regression conducted in in log space</title>
      <link>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/617075#M81662</link>
      <description>&lt;P&gt;Thanks very much Mark.&amp;nbsp; I have two follow up questions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 - Is my computed +/- error in log space the same as a &lt;U&gt;percentage&lt;/U&gt; error in arithmetic space? &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 - Is there a way to show a 95% confidence interval in &lt;EM&gt;arithmetic&lt;/EM&gt; space based on the SD of my &lt;EM&gt;log&lt;/EM&gt; residuals?&amp;nbsp; I'm looking for a simple equation I can use to compute the error associated with arithmetic ecoli based on my (measured) arithmetic turbidity....rather than rely on the quadratic equation used to computed the 95% CI in JMP.&amp;nbsp; (I measure turbidity in real time and want to use it to estimate ecoli and upload it to a web portal in real time....my web designer doesn't do quadratic equations.)&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 17:04:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/617075#M81662</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2023-03-27T17:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: need error bars in arithmetic space for for a linear regression conducted in in log space</title>
      <link>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/617160#M81665</link>
      <description>&lt;P&gt;1. I do not understand what you mean by "percentage error."&lt;/P&gt;
&lt;P&gt;2. No. Are you considering something like a 1 or 2 SD interval? Such an interval is about the residuals, not about the predicted mean from the linear regression. the conventional intervals are not directly based on the SD of the residuals. The individual 95% confidence error bar presented with linear regression has a specific calculation and interpretation. It depends on the standard error of the predicted mean response and the associated &lt;EM&gt;t&lt;/EM&gt; quantile. The standard error for a linear regression model is a quadratic form of your fitted model &lt;EM&gt;f&lt;/EM&gt; and the model matrix &lt;STRONG&gt;X&lt;/STRONG&gt; from the regression:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="var.PNG" style="width: 467px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/51545i4CE80162EB4376EC/image-size/large?v=v2&amp;amp;px=999" role="button" title="var.PNG" alt="var.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(This form is the quadratic equation you referred to.) It sounds like you won't be able to compute 95% confidence intervals as JMP does. You might be able to save the column formula for the interval in JMP and then fit a simple empirical polynomial that the web page can compute.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 20:21:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/617160#M81665</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2023-03-27T20:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: need error bars in arithmetic space for for a linear regression conducted in in log space</title>
      <link>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/617420#M81694</link>
      <description>&lt;P&gt;WRT to your follow up question number 1: The RMSE from your log_turbidity (explanatory variable) vs log_ecoli (response variable) model is an estimate of the CV (SD/mean = coefficient of variation, sometimes called Relative Standard Deviation and often multiplied by 100 to get a %RSD) in the native scale of your response variable. So, since the +/- error in log space is a multiple of that RMSE, then it is related to % error in native (arithmetic) space.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 10:31:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/617420#M81694</guid>
      <dc:creator>MRB3855</dc:creator>
      <dc:date>2023-03-28T10:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: need error bars in arithmetic space for for a linear regression conducted in in log space</title>
      <link>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/617535#M81704</link>
      <description>&lt;P&gt;Here is my JMP-produced equation for the upper 95 CI on the mean of the predicted log_ecoli:&lt;/P&gt;&lt;P&gt;Following up for clarity....&lt;/P&gt;&lt;P&gt;My upper 95% CI equation in JMP is:&lt;/P&gt;&lt;P&gt;1.22332500809584 + 1.09064687207089 * :log_turb + 1.97569392781527 * Sqrt(Vec Quadratic([0.0582857231016302 -0.0410476215408451, -0.0410476215408451 0.0325320549013955], [1] || :log_turb) * 0.0811942392532194)&lt;/P&gt;&lt;P&gt;(note the quadratic equation)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am trying to achieve is this:&amp;nbsp;&amp;nbsp;&amp;nbsp; For each new measurement of turbidity, I'd like to run it through the linear regression equation (log ecoli = f(log_turbidity)) that I modeled using my training data.&amp;nbsp; This will give me an estimated log_ecoli based on log_turbidity that I can back transform to get ecoli in arithmetic space.&amp;nbsp; So far so good.&amp;nbsp; But then I'd like to add error bars (arithmetic space) (like a 95% CI around the estimated ecoli value.....or similar approximation) to the estimated, back transformed ecoli value.&amp;nbsp; If I'm understanding correctly, the error bars would have to be based on the residuals of my log-linear regression....i.e. how well the model fits the observed training data.&amp;nbsp; The question I have centers around the fact that the residuals, RMSE, etc are in log space but my error bars need to be in arithmetic space.&amp;nbsp; The goal is a simple approximation (or simple equation not reliant on a quadratic equation) of the expected error, in arithmetic space, plus and minus my estimated arithmetic-space ecoli.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am told that the error in log space is the same as a percentage in arithmetic space, such that every value in arithmetic space would be in error by that same percentage.&amp;nbsp; But I may not be following that correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ps&amp;nbsp; You mentioned fitting a polynomial function to the quadratic equation to achieve a simple equation for my web master.&amp;nbsp; Can JMP do this fit and give me such an equation? &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 16:40:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/617535#M81704</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2023-03-28T16:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: need error bars in arithmetic space for for a linear regression conducted in in log space</title>
      <link>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/617536#M81705</link>
      <description>&lt;P&gt;Thanks very much MRB3855.&amp;nbsp; Please see above.&amp;nbsp; You stated that " since the +/- error in log space is a multiple of that RMSE, then it is related to % error in native (arithmetic) space".&amp;nbsp; Can you clarify what you mean by "since the error in log space is a multiple of that RMSE"....?&amp;nbsp; I'm trying to understand this intuitively.&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 16:43:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/617536#M81705</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2023-03-28T16:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: need error bars in arithmetic space for for a linear regression conducted in in log space</title>
      <link>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/617679#M81719</link>
      <description>&lt;P&gt;You'll notice the&amp;nbsp;&lt;SPAN&gt;0.0811942392532194 in your equation above. That is the RMSE^2. And, since it is multiplied within the sqrt() function, it can be factored out as RMSE.&amp;nbsp; So, that complex looking equation is some number, let's call it t*C (t =1.97569392781527, the critical value from the t dist), multiplied the RMSE. Now, C, in "simple linear regression" (Y = B0 + B1*X, where Y =&amp;nbsp;log_ecoli and X =&amp;nbsp;log_turbidity) simplifies to something you may find manageable. C is the square root term below (the &lt;EM&gt;S&lt;FONT face="symbol" size="3"&gt;e&lt;/FONT&gt;&lt;/EM&gt; term is the RMSE). The denominator in the third term in the sqrt term is just the sample variance of x multiplied by n-1. The numerator of that term is the squared difference between the&amp;nbsp;log_turbidity value you want to predict at and the mean of all your&amp;nbsp;log_turbidity values in the data set. Then, as&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;&amp;nbsp;&amp;nbsp;indicated, just back transform the lower and upper to get back to your ecoli native scale. As he said, the resulting interval won't be symmetric (around exp(pred) ), but the percentiles carry over; i.e., the resulting Prediction Interval (PI)&amp;nbsp; is a PI around the median ( exp(pred) ) in the ecoli native scale (log normal). So, you add error bars &lt;EM&gt;before&lt;/EM&gt; back-transforming, not after. Note: the formula below is for a prediction interval (an interval for a single predicted value). For a confidence interval (interval for the population mean), drop the first term, the "1", from under the square root.&amp;nbsp;&lt;A href="https://stats.stackexchange.com/questions/16493/difference-between-confidence-intervals-and-prediction-intervals" target="_blank" rel="noopener"&gt;https://stats.stackexchange.com/questions/16493/difference-between-confidence-intervals-and-prediction-intervals&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;C =&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MRB3855_0-1680075775707.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/51567i32B9AA72B448B28A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MRB3855_0-1680075775707.png" alt="MRB3855_0-1680075775707.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You could also then get and upper "error bar" via exp(upper) - exp(pred), and a lower "error bar" via exp(pred) - exp(lower) where upper and lower are defined as in the equation above. But, they won't have the same magnitude so it isn't exp(pred) +/-error...it is exp(pred) - lower error, exp(pred) + upper error.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 10:15:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/617679#M81719</guid>
      <dc:creator>MRB3855</dc:creator>
      <dc:date>2023-03-29T10:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: need error bars in arithmetic space for for a linear regression conducted in in log space</title>
      <link>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/617851#M81733</link>
      <description>&lt;P&gt;I agree with your approach: use the transformed variables for estimating the best linear regression model, predict the mean, then back-transform the prediction to the original scale. Do the same for the confidence limits. You cannot use the JMP formula for the confidence interval, though. You need a surrogate computation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example of what I propose:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

// example of linear regression
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

// transform varibles
dt	&amp;lt;&amp;lt; New Column( "Log weight", "Numeric", "Continuous", Formula( Log( :weight ) ) )
	&amp;lt;&amp;lt; New Column( "Log height", "Numeric", "Continuous", Formula( Log( :height ) ) );

// fit linear regression model on transformed variables
fls = dt &amp;lt;&amp;lt; Fit Model(
	Y( :Log weight ),
	Effects( :Log height ),
	Personality( "Standard Least Squares" ),
	Emphasis( "Minimal Report" ),
	Run(
		:Log weight &amp;lt;&amp;lt; {Summary of Fit( 1 ), Analysis of Variance( 1 ),
		Parameter Estimates( 1 ), Scaled Estimates( 0 ),
		Plot Actual by Predicted( 0 ), Plot Residual by Predicted( 0 ),
		Plot Studentized Residuals( 0 ), Plot Effect Leverage( 0 ),
		Plot Residual by Normal Quantiles( 0 ), Box Cox Y Transformation( 0 )}
	)
);

// save mean prediction formula
fls &amp;lt;&amp;lt; Conditional Pred Formula;

// save mean confidence interval formula
mci = fls &amp;lt;&amp;lt; Mean Confidence Limit Formula( .05 );

// save individual confidence interval formula
ici = fls &amp;lt;&amp;lt; Indiv Confidence Limit Formula( .05 );

// proof of concept - fit polynomial function to upper mean Ci to regressor X
dt &amp;lt;&amp;lt; Bivariate( Y( mci[2] ), X( :Log height ), Fit Polynomial( 2 ) );

// use back transformed value of polynomial for upper mean limit, and so on...&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Mar 2023 14:55:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/617851#M81733</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2023-03-29T14:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: need error bars in arithmetic space for for a linear regression conducted in in log space</title>
      <link>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/618032#M81751</link>
      <description>&lt;P&gt;Excellent - thanks so much Mark!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 03:36:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/618032#M81751</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2023-03-30T03:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: need error bars in arithmetic space for for a linear regression conducted in in log space</title>
      <link>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/618033#M81752</link>
      <description>&lt;P&gt;Super helpful MRB3855.&amp;nbsp; Thanks for the detailed explanation!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 03:37:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/need-error-bars-in-arithmetic-space-for-for-a-linear-regression/m-p/618033#M81752</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2023-03-30T03:37:10Z</dc:date>
    </item>
  </channel>
</rss>

