cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
timothy_forsyth
Level III

Sample size calculation for difference in slopes for least square linear regression in JMP?

I am interested in a sample size calculation to detect a difference in two least square linear regression slopes.  I want to detect a difference of 10% between the slopes.  There will be four time points.  How many replicates do I need at each time point for the two slopes.  Is there a way in JMP to do this?  If not is there a formula?

Drink deep, or taste not the Pierian spring
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Sample size calculation for difference in slopes for least square linear regression in JMP?

The easiest way is to design the experiment (select DOE > Custom Design) and use the built-in Power Analysis.

 

If you insist on using four levels of the continuous factor (time), then select Add Factor > Discrete Numeric. (Do not remove the higher order terms for time in the model.) The optimal design for a first-order model (i.e., straight line response) would require only two levels. The other factor should be categorical with two levels (e.g., A and B) for the comparison you want to make.

 

Add the interaction term to the model. This term is the basis for your test: if there is a difference in the slope between the groups (A versus B), then there will be a significant interaction effect.

 

Select the number of runs that you posit are sufficient for the desired power and then estimate the power. You must enter the significance level of the test, the standard deviation of the response, and the anticipated coefficient for the interaction term. This value is half the full effect of the continuous factor (difference between response at highest factor level and at the lowest level). It is an absolute value so you must convert your relative effect size (i.e., 10%) to the actual difference.

 

If the power is adequate, then you are finished. Click Make Table and collect your data. The Model table script will start the analysis when you have all your data.

 

If the power is not what you want, then adjust the number of runs. Add runs to increase the power, subtract runs if the power is too high and not economical.

View solution in original post

4 REPLIES 4
timothy_forsyth
Level III

Re: Sample size calculation for difference in slopes for least square linear regression in JMP?


@timothy_forsyth wrote:

 

I am interested in a sample size calculation to detect a difference in two least square linear regression slopes.  I want to detect a difference of 10% between the slopes.  There will be four time points.  How many replicates do I need at each time point for the two slopes.  Is there a way in JMP to do this?  If not is there a formula?



The correct title is "Sample size calculation for difference in slopes for least square linear regression in JMP".

Drink deep, or taste not the Pierian spring

Re: Sample size calculation for difference in slopes for least square linear regression in JMP?

The easiest way is to design the experiment (select DOE > Custom Design) and use the built-in Power Analysis.

 

If you insist on using four levels of the continuous factor (time), then select Add Factor > Discrete Numeric. (Do not remove the higher order terms for time in the model.) The optimal design for a first-order model (i.e., straight line response) would require only two levels. The other factor should be categorical with two levels (e.g., A and B) for the comparison you want to make.

 

Add the interaction term to the model. This term is the basis for your test: if there is a difference in the slope between the groups (A versus B), then there will be a significant interaction effect.

 

Select the number of runs that you posit are sufficient for the desired power and then estimate the power. You must enter the significance level of the test, the standard deviation of the response, and the anticipated coefficient for the interaction term. This value is half the full effect of the continuous factor (difference between response at highest factor level and at the lowest level). It is an absolute value so you must convert your relative effect size (i.e., 10%) to the actual difference.

 

If the power is adequate, then you are finished. Click Make Table and collect your data. The Model table script will start the analysis when you have all your data.

 

If the power is not what you want, then adjust the number of runs. Add runs to increase the power, subtract runs if the power is too high and not economical.

timothy_forsyth
Level III

Re: Sample size calculation for difference in slopes for least square linear regression in JMP?

Hi Mark,



I'm not quite sure what you mean by the second to last last sentence, "This value is half the full effect of the continuous factor (difference between response at highest factor level and at the lowest level).." Is it the difference of the end and beginning values of the line with the steepest slope? Or the mean value between the two slopes?





Thanks,



Tim Forsyth


Drink deep, or taste not the Pierian spring

Re: Sample size calculation for difference in slopes for least square linear regression in JMP?

JMP does power analysis in a DOE in a very ingenious way. I did not say obvious way.

 

A power analysis requires a specification of the minimum effect size. The purpose of a DOE is to provide the optimal data for fitting a specific model. The power is about the coefficients in the model and testing their significance versus the null hypothesis that the parameter is zero. That means that we specify our minimum effect in terms of the coefficient.

 

OK, so JMP uses coded factor levels. That fact means that a real factor like pH from 6.5 to 7.5 or time from 10 to 20 minutes or temperature from 25 to 35 degrees Celsius are centered and scaled such that they all now range from -1 to +1. This transformation is internal and performed automatically in the regression analysis if you designed the experiment with JMP. You do not need to manually perform this transformation. Let's say that you need to find a real effect that is a minimum change in the response yield from 40 to 80 when the temperature changed from 25 to 35 degrees Celsius. That means that the anticipated coefficient would be (80-40) / (35-25) = 4. But wait! The anticipated coefficient using coded levels will be (80-40) / (1-(-1)) = 20. Very different! So it is important to know both the minimum change you must find and that JMP uses coded levels.

 

The way that JMP codes factor levels also means that the coefficient for the interaction term is half the minimum difference between the two slopes.

 

If I have a model with just a slope of 10 for both levels A and B (no interaction), then there is no difference in slope. If I have a model with a slope of 10 and an interaction coefficient of -5 for A, then the slope of A is 10 + (-5) = 5 and the slope of B is 10 + (+5) = 15. The hypothesis test in the Effect Test report will help you decide if the estimated coefficient for the interaction effect is significant. The power analysis is related to that decision.