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
jsolo01
Level I

comparing lines of fit

I am trying to compare changes over time in a physiologic variable between two groups of subjects. Each subject has at least two different measurements of this variable with days in between measurements. Subjects will not have the same interval between measurements. The attached graph shows that I'm able to create spaghetti plots for the two groups of subjects. I'm trying to compare lines of fit to see if the subject differ in terms of changes in this variable overtime. When I try to do a line of fit I get the second picture below? Trying to see if the slope differs between the two groups. Any help would be appreciated. Thanks.

 

jsolo01_0-1649346307497.png

jsolo01_1-1649346318580.png

 

3 REPLIES 3
SDF1
Super User

Re: comparing lines of fit

Hi @jsolo01 ,

 

  It looks like you've used Graph Builder to generate those plots, is that right? When you do that, JMP will create lines of fit for all the Overlay graphs you have -- i.e. the ASID Total. The shaded areas around the lines are the 95% confidence intervals on the fit (I believe). It doesn't sound like that's what you are after.

 

  I would recommend doing a Fit Y by X, where you cast the FVC Female and FVC Male columns in the Y role and the Days Between FVC Final in the X role. Then, cast the ASID Total column in the "By" role. This will generate the 60 (or however many ASID levels you have) Fit Y by X graphs. Note, you might want to change your ASID to Ordinal or Character since it appears to be an identifier label and not necessarily a continuous variable.

 

  Then, do a CTRL-left click (broadcast) on the first Bivariate fit red hot button and select Fit Line. This will fit a line to all the data. In the Summary of Fit report table, you can right click and select "Make Into Combined Data Table" and JMP will generate a combined data table with the values of the summary of fit table. You can then review things like R^2 or R^2Adj and so forth. You can do the same for the Analysis of Variance table report to review the F-Ratio and Prob > F for all the fits.

 

  I think this might be a better way to go about comparing so many different lines of fit. At least, it is my way of thinking about it based on your description.

 

  I've attached a couple data tables with scripts you can run to see what I've done in mocking up a data table to be kind of like what it seems you're dealing with.

 

Hope this helps!,

DS

jsolo01
Level I

Re: comparing lines of fit

That’s great info – really appreciate it. Will give it a try


Re: comparing lines of fit

A common approach is to use "analysis of covariance" (ANCOVA). Select Analyze > Fit Model. Select the response data column and click Y. Select the time and ID data columns and click Macros. Select Full Factorial in this case. Click Run.

 

This model includes a term for an interaction effect. The interaction effect, if significant, indicates that the slope is significantly different across IDs.