cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
MikeKim
Level III

How to compare multiple straight lines ? (y=ax+b)

Good day, 

I have some problem with this.

day: 1,2,3,4,5

operator: a,b,c,d

run in a day: r1, r2, r3

every run has 2 observed value: o1, o2

 

above data combination will be created for, 

0 mg/mL, 1mg/mL, 30mg/mL,

concluding that One regression line (y= concentration, x= observed value).

 

 

Since I wanted to figure out how variable the individual observed value are,

tried many methods but somewhat not satisfying.

 

Finally I had tried to compare created regression lines.

however, Y-intercept and Slope are to be taken together to consider, it is not easy to do this comparison.

 

Can I compare these multiple regression line to possibly conclude the following?

 

1. From a universal regression, operator c has the most gap, while operator b has least gap.

2. When for operator d, between day variation is significant since ANOVA with regression lines has significant P value.

3. When use mean(o) as average between o1 and o2, Variance(operator) is decreased since it is related to SEM (rather than SD)

 

Please help me...

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to compare multiple straight lines ? (y=ax+b)

A linear model expects pairs of (X,Y), but you describe a case where X=1 for more than one Y in each group. How can that situation be?

 

Here is an example of what I mean using the Big Class data table in the Sample Data folder. Run the script to see what I am talking about and see if it might work in your case.

 

Names Default to Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

fit = dt << Fit Model(
	Y( :weight ),
	Effects( :height, :age, :height * :age ),
	Personality( "Standard Least Squares" ),
	Emphasis( "Minimal Report" ),
	Run(
		:weight << {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 )}
	)
);

Here is the result:

 

fit.PNG

 

The interaction term is the key. It is used to test the question, "Does the slope depend on the age group?" This case suggests that it does not, because this term is not significant with 95% confidence.

 

Your grouping is more complex (not just a single variable like :age), but the idea is the same. So think about which variables can be used to define a group, and then use a formula to create the grouping variable for the regression analysis.

View solution in original post

8 REPLIES 8

Re: How to compare multiple straight lines ? (y=ax+b)

You can use a linear regression model for this task. You need to create grouping variables in addition to the Y and X variables. Include these in your model. Also cross each grouping variable with the X variable. The tests for the main effects of the grouping variables answers the question about a common or unique intercepts for each group. the tests for the interaction effects with the grouping variables answers the question about a common or unique slope for each group.

 

Please see this JMP Help guide about Fitting Linear Models for more details.

MikeKim
Level III

Re: How to compare multiple straight lines ? (y=ax+b)

Thank you for replying. Please understand that I can not attach example file.

Well, currently I have data JMP file like, 

 

day operator run  repeatability

1        a         r1        o1=47.2       

1        a         r1        o2=45.3

1        a         r2        o1=49

1        a         r2        o2=44.5

1        b         r1...

FOR 1 mg/mL...

 

What kind of column exactly do you want me to create ?

Maybe above data set is x=1, y=47.2, 45.3, ... and you are saying that nominal grouping column ? 

Like,

1 a r1 o1 as, G1 ,

1 a r1 o2 as, G2, ...

?

 

Have a good day!!

 

 

 

Re: How to compare multiple straight lines ? (y=ax+b)

A linear model expects pairs of (X,Y), but you describe a case where X=1 for more than one Y in each group. How can that situation be?

 

Here is an example of what I mean using the Big Class data table in the Sample Data folder. Run the script to see what I am talking about and see if it might work in your case.

 

Names Default to Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

fit = dt << Fit Model(
	Y( :weight ),
	Effects( :height, :age, :height * :age ),
	Personality( "Standard Least Squares" ),
	Emphasis( "Minimal Report" ),
	Run(
		:weight << {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 )}
	)
);

Here is the result:

 

fit.PNG

 

The interaction term is the key. It is used to test the question, "Does the slope depend on the age group?" This case suggests that it does not, because this term is not significant with 95% confidence.

 

Your grouping is more complex (not just a single variable like :age), but the idea is the same. So think about which variables can be used to define a group, and then use a formula to create the grouping variable for the regression analysis.

MikeKim
Level III

Re: How to compare multiple straight lines ? (y=ax+b)

Actually, this really helps.

Didn't tried any further step yet but I suddenly got one idea while reading your reply

Spread Y and group them by "operator" -1

Once devided by "operator" and sort group them by "day" -2

.... Like this way,  I expect that I can answer the questions; 'does Y differ by operator?' or 'does day variable affect operator's Y?', etc..

I do not understand the script but I will try and I hope that I can understand the point of yours.

 

Thank you very much!

 

MikeKim
Level III

Re: How to compare multiple straight lines ? (y=ax+b)

How the interpretation would be wrong, 

I FINALLY got to the destination to get this figure!!

Your help was great for me!

I am little bit confuse whether should I allocate [By] factor with "day, run, etc..'.

But that is not important for now.

MikeKim_0-1655863747558.png

You solved the situation.

My problem was,

I did not arrange the data right way.

it was like,

1mg/mL    30mg/mL

44.2            105.1

30.2            130.0

55.1...

 

It was real problem and I could not find the variable (continuous) that needed to run ANCOVA

After your helping,

it turned out to be,

Conc.    Obs.value

1            44.2

30          105.1

1            30.2

30          130.0

 

... It finally become applicable to ANCOVA.

 

thank you!

Re: How to compare multiple straight lines ? (y=ax+b)

You can use the other variables in the model if they are part of your concept of a group.

 

Yes, this analysis is traditionally known as analysis of covariance (ANCOVA).

MikeKim
Level III

Re: How to compare multiple straight lines ? (y=ax+b)

Dear, 

One last thing to check...

In the picture I posted, 

Can I conclude that there is significant different in slope (interaction term) and not significant in intercept term ?

 

Thus in this case I suppose I can conclude that,

Although slope is different, intercept considered to be same, thus, there is no difference among repeatability 1~3.

(as I know, ANCOVA difference needs both slope difference and intercept difference)

 

Can you agree ?

Re: How to compare multiple straight lines ? (y=ax+b)

I would interpret this analysis the same way as you did. There is no constant bias between the groups, but there is proportional bias.