cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • See how to use the JMP Marketplace – Free tools to expand JMP capabilities. Register. July 10, 2 pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
tomparker
Level II

How to calculate regression slopes by subject in table with many subjects each measured at different ages?

Renal function is measured as Glomerular Filtration rate (GFR) and loss of function in renal disease is estimated as the (negative) slope of GFR by advancing age. In studies of kidney disease, it is often the objective to test for baseline predictors of the slope of GFR by age or time. The attached table shows typical data for 10 subjects with each having GFR measured at two or more ages. Can anyone suggest a method (using JMP10) to calculate the slope for each subject to produce a new table with SubjectID in column one and Slope in column two? Subsequent columns optionally may contain additional information about the fit. 

1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User (Alumni) ms
Super User (Alumni)

Re: How to calculate regression slopes by subject in table with many subjects each measured at different ages?

You can use the Fit Y by X platform. Add GFR as Y, Age as X. Then in the bivariate report, select "Group By..." under the red triangle and select Patient before choosing "Fit Line" (also under the red triangle). Finally, right-click on any of the tables named "Parameter Estimates" and select "make combined data table" to make a table with all the slopes (the intercepts will be there too but are easy to sort out and delete).

The JSL version would be something like this:

dt = Data Table( "Sample_GFRbyAgebyPt.jmp" );

biv = dt << Bivariate( Y( :GFR ), X( :Age ), Group by( :Patient ), Fit Line( 1 ) );

slopes = Report( biv )["Parameter Estimates"][1] << make combined data table;

slopes << select where( :Term == "Intercept" ) << delete rows;

View solution in original post

2 REPLIES 2
ms
Super User (Alumni) ms
Super User (Alumni)

Re: How to calculate regression slopes by subject in table with many subjects each measured at different ages?

You can use the Fit Y by X platform. Add GFR as Y, Age as X. Then in the bivariate report, select "Group By..." under the red triangle and select Patient before choosing "Fit Line" (also under the red triangle). Finally, right-click on any of the tables named "Parameter Estimates" and select "make combined data table" to make a table with all the slopes (the intercepts will be there too but are easy to sort out and delete).

The JSL version would be something like this:

dt = Data Table( "Sample_GFRbyAgebyPt.jmp" );

biv = dt << Bivariate( Y( :GFR ), X( :Age ), Group by( :Patient ), Fit Line( 1 ) );

slopes = Report( biv )["Parameter Estimates"][1] << make combined data table;

slopes << select where( :Term == "Intercept" ) << delete rows;

tomparker
Level II

Re: How to calculate regression slopes by subject in table with many subjects each measured at different ages?

Thanks MS: The script worked immediately and removed the intercept rows. After a couple of stumbles, I was able to get the same results using the JMP menus. The slopes agree with independent regression runs. Very Good.

TSP

Recommended Articles