Another approach would be to use a random intercept / random slopes model. If the profiles of the subject results vs time can be described by a linear regression model, then the Mixed Model platform can fit a model with random slopes and/or or random intercepts for each subject. This script creates and example table and with scripts saved to run this type of analysis.
Names Default To Here( 1 );
dt = New Table( "Example" );
dt << New Column( "Y" );
dt << New Column( "subject", Nominal, Numeric );
dt << New Column( "time" );
ys = [];
t = [];
subjects = [];
times = [0, 1, 2, 3, 6, 9, 12];
ntimes = N Rows( times );
For( subject = 1, subject <= 1000, subject++,
mu = Random Normal( 0, 1 );
slope = Random Normal( 1, .5 );
y_subject = J( ntimes, 1, mu ) + slope * times + J( ntimes, 1, Random Normal( 0, 0.5 ) );
ys = ys |/ y_subject;
t = t |/ times;
subjects = subjects |/ J( ntimes, 1, subject );
);
dt:y << set values( ys );
dt:time << set values( t );
dt:subject << set values( subjects );
dt << Add Properties to Table(
{New Script(
"Y vs. time",
Graph Builder(
Size( 528, 454 ),
Show Control Panel( 0 ),
Variables( X( :time ), Y( :Y ), Overlay( :subject ) ),
Elements( Points( X, Y, Legend( 13 ) ), Line Of Fit( X, Y, Legend( 15 ) ) )
)
)}
);
dt << Add Properties to Table(
{New Script(
"Fit Mixed",
Fit Model(
Y( :Y ),
Effects,
Random Effects( Intercept[:subject], :time[:subject] & Random Coefficients( 1 ) ),
NoBounds( 1 ),
Personality( "Mixed Model" ),
Run(
Repeated Effects Covariance Parameter Estimates( 0 ),
Residual Plots( 1 ),
Conditional Residual Plots( 1 ),
Covariance of Covariance Parameters( 1 ),
Conditional Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
"Conditional",
subject( 9, Lock( 0 ), Show( 1 ) ),
time( 4.714, Lock( 0 ), Show( 1 ) )
)
),
Linear Combination of Variance Components( [1 0 1], Label( "asdfsad" ) )
),
SendToReport(
Dispatch( {}, "Random Coefficients", OutlineBox, {Close( 0 )} ),
Dispatch(
{"Linear Combination of Variance Components"},
" ",
TextEditBox,
{Set Text( "asdfsad" )}
)
)
)
)}
);